diff --git a/README.md b/README.md index e2c2a39fa7..8aa1cf2d6c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](catch-logo-small.png) -*v1.2.1-develop.16* +*v1.3.0-develop.1* Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch) diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 3df960da3f..30540c8267 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -37,7 +37,7 @@ namespace Catch { return os; } - Version libraryVersion( 1, 2, 1, "develop", 16 ); + Version libraryVersion( 1, 3, 0, "develop", 1 ); } diff --git a/single_include/catch.hpp b/single_include/catch.hpp index c0c9db163c..f50973a1d3 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * Catch v1.2.1-develop.16 - * Generated: 2015-11-03 17:37:18.144715 + * Catch v1.3.0-develop.1 + * Generated: 2015-11-05 18:47:08.462966 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -831,6 +831,12 @@ namespace Catch { namespace Matchers { namespace Impl { + namespace Generic { + template class AllOf; + template class AnyOf; + template class Not; + } + template struct Matcher : SharedImpl { @@ -840,6 +846,10 @@ namespace Matchers { virtual Ptr clone() const = 0; virtual bool match( ExpressionT const& expr ) const = 0; virtual std::string toString() const = 0; + + Generic::AllOf operator && ( Matcher const& other ) const; + Generic::AnyOf operator || ( Matcher const& other ) const; + Generic::Not operator ! () const; }; template @@ -853,7 +863,7 @@ namespace Matchers { namespace Generic { template struct Not : public MatcherImpl, ExpressionT> { - Not( Matcher const& matcher ) : m_matcher(matcher.clone()) {} + explicit Not( Matcher const& matcher ) : m_matcher(matcher.clone()) {} Not( Not const& other ) : m_matcher( other.m_matcher ) {} virtual bool match( ExpressionT const& expr ) const CATCH_OVERRIDE { @@ -897,6 +907,12 @@ namespace Matchers { return oss.str(); } + AllOf operator && ( Matcher const& other ) const { + AllOf allOfExpr( *this ); + allOfExpr.add( other ); + return allOfExpr; + } + private: std::vector > > m_matchers; }; @@ -931,9 +947,37 @@ namespace Matchers { return oss.str(); } + AnyOf operator || ( Matcher const& other ) const { + AnyOf anyOfExpr( *this ); + anyOfExpr.add( other ); + return anyOfExpr; + } + private: std::vector > > m_matchers; }; + + } // namespace Generic + + template + Generic::AllOf Matcher::operator && ( Matcher const& other ) const { + Generic::AllOf allOfExpr; + allOfExpr.add( *this ); + allOfExpr.add( other ); + return allOfExpr; + } + + template + Generic::AnyOf Matcher::operator || ( Matcher const& other ) const { + Generic::AnyOf anyOfExpr; + anyOfExpr.add( *this ); + anyOfExpr.add( other ); + return anyOfExpr; + } + + template + Generic::Not Matcher::operator ! () const { + return Generic::Not( *this ); } namespace StdString { @@ -2055,12 +2099,12 @@ namespace Catch { do { \ Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #arg " " #matcher, resultDisposition ); \ try { \ - std::string matcherAsString = ::Catch::Matchers::matcher.toString(); \ + std::string matcherAsString = (matcher).toString(); \ __catchResult \ .setLhs( Catch::toString( arg ) ) \ .setRhs( matcherAsString == Catch::Detail::unprintableString ? #matcher : matcherAsString ) \ .setOp( "matches" ) \ - .setResultType( ::Catch::Matchers::matcher.match( arg ) ); \ + .setResultType( (matcher).match( arg ) ); \ __catchResult.captureExpression(); \ } catch( ... ) { \ __catchResult.useActiveException( resultDisposition | Catch::ResultDisposition::ContinueOnFailure ); \ @@ -7194,7 +7238,7 @@ namespace Catch { return os; } - Version libraryVersion( 1, 2, 1, "develop", 16 ); + Version libraryVersion( 1, 3, 0, "develop", 1 ); } @@ -8429,7 +8473,7 @@ namespace Catch { {} virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE {} - virtual bool assertionEnded( AssertionStats const& _assertionStats ) CATCH_OVERRIDE { + virtual bool assertionEnded( AssertionStats const& ) CATCH_OVERRIDE { return false; } };