mirror of https://github.com/catchorg/Catch2.git
dev build 7
This commit is contained in:
parent
2104ca2aa4
commit
8342ae8dfb
|
@ -1,6 +1,6 @@
|
||||||
![catch logo](catch-logo-small.png)
|
![catch logo](catch-logo-small.png)
|
||||||
|
|
||||||
*v1.2.1-develop.6*
|
*v1.2.1-develop.7*
|
||||||
|
|
||||||
Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch)
|
Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch)
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace Catch {
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
Version libraryVersion( 1, 2, 1, "develop", 6 );
|
Version libraryVersion( 1, 2, 1, "develop", 7 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Catch v1.2.1-develop.6
|
* Catch v1.2.1-develop.7
|
||||||
* Generated: 2015-07-13 06:35:13.441019
|
* Generated: 2015-07-13 15:03:15.644872
|
||||||
* ----------------------------------------------------------
|
* ----------------------------------------------------------
|
||||||
* This file has been merged from multiple headers. Please don't edit it directly
|
* This file has been merged from multiple headers. Please don't edit it directly
|
||||||
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
|
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
|
||||||
|
@ -2838,17 +2838,12 @@ return @ desc; \
|
||||||
#pragma clang diagnostic ignored "-Wpadded"
|
#pragma clang diagnostic ignored "-Wpadded"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string>
|
// #included from: catch_wildcard_pattern.hpp
|
||||||
#include <vector>
|
#define TWOBLUECUBES_CATCH_WILDCARD_PATTERN_HPP_INCLUDED
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch
|
||||||
|
{
|
||||||
class TestSpec {
|
class WildcardPattern {
|
||||||
struct Pattern : SharedImpl<> {
|
|
||||||
virtual ~Pattern();
|
|
||||||
virtual bool matches( TestCaseInfo const& testCase ) const = 0;
|
|
||||||
};
|
|
||||||
class NamePattern : public Pattern {
|
|
||||||
enum WildcardPosition {
|
enum WildcardPosition {
|
||||||
NoWildcard = 0,
|
NoWildcard = 0,
|
||||||
WildcardAtStart = 1,
|
WildcardAtStart = 1,
|
||||||
|
@ -2857,27 +2852,36 @@ namespace Catch {
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NamePattern( std::string const& name ) : m_name( toLower( name ) ), m_wildcard( NoWildcard ) {
|
|
||||||
if( startsWith( m_name, "*" ) ) {
|
enum CaseSensitivity {
|
||||||
m_name = m_name.substr( 1 );
|
CaseSensitive,
|
||||||
|
CaseInsensitive
|
||||||
|
};
|
||||||
|
WildcardPattern( std::string const& pattern, CaseSensitivity caseSensitivity )
|
||||||
|
: m_caseSensitivity( caseSensitivity ),
|
||||||
|
m_wildcard( NoWildcard ),
|
||||||
|
m_pattern( adjustCase( pattern ) )
|
||||||
|
{
|
||||||
|
if( startsWith( m_pattern, "*" ) ) {
|
||||||
|
m_pattern = m_pattern.substr( 1 );
|
||||||
m_wildcard = WildcardAtStart;
|
m_wildcard = WildcardAtStart;
|
||||||
}
|
}
|
||||||
if( endsWith( m_name, "*" ) ) {
|
if( endsWith( m_pattern, "*" ) ) {
|
||||||
m_name = m_name.substr( 0, m_name.size()-1 );
|
m_pattern = m_pattern.substr( 0, m_pattern.size()-1 );
|
||||||
m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd );
|
m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual ~NamePattern();
|
virtual ~WildcardPattern();
|
||||||
virtual bool matches( TestCaseInfo const& testCase ) const {
|
virtual bool matches( std::string const& str ) const {
|
||||||
switch( m_wildcard ) {
|
switch( m_wildcard ) {
|
||||||
case NoWildcard:
|
case NoWildcard:
|
||||||
return m_name == toLower( testCase.name );
|
return m_pattern == adjustCase( str );
|
||||||
case WildcardAtStart:
|
case WildcardAtStart:
|
||||||
return endsWith( toLower( testCase.name ), m_name );
|
return endsWith( adjustCase( str ), m_pattern );
|
||||||
case WildcardAtEnd:
|
case WildcardAtEnd:
|
||||||
return startsWith( toLower( testCase.name ), m_name );
|
return startsWith( adjustCase( str ), m_pattern );
|
||||||
case WildcardAtBothEnds:
|
case WildcardAtBothEnds:
|
||||||
return contains( toLower( testCase.name ), m_name );
|
return contains( adjustCase( str ), m_pattern );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
|
@ -2890,9 +2894,38 @@ namespace Catch {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
std::string m_name;
|
std::string adjustCase( std::string const& str ) const {
|
||||||
|
return m_caseSensitivity == CaseInsensitive ? toLower( str ) : str;
|
||||||
|
}
|
||||||
|
CaseSensitivity m_caseSensitivity;
|
||||||
WildcardPosition m_wildcard;
|
WildcardPosition m_wildcard;
|
||||||
|
std::string m_pattern;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace Catch {
|
||||||
|
|
||||||
|
class TestSpec {
|
||||||
|
struct Pattern : SharedImpl<> {
|
||||||
|
virtual ~Pattern();
|
||||||
|
virtual bool matches( TestCaseInfo const& testCase ) const = 0;
|
||||||
|
};
|
||||||
|
class NamePattern : public Pattern {
|
||||||
|
public:
|
||||||
|
NamePattern( std::string const& name )
|
||||||
|
: m_wildcardPattern( toLower( name ), WildcardPattern::CaseInsensitive )
|
||||||
|
{}
|
||||||
|
virtual ~NamePattern();
|
||||||
|
virtual bool matches( TestCaseInfo const& testCase ) const {
|
||||||
|
return m_wildcardPattern.matches( toLower( testCase.name ) );
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
WildcardPattern m_wildcardPattern;
|
||||||
|
};
|
||||||
|
|
||||||
class TagPattern : public Pattern {
|
class TagPattern : public Pattern {
|
||||||
public:
|
public:
|
||||||
TagPattern( std::string const& tag ) : m_tag( toLower( tag ) ) {}
|
TagPattern( std::string const& tag ) : m_tag( toLower( tag ) ) {}
|
||||||
|
@ -2903,6 +2936,7 @@ namespace Catch {
|
||||||
private:
|
private:
|
||||||
std::string m_tag;
|
std::string m_tag;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ExcludedPattern : public Pattern {
|
class ExcludedPattern : public Pattern {
|
||||||
public:
|
public:
|
||||||
ExcludedPattern( Ptr<Pattern> const& underlyingPattern ) : m_underlyingPattern( underlyingPattern ) {}
|
ExcludedPattern( Ptr<Pattern> const& underlyingPattern ) : m_underlyingPattern( underlyingPattern ) {}
|
||||||
|
@ -6827,7 +6861,7 @@ namespace Catch {
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
Version libraryVersion( 1, 2, 1, "develop", 6 );
|
Version libraryVersion( 1, 2, 1, "develop", 7 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7504,7 +7538,8 @@ namespace Catch {
|
||||||
if( expectedMessage != "" ) {
|
if( expectedMessage != "" ) {
|
||||||
|
|
||||||
std::string actualMessage = Catch::translateActiveException();
|
std::string actualMessage = Catch::translateActiveException();
|
||||||
if( expectedMessage != actualMessage ) {
|
WildcardPattern pattern( expectedMessage, WildcardPattern::CaseInsensitive );
|
||||||
|
if( !pattern.matches( actualMessage ) ) {
|
||||||
data.resultType = ResultWas::ExpressionFailed;
|
data.resultType = ResultWas::ExpressionFailed;
|
||||||
data.reconstructedExpression = actualMessage;
|
data.reconstructedExpression = actualMessage;
|
||||||
}
|
}
|
||||||
|
@ -9299,6 +9334,7 @@ namespace Catch {
|
||||||
FreeFunctionTestCase::~FreeFunctionTestCase() {}
|
FreeFunctionTestCase::~FreeFunctionTestCase() {}
|
||||||
IGeneratorInfo::~IGeneratorInfo() {}
|
IGeneratorInfo::~IGeneratorInfo() {}
|
||||||
IGeneratorsForTest::~IGeneratorsForTest() {}
|
IGeneratorsForTest::~IGeneratorsForTest() {}
|
||||||
|
WildcardPattern::~WildcardPattern() {}
|
||||||
TestSpec::Pattern::~Pattern() {}
|
TestSpec::Pattern::~Pattern() {}
|
||||||
TestSpec::NamePattern::~NamePattern() {}
|
TestSpec::NamePattern::~NamePattern() {}
|
||||||
TestSpec::TagPattern::~TagPattern() {}
|
TestSpec::TagPattern::~TagPattern() {}
|
||||||
|
|
Loading…
Reference in New Issue