From dd26e889b528a8275e4a2395f896dec211103ea6 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 25 Mar 2013 09:25:31 +0000 Subject: [PATCH] Build 28 --- README.md | 2 +- include/internal/catch_list.hpp | 4 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 63 ++++++++++++++++++++---------- 4 files changed, 47 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 1be39d0b..329c4592 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 27 (integration branch) +## CATCH v0.9 build 28 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 50fce992..af53992c 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -45,9 +45,9 @@ namespace Catch { if( matchesFilters( config.filters, *it ) ) { matchedTests++; // !TBD: consider listAs() - std::cout << "\t" << it->getTestCaseInfo().name << "\n"; + std::cout << " " << it->getTestCaseInfo().name << "\n"; if( ( config.listSpec & List::TestNames ) != List::TestNames ) - std::cout << "\t\t '" << it->getTestCaseInfo().description << "'\n"; + std::cout << " '" << it->getTestCaseInfo().description << "'\n"; } } if( config.filters.empty() ) diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 9f8a669f..9e61b30e 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 27, "integration" ); + Version libraryVersion( 0, 9, 28, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 28baa440..3027eba8 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 27 (integration branch) - * Generated: 2013-03-21 08:59:28.031778 + * CATCH v0.9 build 28 (integration branch) + * Generated: 2013-03-25 09:25:14.678493 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -107,9 +107,14 @@ namespace Catch { inline bool contains( const std::string& s, const std::string& infix ) { return s.find( infix ) != std::string::npos; } - inline void toLower( std::string& s ) { + inline void toLowerInPlace( std::string& s ) { std::transform( s.begin(), s.end(), s.begin(), ::tolower ); } + inline std::string toLower( std::string const& s ) { + std::string lc = s; + toLowerInPlace( lc ); + return lc; + } struct pluralise { pluralise( std::size_t count, const std::string& label ) @@ -825,6 +830,11 @@ namespace Catch { // #included from: catch_evaluate.hpp #define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4389) // '==' : signed/unsigned mismatch +#endif + namespace Catch { namespace Internal { @@ -964,6 +974,10 @@ namespace Internal { } // end of namespace Internal } // end of namespace Catch +#ifdef _MSC_VER +#pragma warning(pop) +#endif + namespace Catch { // Wraps the (stringised versions of) the lhs, operator and rhs of an expression - as well as @@ -1507,9 +1521,7 @@ namespace Catch { private: virtual void acceptTag( const std::string& tag ) { - std::string lcTag = tag; - toLower( lcTag ); - m_tags.insert( lcTag ); + m_tags.insert( toLower( tag ) ); } virtual void acceptChar( char c ) { m_remainder += c; @@ -1552,9 +1564,7 @@ namespace Catch { typedef std::map TagMap; public: void add( const Tag& tag ) { - std::string tagName = tag.getName(); - toLower( tagName ); - m_tags.insert( std::make_pair( tagName, tag ) ); + m_tags.insert( std::make_pair( toLower( tag.getName() ), tag ) ); } bool empty() const { @@ -1652,12 +1662,10 @@ namespace Catch { public: TestCaseFilter( const std::string& testSpec, IfFilterMatches::DoWhat matchBehaviour = IfFilterMatches::AutoDetectBehaviour ) - : m_stringToMatch( testSpec ), + : m_stringToMatch( toLower( testSpec ) ), m_filterType( matchBehaviour ), m_wildcardPosition( NoWildcard ) { - toLower( m_stringToMatch ); - if( m_filterType == IfFilterMatches::AutoDetectBehaviour ) { if( startsWith( m_stringToMatch, "exclude:" ) ) { m_stringToMatch = m_stringToMatch.substr( 8 ); @@ -1698,7 +1706,7 @@ namespace Catch { bool isMatch( const TestCase& testCase ) const { std::string name = testCase.getTestCaseInfo().name; - toLower( name ); + toLowerInPlace( name ); switch( m_wildcardPosition ) { case NoWildcard: @@ -4172,9 +4180,9 @@ namespace Catch { if( matchesFilters( config.filters, *it ) ) { matchedTests++; // !TBD: consider listAs() - std::cout << "\t" << it->getTestCaseInfo().name << "\n"; + std::cout << " " << it->getTestCaseInfo().name << "\n"; if( ( config.listSpec & List::TestNames ) != List::TestNames ) - std::cout << "\t\t '" << it->getTestCaseInfo().description << "'\n"; + std::cout << " '" << it->getTestCaseInfo().description << "'\n"; } } if( config.filters.empty() ) @@ -4392,6 +4400,9 @@ namespace Catch { } private: + RunningTest( RunningTest const& ); + void operator=( RunningTest const& ); + const TestCase& m_info; RunStatus m_runStatus; RunningSection m_rootSection; @@ -4729,6 +4740,9 @@ namespace Catch { const unsigned int minorVersion; const unsigned int buildNumber; const std::string branchName; + + private: + void operator=( Version const& ); }; extern Version libraryVersion; @@ -5778,7 +5792,9 @@ namespace Catch { else if( m_exprComponents.op == "matches" ) return m_exprComponents.lhs + " " + m_exprComponents.rhs; else if( m_exprComponents.op != "!" ) { - if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 ) + if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 && + m_exprComponents.lhs.find("\n") == std::string::npos && + m_exprComponents.rhs.find("\n") == std::string::npos ) return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs; else return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs; @@ -5856,7 +5872,7 @@ namespace Catch { } bool TestCase::hasTag( const std::string& tag ) const { - return tags.find( tag ) != tags.end(); + return tags.find( toLower( tag ) ) != tags.end(); } bool TestCase::matchesTags( const std::string& tagPattern ) const { TagExpression exp; @@ -5903,7 +5919,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 27, "integration" ); + Version libraryVersion( 0, 9, 28, "integration" ); } // #included from: catch_line_wrap.hpp @@ -5924,8 +5940,14 @@ namespace Catch { for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) { if( pos == width ) { addIndent( os, indent ); - os << paragraph.substr( 0, wrapPoint ) << "\n"; - return recursivelyWrapLine( os, paragraph.substr( wrapPoint+1 ), columns, indent+tab ); + if( paragraph[wrapPoint] == ' ' ) { + os << paragraph.substr( 0, wrapPoint ) << "\n"; + while( paragraph[++wrapPoint] == ' ' ); + } + else { + os << paragraph.substr( 0, --wrapPoint ) << "-\n"; + } + return recursivelyWrapLine( os, paragraph.substr( wrapPoint ), columns, indent+tab ); } if( paragraph[pos] == '\t' ) { tab = pos; @@ -7071,6 +7093,7 @@ namespace Catch { private: class AssertionPrinter { + void operator= ( AssertionPrinter const& ); public: AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats ) : stream( _stream ),