This commit is contained in:
Phil Nash 2013-03-12 18:49:37 +00:00
parent 32e70b2235
commit 6d56d71318
4 changed files with 27 additions and 13 deletions

2
README
View File

@ -1,4 +1,4 @@
CATCH v0.9 build 23 (integration branch) CATCH v0.9 build 24 (integration branch)
--------------------------------------------- ---------------------------------------------
CATCH is an automated test framework for C, C++ and Objective-C. CATCH is an automated test framework for C, C++ and Objective-C.

View File

@ -13,7 +13,7 @@
namespace Catch { namespace Catch {
// These numbers are maintained by a script // These numbers are maintained by a script
Version libraryVersion( 0, 9, 23, "integration" ); Version libraryVersion( 0, 9, 24, "integration" );
} }
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@ -1,5 +1,5 @@
CatchSelfTest is a CATCH v0.9 b23 (integration) host application. CatchSelfTest is a CATCH v0.9 b24 (integration) host application.
Run with -? for options Run with -? for options
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -4286,7 +4286,7 @@ with expansion:
101 test cases - 47 failed (625 assertions - 104 failed) 101 test cases - 47 failed (625 assertions - 104 failed)
CatchSelfTest is a CATCH v0.9 b23 (integration) host application. CatchSelfTest is a CATCH v0.9 b24 (integration) host application.
Run with -? for options Run with -? for options
------------------------------------------------------------------------------- -------------------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
/* /*
* CATCH v0.9 build 23 (integration branch) * CATCH v0.9 build 24 (integration branch)
* Generated: 2013-03-11 18:35:52.716695 * Generated: 2013-03-12 18:45:29.590076
* ---------------------------------------------------------- * ----------------------------------------------------------
* 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.
@ -98,6 +98,9 @@ namespace Catch {
inline bool contains( const std::string& s, const std::string& infix ) { inline bool contains( const std::string& s, const std::string& infix ) {
return s.find( infix ) != std::string::npos; return s.find( infix ) != std::string::npos;
} }
inline void toLower( std::string& s ) {
std::transform( s.begin(), s.end(), s.begin(), ::tolower );
}
struct pluralise { struct pluralise {
pluralise( std::size_t count, const std::string& label ) pluralise( std::size_t count, const std::string& label )
@ -633,9 +636,13 @@ inline std::string toString( std::nullptr_t ) {
#ifdef __OBJC__ #ifdef __OBJC__
inline std::string toString( NSString const * const& nsstring ) { inline std::string toString( NSString const * const& nsstring ) {
if( !nsstring )
return "nil";
return std::string( "@\"" ) + [nsstring UTF8String] + "\""; return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
} }
inline std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) { inline std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) {
if( !nsstring )
return "nil";
return std::string( "@\"" ) + [nsstring UTF8String] + "\""; return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
} }
inline std::string toString( NSObject* const& nsObject ) { inline std::string toString( NSObject* const& nsObject ) {
@ -1434,7 +1441,9 @@ namespace Catch {
private: private:
virtual void acceptTag( const std::string& tag ) { virtual void acceptTag( const std::string& tag ) {
m_tags.insert( tag ); std::string lcTag = tag;
toLower( lcTag );
m_tags.insert( lcTag );
} }
virtual void acceptChar( char c ) { virtual void acceptChar( char c ) {
m_remainder += c; m_remainder += c;
@ -1477,7 +1486,9 @@ namespace Catch {
typedef std::map<std::string, Tag> TagMap; typedef std::map<std::string, Tag> TagMap;
public: public:
void add( const Tag& tag ) { void add( const Tag& tag ) {
m_tags.insert( std::make_pair( tag.getName(), tag ) ); std::string tagName = tag.getName();
toLower( tagName );
m_tags.insert( std::make_pair( tagName, tag ) );
} }
bool empty() const { bool empty() const {
@ -1579,6 +1590,8 @@ namespace Catch {
m_filterType( matchBehaviour ), m_filterType( matchBehaviour ),
m_wildcardPosition( NoWildcard ) m_wildcardPosition( NoWildcard )
{ {
toLower( m_stringToMatch );
if( m_filterType == IfFilterMatches::AutoDetectBehaviour ) { if( m_filterType == IfFilterMatches::AutoDetectBehaviour ) {
if( startsWith( m_stringToMatch, "exclude:" ) ) { if( startsWith( m_stringToMatch, "exclude:" ) ) {
m_stringToMatch = m_stringToMatch.substr( 8 ); m_stringToMatch = m_stringToMatch.substr( 8 );
@ -1618,7 +1631,8 @@ namespace Catch {
#endif #endif
bool isMatch( const TestCase& testCase ) const { bool isMatch( const TestCase& testCase ) const {
const std::string& name = testCase.getTestCaseInfo().name; std::string name = testCase.getTestCaseInfo().name;
toLower( name );
switch( m_wildcardPosition ) { switch( m_wildcardPosition ) {
case NoWildcard: case NoWildcard:
@ -5459,16 +5473,16 @@ namespace {
std::cout << colourEscape << "[0m"; // white/ normal std::cout << colourEscape << "[0m"; // white/ normal
break; break;
case ResultError: case ResultError:
std::cout << colourEscape << "[0;31m"; // red std::cout << colourEscape << "[1;31m"; // bold red
break; break;
case ResultSuccess: case ResultSuccess:
std::cout << colourEscape << "[0;32m"; // green std::cout << colourEscape << "[1;32m"; // bold green
break; break;
case Error: case Error:
std::cout << colourEscape << "[1;31m"; // bold red std::cout << colourEscape << "[1;31m"; // bold red
break; break;
case Success: case Success:
std::cout << colourEscape << "[1;32m"; // bold green std::cout << colourEscape << "[0;32m"; // green
break; break;
case OriginalExpression: case OriginalExpression:
std::cout << colourEscape << "[0;36m"; // cyan std::cout << colourEscape << "[0;36m"; // cyan
@ -5870,7 +5884,7 @@ namespace Catch {
namespace Catch { namespace Catch {
// These numbers are maintained by a script // These numbers are maintained by a script
Version libraryVersion( 0, 9, 23, "integration" ); Version libraryVersion( 0, 9, 24, "integration" );
} }
// #included from: catch_line_wrap.hpp // #included from: catch_line_wrap.hpp