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