From 105726f8e4363b0a3bd1bae1979be7a7244e7a89 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 28 Oct 2012 12:11:35 +0000 Subject: [PATCH 1/9] Added to the readme --- README | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README b/README index 7c050bf9..dc25caf6 100644 --- a/README +++ b/README @@ -1 +1,5 @@ -See the wiki at: https://github.com/philsquared/Catch/wiki +CATCH is an automated test framework for C, C++ and Objective-C. + +The latest stable version can be found as a single header in the Downloads section. + +For documentation see the wiki at: https://github.com/philsquared/Catch/wiki From b7f705482837eb24fc500e445762482fc4ebea46 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 31 Oct 2012 19:03:08 +0100 Subject: [PATCH 2/9] Fix harmless but annoying MSVC warnings. Suppress catch.hpp(1760) : warning C4512: 'Catch::TagExtracter' : assignment operator could not be generated catch.hpp(1864) : warning C4512: 'Catch::TagExpressionParser' : assignment operator could not be generated warnings given by MSVC 9 (and probably other version too) compiler with /W4 switch. The warnings are given because the compiler can't synthesize the assignment operators for the classes with members of reference type, so simply explicitly declare (without defining) these operators ourselves to suppress them. --- include/internal/catch_tags.hpp | 8 ++++++++ single_include/catch.hpp | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/internal/catch_tags.hpp b/include/internal/catch_tags.hpp index d6060022..c30d6e71 100644 --- a/include/internal/catch_tags.hpp +++ b/include/internal/catch_tags.hpp @@ -74,6 +74,10 @@ namespace Catch { m_remainder += c; } + // Suppress assignment operator to avoid warnings from MSVC saying that + // it can't be implicitly synthesized. + TagExtracter& operator=(const TagExtracter&); + std::set& m_tags; std::string m_remainder; }; @@ -177,6 +181,10 @@ namespace Catch { m_exp.m_tagSets.push_back( m_currentTagSet ); } + // Suppress assignment operator to avoid warnings from MSVC saying that + // it can't be implicitly synthesized. + TagExpressionParser& operator=(const TagExpressionParser&); + bool m_isNegated; TagSet m_currentTagSet; TagExpression& m_exp; diff --git a/single_include/catch.hpp b/single_include/catch.hpp index dca88476..85a3d805 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-10-12 18:17:54.059305 + * Generated: 2012-10-31 19:15:51.281013 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -1755,6 +1755,10 @@ namespace Catch { m_remainder += c; } + // Suppress assignment operator to avoid warnings from MSVC saying that + // it can't be implicitly synthesized. + TagExtracter& operator=(const TagExtracter&); + std::set& m_tags; std::string m_remainder; }; @@ -1858,6 +1862,10 @@ namespace Catch { m_exp.m_tagSets.push_back( m_currentTagSet ); } + // Suppress assignment operator to avoid warnings from MSVC saying that + // it can't be implicitly synthesized. + TagExpressionParser& operator=(const TagExpressionParser&); + bool m_isNegated; TagSet m_currentTagSet; TagExpression& m_exp; From ce612bf6562f62236edc5f416a8aabc29e63ebc1 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 1 Nov 2012 08:27:09 +0000 Subject: [PATCH 3/9] Squashed commit of the following: commit 2a1e8bfc6ed3bcc1e3746d717726a9e525de6369 Author: Phil Nash Date: Thu Nov 1 08:16:15 2012 +0000 Updated colour comments commit f0f407fc3ebdcbdad50fc1f9a45f15ab3cc54c63 Author: Phil Nash Date: Wed Oct 31 18:28:21 2012 +0000 Manually applied merge #133 from Master commit 355b95fda1de28ba830541768aad32c7b1790290 Author: Phil Nash Date: Wed Oct 31 18:04:22 2012 +0000 Cleaned up ANSI colour code impl a bit commit 778f9c4fc7fa66566679d9f1d8a721079d8589bf Author: Phil Nash Date: Tue Oct 30 09:09:30 2012 +0000 Removed "no-" from Wno-global-constructors when disabling commit 5efa4bcb8a620efa13e8eb5e68d0899681919ca1 Author: Phil Nash Date: Mon Oct 29 20:49:22 2012 +0000 Regenerated single_include commit 108f1937d8cbe04038ab8d2aaf9f6e958fe8168c Author: Phil Nash Date: Mon Oct 29 20:46:45 2012 +0000 Added terminal colour codes for POSIX With thanks to Adam Strzelecki commit 8f4cc541d55cf55b2a67b5d6b77b5c4ceb4d99ee Author: Phil Nash Date: Mon Oct 29 19:55:34 2012 +0000 Added regression test baselines commit 2e203a183474672e386f4cf840847cf29ccf90b9 Author: Phil Nash Date: Mon Oct 29 19:55:13 2012 +0000 Fixed remaining reporting regressions commit 134e45b3ade922e5cbdb2df6b81830fbd93fe448 Author: Phil Nash Date: Sun Oct 28 20:57:21 2012 +0000 Fixed #132 commit 2f92db9898978ca1ee27c964d8a51fa507391935 Author: Phil Nash Date: Sun Oct 28 12:15:34 2012 +0000 Updated the readme specifically for the Integration branch commit 82acc2ca05459ce353de71469f141ba93e9b63cf Author: Phil Nash Date: Sun Oct 28 12:07:17 2012 +0000 Regenerated single include commit fe1d7c1d08f06c0a83b727e9b2e00cc49e74175d Author: Phil Nash Date: Sun Oct 28 10:27:44 2012 +0000 Small fixes and tweaks commit 355b5e546d2f64dd0abbc0134dd3579ce6c28cea Author: Phil Nash Date: Fri Oct 26 09:05:36 2012 +0100 Some tidy-up commit f847186ebbf0e7eeabd99925574c8988add600fb Author: Phil Nash Date: Fri Oct 26 08:45:23 2012 +0100 AssertionResultBuilder -> ExpressionResultBuilder commit 8cca2f13699aa6aa5cd4a60e293f49a1bae54629 Author: Phil Nash Date: Wed Oct 24 22:09:01 2012 +0100 ExpressionBuilder ->ExpressionDecomposer Expression -> ExpressionLhs commit e04e74f896c714de1f03a9cc006bcd071318ea11 Author: Phil Nash Date: Wed Oct 24 21:59:47 2012 +0100 More AssertionResult refactoring commit 1dd56d4d2b29520cdd62f5f449a28e67f954f5db Author: Phil Nash Date: Fri Oct 19 08:01:34 2012 +0100 AssertionResultBuilder can be constructed from result type commit f2d5f1b3e444055ff02ed0536d5d0610b08ecb9f Author: Phil Nash Date: Fri Oct 19 08:01:05 2012 +0100 Expression has its own result builder - not passed in from expression builder commit e3b111a39a4edd3bfe4d88290c99c723b8b74417 Author: Phil Nash Date: Thu Oct 18 22:59:16 2012 +0100 streamlined acceptResult commit 3ad13256e1e50a6ee4a2697e7b6d0f669ae82ab5 Author: Phil Nash Date: Thu Oct 18 08:39:44 2012 +0100 Refactored assertion builder stuff out of expression builder commit c96f9330a095f527673de4d8db4f434d38a7e813 Author: Phil Nash Date: Wed Oct 17 08:14:22 2012 +0100 Collect assertion info up front commit a5fa78284d6d95770cd647a2ec10df09d378ba46 Author: Phil Nash Date: Tue Oct 16 08:33:13 2012 +0100 ResultData -> AssertionResultData commit c597a893fa95462b8d2d5029547d4054eda1839f Author: Phil Nash Date: Tue Oct 16 08:31:05 2012 +0100 ResultInfo -> AssertionResult filenames and variables commit d16955f63a4a128221da41602215b5592df39eb9 Author: Phil Nash Date: Tue Oct 16 08:27:21 2012 +0100 Renamed ResultInfo -> AssertionResult commit 175da3ef6454b6fa0465d22c96d21d58dd9d2f90 Author: Phil Nash Date: Fri Oct 12 18:39:22 2012 +0100 regen test 3 --- include/catch.hpp | 10 +- include/internal/catch_assertionresult.h | 66 + include/internal/catch_assertionresult.hpp | 65 + include/internal/catch_capture.hpp | 173 +- include/internal/catch_common.h | 3 + .../internal/catch_console_colour_impl.hpp | 60 +- include/internal/catch_expression.hpp | 90 - include/internal/catch_expression_builder.hpp | 102 -- .../internal/catch_expression_decomposer.hpp | 31 + include/internal/catch_expression_lhs.hpp | 97 ++ .../internal/catch_expressionresult_builder.h | 58 + .../catch_expressionresult_builder.hpp | 98 ++ include/internal/catch_impl.hpp | 4 +- include/internal/catch_interfaces_capture.h | 15 +- .../internal/catch_interfaces_registry_hub.h | 2 + include/internal/catch_interfaces_reporter.h | 28 +- include/internal/catch_registry_hub.hpp | 4 + include/internal/catch_resultinfo.h | 52 - include/internal/catch_resultinfo.hpp | 67 - include/internal/catch_resultinfo_builder.h | 58 - include/internal/catch_resultinfo_builder.hpp | 102 -- include/internal/catch_runner_impl.hpp | 58 +- include/internal/catch_tags.hpp | 6 +- include/reporters/catch_reporter_basic.hpp | 81 +- include/reporters/catch_reporter_junit.hpp | 16 +- include/reporters/catch_reporter_xml.hpp | 34 +- .../SelfTest/Baselines/failingResults.txt | 169 ++ .../SelfTest/Baselines/successfulResults.txt | 469 ++++++ projects/SelfTest/TestMain.cpp | 2 +- projects/SelfTest/TrickyTests.cpp | 21 + projects/SelfTest/catch_self_test.cpp | 18 +- projects/SelfTest/catch_self_test.hpp | 2 +- .../CatchSelfTest.xcodeproj/project.pbxproj | 34 +- single_include/catch.hpp | 1496 +++++++++-------- 34 files changed, 2202 insertions(+), 1389 deletions(-) create mode 100644 include/internal/catch_assertionresult.h create mode 100644 include/internal/catch_assertionresult.hpp delete mode 100644 include/internal/catch_expression.hpp delete mode 100644 include/internal/catch_expression_builder.hpp create mode 100644 include/internal/catch_expression_decomposer.hpp create mode 100644 include/internal/catch_expression_lhs.hpp create mode 100644 include/internal/catch_expressionresult_builder.h create mode 100644 include/internal/catch_expressionresult_builder.hpp delete mode 100644 include/internal/catch_resultinfo.h delete mode 100644 include/internal/catch_resultinfo.hpp delete mode 100644 include/internal/catch_resultinfo_builder.h delete mode 100644 include/internal/catch_resultinfo_builder.hpp create mode 100644 projects/SelfTest/Baselines/failingResults.txt create mode 100644 projects/SelfTest/Baselines/successfulResults.txt diff --git a/include/catch.hpp b/include/catch.hpp index dc66cf00..219b6172 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -10,7 +10,7 @@ #define TWOBLUECUBES_CATCH_HPP_INCLUDED #ifdef __clang__ -#pragma clang diagnostic ignored "-Wno-global-constructors" +#pragma clang diagnostic ignored "-Wglobal-constructors" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" @@ -71,9 +71,9 @@ #define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, false, "CATCH_WARN" ) #define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, true, "CATCH_FAIL" ) #define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, false, "CATCH_SUCCEED" ) -#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg ) +#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg, "CATCH_SCOPED_INFO" ) #define CATCH_CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, false, "CATCH_CAPTURE" ) -#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg ) +#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "CATCH_SCOPED_CAPTURE" ) #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) @@ -116,9 +116,9 @@ #define WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, false, "WARN" ) #define FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, true, "FAIL" ) #define SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, false, "SUCCEED" ) -#define SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg ) +#define SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg, "SCOPED_INFO" ) #define CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, false, "CAPTURE" ) -#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg ) +#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "SCOPED_CAPTURE" ) #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) diff --git a/include/internal/catch_assertionresult.h b/include/internal/catch_assertionresult.h new file mode 100644 index 00000000..b3baff2e --- /dev/null +++ b/include/internal/catch_assertionresult.h @@ -0,0 +1,66 @@ +/* + * Created by Phil on 28/10/2010. + * Copyright 2010 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED + +#include +#include "catch_result_type.h" + +namespace Catch { + + struct AssertionInfo + { + AssertionInfo() {} + AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression, bool _shouldNegate ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + capturedExpression( _capturedExpression ) + { + if( _shouldNegate ) + capturedExpression = "!" + _capturedExpression; + } + + std::string macroName; + SourceLineInfo lineInfo; + std::string capturedExpression; + }; + + struct AssertionResultData + { + AssertionResultData() : resultType( ResultWas::Unknown ) {} + + std::string reconstructedExpression; + std::string message; + ResultWas::OfType resultType; + }; + + class AssertionResult { + public: + AssertionResult(); + AssertionResult( const AssertionInfo& info, const AssertionResultData& data ); + ~AssertionResult(); + + bool ok() const; + ResultWas::OfType getResultType() const; + bool hasExpression() const; + bool hasMessage() const; + std::string getExpression() const; + bool hasExpandedExpression() const; + std::string getExpandedExpression() const; + std::string getMessage() const; + SourceLineInfo getSourceInfo() const; + std::string getTestMacroName() const; + + protected: + AssertionInfo m_info; + AssertionResultData m_resultData; + }; + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED diff --git a/include/internal/catch_assertionresult.hpp b/include/internal/catch_assertionresult.hpp new file mode 100644 index 00000000..f1ef9d18 --- /dev/null +++ b/include/internal/catch_assertionresult.hpp @@ -0,0 +1,65 @@ +/* + * Created by Phil on 8/8/12 + * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED + +#include "catch_assertionresult.h" + +namespace Catch { + + AssertionResult::AssertionResult() {} + + AssertionResult::AssertionResult( const AssertionInfo& info, const AssertionResultData& data ) + : m_info( info ), + m_resultData( data ) + {} + + AssertionResult::~AssertionResult() {} + + bool AssertionResult::ok() const { + return isOk( m_resultData.resultType ); + } + + ResultWas::OfType AssertionResult::getResultType() const { + return m_resultData.resultType; + } + + bool AssertionResult::hasExpression() const { + return !m_info.capturedExpression.empty(); + } + + bool AssertionResult::hasMessage() const { + return !m_resultData.message.empty(); + } + + std::string AssertionResult::getExpression() const { + return m_info.capturedExpression; + } + + bool AssertionResult::hasExpandedExpression() const { + return hasExpression() && getExpandedExpression() != getExpression(); + } + + std::string AssertionResult::getExpandedExpression() const { + return m_resultData.reconstructedExpression; + } + + std::string AssertionResult::getMessage() const { + return m_resultData.message; + } + SourceLineInfo AssertionResult::getSourceInfo() const { + return m_info.lineInfo; + } + + std::string AssertionResult::getTestMacroName() const { + return m_info.macroName; + } + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 381c0dd0..484383c5 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -8,53 +8,84 @@ #ifndef TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED #define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED -#include "catch_expression_builder.hpp" +#include "catch_expression_decomposer.hpp" +#include "catch_expressionresult_builder.h" #include "catch_interfaces_capture.h" #include "catch_debugger.hpp" #include "catch_context.h" #include "catch_common.h" +#include "catch_interfaces_registry_hub.h" #include namespace Catch { + inline IResultCapture& getResultCapture() { + return getCurrentContext().getResultCapture(); + } + + template + ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, + const std::string& matcherCallAsString ) { + std::string matcherAsString = matcher.toString(); + if( matcherAsString == "{?}" ) + matcherAsString = matcherCallAsString; + return ExpressionResultBuilder() + .setRhs( matcherAsString ) + .setOp( "matches" ); + } + + template + ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, + const ArgT& arg, + const std::string& matcherCallAsString ) { + return expressionResultBuilderFromMatcher( matcher, matcherCallAsString ) + .setLhs( Catch::toString( arg ) ) + .setResultType( matcher.match( arg ) ); + } + + template + ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, + ArgT* arg, + const std::string& matcherCallAsString ) { + return expressionResultBuilderFromMatcher( matcher, matcherCallAsString ) + .setLhs( Catch::toString( arg ) ) + .setResultType( matcher.match( arg ) ); + } + struct TestFailureException{}; class ScopedInfo { public: - ScopedInfo() : m_oss() { - getCurrentContext().getResultCapture().pushScopedInfo( this ); + ScopedInfo() : m_resultBuilder( ResultWas::Info ) { + getResultCapture().pushScopedInfo( this ); } - ~ScopedInfo() { - getCurrentContext().getResultCapture().popScopedInfo( this ); + getResultCapture().popScopedInfo( this ); } - template ScopedInfo& operator << ( const T& value ) { - m_oss << value; + m_resultBuilder << value; return *this; } - - ResultInfo getInfo () const { - return ResultInfoBuilder() - .setResultType( ResultWas::Info ) - .setMessage( m_oss.str() ) - .setMacroName( "SCOPED_INFO" ) - .build(); + AssertionResult buildResult( const AssertionInfo& assertionInfo ) const { + return m_resultBuilder.buildResult( assertionInfo ); } private: - std::ostringstream m_oss; + ExpressionResultBuilder m_resultBuilder; }; -// This is just here to avoid compiler warnings with macro constants +// This is just here to avoid compiler warnings with macro constants and boolean literals inline bool isTrue( bool value ){ return value; } - + } // end namespace Catch /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ACCEPT_EXPR( expr, stopOnFailure, originalExpr ) \ - if( Catch::ResultAction::Value internal_catch_action = Catch::getCurrentContext().getResultCapture().acceptExpression( expr ) ) { \ +#define INTERNAL_CATCH_ASSERTIONINFO_NAME INTERNAL_CATCH_UNIQUE_NAME( __assertionInfo ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_ACCEPT_EXPR( evaluatedExpr, stopOnFailure, originalExpr ) \ + if( Catch::ResultAction::Value internal_catch_action = Catch::getResultCapture().acceptExpression( evaluatedExpr, INTERNAL_CATCH_ASSERTIONINFO_NAME ) ) { \ if( internal_catch_action & Catch::ResultAction::Debug ) BreakIntoDebugger(); \ if( internal_catch_action & Catch::ResultAction::Abort ) throw Catch::TestFailureException(); \ if( Catch::isTrue( stopOnFailure ) ) throw Catch::TestFailureException(); \ @@ -62,76 +93,102 @@ inline bool isTrue( bool value ){ return value; } } /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ) \ - do { try { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr, isFalse )->*expr ), stopOnFailure, expr ); \ - } catch( Catch::TestFailureException& ) { \ - throw; \ - } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ) << Catch::getRegistryHub().getExceptionTranslatorRegistry().translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), false, expr ); \ - throw; \ - } } while( Catch::isTrue( false ) ) +#define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, shouldNegate ) \ + Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, shouldNegate ); +// !TBD Catch::getResultCapture().acceptAssertionInfo( INTERNAL_CATCH_ASSERTIONINFO_NAME ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_IF( expr, isFalse, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ); \ - if( Catch::getCurrentContext().getResultCapture().getLastResult()->ok() ) +#define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \ + try { \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).negate( shouldNegate ), stopOnFailure, expr ); \ + } catch( Catch::TestFailureException& ) { \ + throw; \ + } catch( ... ) { \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), false, expr ); \ + throw; \ + } \ + } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ELSE( expr, isFalse, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ); \ - if( !Catch::getCurrentContext().getResultCapture().getLastResult()->ok() ) +#define INTERNAL_CATCH_IF( expr, shouldNegate, stopOnFailure, macroName ) \ + INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ); \ + if( Catch::getResultCapture().getLastResult()->ok() ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_ELSE( expr, shouldNegate, stopOnFailure, macroName ) \ + INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ); \ + if( !Catch::getResultCapture().getLastResult()->ok() ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_NO_THROW( expr, stopOnFailure, macroName ) \ - try { \ - expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ).setResultType( Catch::ResultWas::Ok ), stopOnFailure, false ); \ - } \ - catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ) << Catch::getRegistryHub().getExceptionTranslatorRegistry().translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure, false ); \ - } + do { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ + try { \ + expr; \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + } \ + catch( ... ) { \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), stopOnFailure, false ); \ + } \ +} while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ try { \ if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ).setResultType( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ } \ } \ catch( Catch::TestFailureException& ) { \ throw; \ } \ catch( exceptionType ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ).setResultType( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ } +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ + INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ + } while( Catch::isTrue( false ) ) + /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, stopOnFailure, macroName ) \ - INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ - catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ) << Catch::getRegistryHub().getExceptionTranslatorRegistry() ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure, false ); \ - } + do { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ + INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ + catch( ... ) { \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), stopOnFailure, false ); \ + } \ + } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ - Catch::getCurrentContext().getResultCapture().acceptExpression( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName ) << reason ).setResultType( resultType ) ); + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ); /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_SCOPED_INFO( log ) \ +#define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ Catch::ScopedInfo INTERNAL_CATCH_UNIQUE_NAME( info ); \ INTERNAL_CATCH_UNIQUE_NAME( info ) << log /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CHECK_THAT( arg, matcher, stopOnFailure, macroName ) \ - do { try { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #arg " " #matcher, false ).acceptMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ - } catch( Catch::TestFailureException& ) { \ - throw; \ - } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #arg " " #matcher ) << Catch::getRegistryHub().getExceptionTranslatorRegistry().translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), false, false ); \ - throw; \ - }}while( Catch::isTrue( false ) ) + do { \ + INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, false ); \ + try { \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::expressionResultBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ + } catch( Catch::TestFailureException& ) { \ + throw; \ + } catch( ... ) { \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), false, false ); \ + throw; \ + } \ + } while( Catch::isTrue( false ) ) #endif // TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 49c5918e..cac5d112 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -122,6 +122,9 @@ namespace Catch { file.swap( other.file ); std::swap( line, other.line ); } + bool empty() const { + return file.empty(); + } std::string function; std::string file; diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 1830e182..c05fd07f 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -10,7 +10,60 @@ #include "catch_console_colour.hpp" -#ifdef CATCH_PLATFORM_WINDOWS +#if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) + +#include + +namespace Catch { + + // use POSIX/ ANSI console terminal codes + // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) + // https://github.com/philsquared/Catch/pull/131 + + TextColour::TextColour( Colours colour ) { + if( colour ) + set( colour ); + } + + TextColour::~TextColour() { + set( TextColour::None ); + } + + namespace { const char colourEscape = '\033'; } + + void TextColour::set( Colours colour ) { + if( isatty( fileno(stdout) ) ) { + switch( colour ) { + case TextColour::FileName: + std::cout << colourEscape << "[0m"; // white/ normal + break; + case TextColour::ResultError: + std::cout << colourEscape << "[1;31m"; // bold red + break; + case TextColour::ResultSuccess: + std::cout << colourEscape << "[1;32m"; // bold green + break; + case TextColour::Error: + std::cout << colourEscape << "[0;31m"; // red + break; + case TextColour::Success: + std::cout << colourEscape << "[0;32m"; // green + break; + case TextColour::OriginalExpression: + std::cout << colourEscape << "[0;36m"; // cyan + break; + case TextColour::ReconstructedExpression: + std::cout << colourEscape << "[0;33m"; // yellow + break; + case TextColour::None: + std::cout << colourEscape << "[0m"; // reset + } + } + } + +} // namespace Catch + +#elif defined ( CATCH_PLATFORM_WINDOWS ) #include @@ -78,16 +131,17 @@ namespace Catch { void TextColour::set( Colours colour ) { m_impl->set( colour ); } - + } // end namespace Catch #else namespace Catch { + TextColour::TextColour( Colours ){} TextColour::~TextColour(){} void TextColour::set( Colours ){} - + } // end namespace Catch #endif diff --git a/include/internal/catch_expression.hpp b/include/internal/catch_expression.hpp deleted file mode 100644 index 0fa0920c..00000000 --- a/include/internal/catch_expression.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Created by Phil on 11/5/2012. - * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. - * - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ -#ifndef TWOBLUECUBES_CATCH_EXPRESSION_HPP_INCLUDED -#define TWOBLUECUBES_CATCH_EXPRESSION_HPP_INCLUDED - -#include "catch_resultinfo_builder.h" -#include "catch_evaluate.hpp" - -namespace Catch { - -template -class Expression { - void operator = ( const Expression& ); - -public: - Expression( ResultInfoBuilder& result, T lhs ) - : m_result( result.setLhs( Catch::toString( lhs ) ) ), - m_lhs( lhs ) - {} - - template - ResultInfoBuilder& operator == ( const RhsT& rhs ) { - return captureExpression( rhs ); - } - - template - ResultInfoBuilder& operator != ( const RhsT& rhs ) { - return captureExpression( rhs ); - } - - template - ResultInfoBuilder& operator < ( const RhsT& rhs ) { - return captureExpression( rhs ); - } - - template - ResultInfoBuilder& operator > ( const RhsT& rhs ) { - return captureExpression( rhs ); - } - - template - ResultInfoBuilder& operator <= ( const RhsT& rhs ) { - return captureExpression( rhs ); - } - - template - ResultInfoBuilder& operator >= ( const RhsT& rhs ) { - return captureExpression( rhs ); - } - - ResultInfoBuilder& operator == ( bool rhs ) { - return captureExpression( rhs ); - } - - ResultInfoBuilder& operator != ( bool rhs ) { - return captureExpression( rhs ); - } - - operator ResultInfoBuilder& () { - return m_result.setResultType( m_lhs ? ResultWas::Ok : ResultWas::ExpressionFailed ); - } - - template - STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( const RhsT& ); - - template - STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( const RhsT& ); - -private: - template - ResultInfoBuilder& captureExpression( const RhsT& rhs ) { - return m_result - .setResultType( Internal::compare( m_lhs, rhs ) ? ResultWas::Ok : ResultWas::ExpressionFailed ) - .setRhs( Catch::toString( rhs ) ) - .setOp( Internal::OperatorTraits::getName() ); - } - -private: - ResultInfoBuilder& m_result; - T m_lhs; -}; - -} // end namespace Catch - -#endif // TWOBLUECUBES_CATCH_EXPRESSION_HPP_INCLUDED diff --git a/include/internal/catch_expression_builder.hpp b/include/internal/catch_expression_builder.hpp deleted file mode 100644 index 86f68ecb..00000000 --- a/include/internal/catch_expression_builder.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Created by Phil on 11/5/2012. - * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. - * - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ -#ifndef TWOBLUECUBES_CATCH_EXPRESSION_BUILDER_HPP_INCLUDED -#define TWOBLUECUBES_CATCH_EXPRESSION_BUILDER_HPP_INCLUDED - -#include "catch_expression.hpp" -#include "catch_resultinfo_builder.h" -#include "catch_tostring.hpp" -#include "catch_resultinfo.h" -#include "catch_result_type.h" -#include "catch_context.h" -#include "catch_common.h" -#include - -namespace Catch { - -class ExpressionBuilder { -public: - - ExpressionBuilder( const SourceLineInfo& lineInfo, - const char* macroName, - const char* expr = "", - bool isFalse = false ) - : m_messageStream() - { - m_result - .setCapturedExpression( expr ) - .setIsFalse( isFalse ) - .setLineInfo( lineInfo ) - .setMacroName( macroName ); - } - - template - Expression operator->* ( const T & operand ) { - Expression expr( m_result, operand ); - return expr; - } - - Expression operator->* ( bool value ) { - Expression expr( m_result, value ); - return expr; - } - - template - ExpressionBuilder& operator << ( const T & value ) { - m_messageStream << Catch::toString( value ); - return *this; - } - - template - ExpressionBuilder& acceptMatcher( const MatcherT& matcher, - const ArgT& arg, - const std::string& matcherCallAsString ) { - std::string matcherAsString = matcher.toString(); - if( matcherAsString == "{?}" ) - matcherAsString = matcherCallAsString; - m_result - .setLhs( Catch::toString( arg ) ) - .setRhs( matcherAsString ) - .setOp( "matches" ) - .setResultType( matcher.match( arg ) ? ResultWas::Ok : ResultWas::ExpressionFailed ); - return *this; - } - - template - ExpressionBuilder& acceptMatcher( const MatcherT& matcher, - ArgT* arg, - const std::string& matcherCallAsString ) { - std::string matcherAsString = matcher.toString(); - if( matcherAsString == "{?}" ) - matcherAsString = matcherCallAsString; - m_result - .setLhs( Catch::toString( arg ) ) - .setRhs( matcherAsString ) - .setOp( "matches" ) - .setResultType( matcher.match( arg ) ? ResultWas::Ok : ResultWas::ExpressionFailed ); - return *this; - } - - ExpressionBuilder& setResultType( ResultWas::OfType resultType ) { - m_result.setResultType( resultType ); - return *this; - } - - operator ResultInfoBuilder&() { - m_result.setMessage( m_messageStream.str() ); - return m_result; - } - -private: - ResultInfoBuilder m_result; - std::ostringstream m_messageStream; -}; - -} // end namespace Catch - -#endif // TWOBLUECUBES_CATCH_EXPRESSION_BUILDER_HPP_INCLUDED diff --git a/include/internal/catch_expression_decomposer.hpp b/include/internal/catch_expression_decomposer.hpp new file mode 100644 index 00000000..1d8ca73d --- /dev/null +++ b/include/internal/catch_expression_decomposer.hpp @@ -0,0 +1,31 @@ +/* + * Created by Phil on 11/5/2012. + * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_CATCH_EXPRESSION_DECOMPOSER_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_EXPRESSION_DECOMPOSER_HPP_INCLUDED + +#include "catch_expression_lhs.hpp" + +namespace Catch { + +// Captures the LHS of the expression and wraps it in an Expression Lhs object +class ExpressionDecomposer { +public: + + template + ExpressionLhs operator->* ( const T & operand ) { + return ExpressionLhs( operand ); + } + + ExpressionLhs operator->* ( bool value ) { + return ExpressionLhs( value ); + } +}; + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_EXPRESSION_DECOMPOSER_HPP_INCLUDED diff --git a/include/internal/catch_expression_lhs.hpp b/include/internal/catch_expression_lhs.hpp new file mode 100644 index 00000000..572c8c37 --- /dev/null +++ b/include/internal/catch_expression_lhs.hpp @@ -0,0 +1,97 @@ +/* + * Created by Phil on 11/5/2012. + * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED + +#include "catch_expressionresult_builder.h" +#include "catch_evaluate.hpp" + +namespace Catch { + +struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; + +// Wraps the LHS of an expression and captures the operator and RHS (if any) - wrapping them all +// in an ExpressionResultBuilder object +template +class ExpressionLhs { + void operator = ( const ExpressionLhs& ); + +public: + ExpressionLhs( T lhs ) : m_lhs( lhs ) {} + + template + ExpressionResultBuilder& operator == ( const RhsT& rhs ) { + return captureExpression( rhs ); + } + + template + ExpressionResultBuilder& operator != ( const RhsT& rhs ) { + return captureExpression( rhs ); + } + + template + ExpressionResultBuilder& operator < ( const RhsT& rhs ) { + return captureExpression( rhs ); + } + + template + ExpressionResultBuilder& operator > ( const RhsT& rhs ) { + return captureExpression( rhs ); + } + + template + ExpressionResultBuilder& operator <= ( const RhsT& rhs ) { + return captureExpression( rhs ); + } + + template + ExpressionResultBuilder& operator >= ( const RhsT& rhs ) { + return captureExpression( rhs ); + } + + ExpressionResultBuilder& operator == ( bool rhs ) { + return captureExpression( rhs ); + } + + ExpressionResultBuilder& operator != ( bool rhs ) { + return captureExpression( rhs ); + } + + ExpressionResultBuilder& negate( bool shouldNegate ) { + bool value = m_lhs ? true : false; + return m_result + .setLhs( Catch::toString( value ) ) + .setResultType( value ) + .negate( shouldNegate ); + } + + // Only simple binary expressions are allowed on the LHS. + // If more complex compositions are required then place the sub expression in parentheses + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( const RhsT& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( const RhsT& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( const RhsT& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( const RhsT& ); + +private: + template + ExpressionResultBuilder& captureExpression( const RhsT& rhs ) { + return m_result + .setResultType( Internal::compare( m_lhs, rhs ) ) + .setLhs( Catch::toString( m_lhs ) ) + .setRhs( Catch::toString( rhs ) ) + .setOp( Internal::OperatorTraits::getName() ); + } + +private: + ExpressionResultBuilder m_result; + T m_lhs; +}; + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED diff --git a/include/internal/catch_expressionresult_builder.h b/include/internal/catch_expressionresult_builder.h new file mode 100644 index 00000000..23b84646 --- /dev/null +++ b/include/internal/catch_expressionresult_builder.h @@ -0,0 +1,58 @@ +/* + * Created by Phil on 8/5/2012. + * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_H_INCLUDED +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_H_INCLUDED + +#include "catch_tostring.hpp" +#include "catch_assertionresult.h" +#include "catch_result_type.h" +#include "catch_evaluate.hpp" +#include "catch_common.h" + +namespace Catch { + +// Wraps the (stringised versions of) the lhs, operator and rhs of an expression - as well as +// the result of evaluating it. This is used to build an AssertionResult object +class ExpressionResultBuilder { +public: + + ExpressionResultBuilder( ResultWas::OfType resultType = ResultWas::Unknown ); + ExpressionResultBuilder( const ExpressionResultBuilder& other ); + ExpressionResultBuilder& operator=(const ExpressionResultBuilder& other ); + + ExpressionResultBuilder& setResultType( ResultWas::OfType result ); + ExpressionResultBuilder& setResultType( bool result ); + ExpressionResultBuilder& setLhs( const std::string& lhs ); + ExpressionResultBuilder& setRhs( const std::string& rhs ); + ExpressionResultBuilder& setOp( const std::string& op ); + + ExpressionResultBuilder& negate( bool shouldNegate ); + + template + ExpressionResultBuilder& operator << ( const T& value ) { + m_stream << value; + return *this; + } + + std::string reconstructExpression( const AssertionInfo& info ) const; + + AssertionResult buildResult( const AssertionInfo& info ) const; + +private: + AssertionResultData m_data; + struct ExprComponents { + ExprComponents() : shouldNegate( false ) {} + bool shouldNegate; + std::string lhs, rhs, op; + } m_exprComponents; + std::ostringstream m_stream; +}; + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_H_INCLUDED diff --git a/include/internal/catch_expressionresult_builder.hpp b/include/internal/catch_expressionresult_builder.hpp new file mode 100644 index 00000000..0c0a28a8 --- /dev/null +++ b/include/internal/catch_expressionresult_builder.hpp @@ -0,0 +1,98 @@ +/* + * Created by Phil on 8/8/2012. + * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_CATCH_EXPRESSIONRESULT_BUILDER_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_EXPRESSIONRESULT_BUILDER_HPP_INCLUDED + +#include "catch_expressionresult_builder.h" + +#include + +namespace Catch { + + ExpressionResultBuilder::ExpressionResultBuilder( ResultWas::OfType resultType ) { + m_data.resultType = resultType; + } + ExpressionResultBuilder::ExpressionResultBuilder( const ExpressionResultBuilder& other ) + : m_data( other.m_data ), + m_exprComponents( other.m_exprComponents ) + { + m_stream << other.m_stream.str(); + } + ExpressionResultBuilder& ExpressionResultBuilder::operator=(const ExpressionResultBuilder& other ) { + m_data = other.m_data; + m_exprComponents = other.m_exprComponents; + m_stream.str(""); + m_stream << other.m_stream.str(); + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::setResultType( ResultWas::OfType result ) { + m_data.resultType = result; + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::setResultType( bool result ) { + m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed; + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::negate( bool shouldNegate ) { + m_exprComponents.shouldNegate = shouldNegate; + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { + m_exprComponents.lhs = lhs; + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::setRhs( const std::string& rhs ) { + m_exprComponents.rhs = rhs; + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::setOp( const std::string& op ) { + m_exprComponents.op = op; + return *this; + } + AssertionResult ExpressionResultBuilder::buildResult( const AssertionInfo& info ) const + { + assert( m_data.resultType != ResultWas::Unknown ); + + AssertionResultData data = m_data; + + // Flip bool results if shouldNegate is set + if( m_exprComponents.shouldNegate && data.resultType == ResultWas::Ok ) + data.resultType = ResultWas::ExpressionFailed; + else if( m_exprComponents.shouldNegate && data.resultType == ResultWas::ExpressionFailed ) + data.resultType = ResultWas::Ok; + + data.message = m_stream.str(); + data.reconstructedExpression = reconstructExpression( info ); + if( m_exprComponents.shouldNegate ) { + if( m_exprComponents.op == "" ) + data.reconstructedExpression = "!" + data.reconstructedExpression; + else + data.reconstructedExpression = "!(" + data.reconstructedExpression + ")"; + } + return AssertionResult( info, data ); + } + std::string ExpressionResultBuilder::reconstructExpression( const AssertionInfo& info ) const { + if( m_exprComponents.op == "" ) + return m_exprComponents.lhs.empty() ? info.capturedExpression : m_exprComponents.op + m_exprComponents.lhs; + 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() < 30 ) + return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs; + else if( m_exprComponents.lhs.size() < 70 && m_exprComponents.rhs.size() < 70 ) + return "\n\t" + m_exprComponents.lhs + "\n\t" + m_exprComponents.op + "\n\t" + m_exprComponents.rhs; + else + return "\n" + m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs + "\n\n"; + } + else + return "{can't expand - use " + info.macroName + "_FALSE( " + info.capturedExpression.substr(1) + " ) instead of " + info.macroName + "( " + info.capturedExpression + " ) for better diagnostics}"; + } + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_EXPRESSIONRESULT_BUILDER_HPP_INCLUDED diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index b4c4662b..8bbae1c1 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -22,8 +22,8 @@ #include "catch_context_impl.hpp" #include "catch_console_colour_impl.hpp" #include "catch_generators_impl.hpp" -#include "catch_resultinfo.hpp" -#include "catch_resultinfo_builder.hpp" +#include "catch_assertionresult.hpp" +#include "catch_expressionresult_builder.hpp" #include "catch_test_case_info.hpp" #include "catch_tags.hpp" diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index 07b5ccd9..a3e08226 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -17,14 +17,15 @@ namespace Catch { class TestCaseInfo; class ScopedInfo; - class ResultInfoBuilder; - class ResultInfo; + class ExpressionResultBuilder; + class AssertionResult; + struct AssertionInfo; struct IResultCapture { virtual ~IResultCapture(); - virtual void testEnded( const ResultInfo& result ) = 0; + virtual void testEnded( const AssertionResult& result ) = 0; virtual bool sectionStarted( const std::string& name, const std::string& description, const SourceLineInfo& lineInfo, @@ -34,13 +35,11 @@ namespace Catch { virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; virtual bool shouldDebugBreak() const = 0; - virtual ResultAction::Value acceptResult( bool result ) = 0; - virtual ResultAction::Value acceptResult( ResultWas::OfType result ) = 0; - virtual ResultAction::Value acceptExpression( const ResultInfoBuilder& resultInfo ) = 0; - virtual void acceptMessage( const std::string& msg ) = 0; + virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0; + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; - virtual const ResultInfo* getLastResult() const = 0; + virtual const AssertionResult* getLastResult() const = 0; }; } diff --git a/include/internal/catch_interfaces_registry_hub.h b/include/internal/catch_interfaces_registry_hub.h index 28aae7a0..da2d7fd4 100644 --- a/include/internal/catch_interfaces_registry_hub.h +++ b/include/internal/catch_interfaces_registry_hub.h @@ -38,6 +38,8 @@ namespace Catch { IRegistryHub& getRegistryHub(); IMutableRegistryHub& getMutableRegistryHub(); void cleanUp(); + std::string translateActiveException(); + } #endif // TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 2fb5cc2a..847016ad 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -49,23 +49,37 @@ namespace Catch }; class TestCaseInfo; - class ResultInfo; + class AssertionResult; struct IReporter : IShared { virtual ~IReporter(); - virtual bool shouldRedirectStdout() const = 0; + + virtual bool shouldRedirectStdout() const = 0; + virtual void StartTesting() = 0; virtual void EndTesting( const Totals& totals ) = 0; - virtual void StartGroup( const std::string& groupName ) = 0; + + virtual void StartGroup( const std::string& groupName ) = 0; virtual void EndGroup( const std::string& groupName, const Totals& totals ) = 0; + + virtual void StartTestCase( const TestCaseInfo& testInfo ) = 0; + // TestCaseResult + virtual void EndTestCase( const TestCaseInfo& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0; + + // SectionInfo virtual void StartSection( const std::string& sectionName, const std::string& description ) = 0; + // Section Result + virtual void EndSection( const std::string& sectionName, const Counts& assertions ) = 0; + + // - merge into SectionResult ? virtual void NoAssertionsInSection( const std::string& sectionName ) = 0; virtual void NoAssertionsInTestCase( const std::string& testName ) = 0; - virtual void EndSection( const std::string& sectionName, const Counts& assertions ) = 0; - virtual void StartTestCase( const TestCaseInfo& testInfo ) = 0; + + // - merge into SectionResult, TestCaseResult, GroupResult & TestRunResult virtual void Aborted() = 0; - virtual void EndTestCase( const TestCaseInfo& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0; - virtual void Result( const ResultInfo& result ) = 0; + + // AssertionReslt + virtual void Result( const AssertionResult& result ) = 0; }; struct IReporterFactory { diff --git a/include/internal/catch_registry_hub.hpp b/include/internal/catch_registry_hub.hpp index b832d54a..d66205de 100644 --- a/include/internal/catch_registry_hub.hpp +++ b/include/internal/catch_registry_hub.hpp @@ -73,6 +73,10 @@ namespace Catch { getTheRegistryHub() = NULL; cleanUpContext(); } + std::string translateActiveException() { + return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException(); + } + } // end namespace Catch diff --git a/include/internal/catch_resultinfo.h b/include/internal/catch_resultinfo.h deleted file mode 100644 index db4e9e6e..00000000 --- a/include/internal/catch_resultinfo.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Created by Phil on 28/10/2010. - * Copyright 2010 Two Blue Cubes Ltd. All rights reserved. - * - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ -#ifndef TWOBLUECUBES_CATCH_RESULTINFO_H_INCLUDED -#define TWOBLUECUBES_CATCH_RESULTINFO_H_INCLUDED - -#include -#include "catch_result_type.h" - -namespace Catch { - - struct ResultData - { - ResultData() : resultType( ResultWas::Unknown ) {} - - std::string macroName; - SourceLineInfo lineInfo; - std::string capturedExpression; - std::string reconstructedExpression; - std::string message; - ResultWas::OfType resultType; - }; - - class ResultInfo { - public: - ResultInfo(); - ResultInfo( const ResultData& data ); - ~ResultInfo(); - - bool ok() const; - ResultWas::OfType getResultType() const; - bool hasExpression() const; - bool hasMessage() const; - std::string getExpression() const; - bool hasExpandedExpression() const; - std::string getExpandedExpression() const; - std::string getMessage() const; - std::string getFilename() const; - std::size_t getLine() const; - std::string getTestMacroName() const; - - protected: - ResultData m_data; - }; - -} // end namespace Catch - -#endif // TWOBLUECUBES_CATCH_RESULTINFO_H_INCLUDED diff --git a/include/internal/catch_resultinfo.hpp b/include/internal/catch_resultinfo.hpp deleted file mode 100644 index b7ec8c2f..00000000 --- a/include/internal/catch_resultinfo.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Created by Phil on 8/8/12 - * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. - * - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ -#ifndef TWOBLUECUBES_CATCH_RESULTINFO_HPP_INCLUDED -#define TWOBLUECUBES_CATCH_RESULTINFO_HPP_INCLUDED - -#include "catch_resultinfo.h" - -namespace Catch { - - ResultInfo::ResultInfo() {} - - ResultInfo::ResultInfo( const ResultData& data ) : m_data( data ) {} - - ResultInfo::~ResultInfo() {} - - bool ResultInfo::ok() const { - return isOk( m_data.resultType ); - } - - ResultWas::OfType ResultInfo::getResultType() const { - return m_data.resultType; - } - - bool ResultInfo::hasExpression() const { - return !m_data.capturedExpression.empty(); - } - - bool ResultInfo::hasMessage() const { - return !m_data.message.empty(); - } - - std::string ResultInfo::getExpression() const { - return m_data.capturedExpression; - } - - bool ResultInfo::hasExpandedExpression() const { - return hasExpression() && getExpandedExpression() != getExpression(); - } - - std::string ResultInfo::getExpandedExpression() const { - return m_data.reconstructedExpression; - } - - std::string ResultInfo::getMessage() const { - return m_data.message; - } - - std::string ResultInfo::getFilename() const { - return m_data.lineInfo.file; - } - - std::size_t ResultInfo::getLine() const { - return m_data.lineInfo.line; - } - - std::string ResultInfo::getTestMacroName() const { - return m_data.macroName; - } - -} // end namespace Catch - -#endif // TWOBLUECUBES_CATCH_RESULTINFO_HPP_INCLUDED diff --git a/include/internal/catch_resultinfo_builder.h b/include/internal/catch_resultinfo_builder.h deleted file mode 100644 index cf2014ec..00000000 --- a/include/internal/catch_resultinfo_builder.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Created by Phil on 8/5/2012. - * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. - * - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ -#ifndef TWOBLUECUBES_CATCH_RESULTINFO_BUILDER_H_INCLUDED -#define TWOBLUECUBES_CATCH_RESULTINFO_BUILDER_H_INCLUDED - -#include "catch_tostring.hpp" -#include "catch_resultinfo.h" -#include "catch_result_type.h" -#include "catch_evaluate.hpp" -#include "catch_common.h" - -namespace Catch { - -struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; - -class ResultInfoBuilder { -public: - - ResultInfoBuilder(); - - ResultInfoBuilder& setResultType( ResultWas::OfType result ); - ResultInfoBuilder& setCapturedExpression( const std::string& capturedExpression ); - ResultInfoBuilder& setIsFalse( bool isFalse ); - ResultInfoBuilder& setMessage( const std::string& message ); - ResultInfoBuilder& setLineInfo( const SourceLineInfo& lineInfo ); - ResultInfoBuilder& setLhs( const std::string& lhs ); - ResultInfoBuilder& setRhs( const std::string& rhs ); - ResultInfoBuilder& setOp( const std::string& op ); - ResultInfoBuilder& setMacroName( const std::string& macroName ); - - std::string reconstructExpression() const; - - ResultInfo build() const; - - // Disable attempts to use || and && in expressions (without parantheses) - template - STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( const RhsT& ); - template - STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( const RhsT& ); - - bool getIsFalse() const { - return m_isFalse; - } - -private: - ResultData m_data; - std::string m_lhs, m_rhs, m_op; - bool m_isFalse; -}; - -} // end namespace Catch - -#endif // TWOBLUECUBES_CATCH_RESULTINFO_BUILDER_H_INCLUDED diff --git a/include/internal/catch_resultinfo_builder.hpp b/include/internal/catch_resultinfo_builder.hpp deleted file mode 100644 index 4da4d5d2..00000000 --- a/include/internal/catch_resultinfo_builder.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Created by Phil on 8/8/2012. - * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. - * - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ -#ifndef TWOBLUECUBES_CATCH_RESULTINFO_BUILDER_HPP_INCLUDED -#define TWOBLUECUBES_CATCH_RESULTINFO_BUILDER_HPP_INCLUDED - -#include "catch_resultinfo_builder.h" - -namespace Catch { - - ResultInfoBuilder::ResultInfoBuilder() {} - - ResultInfoBuilder& ResultInfoBuilder::setResultType( ResultWas::OfType result ) { - // Flip bool results if isFalse is set - if( m_isFalse && result == ResultWas::Ok ) - m_data.resultType = ResultWas::ExpressionFailed; - else if( m_isFalse && result == ResultWas::ExpressionFailed ) - m_data.resultType = ResultWas::Ok; - else - m_data.resultType = result; - return *this; - } - ResultInfoBuilder& ResultInfoBuilder::setCapturedExpression( const std::string& capturedExpression ) { - m_data.capturedExpression = capturedExpression; - return *this; - } - ResultInfoBuilder& ResultInfoBuilder::setIsFalse( bool isFalse ) { - m_isFalse = isFalse; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setMessage( const std::string& message ) { - m_data.message = message; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setLineInfo( const SourceLineInfo& lineInfo ) { - m_data.lineInfo = lineInfo; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setMacroName( const std::string& macroName ) { - m_data.macroName = macroName; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setLhs( const std::string& lhs ) { - m_lhs = lhs; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setRhs( const std::string& rhs ) { - m_rhs = rhs; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setOp( const std::string& op ) { - m_op = op; - return *this; - } - - ResultInfo ResultInfoBuilder::build() const - { - ResultData data = m_data; - data.reconstructedExpression = reconstructExpression(); - if( m_isFalse ) { - if( m_op == "" ) { - data.capturedExpression = "!" + data.capturedExpression; - data.reconstructedExpression = "!" + data.reconstructedExpression; - } - else { - data.capturedExpression = "!(" + data.capturedExpression + ")"; - data.reconstructedExpression = "!(" + data.reconstructedExpression + ")"; - } - } - return ResultInfo( data ); - } - - std::string ResultInfoBuilder::reconstructExpression() const { - if( m_op == "" ) - return m_lhs.empty() ? m_data.capturedExpression : m_op + m_lhs; - else if( m_op == "matches" ) - return m_lhs + " " + m_rhs; - else if( m_op != "!" ) { - if( m_lhs.size() + m_rhs.size() < 30 ) - return m_lhs + " " + m_op + " " + m_rhs; - else if( m_lhs.size() < 70 && m_rhs.size() < 70 ) - return "\n\t" + m_lhs + "\n\t" + m_op + "\n\t" + m_rhs; - else - return "\n" + m_lhs + "\n" + m_op + "\n" + m_rhs + "\n\n"; - } - else - return "{can't expand - use " + m_data.macroName + "_FALSE( " + m_data.capturedExpression.substr(1) + " ) instead of " + m_data.macroName + "( " + m_data.capturedExpression + " ) for better diagnostics}"; - } - -} // end namespace Catch - -#endif // TWOBLUECUBES_CATCH_RESULTINFO_BUILDER_HPP_INCLUDED diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index ef446c3a..1100b23b 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -109,7 +109,7 @@ namespace Catch { do { do { - m_currentResult.setLineInfo( m_runningTest->getTestCaseInfo().getLineInfo() ); + m_assertionInfo.lineInfo = m_runningTest->getTestCaseInfo().getLineInfo(); runCurrentTest( redirectedCout, redirectedCerr ); } while( m_runningTest->hasUntestedSections() && !aborting() ); @@ -131,25 +131,17 @@ namespace Catch { private: // IResultCapture - virtual ResultAction::Value acceptResult( bool result ) { - return acceptResult( result ? ResultWas::Ok : ResultWas::ExpressionFailed ); + virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) { + m_assertionInfo = assertionInfo; } - - virtual ResultAction::Value acceptResult( ResultWas::OfType result ) { - m_currentResult.setResultType( result ); + + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) { + m_assertionInfo = assertionInfo; + m_currentResult = assertionResult; return actOnCurrentResult(); } - virtual ResultAction::Value acceptExpression( const ResultInfoBuilder& resultInfo ) { - m_currentResult = resultInfo; - return actOnCurrentResult(); - } - - virtual void acceptMessage( const std::string& msg ) { - m_currentResult.setMessage( msg ); - } - - virtual void testEnded( const ResultInfo& result ) { + virtual void testEnded( const AssertionResult& result ) { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } @@ -160,19 +152,19 @@ namespace Catch { std::vector::const_iterator it = m_scopedInfos.begin(); std::vector::const_iterator itEnd = m_scopedInfos.end(); for(; it != itEnd; ++it ) - m_reporter->Result( (*it)->getInfo() ); + m_reporter->Result( (*it)->buildResult( m_assertionInfo ) ); } { - std::vector::const_iterator it = m_info.begin(); - std::vector::const_iterator itEnd = m_info.end(); + std::vector::const_iterator it = m_assertionResults.begin(); + std::vector::const_iterator itEnd = m_assertionResults.end(); for(; it != itEnd; ++it ) m_reporter->Result( *it ); } - m_info.clear(); + m_assertionResults.clear(); } if( result.getResultType() == ResultWas::Info ) - m_info.push_back( result ); + m_assertionResults.push_back( result ); else m_reporter->Result( result ); } @@ -190,7 +182,7 @@ namespace Catch { if( !m_runningTest->addSection( oss.str() ) ) return false; - m_currentResult.setLineInfo( lineInfo ); + m_assertionInfo.lineInfo = lineInfo; m_reporter->StartSection( name, description ); assertions = m_totals.assertions; @@ -229,7 +221,7 @@ namespace Catch { : ""; } - virtual const ResultInfo* getLastResult() const { + virtual const AssertionResult* getLastResult() const { return &m_lastResult; } @@ -242,10 +234,11 @@ namespace Catch { private: ResultAction::Value actOnCurrentResult() { - m_lastResult = m_currentResult.build(); + m_lastResult = m_currentResult.buildResult( m_assertionInfo ); testEnded( m_lastResult ); - m_currentResult = ResultInfoBuilder(); + m_currentResult = ExpressionResultBuilder(); + m_assertionInfo = AssertionInfo(); ResultAction::Value action = ResultAction::None; @@ -284,26 +277,29 @@ namespace Catch { // This just means the test was aborted due to failure } catch(...) { - acceptMessage( getRegistryHub().getExceptionTranslatorRegistry().translateActiveException() ); - acceptResult( ResultWas::ThrewException ); + m_currentResult + .setResultType( ResultWas::ThrewException ) + << translateActiveException(); + actOnCurrentResult(); } - m_info.clear(); + m_assertionResults.clear(); } private: IMutableContext& m_context; RunningTest* m_runningTest; - ResultInfoBuilder m_currentResult; - ResultInfo m_lastResult; + ExpressionResultBuilder m_currentResult; + AssertionResult m_lastResult; const Config& m_config; Totals m_totals; Ptr m_reporter; std::vector m_scopedInfos; - std::vector m_info; + std::vector m_assertionResults; IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; + AssertionInfo m_assertionInfo; }; } // end namespace Catch diff --git a/include/internal/catch_tags.hpp b/include/internal/catch_tags.hpp index c30d6e71..591ab5ad 100644 --- a/include/internal/catch_tags.hpp +++ b/include/internal/catch_tags.hpp @@ -74,10 +74,8 @@ namespace Catch { m_remainder += c; } - // Suppress assignment operator to avoid warnings from MSVC saying that - // it can't be implicitly synthesized. TagExtracter& operator=(const TagExtracter&); - + std::set& m_tags; std::string m_remainder; }; @@ -181,8 +179,6 @@ namespace Catch { m_exp.m_tagSets.push_back( m_currentTagSet ); } - // Suppress assignment operator to avoid warnings from MSVC saying that - // it can't be implicitly synthesized. TagExpressionParser& operator=(const TagExpressionParser&); bool m_isNegated; diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 2729510c..63074629 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -159,21 +159,21 @@ namespace Catch { m_sectionSpans.pop_back(); } - virtual void Result( const ResultInfo& resultInfo ) { - if( !m_config.includeSuccessfulResults && resultInfo.getResultType() == ResultWas::Ok ) + virtual void Result( const AssertionResult& assertionResult ) { + if( !m_config.includeSuccessfulResults && assertionResult.getResultType() == ResultWas::Ok ) return; startSpansLazily(); - if( !resultInfo.getFilename().empty() ) { + if( !assertionResult.getSourceInfo().empty() ) { TextColour colour( TextColour::FileName ); - m_config.stream << SourceLineInfo( resultInfo.getFilename(), resultInfo.getLine() ); + m_config.stream << assertionResult.getSourceInfo(); } - if( resultInfo.hasExpression() ) { + if( assertionResult.hasExpression() ) { TextColour colour( TextColour::OriginalExpression ); - m_config.stream << resultInfo.getExpression(); - if( resultInfo.ok() ) { + m_config.stream << assertionResult.getExpression(); + if( assertionResult.ok() ) { TextColour successColour( TextColour::Success ); m_config.stream << " succeeded"; } @@ -182,45 +182,51 @@ namespace Catch { m_config.stream << " failed"; } } - switch( resultInfo.getResultType() ) { + switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: - { - TextColour colour( TextColour::Error ); - if( resultInfo.hasExpression() ) - m_config.stream << " with unexpected"; - else - m_config.stream << "Unexpected"; - m_config.stream << " exception with message: '" << resultInfo.getMessage() << "'"; - } + { + TextColour colour( TextColour::Error ); + if( assertionResult.hasExpression() ) + m_config.stream << " with unexpected"; + else + m_config.stream << "Unexpected"; + m_config.stream << " exception with message: '" << assertionResult.getMessage() << "'"; + } break; case ResultWas::DidntThrowException: - { - TextColour colour( TextColour::Error ); - if( resultInfo.hasExpression() ) - m_config.stream << " because no exception was thrown where one was expected"; - else - m_config.stream << "No exception thrown where one was expected"; - } + { + TextColour colour( TextColour::Error ); + if( assertionResult.hasExpression() ) + m_config.stream << " because no exception was thrown where one was expected"; + else + m_config.stream << "No exception thrown where one was expected"; + } break; case ResultWas::Info: - streamVariableLengthText( "info", resultInfo.getMessage() ); + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "info", assertionResult.getMessage() ); + } break; case ResultWas::Warning: - m_config.stream << "warning:\n'" << resultInfo.getMessage() << "'"; + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "warning", assertionResult.getMessage() ); + } break; case ResultWas::ExplicitFailure: - { - TextColour colour( TextColour::Error ); - m_config.stream << "failed with message: '" << resultInfo.getMessage() << "'"; - } + { + TextColour colour( TextColour::Error ); + m_config.stream << "failed with message: '" << assertionResult.getMessage() << "'"; + } break; case ResultWas::Unknown: // These cases are here to prevent compiler warnings case ResultWas::Ok: case ResultWas::FailureBit: case ResultWas::ExpressionFailed: case ResultWas::Exception: - if( !resultInfo.hasExpression() ) { - if( resultInfo.ok() ) { + if( !assertionResult.hasExpression() ) { + if( assertionResult.ok() ) { TextColour colour( TextColour::Success ); m_config.stream << " succeeded"; } @@ -232,14 +238,15 @@ namespace Catch { break; } - if( resultInfo.hasExpandedExpression() ) { + if( assertionResult.hasExpandedExpression() ) { m_config.stream << " for: "; - if( resultInfo.getExpandedExpression().size() > 40 ) + if( assertionResult.getExpandedExpression().size() > 40 ) { m_config.stream << "\n"; - if( resultInfo.getExpandedExpression().size() < 70 ) - m_config.stream << "\t"; + if( assertionResult.getExpandedExpression().size() < 70 ) + m_config.stream << "\t"; + } TextColour colour( TextColour::ReconstructedExpression ); - m_config.stream << resultInfo.getExpandedExpression(); + m_config.stream << assertionResult.getExpandedExpression(); } m_config.stream << std::endl; } @@ -309,7 +316,7 @@ namespace Catch { void streamVariableLengthText( const std::string& prefix, const std::string& text ) { std::string trimmed = trim( text ); if( trimmed.find_first_of( "\r\n" ) == std::string::npos ) { - m_config.stream << "[" << prefix << ": " << trimmed << "]\n"; + m_config.stream << "[" << prefix << ": " << trimmed << "]"; } else { m_config.stream << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 4e66dddf..99e6ed04 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -97,19 +97,19 @@ namespace Catch { m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getName() ) ); } - virtual void Result( const Catch::ResultInfo& resultInfo ) { - if( resultInfo.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults ) { + virtual void Result( const Catch::AssertionResult& assertionResult ) { + if( assertionResult.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults ) { TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); TestStats stats; std::ostringstream oss; - if( !resultInfo.getMessage().empty() ) - oss << resultInfo.getMessage() << " at "; - oss << SourceLineInfo( resultInfo.getFilename(), resultInfo.getLine() ); + if( !assertionResult.getMessage().empty() ) + oss << assertionResult.getMessage() << " at "; + oss << assertionResult.getSourceInfo(); stats.m_content = oss.str(); - stats.m_message = resultInfo.getExpandedExpression(); - stats.m_resultType = resultInfo.getTestMacroName(); + stats.m_message = assertionResult.getExpandedExpression(); + stats.m_resultType = assertionResult.getTestMacroName(); - switch( resultInfo.getResultType() ) { + switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: stats.m_element = "error"; m_currentStats->m_errorsCount++; diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index 8329b95d..f2af6992 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -75,42 +75,42 @@ namespace Catch { m_currentTestSuccess = true; } - virtual void Result( const Catch::ResultInfo& resultInfo ) { - if( !m_config.includeSuccessfulResults && resultInfo.getResultType() == ResultWas::Ok ) + virtual void Result( const Catch::AssertionResult& assertionResult ) { + if( !m_config.includeSuccessfulResults && assertionResult.getResultType() == ResultWas::Ok ) return; - if( resultInfo.hasExpression() ) { + if( assertionResult.hasExpression() ) { m_xml.startElement( "Expression" ) - .writeAttribute( "success", resultInfo.ok() ) - .writeAttribute( "filename", resultInfo.getFilename() ) - .writeAttribute( "line", resultInfo.getLine() ); + .writeAttribute( "success", assertionResult.ok() ) + .writeAttribute( "filename", assertionResult.getSourceInfo().file ) + .writeAttribute( "line", assertionResult.getSourceInfo().line ); m_xml.scopedElement( "Original" ) - .writeText( resultInfo.getExpression() ); + .writeText( assertionResult.getExpression() ); m_xml.scopedElement( "Expanded" ) - .writeText( resultInfo.getExpandedExpression() ); - m_currentTestSuccess &= resultInfo.ok(); + .writeText( assertionResult.getExpandedExpression() ); + m_currentTestSuccess &= assertionResult.ok(); } - switch( resultInfo.getResultType() ) { + switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: m_xml.scopedElement( "Exception" ) - .writeAttribute( "filename", resultInfo.getFilename() ) - .writeAttribute( "line", resultInfo.getLine() ) - .writeText( resultInfo.getMessage() ); + .writeAttribute( "filename", assertionResult.getSourceInfo().file ) + .writeAttribute( "line", assertionResult.getSourceInfo().line ) + .writeText( assertionResult.getMessage() ); m_currentTestSuccess = false; break; case ResultWas::Info: m_xml.scopedElement( "Info" ) - .writeText( resultInfo.getMessage() ); + .writeText( assertionResult.getMessage() ); break; case ResultWas::Warning: m_xml.scopedElement( "Warning" ) - .writeText( resultInfo.getMessage() ); + .writeText( assertionResult.getMessage() ); break; case ResultWas::ExplicitFailure: m_xml.scopedElement( "Failure" ) - .writeText( resultInfo.getMessage() ); + .writeText( assertionResult.getMessage() ); m_currentTestSuccess = false; break; case ResultWas::Unknown: @@ -121,7 +121,7 @@ namespace Catch { case ResultWas::DidntThrowException: break; } - if( resultInfo.hasExpression() ) + if( assertionResult.hasExpression() ) m_xml.endElement(); } diff --git a/projects/SelfTest/Baselines/failingResults.txt b/projects/SelfTest/Baselines/failingResults.txt new file mode 100644 index 00000000..787c246f --- /dev/null +++ b/projects/SelfTest/Baselines/failingResults.txt @@ -0,0 +1,169 @@ +[Started testing] +[Started group: './failing*'] + +[Running: ./failing/TestClass/failingCase] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ClassTests.cpp:28: s == "world" failed for: "hello" == "world" +[Finished: './failing/TestClass/failingCase' 1 test case failed (1 assertion failed)] + +[Running: ./failing/Fixture/failingCase] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 +[Finished: './failing/Fixture/failingCase' 1 test case failed (1 assertion failed)] + +[Running: ./failing/conditions/equality] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:73: data.int_seven == 0 failed for: 7 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:74: data.float_nine_point_one == Approx( 9.11f ) failed for: 9.1 == Approx( 9.11 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:75: data.float_nine_point_one == Approx( 9.0f ) failed for: 9.1 == Approx( 9 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:76: data.float_nine_point_one == Approx( 1 ) failed for: 9.1 == Approx( 1 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:77: data.float_nine_point_one == Approx( 0 ) failed for: 9.1 == Approx( 0 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:78: data.double_pi == Approx( 3.1415 ) failed for: 3.14159 == Approx( 3.1415 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:79: data.str_hello == "goodbye" failed for: "hello" == "goodbye" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:80: data.str_hello == "hell" failed for: "hello" == "hell" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:81: data.str_hello == "hello1" failed for: "hello" == "hello1" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:82: data.str_hello.size() == 6 failed for: 5 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:85: x == Approx( 1.301 ) failed for: 1.3 == Approx( 1.301 ) +[Finished: './failing/conditions/equality' 1 test case failed (All 13 assertions failed)] + +[Running: ./failing/conditions/inequality] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:111: data.int_seven != 7 failed for: 7 != 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:112: data.float_nine_point_one != Approx( 9.1f ) failed for: 9.1 != Approx( 9.1 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:113: data.double_pi != Approx( 3.1415926535 ) failed for: 3.14159 != Approx( 3.14159 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:114: data.str_hello != "hello" failed for: "hello" != "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:115: data.str_hello.size() != 5 failed for: 5 != 5 +[Finished: './failing/conditions/inequality' 1 test case failed (All 5 assertions failed)] + +[Running: ./failing/conditions/ordered] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:152: data.int_seven > 7 failed for: 7 > 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:153: data.int_seven < 7 failed for: 7 < 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:154: data.int_seven > 8 failed for: 7 > 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:155: data.int_seven < 6 failed for: 7 < 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:156: data.int_seven < 0 failed for: 7 < 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:157: data.int_seven < -1 failed for: 7 < -1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:159: data.int_seven >= 8 failed for: 7 >= 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:160: data.int_seven <= 6 failed for: 7 <= 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:162: data.float_nine_point_one < 9 failed for: 9.1 < 9 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:163: data.float_nine_point_one > 10 failed for: 9.1 > 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:164: data.float_nine_point_one > 9.2 failed for: 9.1 > 9.2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:166: data.str_hello > "hello" failed for: "hello" > "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:167: data.str_hello < "hello" failed for: "hello" < "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:168: data.str_hello > "hellp" failed for: "hello" > "hellp" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:169: data.str_hello > "z" failed for: "hello" > "z" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:170: data.str_hello < "hellm" failed for: "hello" < "hellm" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:171: data.str_hello < "a" failed for: "hello" < "a" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:173: data.str_hello >= "z" failed for: "hello" >= "z" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:174: data.str_hello <= "a" failed for: "hello" <= "a" +[Finished: './failing/conditions/ordered' 1 test case failed (All 19 assertions failed)] + +[Running: ./failing/conditions/not] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:320: false != false failed +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:321: true != true failed +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:322: !true failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:323: !true failed +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:325: !trueValue failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:326: !trueValue failed for: !true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:328: !(1 == 1) failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:329: !1 == 1 failed for: !(1 == 1) +[Finished: './failing/conditions/not' 1 test case failed (All 8 assertions failed)] + +[Running: ./failing/exceptions/explicit] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:47: thisThrows() failed with unexpected exception with message: 'expected exception' +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:48: thisDoesntThrow() failed because no exception was thrown where one was expected +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:49: thisThrows() failed with unexpected exception with message: 'expected exception' +[Finished: './failing/exceptions/explicit' 1 test case failed (All 3 assertions failed)] + +[Running: ./failing/exceptions/implicit] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' +[Finished: './failing/exceptions/implicit' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/custom] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:95: Unexpected exception with message: 'custom exception' +[Finished: './failing/exceptions/custom' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/custom/nothrow] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:102: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' +[Finished: './failing/exceptions/custom/nothrow' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/custom/throw] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:107: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' +[Finished: './failing/exceptions/custom/throw' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/custom/double] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:111: Unexpected exception with message: '3.14' +[Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/in-section] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:125: Unexpected exception with message: 'Exception from section' +[Finished: './failing/exceptions/in-section' 1 test case failed (1 assertion failed)] + +[Running: ./failing/message/info/1] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:19: [info: this message should be logged] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:20: [info: so should this] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:22: a == 1 failed for: 2 == 1 +[Finished: './failing/message/info/1' 1 test case failed (1 assertion failed)] + +[Running: ./failing/message/fail] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:46: failed with message: 'This is a failure' +[Finished: './failing/message/fail' 1 test case failed (1 assertion failed)] + +[Running: ./failing/message/sections] + +[Started section: 'one'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:53: failed with message: 'Message from section one' +[End of section: 'one' 1 assertion failed] + +[Started section: 'two'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:58: failed with message: 'Message from section two' +[End of section: 'two' 1 assertion failed] + +[Finished: './failing/message/sections' 1 test case failed (All 2 assertions failed)] + +[Running: ./failing/info] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:169: [info: hi] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:171: [info: i := 7] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:172: false failed +[Finished: './failing/info' 1 test case failed (1 assertion failed)] + +[Running: ./failing/checkedif] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:177: flag failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:190: testCheckedIf( false ) failed for: false +[Finished: './failing/checkedif' 1 test case failed (All 2 assertions failed)] + +[Running: ./failing/checkedelse] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:195: flag failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:208: testCheckedElse( false ) failed for: false +[Finished: './failing/checkedelse' 1 test case failed (All 2 assertions failed)] + +[Running: ./failing/matchers/Contains] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:255: testStringForMatching() Contains( "not there" ) failed for: + "this string contains 'abc' as a substring" contains: "not there" +[Finished: './failing/matchers/Contains' 1 test case failed (1 assertion failed)] + +[Running: ./failing/matchers/StartsWith] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:260: testStringForMatching() StartsWith( "string" ) failed for: + "this string contains 'abc' as a substring" starts with: "string" +[Finished: './failing/matchers/StartsWith' 1 test case failed (1 assertion failed)] + +[Running: ./failing/matchers/EndsWith] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:265: testStringForMatching() EndsWith( "this" ) failed for: + "this string contains 'abc' as a substring" ends with: "this" +[Finished: './failing/matchers/EndsWith' 1 test case failed (1 assertion failed)] + +[Running: ./failing/matchers/Equals] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:270: testStringForMatching() Equals( "something else" ) failed for: + "this string contains 'abc' as a substring" equals: "something else" +[Finished: './failing/matchers/Equals' 1 test case failed (1 assertion failed)] + +[Running: ./failing/Tricky/non streamable type] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff522b88b8 == 0x7fff522b88b0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:96: o1 == o2 failed for: {?} == {?} +[Finished: './failing/Tricky/non streamable type' 1 test case failed (All 2 assertions failed)] + +[Running: ./failing/string literals] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:106: std::string( "first" ) == "second" failed for: "first" == "second" +[Finished: './failing/string literals' 1 test case failed (1 assertion failed)] +[End of group: './failing*'. All 25 test cases failed (All 72 assertions failed)] + + +[Testing completed. All 25 test cases failed (All 72 assertions failed)] + diff --git a/projects/SelfTest/Baselines/successfulResults.txt b/projects/SelfTest/Baselines/successfulResults.txt new file mode 100644 index 00000000..1c4e8fef --- /dev/null +++ b/projects/SelfTest/Baselines/successfulResults.txt @@ -0,0 +1,469 @@ +[Started testing] +[Started group: './succeeding*'] + +[Running: ./succeeding/Approx/simple] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:26: Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 +[Finished: './succeeding/Approx/simple' All tests passed (6 assertions in 1 test case)] + +[Running: ./succeeding/Approx/epsilon] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:39: d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) +[Finished: './succeeding/Approx/epsilon' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/Approx/float] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:50: 0.0f == Approx( 0.0f ) succeeded for: 0 == Approx( 0 ) +[Finished: './succeeding/Approx/float' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/Approx/int] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:61: 0 == Approx( 0 ) succeeded +[Finished: './succeeding/Approx/int' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/Approx/mixed] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:79: dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) +[Finished: './succeeding/Approx/mixed' All tests passed (5 assertions in 1 test case)] + +[Running: ./succeeding/Approx/custom] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:96: d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:101: approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 +[Finished: './succeeding/Approx/custom' All tests passed (8 assertions in 1 test case)] + +[Running: ./succeeding/TestClass/succeedingCase] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" +[Finished: './succeeding/TestClass/succeedingCase' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/Fixture/succeedingCase] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 +[Finished: './succeeding/Fixture/succeedingCase' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/conditions/equality] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:63: x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) +[Finished: './succeeding/conditions/equality' All tests passed (7 assertions in 1 test case)] + +[Running: ./succeeding/conditions/inequality] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:93: data.int_seven != 6 succeeded for: 7 != 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:94: data.int_seven != 8 succeeded for: 7 != 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:95: data.float_nine_point_one != Approx( 9.11f ) succeeded for: 9.1 != Approx( 9.11 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:96: data.float_nine_point_one != Approx( 9.0f ) succeeded for: 9.1 != Approx( 9 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:97: data.float_nine_point_one != Approx( 1 ) succeeded for: 9.1 != Approx( 1 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:98: data.float_nine_point_one != Approx( 0 ) succeeded for: 9.1 != Approx( 0 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:99: data.double_pi != Approx( 3.1415 ) succeeded for: 3.14159 != Approx( 3.1415 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:100: data.str_hello != "goodbye" succeeded for: "hello" != "goodbye" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:101: data.str_hello != "hell" succeeded for: "hello" != "hell" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:102: data.str_hello != "hello1" succeeded for: "hello" != "hello1" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:103: data.str_hello.size() != 6 succeeded for: 5 != 6 +[Finished: './succeeding/conditions/inequality' All tests passed (11 assertions in 1 test case)] + +[Running: ./succeeding/conditions/ordered] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:124: data.int_seven < 8 succeeded for: 7 < 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:125: data.int_seven > 6 succeeded for: 7 > 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:126: data.int_seven > 0 succeeded for: 7 > 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:127: data.int_seven > -1 succeeded for: 7 > -1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:129: data.int_seven >= 7 succeeded for: 7 >= 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:130: data.int_seven >= 6 succeeded for: 7 >= 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:131: data.int_seven <= 7 succeeded for: 7 <= 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:132: data.int_seven <= 8 succeeded for: 7 <= 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:134: data.float_nine_point_one > 9 succeeded for: 9.1 > 9 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:135: data.float_nine_point_one < 10 succeeded for: 9.1 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:136: data.float_nine_point_one < 9.2 succeeded for: 9.1 < 9.2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:138: data.str_hello <= "hello" succeeded for: "hello" <= "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:139: data.str_hello >= "hello" succeeded for: "hello" >= "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:141: data.str_hello < "hellp" succeeded for: "hello" < "hellp" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:142: data.str_hello < "zebra" succeeded for: "hello" < "zebra" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:143: data.str_hello > "hellm" succeeded for: "hello" > "hellm" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:144: data.str_hello > "a" succeeded for: "hello" > "a" +[Finished: './succeeding/conditions/ordered' All tests passed (17 assertions in 1 test case)] + +[Running: ./succeeding/conditions/int literals] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:188: i == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:189: ui == 2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:190: l == 3 succeeded for: 3 == 3 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:191: ul == 4 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:192: c == 5 succeeded for: 5 == 5 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:193: uc == 6 succeeded for:  == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:195: 1 == i succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:196: 2 == ui succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:197: 3 == l succeeded for: 3 == 3 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:198: 4 == ul succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:199: 5 == c succeeded for: 5 == 5 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:200: 6 == uc succeeded for: 6 ==  +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:202: (std::numeric_limits::max)() > ul succeeded for: 0xffffffffffffffff > 4 +[Finished: './succeeding/conditions/int literals' All tests passed (13 assertions in 1 test case)] + +[Running: ./succeeding/conditions//long_to_unsigned_x] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:223: long_var == unsigned_char_var succeeded for: 1 ==  +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:224: long_var == unsigned_short_var succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:225: long_var == unsigned_int_var succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:226: long_var == unsigned_long_var succeeded for: 1 == 1 +[Finished: './succeeding/conditions//long_to_unsigned_x' All tests passed (4 assertions in 1 test case)] + +[Running: ./succeeding/conditions/negative ints] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:232: ( -1 > 2u ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:233: -1 > 2u succeeded for: -1 > 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:235: ( 2u < -1 ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:236: 2u < -1 succeeded for: 2 < -1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:239: ( minInt > 2u ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:240: minInt > 2u succeeded for: -2147483648 > 2 +[Finished: './succeeding/conditions/negative ints' All tests passed (6 assertions in 1 test case)] + +[Running: ./succeeding/conditions/computed ints] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:255: 54 == 6*9 succeeded for: 54 == 54 +[Finished: './succeeding/conditions/computed ints' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/conditions/ptr] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:271: p == __null succeeded for: __null == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:272: p == pNULL succeeded for: __null == __null +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:277: p != __null succeeded for: 0x7fff556be0f8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:280: cp != __null succeeded for: 0x7fff556be0f8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:283: cpc != __null succeeded for: 0x7fff556be0f8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: returnsNull() == __null succeeded for: {null string} == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: returnsConstNull() == __null succeeded for: {null string} == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:288: __null != p succeeded for: 0 != 0x7fff556be0f8 +[Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] + +[Running: ./succeeding/conditions/not] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:303: false == false succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:304: true == true succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:305: !false succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:306: !false succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:308: !falseValue succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:309: !falseValue succeeded for: !false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:311: !(1 == 2) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:312: !1 == 2 succeeded for: !(1 == 2) +[Finished: './succeeding/conditions/not' All tests passed (8 assertions in 1 test case)] + +[Running: ./succeeding/exceptions/explicit] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:39: thisThrows() succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:40: thisDoesntThrow() succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:41: thisThrows() succeeded +[Finished: './succeeding/exceptions/explicit' All tests passed (3 assertions in 1 test case)] + +[Running: ./succeeding/exceptions/error messages] + +[Started section: 'custom, unexpected'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:145: runner.getLog() Contains( "custom exception" ) succeeded for: +"\[g] ./failing/exceptions/custom + \[tc] ./failing/exceptions/custom +ThrewException'custom exception' /[tc] ./failing/exceptions/custom +/[g] ./failing/exceptions/custom +" contains: "custom exception" +[End of section: 'custom, unexpected' 1 assertion passed] + +[Started section: 'in section'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:153: runner.getLog() Contains( "Exception from section" ) succeeded for: +"\[g] ./failing/exceptions/in-section + \[tc] ./failing/exceptions/in-section + \ [s] the section + \ [s] the section2 + / [s] the section2 + / [s] the section +ThrewException'Exception from section' \ [s] the section + / [s] the section + /[tc] ./failing/exceptions/in-section +/[g] ./failing/exceptions/in-section +" contains: "Exception from section" +[End of section: 'in section' 1 assertion passed] + +[Finished: './succeeding/exceptions/error messages' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/exceptions/notimplemented] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:165: thisFunctionNotImplemented( 7 ) succeeded +[Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/generators/1] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +[Finished: './succeeding/generators/1' All tests passed (144 assertions in 1 test case)] + +[Running: ./succeeding/message] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:14: [warning: this is a warning] +[Finished: './succeeding/message' No tests ran] + +[Running: ./succeeding/Misc/Sections] +[Started section: 's1'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:25: a != b succeeded for: 1 != 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:26: b != a succeeded for: 2 != 1 +[End of section: 's1' All 2 assertions passed] + +[Started section: 's2'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:31: a != b succeeded for: 1 != 2 +[End of section: 's2' 1 assertion passed] + +[Finished: './succeeding/Misc/Sections' All tests passed (3 assertions in 1 test case)] + +[Running: ./succeeding/Misc/Sections/nested] +[Started section: 's1'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:42: a != b succeeded for: 1 != 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:43: b != a succeeded for: 2 != 1 +[Started section: 's2'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:47: a != b succeeded for: 1 != 2 +[End of section: 's2' 1 assertion passed] + +[End of section: 's1' All 3 assertions passed] + +[Finished: './succeeding/Misc/Sections/nested' All tests passed (3 assertions in 1 test case)] + +[Running: ./succeeding/Misc/null strings] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:163: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:164: makeString( true ) == static_cast(__null) succeeded for: {null string} == {null string} +[Finished: './succeeding/Misc/null strings' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/checkedif] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:177: flag succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:185: testCheckedIf( true ) succeeded for: true +[Finished: './succeeding/checkedif' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/checkedelse] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:195: flag succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:203: testCheckedElse( true ) succeeded for: true +[Finished: './succeeding/checkedelse' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/atomic if] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:236: x == 0 succeeded for: 0 == 0 +[Finished: './succeeding/atomic if' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/matchers] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:246: testStringForMatching() Contains( "string" ) succeeded for: + "this string contains 'abc' as a substring" contains: "string" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:247: testStringForMatching() Contains( "abc" ) succeeded for: + "this string contains 'abc' as a substring" contains: "abc" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:249: testStringForMatching() StartsWith( "this" ) succeeded for: + "this string contains 'abc' as a substring" starts with: "this" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:250: testStringForMatching() EndsWith( "substring" ) succeeded for: + "this string contains 'abc' as a substring" ends with: "substring" +[Finished: './succeeding/matchers' All tests passed (4 assertions in 1 test case)] + +[Running: ./succeeding/matchers/Equals] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:285: testStringForMatching() Equals( "this string contains 'abc' as a substring" ) succeeded for: +"this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" +[Finished: './succeeding/matchers/Equals' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/Tricky/std::pair] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: + + std::pair( 1, 2 ) + == + std::pair( 1, 2 ) +[Finished: './succeeding/Tricky/std::pair' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/side-effects] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:119: i++ == 7 succeeded for: 7 == 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:120: i++ == 8 succeeded for: 8 == 8 +[Finished: './succeeding/side-effects' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/koenig] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:186: 0xc0000000 == o succeeded for: 0xc0000000 == {?} +[Finished: './succeeding/koenig' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/non-const==] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:212: t == 1u succeeded for: {?} == 1 +[Finished: './succeeding/non-const==' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/enum/bits] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:224: 0xc0000000 == bit30and31 succeeded for: 0xc0000000 == 3221225472 +[Finished: './succeeding/enum/bits' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/boolean member] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff556be8e0 != 0 +[Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/unimplemented static bool] +[Started section: 'compare to true'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:259: is_true::value == true succeeded for: true == true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:260: true == is_true::value succeeded for: true == true +[End of section: 'compare to true' All 2 assertions passed] + +[Started section: 'compare to false'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:264: is_true::value == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:265: false == is_true::value succeeded for: false == false +[End of section: 'compare to false' All 2 assertions passed] + +[Started section: 'negation'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:270: !is_true::value succeeded for: true +[End of section: 'negation' 1 assertion passed] + +[Started section: 'double negation'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:275: !!is_true::value succeeded for: true +[End of section: 'double negation' 1 assertion passed] + +[Started section: 'direct'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:280: is_true::value succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:281: !is_true::value succeeded for: !false +[End of section: 'direct' All 2 assertions passed] + +[Finished: './succeeding/unimplemented static bool' All tests passed (8 assertions in 1 test case)] + +[Running: ./succeeding/SafeBool] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:313: True succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:314: !False succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:315: !False succeeded for: !false +[Finished: './succeeding/SafeBool' All tests passed (3 assertions in 1 test case)] +[End of group: './succeeding*'. All tests passed (288 assertions in 41 test cases)] + + +[Testing completed. All tests passed (288 assertions in 41 test cases)] + diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index b0fe11f5..6e38d44c 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -37,7 +37,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" SECTION( "selftest/test counts/succeeding tests", "Number of 'succeeding' tests is fixed" ) { Totals totals = runner.runMatching( "./succeeding/*" ); - CHECK( totals.assertions.passed == 285 ); + CHECK( totals.assertions.passed == 288 ); CHECK( totals.assertions.failed == 0 ); } diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index 50e6a394..f15d236c 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -293,3 +293,24 @@ TEST_CASE( "./sameName", "Tests with the same name are not allowed" ) } */ + +struct Boolable +{ + explicit Boolable( bool value ) : m_value( value ) {} + + operator Catch::SafeBool::type() const { + return Catch::SafeBool::makeSafe( m_value ); + } + + bool m_value; +}; + +TEST_CASE( "./succeeding/SafeBool", "Objects that evaluated in boolean contexts can be checked") +{ + Boolable True( true ); + Boolable False( false ); + + CHECK( True ); + CHECK( !False ); + CHECK_FALSE( False ); +} diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index 7e910cd4..bca9f284 100644 --- a/projects/SelfTest/catch_self_test.cpp +++ b/projects/SelfTest/catch_self_test.cpp @@ -31,11 +31,11 @@ namespace Catch{ return totals; } - void MockReporter::Result( const ResultInfo& resultInfo ) { - if( resultInfo.getResultType() == ResultWas::Ok ) + void MockReporter::Result( const AssertionResult& assertionResult ) { + if( assertionResult.getResultType() == ResultWas::Ok ) return; - switch( resultInfo.getResultType() ) { + switch( assertionResult.getResultType() ) { case ResultWas::Info: m_log << "Info"; break; @@ -70,14 +70,14 @@ namespace Catch{ break; } - if( resultInfo.hasExpression() ) - m_log << resultInfo.getExpression(); + if( assertionResult.hasExpression() ) + m_log << assertionResult.getExpression(); - if( resultInfo.hasMessage() ) - m_log << "'" << resultInfo.getMessage() << "'"; + if( assertionResult.hasMessage() ) + m_log << "'" << assertionResult.getMessage() << "'"; - if( resultInfo.hasExpandedExpression() ) - m_log << resultInfo.getExpandedExpression(); + if( assertionResult.hasExpandedExpression() ) + m_log << assertionResult.getExpandedExpression(); } void MockReporter::openLabel( const std::string& label, const std::string& arg ) { diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index 93ba26ee..f31a8e99 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -95,7 +95,7 @@ namespace Catch { closeLabel( recordTestCases, testInfo.getName() ); } - virtual void Result( const ResultInfo& resultInfo ); + virtual void Result( const AssertionResult& assertionResult ); private: diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 77d02dcb..7667e515 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -105,7 +105,7 @@ 4A6D0C5A149B3E3D00DB3EAA /* catch_reporter_registrars.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_reporter_registrars.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 4A6D0C5B149B3E3D00DB3EAA /* catch_reporter_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_registry.hpp; sourceTree = ""; }; 4A6D0C5C149B3E3D00DB3EAA /* catch_result_type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_result_type.h; sourceTree = ""; }; - 4A6D0C5D149B3E3D00DB3EAA /* catch_resultinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_resultinfo.h; sourceTree = ""; }; + 4A6D0C5D149B3E3D00DB3EAA /* catch_assertionresult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_assertionresult.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 4A6D0C5E149B3E3D00DB3EAA /* catch_runner_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_runner_impl.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 4A6D0C5F149B3E3D00DB3EAA /* catch_section.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_section.hpp; sourceTree = ""; }; 4A6D0C60149B3E3D00DB3EAA /* catch_stream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_stream.hpp; sourceTree = ""; }; @@ -120,10 +120,10 @@ 4A8E4DCC160A344100194CBD /* catch_tags.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_tags.hpp; sourceTree = ""; }; 4A8E4DD0160A352200194CBD /* catch_tags.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_tags.cpp; path = ../../../SelfTest/SurrogateCpps/catch_tags.cpp; sourceTree = ""; }; 4A90B59B15D0F61A00EF71BC /* catch_interfaces_generators.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_generators.h; sourceTree = ""; }; - 4A90B59D15D24FE900EF71BC /* catch_resultinfo.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_resultinfo.hpp; sourceTree = ""; }; - 4A90B59E15D2521E00EF71BC /* catch_resultinfo_builder.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_resultinfo_builder.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + 4A90B59D15D24FE900EF71BC /* catch_assertionresult.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_assertionresult.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + 4A90B59E15D2521E00EF71BC /* catch_expressionresult_builder.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expressionresult_builder.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 4A9D84B11558FC0400FBB209 /* catch_tostring.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_tostring.hpp; sourceTree = ""; }; - 4A9D84B315599AC900FBB209 /* catch_resultinfo_builder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_resultinfo_builder.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 4A9D84B315599AC900FBB209 /* catch_expressionresult_builder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_expressionresult_builder.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 4AA7FF4115F3E89D009AD7F9 /* BDDTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BDDTests.cpp; sourceTree = ""; }; 4AB1C73514F97BDA00F31DF7 /* catch_console_colour_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_console_colour_impl.hpp; sourceTree = ""; }; 4AB1C73714F97C1300F31DF7 /* catch_console_colour.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_console_colour.hpp; sourceTree = ""; }; @@ -132,10 +132,10 @@ 4AB3D9A1161621B500C9A0F8 /* catch_interfaces_generators.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_interfaces_generators.cpp; path = ../../../SelfTest/SurrogateCpps/catch_interfaces_generators.cpp; sourceTree = ""; }; 4AB77CB51551AEA200857BF0 /* catch_ptr.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_ptr.hpp; sourceTree = ""; }; 4AB77CB71553B72B00857BF0 /* catch_section_info.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_section_info.hpp; sourceTree = ""; }; - 4AB77CB81553BB3800857BF0 /* catch_running_test.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_running_test.hpp; sourceTree = ""; }; + 4AB77CB81553BB3800857BF0 /* catch_running_test.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_running_test.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 4ABEA80415C90D2B009F0424 /* catch_objc_arc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_objc_arc.hpp; sourceTree = ""; }; - 4AC91CCE155CF02800DC5117 /* catch_expression.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; - 4AC91CD0155D8DA600DC5117 /* catch_expression_builder.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression_builder.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + 4AC91CCE155CF02800DC5117 /* catch_expression_lhs.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression_lhs.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + 4AC91CD0155D8DA600DC5117 /* catch_expression_decomposer.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression_decomposer.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 4AE1840A14EE4F230066340D /* catch_self_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_self_test.cpp; path = ../../../SelfTest/catch_self_test.cpp; sourceTree = ""; }; 4AEE031F16142F910071E950 /* catch_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_common.cpp; path = ../../../SelfTest/SurrogateCpps/catch_common.cpp; sourceTree = ""; }; 4AEE032216142FC70071E950 /* catch_debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_debugger.cpp; path = ../../../SelfTest/SurrogateCpps/catch_debugger.cpp; sourceTree = ""; }; @@ -275,8 +275,8 @@ 4A6D0C62149B3E3D00DB3EAA /* catch_test_case_registry_impl.hpp */, 4AB1C73514F97BDA00F31DF7 /* catch_console_colour_impl.hpp */, 4A4B0F9B15CEF8C400AE2392 /* catch_notimplemented_exception.hpp */, - 4A90B59D15D24FE900EF71BC /* catch_resultinfo.hpp */, - 4A90B59E15D2521E00EF71BC /* catch_resultinfo_builder.hpp */, + 4A90B59D15D24FE900EF71BC /* catch_assertionresult.hpp */, + 4A90B59E15D2521E00EF71BC /* catch_expressionresult_builder.hpp */, 4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */, ); name = impl; @@ -288,15 +288,15 @@ 4A6D0C4D149B3E3D00DB3EAA /* catch_evaluate.hpp */, 4A6D0C4F149B3E3D00DB3EAA /* catch_generators.hpp */, 4A6D0C5C149B3E3D00DB3EAA /* catch_result_type.h */, - 4A6D0C5D149B3E3D00DB3EAA /* catch_resultinfo.h */, - 4A9D84B315599AC900FBB209 /* catch_resultinfo_builder.h */, + 4A6D0C5D149B3E3D00DB3EAA /* catch_assertionresult.h */, + 4A9D84B315599AC900FBB209 /* catch_expressionresult_builder.h */, 4A6D0C5F149B3E3D00DB3EAA /* catch_section.hpp */, 4A3D7DD01503869D005F9203 /* catch_matchers.hpp */, 4A9D84B11558FC0400FBB209 /* catch_tostring.hpp */, 4A6D0C46149B3E3D00DB3EAA /* catch_approx.hpp */, 4A6D0C47149B3E3D00DB3EAA /* catch_capture.hpp */, - 4AC91CCE155CF02800DC5117 /* catch_expression.hpp */, - 4AC91CD0155D8DA600DC5117 /* catch_expression_builder.hpp */, + 4AC91CCE155CF02800DC5117 /* catch_expression_lhs.hpp */, + 4AC91CD0155D8DA600DC5117 /* catch_expression_decomposer.hpp */, 4A4B0F9A15CEF84800AE2392 /* catch_notimplemented_exception.h */, ); name = Assertions; @@ -551,11 +551,15 @@ buildSettings = { CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; + GCC_PREPROCESSOR_DEFINITIONS = CATCH_CONFIG_USE_ANSI_COLOUR_CODES; + "GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = ( + CATCH_CONFIG_USE_ANSI_COLOUR_CODES, + "DEBUG=1", + ); PRODUCT_NAME = "$(TARGET_NAME)"; WARNING_CFLAGS = ( "-Weverything", "-Wno-disabled-macro-expansion", - "-Wno-global-constructors", ); }; name = Debug; @@ -565,11 +569,11 @@ buildSettings = { CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; + GCC_PREPROCESSOR_DEFINITIONS = CATCH_CONFIG_USE_ANSI_COLOUR_CODES; PRODUCT_NAME = "$(TARGET_NAME)"; WARNING_CFLAGS = ( "-Weverything", "-Wno-disabled-macro-expansion", - "-Wno-global-constructors", ); }; name = Release; diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 85a3d805..822ebcff 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-10-31 19:15:51.281013 + * Generated: 2012-10-31 18:04:01.157950 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -13,7 +13,7 @@ #define TWOBLUECUBES_CATCH_HPP_INCLUDED #ifdef __clang__ -#pragma clang diagnostic ignored "-Wno-global-constructors" +#pragma clang diagnostic ignored "-Wglobal-constructors" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" @@ -139,6 +139,9 @@ namespace Catch { file.swap( other.file ); std::swap( line, other.line ); } + bool empty() const { + return file.empty(); + } std::string function; std::string file; @@ -445,14 +448,14 @@ private: // #included from: internal/catch_capture.hpp #define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED -// #included from: catch_expression_builder.hpp -#define TWOBLUECUBES_CATCH_EXPRESSION_BUILDER_HPP_INCLUDED +// #included from: catch_expression_decomposer.hpp +#define TWOBLUECUBES_CATCH_EXPRESSION_DECOMPOSER_HPP_INCLUDED -// #included from: catch_expression.hpp -#define TWOBLUECUBES_CATCH_EXPRESSION_HPP_INCLUDED +// #included from: catch_expression_lhs.hpp +#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED -// #included from: catch_resultinfo_builder.h -#define TWOBLUECUBES_CATCH_RESULTINFO_BUILDER_H_INCLUDED +// #included from: catch_expressionresult_builder.h +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_H_INCLUDED // #included from: catch_tostring.hpp #define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED @@ -639,8 +642,8 @@ inline std::string toString( std::nullptr_t ) { } // end namespace Catch -// #included from: catch_resultinfo.h -#define TWOBLUECUBES_CATCH_RESULTINFO_H_INCLUDED +// #included from: catch_assertionresult.h +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED #include // #included from: catch_result_type.h @@ -682,23 +685,37 @@ struct ResultAction { enum Value { namespace Catch { - struct ResultData + struct AssertionInfo { - ResultData() : resultType( ResultWas::Unknown ) {} + AssertionInfo() {} + AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression, bool _shouldNegate ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + capturedExpression( _capturedExpression ) + { + if( _shouldNegate ) + capturedExpression = "!" + _capturedExpression; + } std::string macroName; SourceLineInfo lineInfo; std::string capturedExpression; + }; + + struct AssertionResultData + { + AssertionResultData() : resultType( ResultWas::Unknown ) {} + std::string reconstructedExpression; std::string message; ResultWas::OfType resultType; }; - class ResultInfo { + class AssertionResult { public: - ResultInfo(); - ResultInfo( const ResultData& data ); - ~ResultInfo(); + AssertionResult(); + AssertionResult( const AssertionInfo& info, const AssertionResultData& data ); + ~AssertionResult(); bool ok() const; ResultWas::OfType getResultType() const; @@ -708,12 +725,12 @@ namespace Catch { bool hasExpandedExpression() const; std::string getExpandedExpression() const; std::string getMessage() const; - std::string getFilename() const; - std::size_t getLine() const; + SourceLineInfo getSourceInfo() const; std::string getTestMacroName() const; protected: - ResultData m_data; + AssertionInfo m_info; + AssertionResultData m_resultData; }; } // end namespace Catch @@ -885,201 +902,142 @@ namespace Internal { namespace Catch { -struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; - -class ResultInfoBuilder { +// Wraps the (stringised versions of) the lhs, operator and rhs of an expression - as well as +// the result of evaluating it. This is used to build an AssertionResult object +class ExpressionResultBuilder { public: - ResultInfoBuilder(); + ExpressionResultBuilder( ResultWas::OfType resultType = ResultWas::Unknown ); + ExpressionResultBuilder( const ExpressionResultBuilder& other ); + ExpressionResultBuilder& operator=(const ExpressionResultBuilder& other ); - ResultInfoBuilder& setResultType( ResultWas::OfType result ); - ResultInfoBuilder& setCapturedExpression( const std::string& capturedExpression ); - ResultInfoBuilder& setIsFalse( bool isFalse ); - ResultInfoBuilder& setMessage( const std::string& message ); - ResultInfoBuilder& setLineInfo( const SourceLineInfo& lineInfo ); - ResultInfoBuilder& setLhs( const std::string& lhs ); - ResultInfoBuilder& setRhs( const std::string& rhs ); - ResultInfoBuilder& setOp( const std::string& op ); - ResultInfoBuilder& setMacroName( const std::string& macroName ); + ExpressionResultBuilder& setResultType( ResultWas::OfType result ); + ExpressionResultBuilder& setResultType( bool result ); + ExpressionResultBuilder& setLhs( const std::string& lhs ); + ExpressionResultBuilder& setRhs( const std::string& rhs ); + ExpressionResultBuilder& setOp( const std::string& op ); - std::string reconstructExpression() const; + ExpressionResultBuilder& negate( bool shouldNegate ); - ResultInfo build() const; - - // Disable attempts to use || and && in expressions (without parantheses) - template - STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( const RhsT& ); - template - STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( const RhsT& ); - - bool getIsFalse() const { - return m_isFalse; + template + ExpressionResultBuilder& operator << ( const T& value ) { + m_stream << value; + return *this; } + std::string reconstructExpression( const AssertionInfo& info ) const; + + AssertionResult buildResult( const AssertionInfo& info ) const; + private: - ResultData m_data; - std::string m_lhs, m_rhs, m_op; - bool m_isFalse; + AssertionResultData m_data; + struct ExprComponents { + ExprComponents() : shouldNegate( false ) {} + bool shouldNegate; + std::string lhs, rhs, op; + } m_exprComponents; + std::ostringstream m_stream; }; } // end namespace Catch namespace Catch { +struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; + +// Wraps the LHS of an expression and captures the operator and RHS (if any) - wrapping them all +// in an ExpressionResultBuilder object template -class Expression { - void operator = ( const Expression& ); +class ExpressionLhs { + void operator = ( const ExpressionLhs& ); public: - Expression( ResultInfoBuilder& result, T lhs ) - : m_result( result.setLhs( Catch::toString( lhs ) ) ), - m_lhs( lhs ) - {} + ExpressionLhs( T lhs ) : m_lhs( lhs ) {} template - ResultInfoBuilder& operator == ( const RhsT& rhs ) { + ExpressionResultBuilder& operator == ( const RhsT& rhs ) { return captureExpression( rhs ); } template - ResultInfoBuilder& operator != ( const RhsT& rhs ) { + ExpressionResultBuilder& operator != ( const RhsT& rhs ) { return captureExpression( rhs ); } template - ResultInfoBuilder& operator < ( const RhsT& rhs ) { + ExpressionResultBuilder& operator < ( const RhsT& rhs ) { return captureExpression( rhs ); } template - ResultInfoBuilder& operator > ( const RhsT& rhs ) { + ExpressionResultBuilder& operator > ( const RhsT& rhs ) { return captureExpression( rhs ); } template - ResultInfoBuilder& operator <= ( const RhsT& rhs ) { + ExpressionResultBuilder& operator <= ( const RhsT& rhs ) { return captureExpression( rhs ); } template - ResultInfoBuilder& operator >= ( const RhsT& rhs ) { + ExpressionResultBuilder& operator >= ( const RhsT& rhs ) { return captureExpression( rhs ); } - ResultInfoBuilder& operator == ( bool rhs ) { + ExpressionResultBuilder& operator == ( bool rhs ) { return captureExpression( rhs ); } - ResultInfoBuilder& operator != ( bool rhs ) { + ExpressionResultBuilder& operator != ( bool rhs ) { return captureExpression( rhs ); } - operator ResultInfoBuilder& () { - return m_result.setResultType( m_lhs ? ResultWas::Ok : ResultWas::ExpressionFailed ); + ExpressionResultBuilder& negate( bool shouldNegate ) { + bool value = m_lhs ? true : false; + return m_result + .setLhs( Catch::toString( value ) ) + .setResultType( value ) + .negate( shouldNegate ); } - template - STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( const RhsT& ); - - template - STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( const RhsT& ); + // Only simple binary expressions are allowed on the LHS. + // If more complex compositions are required then place the sub expression in parentheses + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( const RhsT& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( const RhsT& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( const RhsT& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( const RhsT& ); private: template - ResultInfoBuilder& captureExpression( const RhsT& rhs ) { + ExpressionResultBuilder& captureExpression( const RhsT& rhs ) { return m_result - .setResultType( Internal::compare( m_lhs, rhs ) ? ResultWas::Ok : ResultWas::ExpressionFailed ) + .setResultType( Internal::compare( m_lhs, rhs ) ) + .setLhs( Catch::toString( m_lhs ) ) .setRhs( Catch::toString( rhs ) ) .setOp( Internal::OperatorTraits::getName() ); } private: - ResultInfoBuilder& m_result; + ExpressionResultBuilder m_result; T m_lhs; }; } // end namespace Catch -#include - namespace Catch { -class ExpressionBuilder { +// Captures the LHS of the expression and wraps it in an Expression Lhs object +class ExpressionDecomposer { public: - ExpressionBuilder( const SourceLineInfo& lineInfo, - const char* macroName, - const char* expr = "", - bool isFalse = false ) - : m_messageStream() - { - m_result - .setCapturedExpression( expr ) - .setIsFalse( isFalse ) - .setLineInfo( lineInfo ) - .setMacroName( macroName ); - } - template - Expression operator->* ( const T & operand ) { - Expression expr( m_result, operand ); - return expr; + ExpressionLhs operator->* ( const T & operand ) { + return ExpressionLhs( operand ); } - Expression operator->* ( bool value ) { - Expression expr( m_result, value ); - return expr; + ExpressionLhs operator->* ( bool value ) { + return ExpressionLhs( value ); } - - template - ExpressionBuilder& operator << ( const T & value ) { - m_messageStream << Catch::toString( value ); - return *this; - } - - template - ExpressionBuilder& acceptMatcher( const MatcherT& matcher, - const ArgT& arg, - const std::string& matcherCallAsString ) { - std::string matcherAsString = matcher.toString(); - if( matcherAsString == "{?}" ) - matcherAsString = matcherCallAsString; - m_result - .setLhs( Catch::toString( arg ) ) - .setRhs( matcherAsString ) - .setOp( "matches" ) - .setResultType( matcher.match( arg ) ? ResultWas::Ok : ResultWas::ExpressionFailed ); - return *this; - } - - template - ExpressionBuilder& acceptMatcher( const MatcherT& matcher, - ArgT* arg, - const std::string& matcherCallAsString ) { - std::string matcherAsString = matcher.toString(); - if( matcherAsString == "{?}" ) - matcherAsString = matcherCallAsString; - m_result - .setLhs( Catch::toString( arg ) ) - .setRhs( matcherAsString ) - .setOp( "matches" ) - .setResultType( matcher.match( arg ) ? ResultWas::Ok : ResultWas::ExpressionFailed ); - return *this; - } - - ExpressionBuilder& setResultType( ResultWas::OfType resultType ) { - m_result.setResultType( resultType ); - return *this; - } - - operator ResultInfoBuilder&() { - m_result.setMessage( m_messageStream.str() ); - return m_result; - } - -private: - ResultInfoBuilder m_result; - std::ostringstream m_messageStream; }; } // end namespace Catch @@ -1152,14 +1110,15 @@ namespace Catch { class TestCaseInfo; class ScopedInfo; - class ResultInfoBuilder; - class ResultInfo; + class ExpressionResultBuilder; + class AssertionResult; + struct AssertionInfo; struct IResultCapture { virtual ~IResultCapture(); - virtual void testEnded( const ResultInfo& result ) = 0; + virtual void testEnded( const AssertionResult& result ) = 0; virtual bool sectionStarted( const std::string& name, const std::string& description, const SourceLineInfo& lineInfo, @@ -1169,13 +1128,11 @@ namespace Catch { virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; virtual bool shouldDebugBreak() const = 0; - virtual ResultAction::Value acceptResult( bool result ) = 0; - virtual ResultAction::Value acceptResult( ResultWas::OfType result ) = 0; - virtual ResultAction::Value acceptExpression( const ResultInfoBuilder& resultInfo ) = 0; - virtual void acceptMessage( const std::string& msg ) = 0; + virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0; + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; - virtual const ResultInfo* getLastResult() const = 0; + virtual const AssertionResult* getLastResult() const = 0; }; } @@ -1285,349 +1242,6 @@ inline void writeToDebugConsole( const std::string& text ) { } #endif // CATCH_PLATFORM_WINDOWS -#include - -namespace Catch { - -struct TestFailureException{}; - -class ScopedInfo { -public: - ScopedInfo() : m_oss() { - getCurrentContext().getResultCapture().pushScopedInfo( this ); - } - - ~ScopedInfo() { - getCurrentContext().getResultCapture().popScopedInfo( this ); - } - - template - ScopedInfo& operator << ( const T& value ) { - m_oss << value; - return *this; - } - - ResultInfo getInfo () const { - return ResultInfoBuilder() - .setResultType( ResultWas::Info ) - .setMessage( m_oss.str() ) - .setMacroName( "SCOPED_INFO" ) - .build(); - } - -private: - std::ostringstream m_oss; -}; - -// This is just here to avoid compiler warnings with macro constants -inline bool isTrue( bool value ){ return value; } - -} // end namespace Catch - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ACCEPT_EXPR( expr, stopOnFailure, originalExpr ) \ - if( Catch::ResultAction::Value internal_catch_action = Catch::getCurrentContext().getResultCapture().acceptExpression( expr ) ) { \ - if( internal_catch_action & Catch::ResultAction::Debug ) BreakIntoDebugger(); \ - if( internal_catch_action & Catch::ResultAction::Abort ) throw Catch::TestFailureException(); \ - if( Catch::isTrue( stopOnFailure ) ) throw Catch::TestFailureException(); \ - if( Catch::isTrue( false ) ){ bool this_is_here_to_invoke_warnings = ( originalExpr ); Catch::isTrue( this_is_here_to_invoke_warnings ); } \ - } - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ) \ - do { try { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr, isFalse )->*expr ), stopOnFailure, expr ); \ - } catch( Catch::TestFailureException& ) { \ - throw; \ - } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ) << Catch::getRegistryHub().getExceptionTranslatorRegistry().translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), false, expr ); \ - throw; \ - } } while( Catch::isTrue( false ) ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_IF( expr, isFalse, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ); \ - if( Catch::getCurrentContext().getResultCapture().getLastResult()->ok() ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ELSE( expr, isFalse, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ); \ - if( !Catch::getCurrentContext().getResultCapture().getLastResult()->ok() ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_NO_THROW( expr, stopOnFailure, macroName ) \ - try { \ - expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ).setResultType( Catch::ResultWas::Ok ), stopOnFailure, false ); \ - } \ - catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ) << Catch::getRegistryHub().getExceptionTranslatorRegistry().translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure, false ); \ - } - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ - try { \ - if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ - expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ).setResultType( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ - } \ - } \ - catch( Catch::TestFailureException& ) { \ - throw; \ - } \ - catch( exceptionType ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ).setResultType( Catch::ResultWas::Ok ), stopOnFailure, false ); \ - } - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, stopOnFailure, macroName ) \ - INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ - catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ) << Catch::getRegistryHub().getExceptionTranslatorRegistry() ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure, false ); \ - } - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ - Catch::getCurrentContext().getResultCapture().acceptExpression( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName ) << reason ).setResultType( resultType ) ); - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_SCOPED_INFO( log ) \ - Catch::ScopedInfo INTERNAL_CATCH_UNIQUE_NAME( info ); \ - INTERNAL_CATCH_UNIQUE_NAME( info ) << log - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CHECK_THAT( arg, matcher, stopOnFailure, macroName ) \ - do { try { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #arg " " #matcher, false ).acceptMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ - } catch( Catch::TestFailureException& ) { \ - throw; \ - } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #arg " " #matcher ) << Catch::getRegistryHub().getExceptionTranslatorRegistry().translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), false, false ); \ - throw; \ - }}while( Catch::isTrue( false ) ) - -// #included from: internal/catch_section.hpp -#define TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED - -#include - -namespace Catch { - - class Section { - public: - Section( const std::string& name, - const std::string& description, - const SourceLineInfo& lineInfo ) - : m_name( name ), - m_sectionIncluded( getCurrentContext().getResultCapture().sectionStarted( name, description, lineInfo, m_assertions ) ) - {} - - ~Section() { - if( m_sectionIncluded ) - getCurrentContext().getResultCapture().sectionEnded( m_name, m_assertions ); - } - - // This indicates whether the section should be executed or not - operator bool() { - return m_sectionIncluded; - } - - private: - - std::string m_name; - Counts m_assertions; - bool m_sectionIncluded; - }; - -} // end namespace Catch - -#define INTERNAL_CATCH_SECTION( name, desc ) \ - if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( name, desc, CATCH_INTERNAL_LINEINFO ) ) - -// #included from: internal/catch_generators.hpp -#define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED - -#include -#include -#include -#include - -namespace Catch { - -template -struct IGenerator { - virtual ~IGenerator() {} - virtual T getValue( std::size_t index ) const = 0; - virtual std::size_t size () const = 0; -}; - -template -class BetweenGenerator : public IGenerator { -public: - BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){} - - virtual T getValue( std::size_t index ) const { - return m_from+static_cast( index ); - } - - virtual std::size_t size() const { - return static_cast( 1+m_to-m_from ); - } - -private: - - T m_from; - T m_to; -}; - -template -class ValuesGenerator : public IGenerator { -public: - ValuesGenerator(){} - - void add( T value ) { - m_values.push_back( value ); - } - - virtual T getValue( std::size_t index ) const { - return m_values[index]; - } - - virtual std::size_t size() const { - return m_values.size(); - } - -private: - std::vector m_values; -}; - -template -class CompositeGenerator { -public: - CompositeGenerator() : m_totalSize( 0 ) {} - - // *** Move semantics, similar to auto_ptr *** - CompositeGenerator( CompositeGenerator& other ) - : m_fileInfo( other.m_fileInfo ), - m_totalSize( 0 ) - { - move( other ); - } - - CompositeGenerator& setFileInfo( const char* fileInfo ) { - m_fileInfo = fileInfo; - return *this; - } - - ~CompositeGenerator() { - deleteAll( m_composed ); - } - - operator T () const { - size_t overallIndex = getCurrentContext().getGeneratorIndex( m_fileInfo, m_totalSize ); - - typename std::vector*>::const_iterator it = m_composed.begin(); - typename std::vector*>::const_iterator itEnd = m_composed.end(); - for( size_t index = 0; it != itEnd; ++it ) - { - const IGenerator* generator = *it; - if( overallIndex >= index && overallIndex < index + generator->size() ) - { - return generator->getValue( overallIndex-index ); - } - index += generator->size(); - } - CATCH_INTERNAL_ERROR( "Indexed past end of generated range" ); - return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so - } - - void add( const IGenerator* generator ) { - m_totalSize += generator->size(); - m_composed.push_back( generator ); - } - - CompositeGenerator& then( CompositeGenerator& other ) { - move( other ); - return *this; - } - - CompositeGenerator& then( T value ) { - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( value ); - add( valuesGen ); - return *this; - } - -private: - - void move( CompositeGenerator& other ) { - std::copy( other.m_composed.begin(), other.m_composed.end(), std::back_inserter( m_composed ) ); - m_totalSize += other.m_totalSize; - other.m_composed.clear(); - } - - std::vector*> m_composed; - std::string m_fileInfo; - size_t m_totalSize; -}; - -namespace Generators -{ - template - CompositeGenerator between( T from, T to ) { - CompositeGenerator generators; - generators.add( new BetweenGenerator( from, to ) ); - return generators; - } - - template - CompositeGenerator values( T val1, T val2 ) { - CompositeGenerator generators; - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( val1 ); - valuesGen->add( val2 ); - generators.add( valuesGen ); - return generators; - } - - template - CompositeGenerator values( T val1, T val2, T val3 ){ - CompositeGenerator generators; - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( val1 ); - valuesGen->add( val2 ); - valuesGen->add( val3 ); - generators.add( valuesGen ); - return generators; - } - - template - CompositeGenerator values( T val1, T val2, T val3, T val4 ) { - CompositeGenerator generators; - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( val1 ); - valuesGen->add( val2 ); - valuesGen->add( val3 ); - valuesGen->add( val4 ); - generators.add( valuesGen ); - return generators; - } - -} // end namespace Generators - -using namespace Generators; - -} // end namespace Catch - -#define INTERNAL_CATCH_LINESTR2( line ) #line -#define INTERNAL_CATCH_LINESTR( line ) INTERNAL_CATCH_LINESTR2( line ) - -#define INTERNAL_CATCH_GENERATE( expr ) expr.setFileInfo( __FILE__ "(" INTERNAL_CATCH_LINESTR( __LINE__ ) ")" ) - -// #included from: internal/catch_interfaces_exception.h -#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED - -#include // #included from: catch_interfaces_registry_hub.h #define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED @@ -1755,10 +1369,6 @@ namespace Catch { m_remainder += c; } - // Suppress assignment operator to avoid warnings from MSVC saying that - // it can't be implicitly synthesized. - TagExtracter& operator=(const TagExtracter&); - std::set& m_tags; std::string m_remainder; }; @@ -1862,10 +1472,6 @@ namespace Catch { m_exp.m_tagSets.push_back( m_currentTagSet ); } - // Suppress assignment operator to avoid warnings from MSVC saying that - // it can't be implicitly synthesized. - TagExpressionParser& operator=(const TagExpressionParser&); - bool m_isNegated; TagSet m_currentTagSet; TagExpression& m_exp; @@ -2319,23 +1925,37 @@ namespace Catch }; class TestCaseInfo; - class ResultInfo; + class AssertionResult; struct IReporter : IShared { virtual ~IReporter(); + virtual bool shouldRedirectStdout() const = 0; + virtual void StartTesting() = 0; virtual void EndTesting( const Totals& totals ) = 0; + virtual void StartGroup( const std::string& groupName ) = 0; virtual void EndGroup( const std::string& groupName, const Totals& totals ) = 0; + + virtual void StartTestCase( const TestCaseInfo& testInfo ) = 0; + // TestCaseResult + virtual void EndTestCase( const TestCaseInfo& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0; + + // SectionInfo virtual void StartSection( const std::string& sectionName, const std::string& description ) = 0; + // Section Result + virtual void EndSection( const std::string& sectionName, const Counts& assertions ) = 0; + + // - merge into SectionResult ? virtual void NoAssertionsInSection( const std::string& sectionName ) = 0; virtual void NoAssertionsInTestCase( const std::string& testName ) = 0; - virtual void EndSection( const std::string& sectionName, const Counts& assertions ) = 0; - virtual void StartTestCase( const TestCaseInfo& testInfo ) = 0; + + // - merge into SectionResult, TestCaseResult, GroupResult & TestRunResult virtual void Aborted() = 0; - virtual void EndTestCase( const TestCaseInfo& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0; - virtual void Result( const ResultInfo& result ) = 0; + + // AssertionReslt + virtual void Result( const AssertionResult& result ) = 0; }; struct IReporterFactory { @@ -2387,8 +2007,408 @@ namespace Catch { IRegistryHub& getRegistryHub(); IMutableRegistryHub& getMutableRegistryHub(); void cleanUp(); + std::string translateActiveException(); + } +#include + +namespace Catch { + + inline IResultCapture& getResultCapture() { + return getCurrentContext().getResultCapture(); + } + + template + ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, + const std::string& matcherCallAsString ) { + std::string matcherAsString = matcher.toString(); + if( matcherAsString == "{?}" ) + matcherAsString = matcherCallAsString; + return ExpressionResultBuilder() + .setRhs( matcherAsString ) + .setOp( "matches" ); + } + + template + ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, + const ArgT& arg, + const std::string& matcherCallAsString ) { + return expressionResultBuilderFromMatcher( matcher, matcherCallAsString ) + .setLhs( Catch::toString( arg ) ) + .setResultType( matcher.match( arg ) ); + } + + template + ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, + ArgT* arg, + const std::string& matcherCallAsString ) { + return expressionResultBuilderFromMatcher( matcher, matcherCallAsString ) + .setLhs( Catch::toString( arg ) ) + .setResultType( matcher.match( arg ) ); + } + +struct TestFailureException{}; + +class ScopedInfo { +public: + ScopedInfo() : m_resultBuilder( ResultWas::Info ) { + getResultCapture().pushScopedInfo( this ); + } + ~ScopedInfo() { + getResultCapture().popScopedInfo( this ); + } + template + ScopedInfo& operator << ( const T& value ) { + m_resultBuilder << value; + return *this; + } + AssertionResult buildResult( const AssertionInfo& assertionInfo ) const { + return m_resultBuilder.buildResult( assertionInfo ); + } + +private: + ExpressionResultBuilder m_resultBuilder; +}; + +// This is just here to avoid compiler warnings with macro constants and boolean literals +inline bool isTrue( bool value ){ return value; } + +} // end namespace Catch + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_ASSERTIONINFO_NAME INTERNAL_CATCH_UNIQUE_NAME( __assertionInfo ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_ACCEPT_EXPR( evaluatedExpr, stopOnFailure, originalExpr ) \ + if( Catch::ResultAction::Value internal_catch_action = Catch::getResultCapture().acceptExpression( evaluatedExpr, INTERNAL_CATCH_ASSERTIONINFO_NAME ) ) { \ + if( internal_catch_action & Catch::ResultAction::Debug ) BreakIntoDebugger(); \ + if( internal_catch_action & Catch::ResultAction::Abort ) throw Catch::TestFailureException(); \ + if( Catch::isTrue( stopOnFailure ) ) throw Catch::TestFailureException(); \ + if( Catch::isTrue( false ) ){ bool this_is_here_to_invoke_warnings = ( originalExpr ); Catch::isTrue( this_is_here_to_invoke_warnings ); } \ + } + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, shouldNegate ) \ + Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, shouldNegate ); +// !TBD Catch::getResultCapture().acceptAssertionInfo( INTERNAL_CATCH_ASSERTIONINFO_NAME ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \ + try { \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).negate( shouldNegate ), stopOnFailure, expr ); \ + } catch( Catch::TestFailureException& ) { \ + throw; \ + } catch( ... ) { \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), false, expr ); \ + throw; \ + } \ + } while( Catch::isTrue( false ) ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_IF( expr, shouldNegate, stopOnFailure, macroName ) \ + INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ); \ + if( Catch::getResultCapture().getLastResult()->ok() ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_ELSE( expr, shouldNegate, stopOnFailure, macroName ) \ + INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ); \ + if( !Catch::getResultCapture().getLastResult()->ok() ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_NO_THROW( expr, stopOnFailure, macroName ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ + try { \ + expr; \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + } \ + catch( ... ) { \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), stopOnFailure, false ); \ + } \ +} while( Catch::isTrue( false ) ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ + try { \ + if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ + expr; \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ + } \ + } \ + catch( Catch::TestFailureException& ) { \ + throw; \ + } \ + catch( exceptionType ) { \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + } + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ + INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ + } while( Catch::isTrue( false ) ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, stopOnFailure, macroName ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ + INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ + catch( ... ) { \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), stopOnFailure, false ); \ + } \ + } while( Catch::isTrue( false ) ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ); + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ + Catch::ScopedInfo INTERNAL_CATCH_UNIQUE_NAME( info ); \ + INTERNAL_CATCH_UNIQUE_NAME( info ) << log + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CHECK_THAT( arg, matcher, stopOnFailure, macroName ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, false ); \ + try { \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::expressionResultBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ + } catch( Catch::TestFailureException& ) { \ + throw; \ + } catch( ... ) { \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), false, false ); \ + throw; \ + } \ + } while( Catch::isTrue( false ) ) + +// #included from: internal/catch_section.hpp +#define TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED + +#include + +namespace Catch { + + class Section { + public: + Section( const std::string& name, + const std::string& description, + const SourceLineInfo& lineInfo ) + : m_name( name ), + m_sectionIncluded( getCurrentContext().getResultCapture().sectionStarted( name, description, lineInfo, m_assertions ) ) + {} + + ~Section() { + if( m_sectionIncluded ) + getCurrentContext().getResultCapture().sectionEnded( m_name, m_assertions ); + } + + // This indicates whether the section should be executed or not + operator bool() { + return m_sectionIncluded; + } + + private: + + std::string m_name; + Counts m_assertions; + bool m_sectionIncluded; + }; + +} // end namespace Catch + +#define INTERNAL_CATCH_SECTION( name, desc ) \ + if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( name, desc, CATCH_INTERNAL_LINEINFO ) ) + +// #included from: internal/catch_generators.hpp +#define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED + +#include +#include +#include +#include + +namespace Catch { + +template +struct IGenerator { + virtual ~IGenerator() {} + virtual T getValue( std::size_t index ) const = 0; + virtual std::size_t size () const = 0; +}; + +template +class BetweenGenerator : public IGenerator { +public: + BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){} + + virtual T getValue( std::size_t index ) const { + return m_from+static_cast( index ); + } + + virtual std::size_t size() const { + return static_cast( 1+m_to-m_from ); + } + +private: + + T m_from; + T m_to; +}; + +template +class ValuesGenerator : public IGenerator { +public: + ValuesGenerator(){} + + void add( T value ) { + m_values.push_back( value ); + } + + virtual T getValue( std::size_t index ) const { + return m_values[index]; + } + + virtual std::size_t size() const { + return m_values.size(); + } + +private: + std::vector m_values; +}; + +template +class CompositeGenerator { +public: + CompositeGenerator() : m_totalSize( 0 ) {} + + // *** Move semantics, similar to auto_ptr *** + CompositeGenerator( CompositeGenerator& other ) + : m_fileInfo( other.m_fileInfo ), + m_totalSize( 0 ) + { + move( other ); + } + + CompositeGenerator& setFileInfo( const char* fileInfo ) { + m_fileInfo = fileInfo; + return *this; + } + + ~CompositeGenerator() { + deleteAll( m_composed ); + } + + operator T () const { + size_t overallIndex = getCurrentContext().getGeneratorIndex( m_fileInfo, m_totalSize ); + + typename std::vector*>::const_iterator it = m_composed.begin(); + typename std::vector*>::const_iterator itEnd = m_composed.end(); + for( size_t index = 0; it != itEnd; ++it ) + { + const IGenerator* generator = *it; + if( overallIndex >= index && overallIndex < index + generator->size() ) + { + return generator->getValue( overallIndex-index ); + } + index += generator->size(); + } + CATCH_INTERNAL_ERROR( "Indexed past end of generated range" ); + return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so + } + + void add( const IGenerator* generator ) { + m_totalSize += generator->size(); + m_composed.push_back( generator ); + } + + CompositeGenerator& then( CompositeGenerator& other ) { + move( other ); + return *this; + } + + CompositeGenerator& then( T value ) { + ValuesGenerator* valuesGen = new ValuesGenerator(); + valuesGen->add( value ); + add( valuesGen ); + return *this; + } + +private: + + void move( CompositeGenerator& other ) { + std::copy( other.m_composed.begin(), other.m_composed.end(), std::back_inserter( m_composed ) ); + m_totalSize += other.m_totalSize; + other.m_composed.clear(); + } + + std::vector*> m_composed; + std::string m_fileInfo; + size_t m_totalSize; +}; + +namespace Generators +{ + template + CompositeGenerator between( T from, T to ) { + CompositeGenerator generators; + generators.add( new BetweenGenerator( from, to ) ); + return generators; + } + + template + CompositeGenerator values( T val1, T val2 ) { + CompositeGenerator generators; + ValuesGenerator* valuesGen = new ValuesGenerator(); + valuesGen->add( val1 ); + valuesGen->add( val2 ); + generators.add( valuesGen ); + return generators; + } + + template + CompositeGenerator values( T val1, T val2, T val3 ){ + CompositeGenerator generators; + ValuesGenerator* valuesGen = new ValuesGenerator(); + valuesGen->add( val1 ); + valuesGen->add( val2 ); + valuesGen->add( val3 ); + generators.add( valuesGen ); + return generators; + } + + template + CompositeGenerator values( T val1, T val2, T val3, T val4 ) { + CompositeGenerator generators; + ValuesGenerator* valuesGen = new ValuesGenerator(); + valuesGen->add( val1 ); + valuesGen->add( val2 ); + valuesGen->add( val3 ); + valuesGen->add( val4 ); + generators.add( valuesGen ); + return generators; + } + +} // end namespace Generators + +using namespace Generators; + +} // end namespace Catch + +#define INTERNAL_CATCH_LINESTR2( line ) #line +#define INTERNAL_CATCH_LINESTR( line ) INTERNAL_CATCH_LINESTR2( line ) + +#define INTERNAL_CATCH_GENERATE( expr ) expr.setFileInfo( __FILE__ "(" INTERNAL_CATCH_LINESTR( __LINE__ ) ")" ) + +// #included from: internal/catch_interfaces_exception.h +#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED + +#include namespace Catch { @@ -3950,7 +3970,7 @@ namespace Catch { do { do { - m_currentResult.setLineInfo( m_runningTest->getTestCaseInfo().getLineInfo() ); + m_assertionInfo.lineInfo = m_runningTest->getTestCaseInfo().getLineInfo(); runCurrentTest( redirectedCout, redirectedCerr ); } while( m_runningTest->hasUntestedSections() && !aborting() ); @@ -3972,25 +3992,17 @@ namespace Catch { private: // IResultCapture - virtual ResultAction::Value acceptResult( bool result ) { - return acceptResult( result ? ResultWas::Ok : ResultWas::ExpressionFailed ); + virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) { + m_assertionInfo = assertionInfo; } - virtual ResultAction::Value acceptResult( ResultWas::OfType result ) { - m_currentResult.setResultType( result ); + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) { + m_assertionInfo = assertionInfo; + m_currentResult = assertionResult; return actOnCurrentResult(); } - virtual ResultAction::Value acceptExpression( const ResultInfoBuilder& resultInfo ) { - m_currentResult = resultInfo; - return actOnCurrentResult(); - } - - virtual void acceptMessage( const std::string& msg ) { - m_currentResult.setMessage( msg ); - } - - virtual void testEnded( const ResultInfo& result ) { + virtual void testEnded( const AssertionResult& result ) { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } @@ -4001,19 +4013,19 @@ namespace Catch { std::vector::const_iterator it = m_scopedInfos.begin(); std::vector::const_iterator itEnd = m_scopedInfos.end(); for(; it != itEnd; ++it ) - m_reporter->Result( (*it)->getInfo() ); + m_reporter->Result( (*it)->buildResult( m_assertionInfo ) ); } { - std::vector::const_iterator it = m_info.begin(); - std::vector::const_iterator itEnd = m_info.end(); + std::vector::const_iterator it = m_assertionResults.begin(); + std::vector::const_iterator itEnd = m_assertionResults.end(); for(; it != itEnd; ++it ) m_reporter->Result( *it ); } - m_info.clear(); + m_assertionResults.clear(); } if( result.getResultType() == ResultWas::Info ) - m_info.push_back( result ); + m_assertionResults.push_back( result ); else m_reporter->Result( result ); } @@ -4031,7 +4043,7 @@ namespace Catch { if( !m_runningTest->addSection( oss.str() ) ) return false; - m_currentResult.setLineInfo( lineInfo ); + m_assertionInfo.lineInfo = lineInfo; m_reporter->StartSection( name, description ); assertions = m_totals.assertions; @@ -4070,7 +4082,7 @@ namespace Catch { : ""; } - virtual const ResultInfo* getLastResult() const { + virtual const AssertionResult* getLastResult() const { return &m_lastResult; } @@ -4083,10 +4095,11 @@ namespace Catch { private: ResultAction::Value actOnCurrentResult() { - m_lastResult = m_currentResult.build(); + m_lastResult = m_currentResult.buildResult( m_assertionInfo ); testEnded( m_lastResult ); - m_currentResult = ResultInfoBuilder(); + m_currentResult = ExpressionResultBuilder(); + m_assertionInfo = AssertionInfo(); ResultAction::Value action = ResultAction::None; @@ -4125,26 +4138,29 @@ namespace Catch { // This just means the test was aborted due to failure } catch(...) { - acceptMessage( getRegistryHub().getExceptionTranslatorRegistry().translateActiveException() ); - acceptResult( ResultWas::ThrewException ); + m_currentResult + .setResultType( ResultWas::ThrewException ) + << translateActiveException(); + actOnCurrentResult(); } - m_info.clear(); + m_assertionResults.clear(); } private: IMutableContext& m_context; RunningTest* m_runningTest; - ResultInfoBuilder m_currentResult; - ResultInfo m_lastResult; + ExpressionResultBuilder m_currentResult; + AssertionResult m_lastResult; const Config& m_config; Totals m_totals; Ptr m_reporter; std::vector m_scopedInfos; - std::vector m_info; + std::vector m_assertionResults; IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; + AssertionInfo m_assertionInfo; }; } // end namespace Catch @@ -4677,6 +4693,9 @@ namespace Catch { getTheRegistryHub() = NULL; cleanUpContext(); } + std::string translateActiveException() { + return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException(); + } } // end namespace Catch @@ -4839,7 +4858,60 @@ namespace Catch { } // end namespace Catch -#ifdef CATCH_PLATFORM_WINDOWS +#if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) + +#include + +namespace Catch { + + // use POSIX/ ANSI console terminal codes + // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) + // https://github.com/philsquared/Catch/pull/131 + + TextColour::TextColour( Colours colour ) { + if( colour ) + set( colour ); + } + + TextColour::~TextColour() { + set( TextColour::None ); + } + + namespace { const char colourEscape = '\033'; } + + void TextColour::set( Colours colour ) { + if( isatty( fileno(stdout) ) ) { + switch( colour ) { + case TextColour::FileName: + std::cout << colourEscape << "[0m"; // white + break; + case TextColour::ResultError: + std::cout << colourEscape << "[1;31m"; // bold red + break; + case TextColour::ResultSuccess: + std::cout << colourEscape << "[1;32m"; // bold green + break; + case TextColour::Error: + std::cout << colourEscape << "[0;31m"; // red + break; + case TextColour::Success: + std::cout << colourEscape << "[0;32m"; // green + break; + case TextColour::OriginalExpression: + std::cout << colourEscape << "[0;36m"; // cyan + break; + case TextColour::ReconstructedExpression: + std::cout << colourEscape << "[0;33m"; // yellow + break; + case TextColour::None: + std::cout << colourEscape << "[0m"; // reset to white + } + } + } + +} // namespace Catch + +#elif defined ( CATCH_PLATFORM_WINDOWS ) #include @@ -4913,6 +4985,7 @@ namespace Catch { #else namespace Catch { + TextColour::TextColour( Colours ){} TextColour::~TextColour(){} void TextColour::set( Colours ){} @@ -4995,151 +5068,145 @@ namespace Catch { } // end namespace Catch -// #included from: catch_resultinfo.hpp -#define TWOBLUECUBES_CATCH_RESULTINFO_HPP_INCLUDED +// #included from: catch_assertionresult.hpp +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED namespace Catch { - ResultInfo::ResultInfo() {} + AssertionResult::AssertionResult() {} - ResultInfo::ResultInfo( const ResultData& data ) : m_data( data ) {} + AssertionResult::AssertionResult( const AssertionInfo& info, const AssertionResultData& data ) + : m_info( info ), + m_resultData( data ) + {} - ResultInfo::~ResultInfo() {} + AssertionResult::~AssertionResult() {} - bool ResultInfo::ok() const { - return isOk( m_data.resultType ); + bool AssertionResult::ok() const { + return isOk( m_resultData.resultType ); } - ResultWas::OfType ResultInfo::getResultType() const { - return m_data.resultType; + ResultWas::OfType AssertionResult::getResultType() const { + return m_resultData.resultType; } - bool ResultInfo::hasExpression() const { - return !m_data.capturedExpression.empty(); + bool AssertionResult::hasExpression() const { + return !m_info.capturedExpression.empty(); } - bool ResultInfo::hasMessage() const { - return !m_data.message.empty(); + bool AssertionResult::hasMessage() const { + return !m_resultData.message.empty(); } - std::string ResultInfo::getExpression() const { - return m_data.capturedExpression; + std::string AssertionResult::getExpression() const { + return m_info.capturedExpression; } - bool ResultInfo::hasExpandedExpression() const { + bool AssertionResult::hasExpandedExpression() const { return hasExpression() && getExpandedExpression() != getExpression(); } - std::string ResultInfo::getExpandedExpression() const { - return m_data.reconstructedExpression; + std::string AssertionResult::getExpandedExpression() const { + return m_resultData.reconstructedExpression; } - std::string ResultInfo::getMessage() const { - return m_data.message; + std::string AssertionResult::getMessage() const { + return m_resultData.message; + } + SourceLineInfo AssertionResult::getSourceInfo() const { + return m_info.lineInfo; } - std::string ResultInfo::getFilename() const { - return m_data.lineInfo.file; - } - - std::size_t ResultInfo::getLine() const { - return m_data.lineInfo.line; - } - - std::string ResultInfo::getTestMacroName() const { - return m_data.macroName; + std::string AssertionResult::getTestMacroName() const { + return m_info.macroName; } } // end namespace Catch -// #included from: catch_resultinfo_builder.hpp -#define TWOBLUECUBES_CATCH_RESULTINFO_BUILDER_HPP_INCLUDED +// #included from: catch_expressionresult_builder.hpp +#define TWOBLUECUBES_CATCH_EXPRESSIONRESULT_BUILDER_HPP_INCLUDED + +#include namespace Catch { - ResultInfoBuilder::ResultInfoBuilder() {} - - ResultInfoBuilder& ResultInfoBuilder::setResultType( ResultWas::OfType result ) { - // Flip bool results if isFalse is set - if( m_isFalse && result == ResultWas::Ok ) - m_data.resultType = ResultWas::ExpressionFailed; - else if( m_isFalse && result == ResultWas::ExpressionFailed ) - m_data.resultType = ResultWas::Ok; - else - m_data.resultType = result; - return *this; + ExpressionResultBuilder::ExpressionResultBuilder( ResultWas::OfType resultType ) { + m_data.resultType = resultType; } - ResultInfoBuilder& ResultInfoBuilder::setCapturedExpression( const std::string& capturedExpression ) { - m_data.capturedExpression = capturedExpression; - return *this; - } - ResultInfoBuilder& ResultInfoBuilder::setIsFalse( bool isFalse ) { - m_isFalse = isFalse; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setMessage( const std::string& message ) { - m_data.message = message; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setLineInfo( const SourceLineInfo& lineInfo ) { - m_data.lineInfo = lineInfo; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setMacroName( const std::string& macroName ) { - m_data.macroName = macroName; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setLhs( const std::string& lhs ) { - m_lhs = lhs; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setRhs( const std::string& rhs ) { - m_rhs = rhs; - return *this; - } - - ResultInfoBuilder& ResultInfoBuilder::setOp( const std::string& op ) { - m_op = op; - return *this; - } - - ResultInfo ResultInfoBuilder::build() const + ExpressionResultBuilder::ExpressionResultBuilder( const ExpressionResultBuilder& other ) + : m_data( other.m_data ), + m_exprComponents( other.m_exprComponents ) { - ResultData data = m_data; - data.reconstructedExpression = reconstructExpression(); - if( m_isFalse ) { - if( m_op == "" ) { - data.capturedExpression = "!" + data.capturedExpression; - data.reconstructedExpression = "!" + data.reconstructedExpression; - } - else { - data.capturedExpression = "!(" + data.capturedExpression + ")"; - data.reconstructedExpression = "!(" + data.reconstructedExpression + ")"; - } - } - return ResultInfo( data ); + m_stream << other.m_stream.str(); } + ExpressionResultBuilder& ExpressionResultBuilder::operator=(const ExpressionResultBuilder& other ) { + m_data = other.m_data; + m_exprComponents = other.m_exprComponents; + m_stream.str(""); + m_stream << other.m_stream.str(); + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::setResultType( ResultWas::OfType result ) { + m_data.resultType = result; + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::setResultType( bool result ) { + m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed; + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::negate( bool shouldNegate ) { + m_exprComponents.shouldNegate = shouldNegate; + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { + m_exprComponents.lhs = lhs; + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::setRhs( const std::string& rhs ) { + m_exprComponents.rhs = rhs; + return *this; + } + ExpressionResultBuilder& ExpressionResultBuilder::setOp( const std::string& op ) { + m_exprComponents.op = op; + return *this; + } + AssertionResult ExpressionResultBuilder::buildResult( const AssertionInfo& info ) const + { + assert( m_data.resultType != ResultWas::Unknown ); - std::string ResultInfoBuilder::reconstructExpression() const { - if( m_op == "" ) - return m_lhs.empty() ? m_data.capturedExpression : m_op + m_lhs; - else if( m_op == "matches" ) - return m_lhs + " " + m_rhs; - else if( m_op != "!" ) { - if( m_lhs.size() + m_rhs.size() < 30 ) - return m_lhs + " " + m_op + " " + m_rhs; - else if( m_lhs.size() < 70 && m_rhs.size() < 70 ) - return "\n\t" + m_lhs + "\n\t" + m_op + "\n\t" + m_rhs; + AssertionResultData data = m_data; + + // Flip bool results if shouldNegate is set + if( m_exprComponents.shouldNegate && data.resultType == ResultWas::Ok ) + data.resultType = ResultWas::ExpressionFailed; + else if( m_exprComponents.shouldNegate && data.resultType == ResultWas::ExpressionFailed ) + data.resultType = ResultWas::Ok; + + data.message = m_stream.str(); + data.reconstructedExpression = reconstructExpression( info ); + if( m_exprComponents.shouldNegate ) { + if( m_exprComponents.op == "" ) + data.reconstructedExpression = "!" + data.reconstructedExpression; else - return "\n" + m_lhs + "\n" + m_op + "\n" + m_rhs + "\n\n"; + data.reconstructedExpression = "!(" + data.reconstructedExpression + ")"; + } + return AssertionResult( info, data ); + } + std::string ExpressionResultBuilder::reconstructExpression( const AssertionInfo& info ) const { + if( m_exprComponents.op == "" ) + return m_exprComponents.lhs.empty() ? info.capturedExpression : m_exprComponents.op + m_exprComponents.lhs; + 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() < 30 ) + return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs; + else if( m_exprComponents.lhs.size() < 70 && m_exprComponents.rhs.size() < 70 ) + return "\n\t" + m_exprComponents.lhs + "\n\t" + m_exprComponents.op + "\n\t" + m_exprComponents.rhs; + else + return "\n" + m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs + "\n\n"; } else - return "{can't expand - use " + m_data.macroName + "_FALSE( " + m_data.capturedExpression.substr(1) + " ) instead of " + m_data.macroName + "( " + m_data.capturedExpression + " ) for better diagnostics}"; + return "{can't expand - use " + info.macroName + "_FALSE( " + info.capturedExpression.substr(1) + " ) instead of " + info.macroName + "( " + info.capturedExpression + " ) for better diagnostics}"; } } // end namespace Catch @@ -5422,21 +5489,21 @@ namespace Catch { m_sectionSpans.pop_back(); } - virtual void Result( const ResultInfo& resultInfo ) { - if( !m_config.includeSuccessfulResults && resultInfo.getResultType() == ResultWas::Ok ) + virtual void Result( const AssertionResult& assertionResult ) { + if( !m_config.includeSuccessfulResults && assertionResult.getResultType() == ResultWas::Ok ) return; startSpansLazily(); - if( !resultInfo.getFilename().empty() ) { + if( !assertionResult.getSourceInfo().empty() ) { TextColour colour( TextColour::FileName ); - m_config.stream << SourceLineInfo( resultInfo.getFilename(), resultInfo.getLine() ); + m_config.stream << assertionResult.getSourceInfo(); } - if( resultInfo.hasExpression() ) { + if( assertionResult.hasExpression() ) { TextColour colour( TextColour::OriginalExpression ); - m_config.stream << resultInfo.getExpression(); - if( resultInfo.ok() ) { + m_config.stream << assertionResult.getExpression(); + if( assertionResult.ok() ) { TextColour successColour( TextColour::Success ); m_config.stream << " succeeded"; } @@ -5445,45 +5512,51 @@ namespace Catch { m_config.stream << " failed"; } } - switch( resultInfo.getResultType() ) { + switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: - { - TextColour colour( TextColour::Error ); - if( resultInfo.hasExpression() ) - m_config.stream << " with unexpected"; - else - m_config.stream << "Unexpected"; - m_config.stream << " exception with message: '" << resultInfo.getMessage() << "'"; - } + { + TextColour colour( TextColour::Error ); + if( assertionResult.hasExpression() ) + m_config.stream << " with unexpected"; + else + m_config.stream << "Unexpected"; + m_config.stream << " exception with message: '" << assertionResult.getMessage() << "'"; + } break; case ResultWas::DidntThrowException: - { - TextColour colour( TextColour::Error ); - if( resultInfo.hasExpression() ) - m_config.stream << " because no exception was thrown where one was expected"; - else - m_config.stream << "No exception thrown where one was expected"; - } + { + TextColour colour( TextColour::Error ); + if( assertionResult.hasExpression() ) + m_config.stream << " because no exception was thrown where one was expected"; + else + m_config.stream << "No exception thrown where one was expected"; + } break; case ResultWas::Info: - streamVariableLengthText( "info", resultInfo.getMessage() ); + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "info", assertionResult.getMessage() ); + } break; case ResultWas::Warning: - m_config.stream << "warning:\n'" << resultInfo.getMessage() << "'"; + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "warning", assertionResult.getMessage() ); + } break; case ResultWas::ExplicitFailure: - { - TextColour colour( TextColour::Error ); - m_config.stream << "failed with message: '" << resultInfo.getMessage() << "'"; - } + { + TextColour colour( TextColour::Error ); + m_config.stream << "failed with message: '" << assertionResult.getMessage() << "'"; + } break; case ResultWas::Unknown: // These cases are here to prevent compiler warnings case ResultWas::Ok: case ResultWas::FailureBit: case ResultWas::ExpressionFailed: case ResultWas::Exception: - if( !resultInfo.hasExpression() ) { - if( resultInfo.ok() ) { + if( !assertionResult.hasExpression() ) { + if( assertionResult.ok() ) { TextColour colour( TextColour::Success ); m_config.stream << " succeeded"; } @@ -5495,14 +5568,15 @@ namespace Catch { break; } - if( resultInfo.hasExpandedExpression() ) { + if( assertionResult.hasExpandedExpression() ) { m_config.stream << " for: "; - if( resultInfo.getExpandedExpression().size() > 40 ) + if( assertionResult.getExpandedExpression().size() > 40 ) { m_config.stream << "\n"; - if( resultInfo.getExpandedExpression().size() < 70 ) - m_config.stream << "\t"; + if( assertionResult.getExpandedExpression().size() < 70 ) + m_config.stream << "\t"; + } TextColour colour( TextColour::ReconstructedExpression ); - m_config.stream << resultInfo.getExpandedExpression(); + m_config.stream << assertionResult.getExpandedExpression(); } m_config.stream << std::endl; } @@ -5572,7 +5646,7 @@ namespace Catch { void streamVariableLengthText( const std::string& prefix, const std::string& text ) { std::string trimmed = trim( text ); if( trimmed.find_first_of( "\r\n" ) == std::string::npos ) { - m_config.stream << "[" << prefix << ": " << trimmed << "]\n"; + m_config.stream << "[" << prefix << ": " << trimmed << "]"; } else { m_config.stream << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed @@ -5861,42 +5935,42 @@ namespace Catch { m_currentTestSuccess = true; } - virtual void Result( const Catch::ResultInfo& resultInfo ) { - if( !m_config.includeSuccessfulResults && resultInfo.getResultType() == ResultWas::Ok ) + virtual void Result( const Catch::AssertionResult& assertionResult ) { + if( !m_config.includeSuccessfulResults && assertionResult.getResultType() == ResultWas::Ok ) return; - if( resultInfo.hasExpression() ) { + if( assertionResult.hasExpression() ) { m_xml.startElement( "Expression" ) - .writeAttribute( "success", resultInfo.ok() ) - .writeAttribute( "filename", resultInfo.getFilename() ) - .writeAttribute( "line", resultInfo.getLine() ); + .writeAttribute( "success", assertionResult.ok() ) + .writeAttribute( "filename", assertionResult.getSourceInfo().file ) + .writeAttribute( "line", assertionResult.getSourceInfo().line ); m_xml.scopedElement( "Original" ) - .writeText( resultInfo.getExpression() ); + .writeText( assertionResult.getExpression() ); m_xml.scopedElement( "Expanded" ) - .writeText( resultInfo.getExpandedExpression() ); - m_currentTestSuccess &= resultInfo.ok(); + .writeText( assertionResult.getExpandedExpression() ); + m_currentTestSuccess &= assertionResult.ok(); } - switch( resultInfo.getResultType() ) { + switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: m_xml.scopedElement( "Exception" ) - .writeAttribute( "filename", resultInfo.getFilename() ) - .writeAttribute( "line", resultInfo.getLine() ) - .writeText( resultInfo.getMessage() ); + .writeAttribute( "filename", assertionResult.getSourceInfo().file ) + .writeAttribute( "line", assertionResult.getSourceInfo().line ) + .writeText( assertionResult.getMessage() ); m_currentTestSuccess = false; break; case ResultWas::Info: m_xml.scopedElement( "Info" ) - .writeText( resultInfo.getMessage() ); + .writeText( assertionResult.getMessage() ); break; case ResultWas::Warning: m_xml.scopedElement( "Warning" ) - .writeText( resultInfo.getMessage() ); + .writeText( assertionResult.getMessage() ); break; case ResultWas::ExplicitFailure: m_xml.scopedElement( "Failure" ) - .writeText( resultInfo.getMessage() ); + .writeText( assertionResult.getMessage() ); m_currentTestSuccess = false; break; case ResultWas::Unknown: @@ -5907,7 +5981,7 @@ namespace Catch { case ResultWas::DidntThrowException: break; } - if( resultInfo.hasExpression() ) + if( assertionResult.hasExpression() ) m_xml.endElement(); } @@ -6015,19 +6089,19 @@ namespace Catch { m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getName() ) ); } - virtual void Result( const Catch::ResultInfo& resultInfo ) { - if( resultInfo.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults ) { + virtual void Result( const Catch::AssertionResult& assertionResult ) { + if( assertionResult.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults ) { TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); TestStats stats; std::ostringstream oss; - if( !resultInfo.getMessage().empty() ) - oss << resultInfo.getMessage() << " at "; - oss << SourceLineInfo( resultInfo.getFilename(), resultInfo.getLine() ); + if( !assertionResult.getMessage().empty() ) + oss << assertionResult.getMessage() << " at "; + oss << assertionResult.getSourceInfo(); stats.m_content = oss.str(); - stats.m_message = resultInfo.getExpandedExpression(); - stats.m_resultType = resultInfo.getTestMacroName(); + stats.m_message = assertionResult.getExpandedExpression(); + stats.m_resultType = assertionResult.getTestMacroName(); - switch( resultInfo.getResultType() ) { + switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: stats.m_element = "error"; m_currentStats->m_errorsCount++; @@ -6252,9 +6326,9 @@ int main (int argc, char * const argv[]) { #define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, false, "CATCH_WARN" ) #define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, true, "CATCH_FAIL" ) #define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, false, "CATCH_SUCCEED" ) -#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg ) +#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg, "CATCH_SCOPED_INFO" ) #define CATCH_CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, false, "CATCH_CAPTURE" ) -#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg ) +#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "CATCH_SCOPED_CAPTURE" ) #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) @@ -6297,9 +6371,9 @@ int main (int argc, char * const argv[]) { #define WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, false, "WARN" ) #define FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, true, "FAIL" ) #define SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, false, "SUCCEED" ) -#define SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg ) +#define SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg, "SCOPED_INFO" ) #define CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, false, "CAPTURE" ) -#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg ) +#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "SCOPED_CAPTURE" ) #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) From e0a40e2ceda10b4149dac87938bc0d4edace17f1 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 1 Nov 2012 08:28:26 +0000 Subject: [PATCH 4/9] Regenerated single include following merge --- single_include/catch.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 822ebcff..67e0ca02 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-10-31 18:04:01.157950 + * Generated: 2012-11-01 08:27:51.720005 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -1369,6 +1369,8 @@ namespace Catch { m_remainder += c; } + TagExtracter& operator=(const TagExtracter&); + std::set& m_tags; std::string m_remainder; }; @@ -1472,6 +1474,8 @@ namespace Catch { m_exp.m_tagSets.push_back( m_currentTagSet ); } + TagExpressionParser& operator=(const TagExpressionParser&); + bool m_isNegated; TagSet m_currentTagSet; TagExpression& m_exp; @@ -4883,7 +4887,7 @@ namespace Catch { if( isatty( fileno(stdout) ) ) { switch( colour ) { case TextColour::FileName: - std::cout << colourEscape << "[0m"; // white + std::cout << colourEscape << "[0m"; // white/ normal break; case TextColour::ResultError: std::cout << colourEscape << "[1;31m"; // bold red @@ -4904,7 +4908,7 @@ namespace Catch { std::cout << colourEscape << "[0;33m"; // yellow break; case TextColour::None: - std::cout << colourEscape << "[0m"; // reset to white + std::cout << colourEscape << "[0m"; // reset } } } From 4f13f5b7d3c4e7e9c9453b5740ae7028810e4127 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 1 Nov 2012 08:42:22 +0000 Subject: [PATCH 5/9] Updated read me --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index dc25caf6..95f6eb2a 100644 --- a/README +++ b/README @@ -3,3 +3,5 @@ CATCH is an automated test framework for C, C++ and Objective-C. The latest stable version can be found as a single header in the Downloads section. For documentation see the wiki at: https://github.com/philsquared/Catch/wiki + +Maintainers: Please now work off the Integration branch and target any pull requests there. \ No newline at end of file From 42d1b4538696ecb4cb938a9e43b79084b23ff12e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 13 Nov 2012 21:59:50 +0000 Subject: [PATCH 6/9] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 70c5ef9eede41e7061ff1af45b5babe0d7cde4ba Author: Phil Nash Date: Tue Nov 13 21:46:01 2012 +0000 Regen single include commit 4ea535e5059a664cc393404b454f29e6dad0886e Author: Phil Nash Date: Tue Nov 13 09:56:30 2012 +0000 Tidied up result enums commit 7717c29072013fd45e36d1bc48527927fa94cbed Author: Phil Nash Date: Tue Nov 13 09:45:29 2012 +0000 Implemented CHECK_NOFAIL Previous commit missed some files commit d539da903032e5a6f2bf40d6d7d8e7874c860088 Author: Phil Nash Date: Tue Nov 13 09:44:52 2012 +0000 Implemented CHECK_NO_FAIL commit af1a321860a8b63fb57fcade75ba7f33cad7400c Author: Phil Nash Date: Sat Nov 10 18:46:39 2012 +0000 Regen single include commit f54ac5625e4702e1c032f7b5a7f4d9346c64f502 Author: Phil Nash Date: Sat Nov 10 18:44:12 2012 +0000 New (combined) baselines commit defca58566653fd088f615c2979d7e7a681bf107 Author: Phil Nash Date: Sat Nov 10 18:43:23 2012 +0000 negate() -> endExpression(), takes ResultDisposition commit b2ef99882590ccd3824ebca44cb9b4cfc42f4728 Author: Phil Nash Date: Sat Nov 10 10:35:09 2012 +0000 Changed shouldNegate boolean to use part of ResultDisposition enum commit 1af13dba97474c2a0b33f1ca1919c80ea4f95ca3 Author: Phil Nash Date: Sat Nov 10 10:20:08 2012 +0000 Changed StopOnFailure boolean to an enum commit a1dc7e312cffb0a2d241273adcae4a126d49ff15 Author: Phil Nash Date: Tue Nov 6 19:34:35 2012 +0000 Regen single include commit 20e59ce9d133b469798c4ce2a8d681c0d9b18975 Author: Phil Nash Date: Tue Nov 6 19:34:10 2012 +0000 Added tags docs commit b5b1b1e430c8c61dbd3162da0255a368ba9ad75f Author: Phil Nash Date: Tue Nov 6 19:13:25 2012 +0000 Some expression/ evaluation clean-up commit ec5956f47114ff8b597be85fd7654d29da93aea0 Author: Phil Nash Date: Tue Nov 6 07:52:28 2012 +0000 Fix for #134 The INTERNAL_CATCH_MSG macro, which is used by INFO, WARN and FAIL places its lines in a do…while block so it can be used after an if statement with no block commit 88b70828f24bbbeae636d663b14fd0117165108a Author: Phil Nash Date: Sun Nov 4 21:39:38 2012 +0000 Regen single include commit b323fc7e6c57caa535d65cae31e6018822ed9e3c Author: Phil Nash Date: Sun Nov 4 21:39:16 2012 +0000 Fixed line/no regression for SECTIONs Unexpected exceptions within a section now get the SECTION's line no. again (instead of TEST_CASE line/no) commit 78fba28c4b9f48ec25c9d234a29c36e4427ca6e0 Author: Phil Nash Date: Sun Nov 4 21:11:59 2012 +0000 Added className to TestCaseInfo className is passed through from class based test methods and held in the TestCaseInfo. For free-function based test cases it is set to "global". The JUnit reporter uses the className value to populate he class attribute. commit 81cb69ef1831ed29bf770254c9112b8f0465e912 Author: Phil Nash Date: Sun Nov 4 21:09:22 2012 +0000 AssertionInfo captures more info (for test cases and sections) commit a4e088c999439e9ec0fe3a4205b7520fbf258a5f Author: Phil Nash Date: Fri Nov 2 08:29:03 2012 +0000 Removed __FUNCTION__ from SourceLineInfo commit 2a1e8bfc6ed3bcc1e3746d717726a9e525de6369 Author: Phil Nash Date: Thu Nov 1 08:16:15 2012 +0000 Updated colour comments commit f0f407fc3ebdcbdad50fc1f9a45f15ab3cc54c63 Author: Phil Nash Date: Wed Oct 31 18:28:21 2012 +0000 Manually applied merge #133 from Master commit 355b95fda1de28ba830541768aad32c7b1790290 Author: Phil Nash Date: Wed Oct 31 18:04:22 2012 +0000 Cleaned up ANSI colour code impl a bit commit 778f9c4fc7fa66566679d9f1d8a721079d8589bf Author: Phil Nash Date: Tue Oct 30 09:09:30 2012 +0000 Removed "no-" from Wno-global-constructors when disabling commit 5efa4bcb8a620efa13e8eb5e68d0899681919ca1 Author: Phil Nash Date: Mon Oct 29 20:49:22 2012 +0000 Regenerated single_include commit 108f1937d8cbe04038ab8d2aaf9f6e958fe8168c Author: Phil Nash Date: Mon Oct 29 20:46:45 2012 +0000 Added terminal colour codes for POSIX With thanks to Adam Strzelecki commit 8f4cc541d55cf55b2a67b5d6b77b5c4ceb4d99ee Author: Phil Nash Date: Mon Oct 29 19:55:34 2012 +0000 Added regression test baselines commit 2e203a183474672e386f4cf840847cf29ccf90b9 Author: Phil Nash Date: Mon Oct 29 19:55:13 2012 +0000 Fixed remaining reporting regressions commit 134e45b3ade922e5cbdb2df6b81830fbd93fe448 Author: Phil Nash Date: Sun Oct 28 20:57:21 2012 +0000 Fixed #132 commit 2f92db9898978ca1ee27c964d8a51fa507391935 Author: Phil Nash Date: Sun Oct 28 12:15:34 2012 +0000 Updated the readme specifically for the Integration branch commit 82acc2ca05459ce353de71469f141ba93e9b63cf Author: Phil Nash Date: Sun Oct 28 12:07:17 2012 +0000 Regenerated single include commit fe1d7c1d08f06c0a83b727e9b2e00cc49e74175d Author: Phil Nash Date: Sun Oct 28 10:27:44 2012 +0000 Small fixes and tweaks commit 355b5e546d2f64dd0abbc0134dd3579ce6c28cea Author: Phil Nash Date: Fri Oct 26 09:05:36 2012 +0100 Some tidy-up commit f847186ebbf0e7eeabd99925574c8988add600fb Author: Phil Nash Date: Fri Oct 26 08:45:23 2012 +0100 AssertionResultBuilder -> ExpressionResultBuilder commit 8cca2f13699aa6aa5cd4a60e293f49a1bae54629 Author: Phil Nash Date: Wed Oct 24 22:09:01 2012 +0100 ExpressionBuilder ->ExpressionDecomposer Expression -> ExpressionLhs commit e04e74f896c714de1f03a9cc006bcd071318ea11 Author: Phil Nash Date: Wed Oct 24 21:59:47 2012 +0100 More AssertionResult refactoring commit 1dd56d4d2b29520cdd62f5f449a28e67f954f5db Author: Phil Nash Date: Fri Oct 19 08:01:34 2012 +0100 AssertionResultBuilder can be constructed from result type commit f2d5f1b3e444055ff02ed0536d5d0610b08ecb9f Author: Phil Nash Date: Fri Oct 19 08:01:05 2012 +0100 Expression has its own result builder - not passed in from expression builder commit e3b111a39a4edd3bfe4d88290c99c723b8b74417 Author: Phil Nash Date: Thu Oct 18 22:59:16 2012 +0100 streamlined acceptResult commit 3ad13256e1e50a6ee4a2697e7b6d0f669ae82ab5 Author: Phil Nash Date: Thu Oct 18 08:39:44 2012 +0100 Refactored assertion builder stuff out of expression builder commit c96f9330a095f527673de4d8db4f434d38a7e813 Author: Phil Nash Date: Wed Oct 17 08:14:22 2012 +0100 Collect assertion info up front commit a5fa78284d6d95770cd647a2ec10df09d378ba46 Author: Phil Nash Date: Tue Oct 16 08:33:13 2012 +0100 ResultData -> AssertionResultData commit c597a893fa95462b8d2d5029547d4054eda1839f Author: Phil Nash Date: Tue Oct 16 08:31:05 2012 +0100 ResultInfo -> AssertionResult filenames and variables commit d16955f63a4a128221da41602215b5592df39eb9 Author: Phil Nash Date: Tue Oct 16 08:27:21 2012 +0100 Renamed ResultInfo -> AssertionResult commit 175da3ef6454b6fa0465d22c96d21d58dd9d2f90 Author: Phil Nash Date: Fri Oct 12 18:39:22 2012 +0100 regen test 3 --- include/catch.hpp | 82 ++- include/internal/catch_assertionresult.h | 16 +- include/internal/catch_assertionresult.hpp | 24 +- include/internal/catch_capture.hpp | 80 +-- include/internal/catch_commandline.hpp | 9 +- include/internal/catch_common.h | 13 +- include/internal/catch_evaluate.hpp | 43 +- include/internal/catch_expression_lhs.hpp | 6 +- .../internal/catch_expressionresult_builder.h | 2 +- .../catch_expressionresult_builder.hpp | 4 +- include/internal/catch_interfaces_capture.h | 1 - .../catch_notimplemented_exception.hpp | 2 - include/internal/catch_result_type.h | 75 +- include/internal/catch_runner_impl.hpp | 40 +- include/internal/catch_tags.hpp | 4 +- include/internal/catch_test_case_info.h | 8 +- include/internal/catch_test_case_info.hpp | 21 +- .../catch_test_case_registry_impl.hpp | 25 +- include/internal/catch_test_registry.hpp | 14 +- include/reporters/catch_reporter_basic.hpp | 12 +- include/reporters/catch_reporter_junit.hpp | 7 +- include/reporters/catch_reporter_xml.hpp | 4 +- projects/SelfTest/Baselines/results.txt | 646 ++++++++++++++++++ projects/SelfTest/ClassTests.cpp | 8 +- projects/SelfTest/ExceptionTests.cpp | 2 +- projects/SelfTest/MessageTests.cpp | 8 +- projects/SelfTest/TestMain.cpp | 14 +- projects/SelfTest/catch_self_test.cpp | 2 + .../CatchSelfTest.xcodeproj/project.pbxproj | 6 +- 29 files changed, 937 insertions(+), 241 deletions(-) create mode 100644 projects/SelfTest/Baselines/results.txt diff --git a/include/catch.hpp b/include/catch.hpp index 219b6172..54acd738 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -48,31 +48,32 @@ // If this config identifier is defined then all CATCH macros are prefixed with CATCH_ #ifdef CATCH_CONFIG_PREFIX_ALL -#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, false, true, "CATCH_REQUIRE" ) -#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, true, "CATCH_REQUIRE_FALSE" ) +#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) +#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::NegateResult, "CATCH_REQUIRE_FALSE" ) -#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., true, "CATCH_REQUIRE_THROWS" ) -#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, true, "CATCH_REQUIRE_THROWS_AS" ) -#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, true, "CATCH_REQUIRE_NOTHROW" ) +#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" ) +#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" ) +#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" ) -#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, false, false, "CATCH_CHECK" ) -#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, false, "CATCH_CHECK_FALSE" ) -#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, false, false, "CATCH_CHECKED_IF" ) -#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, false, false, "CATCH_CHECKED_ELSE" ) +#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) +#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::NegateResult, "CATCH_CHECK_FALSE" ) +#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) +#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) +#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" ) -#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., false, "CATCH_CHECK_THROWS" ) -#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, false, "CATCH_CHECK_THROWS_AS" ) -#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, false, "CATCH_CHECK_NOTHROW" ) +#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" ) +#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" ) +#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" ) -#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, false, "CATCH_CHECK_THAT" ) -#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, true, "CATCH_REQUIRE_THAT" ) +#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" ) +#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" ) -#define CATCH_INFO( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Info, false, "CATCH_INFO" ) -#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, false, "CATCH_WARN" ) -#define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, true, "CATCH_FAIL" ) -#define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, false, "CATCH_SUCCEED" ) +#define CATCH_INFO( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "CATCH_INFO" ) +#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "CATCH_WARN" ) +#define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL" ) +#define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED" ) #define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg, "CATCH_SCOPED_INFO" ) -#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, false, "CATCH_CAPTURE" ) +#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CAPTURE" ) #define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "CATCH_SCOPED_CAPTURE" ) #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) @@ -86,38 +87,35 @@ #define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) -/////////////// -// Still to be implemented -//#define CHECK_NOFAIL( expr ) // !TBD - reports violation, but doesn't fail Test - // If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required #else -#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, false, true, "REQUIRE" ) -#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, true, "REQUIRE_FALSE" ) +#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" ) +#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::NegateResult, "REQUIRE_FALSE" ) -#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., true, "REQUIRE_THROWS" ) -#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, true, "REQUIRE_THROWS_AS" ) -#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, true, "REQUIRE_NOTHROW" ) +#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) +#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" ) +#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) -#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, false, false, "CHECK" ) -#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, false, "CHECK_FALSE" ) -#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, false, false, "CHECKED_IF" ) -#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, false, false, "CHECKED_ELSE" ) +#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) +#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::NegateResult, "CHECK_FALSE" ) +#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) +#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) +#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) -#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., false, "CHECK_THROWS" ) -#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, false, "CHECK_THROWS_AS" ) -#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, false, "CHECK_NOTHROW" ) +#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) +#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" ) +#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) -#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, false, "CHECK_THAT" ) -#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, true, "REQUIRE_THAT" ) +#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" ) +#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" ) -#define INFO( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Info, false, "INFO" ) -#define WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, false, "WARN" ) -#define FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, true, "FAIL" ) -#define SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, false, "SUCCEED" ) +#define INFO( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "INFO" ) +#define WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "WARN" ) +#define FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL" ) +#define SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED" ) #define SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg, "SCOPED_INFO" ) -#define CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, false, "CAPTURE" ) +#define CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "CAPTURE" ) #define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "SCOPED_CAPTURE" ) #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) diff --git a/include/internal/catch_assertionresult.h b/include/internal/catch_assertionresult.h index b3baff2e..37372b67 100644 --- a/include/internal/catch_assertionresult.h +++ b/include/internal/catch_assertionresult.h @@ -16,18 +16,15 @@ namespace Catch { struct AssertionInfo { AssertionInfo() {} - AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression, bool _shouldNegate ) - : macroName( _macroName ), - lineInfo( _lineInfo ), - capturedExpression( _capturedExpression ) - { - if( _shouldNegate ) - capturedExpression = "!" + _capturedExpression; - } + AssertionInfo( const std::string& _macroName, + const SourceLineInfo& _lineInfo, + const std::string& _capturedExpression, + ResultDisposition::Flags _resultDisposition ); std::string macroName; SourceLineInfo lineInfo; std::string capturedExpression; + ResultDisposition::Flags resultDisposition; }; struct AssertionResultData @@ -45,7 +42,8 @@ namespace Catch { AssertionResult( const AssertionInfo& info, const AssertionResultData& data ); ~AssertionResult(); - bool ok() const; + bool isOk() const; + bool succeeded() const; ResultWas::OfType getResultType() const; bool hasExpression() const; bool hasMessage() const; diff --git a/include/internal/catch_assertionresult.hpp b/include/internal/catch_assertionresult.hpp index f1ef9d18..91853307 100644 --- a/include/internal/catch_assertionresult.hpp +++ b/include/internal/catch_assertionresult.hpp @@ -12,6 +12,20 @@ namespace Catch { + + AssertionInfo::AssertionInfo( const std::string& _macroName, + const SourceLineInfo& _lineInfo, + const std::string& _capturedExpression, + ResultDisposition::Flags _resultDisposition ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + capturedExpression( _capturedExpression ), + resultDisposition( _resultDisposition ) + { + if( shouldNegate( resultDisposition ) ) + capturedExpression = "!" + _capturedExpression; + } + AssertionResult::AssertionResult() {} AssertionResult::AssertionResult( const AssertionInfo& info, const AssertionResultData& data ) @@ -21,8 +35,14 @@ namespace Catch { AssertionResult::~AssertionResult() {} - bool AssertionResult::ok() const { - return isOk( m_resultData.resultType ); + // Result was a success + bool AssertionResult::succeeded() const { + return Catch::isOk( m_resultData.resultType ); + } + + // Result was a success, or failure is suppressed + bool AssertionResult::isOk() const { + return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition ); } ResultWas::OfType AssertionResult::getResultType() const { diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 484383c5..e2919848 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -74,7 +74,7 @@ public: private: ExpressionResultBuilder m_resultBuilder; }; - + // This is just here to avoid compiler warnings with macro constants and boolean literals inline bool isTrue( bool value ){ return value; } @@ -84,109 +84,113 @@ inline bool isTrue( bool value ){ return value; } #define INTERNAL_CATCH_ASSERTIONINFO_NAME INTERNAL_CATCH_UNIQUE_NAME( __assertionInfo ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ACCEPT_EXPR( evaluatedExpr, stopOnFailure, originalExpr ) \ +#define INTERNAL_CATCH_ACCEPT_EXPR( evaluatedExpr, resultDisposition, originalExpr ) \ if( Catch::ResultAction::Value internal_catch_action = Catch::getResultCapture().acceptExpression( evaluatedExpr, INTERNAL_CATCH_ASSERTIONINFO_NAME ) ) { \ if( internal_catch_action & Catch::ResultAction::Debug ) BreakIntoDebugger(); \ if( internal_catch_action & Catch::ResultAction::Abort ) throw Catch::TestFailureException(); \ - if( Catch::isTrue( stopOnFailure ) ) throw Catch::TestFailureException(); \ + if( !Catch::shouldContinueOnFailure( resultDisposition ) ) throw Catch::TestFailureException(); \ if( Catch::isTrue( false ) ){ bool this_is_here_to_invoke_warnings = ( originalExpr ); Catch::isTrue( this_is_here_to_invoke_warnings ); } \ } /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, shouldNegate ) \ - Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, shouldNegate ); -// !TBD Catch::getResultCapture().acceptAssertionInfo( INTERNAL_CATCH_ASSERTIONINFO_NAME ) +#define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, resultDisposition ) \ + Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, resultDisposition ); /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \ try { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).negate( shouldNegate ), stopOnFailure, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).endExpression( resultDisposition ), resultDisposition, expr ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), false, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), \ + resultDisposition | Catch::ResultDisposition::ContinueOnFailure, expr ); \ throw; \ } \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_IF( expr, shouldNegate, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ); \ - if( Catch::getResultCapture().getLastResult()->ok() ) +#define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \ + INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ + if( Catch::getResultCapture().getLastResult()->succeeded() ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ELSE( expr, shouldNegate, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ); \ - if( !Catch::getResultCapture().getLastResult()->ok() ) +#define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \ + INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ + if( !Catch::getResultCapture().getLastResult()->succeeded() ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_NO_THROW( expr, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \ try { \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \ } \ catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), resultDisposition, false ); \ } \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ +#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \ try { \ if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), resultDisposition, false ); \ } \ } \ catch( Catch::TestFailureException& ) { \ throw; \ } \ catch( exceptionType ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \ } /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_THROWS( expr, exceptionType, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ - INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \ + INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ - INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \ + INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \ catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), \ + resultDisposition | Catch::ResultDisposition::ContinueOnFailure, false ); \ } \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ - INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ); +#define INTERNAL_CATCH_MSG( reason, resultType, resultDisposition, macroName ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, resultDisposition, true ) \ + } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \ - INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, Catch::ResultDisposition::Normal ); \ Catch::ScopedInfo INTERNAL_CATCH_UNIQUE_NAME( info ); \ INTERNAL_CATCH_UNIQUE_NAME( info ) << log /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CHECK_THAT( arg, matcher, stopOnFailure, macroName ) \ +#define INTERNAL_CHECK_THAT( arg, matcher, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, false ); \ + INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, resultDisposition ); \ try { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::expressionResultBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::expressionResultBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), resultDisposition, false ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), false, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), \ + resultDisposition | Catch::ResultDisposition::ContinueOnFailure, false ); \ throw; \ } \ } while( Catch::isTrue( false ) ) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index f03ae3c8..4df98531 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -282,7 +282,14 @@ namespace Catch { // subsequently wrapped lines virtual std::string optionDescription() const { return - "!TBD"; + "This option allows one or more tags or tag patterns to be specified.\n" + "Each tag is enclosed in square brackets. A series of tags form an AND expression " + "wheras a comma seperated sequence forms an OR expression. e.g.:\n\n" + " -g [one][two],[three]\n\n" + "This matches all tests tagged [one] and [two], as well as all tests tagged [three].\n\n" + "Tags can be negated with the ~ character. This removes matching tests from the set. e.g.:\n\n" + " -g [one]~[two]\n\n" + "matches all tests tagged [one], except those also tagged [two]"; } virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index cac5d112..41573556 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -94,7 +94,7 @@ namespace Catch { friend std::ostream& operator << ( std::ostream& os, const pluralise& pluraliser ) { os << pluraliser.m_count << " " << pluraliser.m_label; if( pluraliser.m_count != 1 ) - os << "s"; + os << "s"; return os; } @@ -109,24 +109,17 @@ namespace Catch { : file( _file ), line( _line ) {} - SourceLineInfo( const std::string& _function, const std::string& _file, std::size_t _line ) - : function( _function ), - file( _file ), - line( _line ) - {} SourceLineInfo( const SourceLineInfo& other ) : file( other.file ), line( other.line ) {} - void swap( SourceLineInfo& other ){ - file.swap( other.file ); - std::swap( line, other.line ); + bool empty() const { + return file.empty(); } bool empty() const { return file.empty(); } - std::string function; std::string file; std::size_t line; }; diff --git a/include/internal/catch_evaluate.hpp b/include/internal/catch_evaluate.hpp index 85f12de7..7e9d57d0 100644 --- a/include/internal/catch_evaluate.hpp +++ b/include/internal/catch_evaluate.hpp @@ -69,18 +69,21 @@ namespace Internal { return const_cast( lhs ) <= const_cast( rhs ); } }; - + template bool applyEvaluator( const T1& lhs, const T2& rhs ) { return Evaluator::evaluate( lhs, rhs ); } - + + // This level of indirection allows us to specialise for integer types + // to avoid signed/ unsigned warnings + // "base" overload template bool compare( const T1& lhs, const T2& rhs ) { return Evaluator::evaluate( lhs, rhs ); } - + // unsigned X to int template bool compare( unsigned int lhs, int rhs ) { return applyEvaluator( lhs, static_cast( rhs ) ); @@ -126,44 +129,18 @@ namespace Internal { } // pointer to long (when comparing against NULL) - template - bool compare( long lhs, const T* rhs ) { - return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); - } - - template - bool compare( long lhs, T* rhs ) { + template bool compare( long lhs, T* rhs ) { return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); } - - template - bool compare( const T* lhs, long rhs ) { - return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); - } - - template - bool compare( T* lhs, long rhs ) { + template bool compare( T* lhs, long rhs ) { return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); } // pointer to int (when comparing against NULL) - template - bool compare( int lhs, const T* rhs ) { - return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); - } - - template - bool compare( int lhs, T* rhs ) { + template bool compare( int lhs, T* rhs ) { return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); } - - template - bool compare( const T* lhs, int rhs ) { - return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); - } - - template - bool compare( T* lhs, int rhs ) { + template bool compare( T* lhs, int rhs ) { return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); } diff --git a/include/internal/catch_expression_lhs.hpp b/include/internal/catch_expression_lhs.hpp index 572c8c37..7ee8b2ef 100644 --- a/include/internal/catch_expression_lhs.hpp +++ b/include/internal/catch_expression_lhs.hpp @@ -22,7 +22,7 @@ class ExpressionLhs { void operator = ( const ExpressionLhs& ); public: - ExpressionLhs( T lhs ) : m_lhs( lhs ) {} + ExpressionLhs( const T& lhs ) : m_lhs( lhs ) {} template ExpressionResultBuilder& operator == ( const RhsT& rhs ) { @@ -62,12 +62,12 @@ public: return captureExpression( rhs ); } - ExpressionResultBuilder& negate( bool shouldNegate ) { + ExpressionResultBuilder& endExpression( ResultDisposition::Flags resultDisposition ) { bool value = m_lhs ? true : false; return m_result .setLhs( Catch::toString( value ) ) .setResultType( value ) - .negate( shouldNegate ); + .endExpression( resultDisposition ); } // Only simple binary expressions are allowed on the LHS. diff --git a/include/internal/catch_expressionresult_builder.h b/include/internal/catch_expressionresult_builder.h index 23b84646..eb9109f9 100644 --- a/include/internal/catch_expressionresult_builder.h +++ b/include/internal/catch_expressionresult_builder.h @@ -31,7 +31,7 @@ public: ExpressionResultBuilder& setRhs( const std::string& rhs ); ExpressionResultBuilder& setOp( const std::string& op ); - ExpressionResultBuilder& negate( bool shouldNegate ); + ExpressionResultBuilder& endExpression( ResultDisposition::Flags resultDisposition ); template ExpressionResultBuilder& operator << ( const T& value ) { diff --git a/include/internal/catch_expressionresult_builder.hpp b/include/internal/catch_expressionresult_builder.hpp index 0c0a28a8..f0a8cccc 100644 --- a/include/internal/catch_expressionresult_builder.hpp +++ b/include/internal/catch_expressionresult_builder.hpp @@ -38,8 +38,8 @@ namespace Catch { m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed; return *this; } - ExpressionResultBuilder& ExpressionResultBuilder::negate( bool shouldNegate ) { - m_exprComponents.shouldNegate = shouldNegate; + ExpressionResultBuilder& ExpressionResultBuilder::endExpression( ResultDisposition::Flags resultDisposition ) { + m_exprComponents.shouldNegate = shouldNegate( resultDisposition ); return *this; } ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index a3e08226..3cbbb88e 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -35,7 +35,6 @@ namespace Catch { virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; virtual bool shouldDebugBreak() const = 0; - virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0; virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; diff --git a/include/internal/catch_notimplemented_exception.hpp b/include/internal/catch_notimplemented_exception.hpp index b301fb1b..f051ed3d 100644 --- a/include/internal/catch_notimplemented_exception.hpp +++ b/include/internal/catch_notimplemented_exception.hpp @@ -17,8 +17,6 @@ namespace Catch { : m_lineInfo( lineInfo ) { std::ostringstream oss; oss << lineInfo << "function "; - if( !lineInfo.function.empty() ) - oss << lineInfo.function << " "; oss << "not implemented"; m_what = oss.str(); } diff --git a/include/internal/catch_result_type.h b/include/internal/catch_result_type.h index e151f070..9fd23861 100644 --- a/include/internal/catch_result_type.h +++ b/include/internal/catch_result_type.h @@ -10,35 +10,54 @@ namespace Catch { -struct ResultWas { enum OfType { - Unknown = -1, - Ok = 0, - Info = 1, - Warning = 2, - - FailureBit = 0x10, - - ExpressionFailed = FailureBit | 1, - ExplicitFailure = FailureBit | 2, - - Exception = 0x100 | FailureBit, - - ThrewException = Exception | 1, - DidntThrowException = Exception | 2 - -}; }; + // ResultWas::OfType enum + struct ResultWas { enum OfType { + Unknown = -1, + Ok = 0, + Info = 1, + Warning = 2, + + FailureBit = 0x10, + + ExpressionFailed = FailureBit | 1, + ExplicitFailure = FailureBit | 2, + + Exception = 0x100 | FailureBit, + + ThrewException = Exception | 1, + DidntThrowException = Exception | 2 + + }; }; -inline bool isOk( ResultWas::OfType resultType ) { - return ( resultType & ResultWas::FailureBit ) == 0; -} + inline bool isOk( ResultWas::OfType resultType ) { + return ( resultType & ResultWas::FailureBit ) == 0; + } -struct ResultAction { enum Value { - None, - Failed = 1, // Failure - but no debug break if Debug bit not set - Debug = 2, // If this bit is set, invoke the debugger - Abort = 4 // Test run should abort -}; }; - -} + // ResultAction::Value enum + struct ResultAction { enum Value { + None, + Failed = 1, // Failure - but no debug break if Debug bit not set + Debug = 2, // If this bit is set, invoke the debugger + Abort = 4 // Test run should abort + }; }; + + // ResultDisposition::Flags enum + struct ResultDisposition { enum Flags { + Normal = 0x00, + + ContinueOnFailure = 0x01, // Failures fail test, but execution continues + NegateResult = 0x02, // Prefix expressiom with ! + SuppressFail = 0x04 // Failures are reported but do not fail the test + }; }; + + inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { + return static_cast( static_cast( lhs ) | static_cast( rhs ) ); + } + + inline bool shouldContinueOnFailure( int flags ) { return flags & ResultDisposition::ContinueOnFailure; } + inline bool shouldNegate( int flags ) { return flags & ResultDisposition::NegateResult; } + inline bool shouldSuppressFailure( int flags ) { return flags & ResultDisposition::SuppressFail; } + +} // end namespace Catch #endif // TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 1100b23b..f72d5768 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -46,7 +46,7 @@ namespace Catch { std::ostringstream m_oss; std::string& m_targetString; }; - + /////////////////////////////////////////////////////////////////////////// class Runner : public IResultCapture, public IRunner { @@ -109,7 +109,6 @@ namespace Catch { do { do { - m_assertionInfo.lineInfo = m_runningTest->getTestCaseInfo().getLineInfo(); runCurrentTest( redirectedCout, redirectedCerr ); } while( m_runningTest->hasUntestedSections() && !aborting() ); @@ -131,28 +130,23 @@ namespace Catch { private: // IResultCapture - virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) { - m_assertionInfo = assertionInfo; - } - virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) { - m_assertionInfo = assertionInfo; - m_currentResult = assertionResult; - return actOnCurrentResult(); + m_lastAssertionInfo = assertionInfo; + return actOnCurrentResult( assertionResult.buildResult( assertionInfo ) ); } virtual void testEnded( const AssertionResult& result ) { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } - else if( !result.ok() ) { + else if( !result.isOk() ) { m_totals.assertions.failed++; { std::vector::const_iterator it = m_scopedInfos.begin(); std::vector::const_iterator itEnd = m_scopedInfos.end(); for(; it != itEnd; ++it ) - m_reporter->Result( (*it)->buildResult( m_assertionInfo ) ); + m_reporter->Result( (*it)->buildResult( m_lastAssertionInfo ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); @@ -179,10 +173,12 @@ namespace Catch { std::ostringstream oss; oss << name << "@" << lineInfo; + if( !m_runningTest->addSection( oss.str() ) ) return false; - m_assertionInfo.lineInfo = lineInfo; + m_lastAssertionInfo.lineInfo = lineInfo; + m_reporter->StartSection( name, description ); assertions = m_totals.assertions; @@ -233,16 +229,13 @@ namespace Catch { private: - ResultAction::Value actOnCurrentResult() { - m_lastResult = m_currentResult.buildResult( m_assertionInfo ); + ResultAction::Value actOnCurrentResult( const AssertionResult& result ) { + m_lastResult = result; testEnded( m_lastResult ); - m_currentResult = ExpressionResultBuilder(); - m_assertionInfo = AssertionInfo(); - ResultAction::Value action = ResultAction::None; - if( !m_lastResult.ok() ) { + if( !m_lastResult.isOk() ) { action = ResultAction::Failed; if( shouldDebugBreak() ) action = (ResultAction::Value)( action | ResultAction::Debug ); @@ -254,6 +247,7 @@ namespace Catch { void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { try { + m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo(), "", ResultDisposition::Normal ); m_runningTest->reset(); Counts prevAssertions = m_totals.assertions; if( m_reporter->shouldRedirectStdout() ) { @@ -277,10 +271,9 @@ namespace Catch { // This just means the test was aborted due to failure } catch(...) { - m_currentResult - .setResultType( ResultWas::ThrewException ) - << translateActiveException(); - actOnCurrentResult(); + ExpressionResultBuilder exResult( ResultWas::ThrewException ); + exResult << translateActiveException(); + actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) ); } m_assertionResults.clear(); } @@ -288,7 +281,6 @@ namespace Catch { private: IMutableContext& m_context; RunningTest* m_runningTest; - ExpressionResultBuilder m_currentResult; AssertionResult m_lastResult; const Config& m_config; @@ -299,7 +291,7 @@ namespace Catch { IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; - AssertionInfo m_assertionInfo; + AssertionInfo m_lastAssertionInfo; }; } // end namespace Catch diff --git a/include/internal/catch_tags.hpp b/include/internal/catch_tags.hpp index 591ab5ad..510bff3c 100644 --- a/include/internal/catch_tags.hpp +++ b/include/internal/catch_tags.hpp @@ -83,12 +83,12 @@ namespace Catch { class Tag { public: Tag() - : m_isNegated( false ) + : m_isNegated( false ) {} Tag( const std::string& name, bool isNegated ) : m_name( name ), - m_isNegated( isNegated ) + m_isNegated( isNegated ) {} std::string getName() const { diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h index eee460a7..1fce27fb 100644 --- a/include/internal/catch_test_case_info.h +++ b/include/internal/catch_test_case_info.h @@ -22,8 +22,9 @@ namespace Catch { TestCaseInfo(); TestCaseInfo( ITestCase* testCase, - const char* name, - const char* description, + const std::string& className, + const std::string& name, + const std::string& description, const SourceLineInfo& lineInfo ); @@ -31,6 +32,8 @@ namespace Catch { TestCaseInfo( const TestCaseInfo& other ); void invoke() const; + + const std::string& getClassName() const; const std::string& getName() const; const std::string& getDescription() const; const SourceLineInfo& getLineInfo() const; @@ -46,6 +49,7 @@ namespace Catch { private: Ptr m_test; + std::string m_className; std::string m_name; std::string m_description; std::set m_tags; diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index 38adac91..bb50759a 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -16,10 +16,12 @@ namespace Catch { TestCaseInfo::TestCaseInfo( ITestCase* testCase, - const char* name, - const char* description, + const std::string& className, + const std::string& name, + const std::string& description, const SourceLineInfo& lineInfo ) : m_test( testCase ), + m_className( className ), m_name( name ), m_description( description ), m_lineInfo( lineInfo ), @@ -32,6 +34,7 @@ namespace Catch { TestCaseInfo::TestCaseInfo() : m_test( NULL ), + m_className(), m_name(), m_description(), m_isHidden( false ) @@ -39,6 +42,7 @@ namespace Catch { TestCaseInfo::TestCaseInfo( const TestCaseInfo& other, const std::string& name ) : m_test( other.m_test ), + m_className( other.m_className ), m_name( name ), m_description( other.m_description ), m_tags( other.m_tags ), @@ -48,6 +52,7 @@ namespace Catch { TestCaseInfo::TestCaseInfo( const TestCaseInfo& other ) : m_test( other.m_test ), + m_className( other.m_className ), m_name( other.m_name ), m_description( other.m_description ), m_tags( other.m_tags ), @@ -59,14 +64,15 @@ namespace Catch { m_test->invoke(); } + const std::string& TestCaseInfo::getClassName() const { + return m_className; + } const std::string& TestCaseInfo::getName() const { return m_name; } - const std::string& TestCaseInfo::getDescription() const { return m_description; } - const SourceLineInfo& TestCaseInfo::getLineInfo() const { return m_lineInfo; } @@ -89,13 +95,16 @@ namespace Catch { void TestCaseInfo::swap( TestCaseInfo& other ) { m_test.swap( other.m_test ); + m_className.swap( other.m_className ); m_name.swap( other.m_name ); m_description.swap( other.m_description ); - m_lineInfo.swap( other.m_lineInfo ); + std::swap( m_lineInfo, other.m_lineInfo ); } bool TestCaseInfo::operator == ( const TestCaseInfo& other ) const { - return m_test.get() == other.m_test.get() && m_name == other.m_name; + return m_test.get() == other.m_test.get() && + m_name == other.m_name && + m_className == other.m_className; } bool TestCaseInfo::operator < ( const TestCaseInfo& other ) const { diff --git a/include/internal/catch_test_case_registry_impl.hpp b/include/internal/catch_test_case_registry_impl.hpp index 96c5783f..adaefc35 100644 --- a/include/internal/catch_test_case_registry_impl.hpp +++ b/include/internal/catch_test_case_registry_impl.hpp @@ -107,23 +107,38 @@ namespace Catch { TestFunction m_fun; }; - + + inline std::string extractClassName( const std::string& classOrQualifiedMethodName ) { + std::string className = classOrQualifiedMethodName; + if( className[0] == '&' ) + { + std::size_t lastColons = className.rfind( "::" ); + std::size_t penultimateColons = className.rfind( "::", lastColons-1 ); + if( penultimateColons == std::string::npos ) + penultimateColons = 1; + className = className.substr( penultimateColons, lastColons-penultimateColons ); + } + return className; + } + /////////////////////////////////////////////////////////////////////////// AutoReg::AutoReg( TestFunction function, const char* name, const char* description, const SourceLineInfo& lineInfo ) { - registerTestCase( new FreeFunctionTestCase( function ), name, description, lineInfo ); + registerTestCase( new FreeFunctionTestCase( function ), "global", name, description, lineInfo ); } AutoReg::~AutoReg() {} - void AutoReg::registerTestCase( ITestCase* testCase, - const char* name, + void AutoReg::registerTestCase( ITestCase* testCase, + const char* classOrQualifiedMethodName, + const char* name, const char* description, const SourceLineInfo& lineInfo ) { - getMutableRegistryHub().registerTest( TestCaseInfo( testCase, name, description, lineInfo ) ); + + getMutableRegistryHub().registerTest( TestCaseInfo( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); } } // end namespace Catch diff --git a/include/internal/catch_test_registry.hpp b/include/internal/catch_test_registry.hpp index 6a42fdbe..0530e4f2 100644 --- a/include/internal/catch_test_registry.hpp +++ b/include/internal/catch_test_registry.hpp @@ -34,21 +34,23 @@ typedef void(*TestFunction)(); struct AutoReg { - AutoReg( TestFunction function, + AutoReg( TestFunction function, const char* name, const char* description, const SourceLineInfo& lineInfo ); template - AutoReg( void (C::*method)(), + AutoReg( void (C::*method)(), + const char* className, const char* name, const char* description, const SourceLineInfo& lineInfo ) { - registerTestCase( new MethodTestCase( method ), name, description, lineInfo ); + registerTestCase( new MethodTestCase( method ), className, name, description, lineInfo ); } void registerTestCase( ITestCase* testCase, - const char* name, + const char* className, + const char* name, const char* description, const SourceLineInfo& lineInfo ); @@ -75,7 +77,7 @@ private: /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, Name, Desc, CATCH_INTERNAL_LINEINFO ); } + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Name, Desc, CATCH_INTERNAL_LINEINFO ); } /////////////////////////////////////////////////////////////////////////////// #define TEST_CASE_METHOD( ClassName, TestName, Desc )\ @@ -83,7 +85,7 @@ private: struct INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ ) : ClassName{ \ void test(); \ }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test, TestName, Desc, CATCH_INTERNAL_LINEINFO ); \ + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test, #ClassName, TestName, Desc, CATCH_INTERNAL_LINEINFO ); \ } \ void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 63074629..7a55d3be 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -173,13 +173,17 @@ namespace Catch { if( assertionResult.hasExpression() ) { TextColour colour( TextColour::OriginalExpression ); m_config.stream << assertionResult.getExpression(); - if( assertionResult.ok() ) { + if( assertionResult.succeeded() ) { TextColour successColour( TextColour::Success ); m_config.stream << " succeeded"; } else { TextColour errorColour( TextColour::Error ); m_config.stream << " failed"; + if( assertionResult.isOk() ) { + TextColour okAnywayColour( TextColour::Success ); + m_config.stream << " - but was ok"; + } } } switch( assertionResult.getResultType() ) { @@ -226,13 +230,17 @@ namespace Catch { case ResultWas::ExpressionFailed: case ResultWas::Exception: if( !assertionResult.hasExpression() ) { - if( assertionResult.ok() ) { + if( assertionResult.succeeded() ) { TextColour colour( TextColour::Success ); m_config.stream << " succeeded"; } else { TextColour colour( TextColour::Error ); m_config.stream << " failed"; + if( assertionResult.isOk() ) { + TextColour okAnywayColour( TextColour::Success ); + m_config.stream << " - but was ok"; + } } } break; diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 99e6ed04..93c48360 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -26,7 +26,10 @@ namespace Catch { struct TestCaseStats { - TestCaseStats( const std::string& name = std::string() ) :m_name( name ){} + TestCaseStats( const std::string& className, const std::string& name ) + : m_className( className ), + m_name( name ) + {} double m_timeInSeconds; std::string m_status; @@ -94,7 +97,7 @@ namespace Catch { virtual void EndSection( const std::string&, const Counts& ) {} virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) { - m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getName() ) ); + m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getClassName(), testInfo.getName() ) ); } virtual void Result( const Catch::AssertionResult& assertionResult ) { diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index f2af6992..d2163dd3 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -81,7 +81,7 @@ namespace Catch { if( assertionResult.hasExpression() ) { m_xml.startElement( "Expression" ) - .writeAttribute( "success", assertionResult.ok() ) + .writeAttribute( "success", assertionResult.succeeded() ) .writeAttribute( "filename", assertionResult.getSourceInfo().file ) .writeAttribute( "line", assertionResult.getSourceInfo().line ); @@ -89,7 +89,7 @@ namespace Catch { .writeText( assertionResult.getExpression() ); m_xml.scopedElement( "Expanded" ) .writeText( assertionResult.getExpandedExpression() ); - m_currentTestSuccess &= assertionResult.ok(); + m_currentTestSuccess &= assertionResult.succeeded(); } switch( assertionResult.getResultType() ) { diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt new file mode 100644 index 00000000..0f2a40c6 --- /dev/null +++ b/projects/SelfTest/Baselines/results.txt @@ -0,0 +1,646 @@ +[Started testing] +[Started group: './failing* ./succeeding*'] + +[Running: ./succeeding/Approx/simple] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:26: Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 +[Finished: './succeeding/Approx/simple' All tests passed (6 assertions in 1 test case)] + +[Running: ./succeeding/Approx/epsilon] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:39: d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) +[Finished: './succeeding/Approx/epsilon' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/Approx/float] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:50: 0.0f == Approx( 0.0f ) succeeded for: 0 == Approx( 0 ) +[Finished: './succeeding/Approx/float' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/Approx/int] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:61: 0 == Approx( 0 ) succeeded +[Finished: './succeeding/Approx/int' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/Approx/mixed] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:79: dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) +[Finished: './succeeding/Approx/mixed' All tests passed (5 assertions in 1 test case)] + +[Running: ./succeeding/Approx/custom] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:96: d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ApproxTests.cpp:101: approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 +[Finished: './succeeding/Approx/custom' All tests passed (8 assertions in 1 test case)] + +[Running: ./succeeding/TestClass/succeedingCase] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" +[Finished: './succeeding/TestClass/succeedingCase' All tests passed (1 assertion in 1 test case)] + +[Running: ./failing/TestClass/failingCase] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ClassTests.cpp:28: s == "world" failed for: "hello" == "world" +[Finished: './failing/TestClass/failingCase' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/Fixture/succeedingCase] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 +[Finished: './succeeding/Fixture/succeedingCase' All tests passed (1 assertion in 1 test case)] + +[Running: ./failing/Fixture/failingCase] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 +[Finished: './failing/Fixture/failingCase' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/conditions/equality] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:63: x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) +[Finished: './succeeding/conditions/equality' All tests passed (7 assertions in 1 test case)] + +[Running: ./failing/conditions/equality] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:73: data.int_seven == 0 failed for: 7 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:74: data.float_nine_point_one == Approx( 9.11f ) failed for: 9.1 == Approx( 9.11 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:75: data.float_nine_point_one == Approx( 9.0f ) failed for: 9.1 == Approx( 9 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:76: data.float_nine_point_one == Approx( 1 ) failed for: 9.1 == Approx( 1 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:77: data.float_nine_point_one == Approx( 0 ) failed for: 9.1 == Approx( 0 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:78: data.double_pi == Approx( 3.1415 ) failed for: 3.14159 == Approx( 3.1415 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:79: data.str_hello == "goodbye" failed for: "hello" == "goodbye" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:80: data.str_hello == "hell" failed for: "hello" == "hell" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:81: data.str_hello == "hello1" failed for: "hello" == "hello1" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:82: data.str_hello.size() == 6 failed for: 5 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:85: x == Approx( 1.301 ) failed for: 1.3 == Approx( 1.301 ) +[Finished: './failing/conditions/equality' 1 test case failed (All 13 assertions failed)] + +[Running: ./succeeding/conditions/inequality] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:93: data.int_seven != 6 succeeded for: 7 != 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:94: data.int_seven != 8 succeeded for: 7 != 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:95: data.float_nine_point_one != Approx( 9.11f ) succeeded for: 9.1 != Approx( 9.11 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:96: data.float_nine_point_one != Approx( 9.0f ) succeeded for: 9.1 != Approx( 9 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:97: data.float_nine_point_one != Approx( 1 ) succeeded for: 9.1 != Approx( 1 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:98: data.float_nine_point_one != Approx( 0 ) succeeded for: 9.1 != Approx( 0 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:99: data.double_pi != Approx( 3.1415 ) succeeded for: 3.14159 != Approx( 3.1415 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:100: data.str_hello != "goodbye" succeeded for: "hello" != "goodbye" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:101: data.str_hello != "hell" succeeded for: "hello" != "hell" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:102: data.str_hello != "hello1" succeeded for: "hello" != "hello1" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:103: data.str_hello.size() != 6 succeeded for: 5 != 6 +[Finished: './succeeding/conditions/inequality' All tests passed (11 assertions in 1 test case)] + +[Running: ./failing/conditions/inequality] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:111: data.int_seven != 7 failed for: 7 != 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:112: data.float_nine_point_one != Approx( 9.1f ) failed for: 9.1 != Approx( 9.1 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:113: data.double_pi != Approx( 3.1415926535 ) failed for: 3.14159 != Approx( 3.14159 ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:114: data.str_hello != "hello" failed for: "hello" != "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:115: data.str_hello.size() != 5 failed for: 5 != 5 +[Finished: './failing/conditions/inequality' 1 test case failed (All 5 assertions failed)] + +[Running: ./succeeding/conditions/ordered] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:124: data.int_seven < 8 succeeded for: 7 < 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:125: data.int_seven > 6 succeeded for: 7 > 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:126: data.int_seven > 0 succeeded for: 7 > 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:127: data.int_seven > -1 succeeded for: 7 > -1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:129: data.int_seven >= 7 succeeded for: 7 >= 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:130: data.int_seven >= 6 succeeded for: 7 >= 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:131: data.int_seven <= 7 succeeded for: 7 <= 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:132: data.int_seven <= 8 succeeded for: 7 <= 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:134: data.float_nine_point_one > 9 succeeded for: 9.1 > 9 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:135: data.float_nine_point_one < 10 succeeded for: 9.1 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:136: data.float_nine_point_one < 9.2 succeeded for: 9.1 < 9.2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:138: data.str_hello <= "hello" succeeded for: "hello" <= "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:139: data.str_hello >= "hello" succeeded for: "hello" >= "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:141: data.str_hello < "hellp" succeeded for: "hello" < "hellp" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:142: data.str_hello < "zebra" succeeded for: "hello" < "zebra" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:143: data.str_hello > "hellm" succeeded for: "hello" > "hellm" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:144: data.str_hello > "a" succeeded for: "hello" > "a" +[Finished: './succeeding/conditions/ordered' All tests passed (17 assertions in 1 test case)] + +[Running: ./failing/conditions/ordered] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:152: data.int_seven > 7 failed for: 7 > 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:153: data.int_seven < 7 failed for: 7 < 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:154: data.int_seven > 8 failed for: 7 > 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:155: data.int_seven < 6 failed for: 7 < 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:156: data.int_seven < 0 failed for: 7 < 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:157: data.int_seven < -1 failed for: 7 < -1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:159: data.int_seven >= 8 failed for: 7 >= 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:160: data.int_seven <= 6 failed for: 7 <= 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:162: data.float_nine_point_one < 9 failed for: 9.1 < 9 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:163: data.float_nine_point_one > 10 failed for: 9.1 > 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:164: data.float_nine_point_one > 9.2 failed for: 9.1 > 9.2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:166: data.str_hello > "hello" failed for: "hello" > "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:167: data.str_hello < "hello" failed for: "hello" < "hello" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:168: data.str_hello > "hellp" failed for: "hello" > "hellp" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:169: data.str_hello > "z" failed for: "hello" > "z" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:170: data.str_hello < "hellm" failed for: "hello" < "hellm" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:171: data.str_hello < "a" failed for: "hello" < "a" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:173: data.str_hello >= "z" failed for: "hello" >= "z" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:174: data.str_hello <= "a" failed for: "hello" <= "a" +[Finished: './failing/conditions/ordered' 1 test case failed (All 19 assertions failed)] + +[Running: ./succeeding/conditions/int literals] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:188: i == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:189: ui == 2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:190: l == 3 succeeded for: 3 == 3 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:191: ul == 4 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:192: c == 5 succeeded for: 5 == 5 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:193: uc == 6 succeeded for:  == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:195: 1 == i succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:196: 2 == ui succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:197: 3 == l succeeded for: 3 == 3 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:198: 4 == ul succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:199: 5 == c succeeded for: 5 == 5 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:200: 6 == uc succeeded for: 6 ==  +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:202: (std::numeric_limits::max)() > ul succeeded for: 0xffffffffffffffff > 4 +[Finished: './succeeding/conditions/int literals' All tests passed (13 assertions in 1 test case)] + +[Running: ./succeeding/conditions//long_to_unsigned_x] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:223: long_var == unsigned_char_var succeeded for: 1 ==  +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:224: long_var == unsigned_short_var succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:225: long_var == unsigned_int_var succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:226: long_var == unsigned_long_var succeeded for: 1 == 1 +[Finished: './succeeding/conditions//long_to_unsigned_x' All tests passed (4 assertions in 1 test case)] + +[Running: ./succeeding/conditions/negative ints] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:232: ( -1 > 2u ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:233: -1 > 2u succeeded for: -1 > 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:235: ( 2u < -1 ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:236: 2u < -1 succeeded for: 2 < -1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:239: ( minInt > 2u ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:240: minInt > 2u succeeded for: -2147483648 > 2 +[Finished: './succeeding/conditions/negative ints' All tests passed (6 assertions in 1 test case)] + +[Running: ./succeeding/conditions/computed ints] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:255: 54 == 6*9 succeeded for: 54 == 54 +[Finished: './succeeding/conditions/computed ints' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/conditions/ptr] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:271: p == __null succeeded for: __null == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:272: p == pNULL succeeded for: __null == __null +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:277: p != __null succeeded for: 0x7fff54208078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:280: cp != __null succeeded for: 0x7fff54208078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:283: cpc != __null succeeded for: 0x7fff54208078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: returnsNull() == __null succeeded for: {null string} == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: returnsConstNull() == __null succeeded for: {null string} == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:288: __null != p succeeded for: 0 != 0x7fff54208078 +[Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] + +[Running: ./succeeding/conditions/not] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:303: false == false succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:304: true == true succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:305: !false succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:306: !false succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:308: !falseValue succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:309: !falseValue succeeded for: !false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:311: !(1 == 2) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:312: !1 == 2 succeeded for: !(1 == 2) +[Finished: './succeeding/conditions/not' All tests passed (8 assertions in 1 test case)] + +[Running: ./failing/conditions/not] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:320: false != false failed +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:321: true != true failed +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:322: !true failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:323: !true failed +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:325: !trueValue failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:326: !trueValue failed for: !true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:328: !(1 == 1) failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:329: !1 == 1 failed for: !(1 == 1) +[Finished: './failing/conditions/not' 1 test case failed (All 8 assertions failed)] + +[Running: ./succeeding/exceptions/explicit] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:39: thisThrows() succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:40: thisDoesntThrow() succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:41: thisThrows() succeeded +[Finished: './succeeding/exceptions/explicit' All tests passed (3 assertions in 1 test case)] + +[Running: ./failing/exceptions/explicit] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:47: thisThrows() failed with unexpected exception with message: 'expected exception' +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:48: thisDoesntThrow() failed because no exception was thrown where one was expected +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:49: thisThrows() failed with unexpected exception with message: 'expected exception' +[Finished: './failing/exceptions/explicit' 1 test case failed (All 3 assertions failed)] + +[Running: ./failing/exceptions/implicit] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' +[Finished: './failing/exceptions/implicit' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/custom] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:95: Unexpected exception with message: 'custom exception' +[Finished: './failing/exceptions/custom' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/custom/nothrow] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:102: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' +[Finished: './failing/exceptions/custom/nothrow' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/custom/throw] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:107: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' +[Finished: './failing/exceptions/custom/throw' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/custom/double] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:111: Unexpected exception with message: '3.14' +[Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/in-section] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:125: Unexpected exception with message: 'Exception from section' +[Finished: './failing/exceptions/in-section' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/exceptions/error messages] + +[Started section: 'custom, unexpected'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:145: runner.getLog() Contains( "custom exception" ) succeeded for: +"\[g] ./failing/exceptions/custom + \[tc] ./failing/exceptions/custom +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:95: ThrewException'custom exception' /[tc] ./failing/exceptions/custom +/[g] ./failing/exceptions/custom +" contains: "custom exception" +[End of section: 'custom, unexpected' 1 assertion passed] + +[Started section: 'in section'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:153: runner.getLog() Contains( "Exception from section" ) succeeded for: +"\[g] ./failing/exceptions/in-section + \[tc] ./failing/exceptions/in-section + \ [s] the section + \ [s] the section2 + / [s] the section2 + / [s] the section +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:125: ThrewException'Exception from section' \ [s] the section + / [s] the section + /[tc] ./failing/exceptions/in-section +/[g] ./failing/exceptions/in-section +" contains: "Exception from section" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:154: runner.getLog() Contains( ::Catch::LineInfoRegistry::get().infoForName( "the section2" ) ) succeeded for: +"\[g] ./failing/exceptions/in-section + \[tc] ./failing/exceptions/in-section + \ [s] the section + \ [s] the section2 + / [s] the section2 + / [s] the section +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:125: ThrewException'Exception from section' \ [s] the section + / [s] the section + /[tc] ./failing/exceptions/in-section +/[g] ./failing/exceptions/in-section +" contains: "/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:125: " +[End of section: 'in section' All 2 assertions passed] + +[Finished: './succeeding/exceptions/error messages' All tests passed (3 assertions in 1 test case)] + +[Running: ./succeeding/exceptions/notimplemented] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:165: thisFunctionNotImplemented( 7 ) succeeded +[Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/generators/1] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +[Finished: './succeeding/generators/1' All tests passed (144 assertions in 1 test case)] + +[Running: ./succeeding/message] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:14: [warning: this is a warning] +[Finished: './succeeding/message' No tests ran] + +[Running: ./failing/message/info/1] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:19: [info: this message should be logged] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:20: [info: so should this] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:22: a == 1 failed for: 2 == 1 +[Finished: './failing/message/info/1' 1 test case failed (1 assertion failed)] + +[Running: ./failing/message/fail] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:47: failed with message: 'This is a failure' +[Finished: './failing/message/fail' 1 test case failed (1 assertion failed)] + +[Running: ./failing/message/sections] +[Started section: 'one'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:54: failed with message: 'Message from section one' +[End of section: 'one' 1 assertion failed] + +[Started section: 'two'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:59: failed with message: 'Message from section two' +[End of section: 'two' 1 assertion failed] + +[Finished: './failing/message/sections' 1 test case failed (All 2 assertions failed)] + +[Running: ./succeeding/nofail] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:88: 1 == 2 failed - but was ok +[Finished: './succeeding/nofail' No tests ran] + +[Running: ./succeeding/Misc/Sections] +[Started section: 's1'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:25: a != b succeeded for: 1 != 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:26: b != a succeeded for: 2 != 1 +[End of section: 's1' All 2 assertions passed] + +[Started section: 's2'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:31: a != b succeeded for: 1 != 2 +[End of section: 's2' 1 assertion passed] + +[Finished: './succeeding/Misc/Sections' All tests passed (3 assertions in 1 test case)] + +[Running: ./succeeding/Misc/Sections/nested] +[Started section: 's1'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:42: a != b succeeded for: 1 != 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:43: b != a succeeded for: 2 != 1 +[Started section: 's2'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:47: a != b succeeded for: 1 != 2 +[End of section: 's2' 1 assertion passed] + +[End of section: 's1' All 3 assertions passed] + +[Finished: './succeeding/Misc/Sections/nested' All tests passed (3 assertions in 1 test case)] + +[Running: ./succeeding/Misc/null strings] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:163: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:164: makeString( true ) == static_cast(__null) succeeded for: {null string} == {null string} +[Finished: './succeeding/Misc/null strings' All tests passed (2 assertions in 1 test case)] + +[Running: ./failing/info] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:169: [info: hi] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:171: [info: i := 7] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:172: false failed +[Finished: './failing/info' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/checkedif] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:177: flag succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:185: testCheckedIf( true ) succeeded for: true +[Finished: './succeeding/checkedif' All tests passed (2 assertions in 1 test case)] + +[Running: ./failing/checkedif] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:177: flag failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:190: testCheckedIf( false ) failed for: false +[Finished: './failing/checkedif' 1 test case failed (All 2 assertions failed)] + +[Running: ./succeeding/checkedelse] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:195: flag succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:203: testCheckedElse( true ) succeeded for: true +[Finished: './succeeding/checkedelse' All tests passed (2 assertions in 1 test case)] + +[Running: ./failing/checkedelse] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:195: flag failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:208: testCheckedElse( false ) failed for: false +[Finished: './failing/checkedelse' 1 test case failed (All 2 assertions failed)] + +[Running: ./succeeding/atomic if] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:236: x == 0 succeeded for: 0 == 0 +[Finished: './succeeding/atomic if' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/matchers] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:246: testStringForMatching() Contains( "string" ) succeeded for: + "this string contains 'abc' as a substring" contains: "string" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:247: testStringForMatching() Contains( "abc" ) succeeded for: + "this string contains 'abc' as a substring" contains: "abc" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:249: testStringForMatching() StartsWith( "this" ) succeeded for: + "this string contains 'abc' as a substring" starts with: "this" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:250: testStringForMatching() EndsWith( "substring" ) succeeded for: + "this string contains 'abc' as a substring" ends with: "substring" +[Finished: './succeeding/matchers' All tests passed (4 assertions in 1 test case)] + +[Running: ./failing/matchers/Contains] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:255: testStringForMatching() Contains( "not there" ) failed for: + "this string contains 'abc' as a substring" contains: "not there" +[Finished: './failing/matchers/Contains' 1 test case failed (1 assertion failed)] + +[Running: ./failing/matchers/StartsWith] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:260: testStringForMatching() StartsWith( "string" ) failed for: + "this string contains 'abc' as a substring" starts with: "string" +[Finished: './failing/matchers/StartsWith' 1 test case failed (1 assertion failed)] + +[Running: ./failing/matchers/EndsWith] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:265: testStringForMatching() EndsWith( "this" ) failed for: + "this string contains 'abc' as a substring" ends with: "this" +[Finished: './failing/matchers/EndsWith' 1 test case failed (1 assertion failed)] + +[Running: ./failing/matchers/Equals] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:270: testStringForMatching() Equals( "something else" ) failed for: + "this string contains 'abc' as a substring" equals: "something else" +[Finished: './failing/matchers/Equals' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/matchers/Equals] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:285: testStringForMatching() Equals( "this string contains 'abc' as a substring" ) succeeded for: +"this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" +[Finished: './succeeding/matchers/Equals' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/Tricky/std::pair] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: + + std::pair( 1, 2 ) + == + std::pair( 1, 2 ) +[Finished: './succeeding/Tricky/std::pair' All tests passed (1 assertion in 1 test case)] + +[Running: ./failing/Tricky/non streamable type] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff54208858 == 0x7fff54208850 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:96: o1 == o2 failed for: {?} == {?} +[Finished: './failing/Tricky/non streamable type' 1 test case failed (All 2 assertions failed)] + +[Running: ./failing/string literals] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:106: std::string( "first" ) == "second" failed for: "first" == "second" +[Finished: './failing/string literals' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/side-effects] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:119: i++ == 7 succeeded for: 7 == 7 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:120: i++ == 8 succeeded for: 8 == 8 +[Finished: './succeeding/side-effects' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/koenig] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:186: 0xc0000000 == o succeeded for: 0xc0000000 == {?} +[Finished: './succeeding/koenig' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/non-const==] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:212: t == 1u succeeded for: {?} == 1 +[Finished: './succeeding/non-const==' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/enum/bits] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:224: 0xc0000000 == bit30and31 succeeded for: 0xc0000000 == 3221225472 +[Finished: './succeeding/enum/bits' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/boolean member] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff54208850 != 0 +[Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/unimplemented static bool] +[Started section: 'compare to true'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:259: is_true::value == true succeeded for: true == true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:260: true == is_true::value succeeded for: true == true +[End of section: 'compare to true' All 2 assertions passed] + +[Started section: 'compare to false'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:264: is_true::value == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:265: false == is_true::value succeeded for: false == false +[End of section: 'compare to false' All 2 assertions passed] + +[Started section: 'negation'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:270: !is_true::value succeeded for: true +[End of section: 'negation' 1 assertion passed] + +[Started section: 'double negation'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:275: !!is_true::value succeeded for: true +[End of section: 'double negation' 1 assertion passed] + +[Started section: 'direct'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:280: is_true::value succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:281: !is_true::value succeeded for: !false +[End of section: 'direct' All 2 assertions passed] + +[Finished: './succeeding/unimplemented static bool' All tests passed (8 assertions in 1 test case)] + +[Running: ./succeeding/SafeBool] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:313: True succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:314: !False succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:315: !False succeeded for: !false +[Finished: './succeeding/SafeBool' All tests passed (3 assertions in 1 test case)] +[End of group: './failing* ./succeeding*'. 25 of 67 test cases failed (72 of 361 assertions failed)] + + +[Testing completed. 25 of 67 test cases failed (72 of 361 assertions failed)] + diff --git a/projects/SelfTest/ClassTests.cpp b/projects/SelfTest/ClassTests.cpp index 76c06dd7..573f5aaa 100644 --- a/projects/SelfTest/ClassTests.cpp +++ b/projects/SelfTest/ClassTests.cpp @@ -31,8 +31,8 @@ namespace } -METHOD_AS_TEST_CASE( TestClass::succeedingCase, "./succeeding/TestClass/succeedingCase", "A method based test run that succeeds" ) -METHOD_AS_TEST_CASE( TestClass::failingCase, "./failing/TestClass/failingCase", "A method based test run that fails" ) +METHOD_AS_TEST_CASE( TestClass::succeedingCase, "./succeeding/TestClass/succeedingCase", "A method based test run that succeeds [class]" ) +METHOD_AS_TEST_CASE( TestClass::failingCase, "./failing/TestClass/failingCase", "A method based test run that fails [class]" ) struct Fixture @@ -42,7 +42,7 @@ struct Fixture int m_a; }; -TEST_CASE_METHOD( Fixture, "./succeeding/Fixture/succeedingCase", "A method based test run that succeeds" ) +TEST_CASE_METHOD( Fixture, "./succeeding/Fixture/succeedingCase", "A method based test run that succeeds [class]" ) { REQUIRE( m_a == 1 ); } @@ -50,7 +50,7 @@ TEST_CASE_METHOD( Fixture, "./succeeding/Fixture/succeedingCase", "A method base // We should be able to write our tests within a different namespace namespace Inner { - TEST_CASE_METHOD( Fixture, "./failing/Fixture/failingCase", "A method based test run that fails" ) + TEST_CASE_METHOD( Fixture, "./failing/Fixture/failingCase", "A method based test run that fails [class]" ) { REQUIRE( m_a == 2 ); } diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp index bf02e2dd..73354cbc 100644 --- a/projects/SelfTest/ExceptionTests.cpp +++ b/projects/SelfTest/ExceptionTests.cpp @@ -151,7 +151,7 @@ TEST_CASE( "./succeeding/exceptions/error messages", "The error messages produce INFO( runner.getLog() ); // CHECK( runner.getLog().find( "Unexpected exception" ) != std::string::npos ); // Mock reporter doesn't say this CHECK_THAT( runner.getLog(), Contains( "Exception from section" ) ); -// CHECK( runner.getLog().find( CATCH_GET_LINE_INFO( "the section2" ) ) != std::string::npos ); // Mock reporter doesn't say this + CHECK_THAT( runner.getLog(), Contains( CATCH_GET_LINE_INFO( "the section2" ) ) ); } } diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index 776d7169..bcd52d71 100644 --- a/projects/SelfTest/MessageTests.cpp +++ b/projects/SelfTest/MessageTests.cpp @@ -43,7 +43,8 @@ TEST_CASE( "./mixed/message/info/2", "INFO gets logged on failure" ) TEST_CASE( "./failing/message/fail", "FAIL aborts the test" ) { - FAIL( "This is a " << "failure" ); // This should output the message and abort + if( true ) + FAIL( "This is a " << "failure" ); // This should output the message and abort } TEST_CASE( "./failing/message/sections", "Output from all sections is reported" ) @@ -81,3 +82,8 @@ TEST_CASE( "./mixed/message/scoped", "" ) REQUIRE( i < 10 ); } } + +TEST_CASE( "./succeeding/nofail", "The NO_FAIL macro reports a failure but does not fail the test" ) +{ + CHECK_NOFAIL( 1 == 2 ); +} diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 6e38d44c..128ece7c 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -37,7 +37,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" SECTION( "selftest/test counts/succeeding tests", "Number of 'succeeding' tests is fixed" ) { Totals totals = runner.runMatching( "./succeeding/*" ); - CHECK( totals.assertions.passed == 288 ); + CHECK( totals.assertions.passed == 289 ); CHECK( totals.assertions.failed == 0 ); } @@ -86,7 +86,7 @@ std::string parseIntoConfigAndReturnError( const char * (&argv)[size], Catch::Co return ""; } -inline Catch::TestCaseInfo makeTestCase( const char* name ){ return Catch::TestCaseInfo( NULL, name, "", CATCH_INTERNAL_LINEINFO ); } +inline Catch::TestCaseInfo makeTestCase( const char* name ){ return Catch::TestCaseInfo( NULL, "", name, "", CATCH_INTERNAL_LINEINFO ); } TEST_CASE( "selftest/parser/2", "ConfigData" ) { @@ -364,7 +364,7 @@ TEST_CASE( "selftest/tags", "" ) { std::string p5 = "[one][two]~[hide],[three]"; SECTION( "one tag", "" ) { - Catch::TestCaseInfo oneTag( NULL, "test", "[one]", CATCH_INTERNAL_LINEINFO ); + Catch::TestCaseInfo oneTag( NULL, "", "test", "[one]", CATCH_INTERNAL_LINEINFO ); CHECK( oneTag.getDescription() == "" ); CHECK( oneTag.hasTag( "one" ) ); @@ -378,7 +378,7 @@ TEST_CASE( "selftest/tags", "" ) { } SECTION( "two tags", "" ) { - Catch::TestCaseInfo twoTags( NULL, "test", "[one][two]", CATCH_INTERNAL_LINEINFO ); + Catch::TestCaseInfo twoTags( NULL, "", "test", "[one][two]", CATCH_INTERNAL_LINEINFO ); CHECK( twoTags.getDescription() == "" ); CHECK( twoTags.hasTag( "one" ) ); @@ -395,7 +395,7 @@ TEST_CASE( "selftest/tags", "" ) { SECTION( "one tag with characters either side", "" ) { - Catch::TestCaseInfo oneTagWithExtras( NULL, "test", "12[one]34", CATCH_INTERNAL_LINEINFO ); + Catch::TestCaseInfo oneTagWithExtras( NULL, "", "test", "12[one]34", CATCH_INTERNAL_LINEINFO ); CHECK( oneTagWithExtras.getDescription() == "1234" ); CHECK( oneTagWithExtras.hasTag( "one" ) ); CHECK( oneTagWithExtras.hasTag( "two" ) == false ); @@ -404,7 +404,7 @@ TEST_CASE( "selftest/tags", "" ) { SECTION( "start of a tag, but not closed", "" ) { - Catch::TestCaseInfo oneTagOpen( NULL, "test", "[one", CATCH_INTERNAL_LINEINFO ); + Catch::TestCaseInfo oneTagOpen( NULL, "", "test", "[one", CATCH_INTERNAL_LINEINFO ); CHECK( oneTagOpen.getDescription() == "[one" ); CHECK( oneTagOpen.hasTag( "one" ) == false ); @@ -412,7 +412,7 @@ TEST_CASE( "selftest/tags", "" ) { } SECTION( "hidden", "" ) { - Catch::TestCaseInfo oneTag( NULL, "test", "[hide]", CATCH_INTERNAL_LINEINFO ); + Catch::TestCaseInfo oneTag( NULL, "", "test", "[hide]", CATCH_INTERNAL_LINEINFO ); CHECK( oneTag.getDescription() == "" ); CHECK( oneTag.hasTag( "hide" ) ); diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index bca9f284..244cd822 100644 --- a/projects/SelfTest/catch_self_test.cpp +++ b/projects/SelfTest/catch_self_test.cpp @@ -34,6 +34,8 @@ namespace Catch{ void MockReporter::Result( const AssertionResult& assertionResult ) { if( assertionResult.getResultType() == ResultWas::Ok ) return; + + m_log << assertionResult.getSourceInfo() << " "; switch( assertionResult.getResultType() ) { case ResultWas::Info: diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 7667e515..3878491a 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -551,11 +551,7 @@ buildSettings = { CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; - GCC_PREPROCESSOR_DEFINITIONS = CATCH_CONFIG_USE_ANSI_COLOUR_CODES; - "GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = ( - CATCH_CONFIG_USE_ANSI_COLOUR_CODES, - "DEBUG=1", - ); + GCC_PREPROCESSOR_DEFINITIONS = ""; PRODUCT_NAME = "$(TARGET_NAME)"; WARNING_CFLAGS = ( "-Weverything", From ceeebfda494b82f5dbe3a61ba1350afad0e94968 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 13 Nov 2012 22:03:50 +0000 Subject: [PATCH 7/9] Fixed merge hiccup --- include/internal/catch_common.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 41573556..58fbe0ff 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -116,9 +116,6 @@ namespace Catch { bool empty() const { return file.empty(); } - bool empty() const { - return file.empty(); - } std::string file; std::size_t line; From 90a3594e104ebbf1f13d44153ceb962972761092 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 13 Nov 2012 22:04:29 +0000 Subject: [PATCH 8/9] Regenerated single include following merge --- single_include/catch.hpp | 457 +++++++++++++++++++++------------------ 1 file changed, 249 insertions(+), 208 deletions(-) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 67e0ca02..16894691 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-11-01 08:27:51.720005 + * Generated: 2012-11-13 22:03:59.839085 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -111,7 +111,7 @@ namespace Catch { friend std::ostream& operator << ( std::ostream& os, const pluralise& pluraliser ) { os << pluraliser.m_count << " " << pluraliser.m_label; if( pluraliser.m_count != 1 ) - os << "s"; + os << "s"; return os; } @@ -126,24 +126,14 @@ namespace Catch { : file( _file ), line( _line ) {} - SourceLineInfo( const std::string& _function, const std::string& _file, std::size_t _line ) - : function( _function ), - file( _file ), - line( _line ) - {} SourceLineInfo( const SourceLineInfo& other ) : file( other.file ), line( other.line ) {} - void swap( SourceLineInfo& other ){ - file.swap( other.file ); - std::swap( line, other.line ); - } bool empty() const { return file.empty(); } - std::string function; std::string file; std::size_t line; }; @@ -399,13 +389,15 @@ struct AutoReg { template AutoReg( void (C::*method)(), + const char* className, const char* name, const char* description, const SourceLineInfo& lineInfo ) { - registerTestCase( new MethodTestCase( method ), name, description, lineInfo ); + registerTestCase( new MethodTestCase( method ), className, name, description, lineInfo ); } void registerTestCase( ITestCase* testCase, + const char* className, const char* name, const char* description, const SourceLineInfo& lineInfo ); @@ -433,7 +425,7 @@ private: /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, Name, Desc, CATCH_INTERNAL_LINEINFO ); } + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Name, Desc, CATCH_INTERNAL_LINEINFO ); } /////////////////////////////////////////////////////////////////////////////// #define TEST_CASE_METHOD( ClassName, TestName, Desc )\ @@ -441,7 +433,7 @@ private: struct INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ ) : ClassName{ \ void test(); \ }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test, TestName, Desc, CATCH_INTERNAL_LINEINFO ); \ + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test, #ClassName, TestName, Desc, CATCH_INTERNAL_LINEINFO ); \ } \ void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() @@ -651,36 +643,55 @@ inline std::string toString( std::nullptr_t ) { namespace Catch { -struct ResultWas { enum OfType { - Unknown = -1, - Ok = 0, - Info = 1, - Warning = 2, + // ResultWas::OfType enum + struct ResultWas { enum OfType { + Unknown = -1, + Ok = 0, + Info = 1, + Warning = 2, - FailureBit = 0x10, + FailureBit = 0x10, - ExpressionFailed = FailureBit | 1, - ExplicitFailure = FailureBit | 2, + ExpressionFailed = FailureBit | 1, + ExplicitFailure = FailureBit | 2, - Exception = 0x100 | FailureBit, + Exception = 0x100 | FailureBit, - ThrewException = Exception | 1, - DidntThrowException = Exception | 2 + ThrewException = Exception | 1, + DidntThrowException = Exception | 2 -}; }; + }; }; -inline bool isOk( ResultWas::OfType resultType ) { - return ( resultType & ResultWas::FailureBit ) == 0; -} + inline bool isOk( ResultWas::OfType resultType ) { + return ( resultType & ResultWas::FailureBit ) == 0; + } -struct ResultAction { enum Value { - None, - Failed = 1, // Failure - but no debug break if Debug bit not set - Debug = 2, // If this bit is set, invoke the debugger - Abort = 4 // Test run should abort -}; }; + // ResultAction::Value enum + struct ResultAction { enum Value { + None, + Failed = 1, // Failure - but no debug break if Debug bit not set + Debug = 2, // If this bit is set, invoke the debugger + Abort = 4 // Test run should abort + }; }; -} + // ResultDisposition::Flags enum + struct ResultDisposition { enum Flags { + Normal = 0x00, + + ContinueOnFailure = 0x01, // Failures fail test, but execution continues + NegateResult = 0x02, // Prefix expressiom with ! + SuppressFail = 0x04 // Failures are reported but do not fail the test + }; }; + + inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { + return static_cast( static_cast( lhs ) | static_cast( rhs ) ); + } + + inline bool shouldContinueOnFailure( int flags ) { return flags & ResultDisposition::ContinueOnFailure; } + inline bool shouldNegate( int flags ) { return flags & ResultDisposition::NegateResult; } + inline bool shouldSuppressFailure( int flags ) { return flags & ResultDisposition::SuppressFail; } + +} // end namespace Catch namespace Catch { @@ -688,18 +699,15 @@ namespace Catch { struct AssertionInfo { AssertionInfo() {} - AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression, bool _shouldNegate ) - : macroName( _macroName ), - lineInfo( _lineInfo ), - capturedExpression( _capturedExpression ) - { - if( _shouldNegate ) - capturedExpression = "!" + _capturedExpression; - } + AssertionInfo( const std::string& _macroName, + const SourceLineInfo& _lineInfo, + const std::string& _capturedExpression, + ResultDisposition::Flags _resultDisposition ); std::string macroName; SourceLineInfo lineInfo; std::string capturedExpression; + ResultDisposition::Flags resultDisposition; }; struct AssertionResultData @@ -717,7 +725,8 @@ namespace Catch { AssertionResult( const AssertionInfo& info, const AssertionResultData& data ); ~AssertionResult(); - bool ok() const; + bool isOk() const; + bool succeeded() const; ResultWas::OfType getResultType() const; bool hasExpression() const; bool hasMessage() const; @@ -805,6 +814,9 @@ namespace Internal { return Evaluator::evaluate( lhs, rhs ); } + // This level of indirection allows us to specialise for integer types + // to avoid signed/ unsigned warnings + // "base" overload template bool compare( const T1& lhs, const T2& rhs ) { @@ -856,44 +868,18 @@ namespace Internal { } // pointer to long (when comparing against NULL) - template - bool compare( long lhs, const T* rhs ) { - return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); - } - - template - bool compare( long lhs, T* rhs ) { + template bool compare( long lhs, T* rhs ) { return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); } - - template - bool compare( const T* lhs, long rhs ) { - return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); - } - - template - bool compare( T* lhs, long rhs ) { + template bool compare( T* lhs, long rhs ) { return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); } // pointer to int (when comparing against NULL) - template - bool compare( int lhs, const T* rhs ) { - return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); - } - - template - bool compare( int lhs, T* rhs ) { + template bool compare( int lhs, T* rhs ) { return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); } - - template - bool compare( const T* lhs, int rhs ) { - return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); - } - - template - bool compare( T* lhs, int rhs ) { + template bool compare( T* lhs, int rhs ) { return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); } @@ -917,7 +903,7 @@ public: ExpressionResultBuilder& setRhs( const std::string& rhs ); ExpressionResultBuilder& setOp( const std::string& op ); - ExpressionResultBuilder& negate( bool shouldNegate ); + ExpressionResultBuilder& endExpression( ResultDisposition::Flags resultDisposition ); template ExpressionResultBuilder& operator << ( const T& value ) { @@ -952,7 +938,7 @@ class ExpressionLhs { void operator = ( const ExpressionLhs& ); public: - ExpressionLhs( T lhs ) : m_lhs( lhs ) {} + ExpressionLhs( const T& lhs ) : m_lhs( lhs ) {} template ExpressionResultBuilder& operator == ( const RhsT& rhs ) { @@ -992,12 +978,12 @@ public: return captureExpression( rhs ); } - ExpressionResultBuilder& negate( bool shouldNegate ) { + ExpressionResultBuilder& endExpression( ResultDisposition::Flags resultDisposition ) { bool value = m_lhs ? true : false; return m_result .setLhs( Catch::toString( value ) ) .setResultType( value ) - .negate( shouldNegate ); + .endExpression( resultDisposition ); } // Only simple binary expressions are allowed on the LHS. @@ -1128,7 +1114,6 @@ namespace Catch { virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; virtual bool shouldDebugBreak() const = 0; - virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0; virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; @@ -1269,14 +1254,17 @@ namespace Catch { TestCaseInfo(); TestCaseInfo( ITestCase* testCase, - const char* name, - const char* description, + const std::string& className, + const std::string& name, + const std::string& description, const SourceLineInfo& lineInfo ); TestCaseInfo( const TestCaseInfo& other, const std::string& name ); TestCaseInfo( const TestCaseInfo& other ); void invoke() const; + + const std::string& getClassName() const; const std::string& getName() const; const std::string& getDescription() const; const SourceLineInfo& getLineInfo() const; @@ -1292,6 +1280,7 @@ namespace Catch { private: Ptr m_test; + std::string m_className; std::string m_name; std::string m_description; std::set m_tags; @@ -1378,12 +1367,12 @@ namespace Catch { class Tag { public: Tag() - : m_isNegated( false ) + : m_isNegated( false ) {} Tag( const std::string& name, bool isNegated ) : m_name( name ), - m_isNegated( isNegated ) + m_isNegated( isNegated ) {} std::string getName() const { @@ -2084,109 +2073,113 @@ inline bool isTrue( bool value ){ return value; } #define INTERNAL_CATCH_ASSERTIONINFO_NAME INTERNAL_CATCH_UNIQUE_NAME( __assertionInfo ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ACCEPT_EXPR( evaluatedExpr, stopOnFailure, originalExpr ) \ +#define INTERNAL_CATCH_ACCEPT_EXPR( evaluatedExpr, resultDisposition, originalExpr ) \ if( Catch::ResultAction::Value internal_catch_action = Catch::getResultCapture().acceptExpression( evaluatedExpr, INTERNAL_CATCH_ASSERTIONINFO_NAME ) ) { \ if( internal_catch_action & Catch::ResultAction::Debug ) BreakIntoDebugger(); \ if( internal_catch_action & Catch::ResultAction::Abort ) throw Catch::TestFailureException(); \ - if( Catch::isTrue( stopOnFailure ) ) throw Catch::TestFailureException(); \ + if( !Catch::shouldContinueOnFailure( resultDisposition ) ) throw Catch::TestFailureException(); \ if( Catch::isTrue( false ) ){ bool this_is_here_to_invoke_warnings = ( originalExpr ); Catch::isTrue( this_is_here_to_invoke_warnings ); } \ } /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, shouldNegate ) \ - Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, shouldNegate ); -// !TBD Catch::getResultCapture().acceptAssertionInfo( INTERNAL_CATCH_ASSERTIONINFO_NAME ) +#define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, resultDisposition ) \ + Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, resultDisposition ); /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \ try { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).negate( shouldNegate ), stopOnFailure, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).endExpression( resultDisposition ), resultDisposition, expr ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), false, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), \ + resultDisposition | Catch::ResultDisposition::ContinueOnFailure, expr ); \ throw; \ } \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_IF( expr, shouldNegate, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ); \ - if( Catch::getResultCapture().getLastResult()->ok() ) +#define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \ + INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ + if( Catch::getResultCapture().getLastResult()->succeeded() ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ELSE( expr, shouldNegate, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ); \ - if( !Catch::getResultCapture().getLastResult()->ok() ) +#define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \ + INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ + if( !Catch::getResultCapture().getLastResult()->succeeded() ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_NO_THROW( expr, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \ try { \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \ } \ catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), resultDisposition, false ); \ } \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ +#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \ try { \ if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), resultDisposition, false ); \ } \ } \ catch( Catch::TestFailureException& ) { \ throw; \ } \ catch( exceptionType ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \ } /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_THROWS( expr, exceptionType, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ - INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \ + INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ - INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, stopOnFailure ) \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \ + INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \ catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), \ + resultDisposition | Catch::ResultDisposition::ContinueOnFailure, false ); \ } \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ - INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ); +#define INTERNAL_CATCH_MSG( reason, resultType, resultDisposition, macroName ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, resultDisposition, true ) \ + } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \ - INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, Catch::ResultDisposition::Normal ); \ Catch::ScopedInfo INTERNAL_CATCH_UNIQUE_NAME( info ); \ INTERNAL_CATCH_UNIQUE_NAME( info ) << log /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CHECK_THAT( arg, matcher, stopOnFailure, macroName ) \ +#define INTERNAL_CHECK_THAT( arg, matcher, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, false ); \ + INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, resultDisposition ); \ try { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::expressionResultBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::expressionResultBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), resultDisposition, false ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), false, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), \ + resultDisposition | Catch::ResultDisposition::ContinueOnFailure, false ); \ throw; \ } \ } while( Catch::isTrue( false ) ) @@ -3246,7 +3239,14 @@ namespace Catch { // subsequently wrapped lines virtual std::string optionDescription() const { return - "!TBD"; + "This option allows one or more tags or tag patterns to be specified.\n" + "Each tag is enclosed in square brackets. A series of tags form an AND expression " + "wheras a comma seperated sequence forms an OR expression. e.g.:\n\n" + " -g [one][two],[three]\n\n" + "This matches all tests tagged [one] and [two], as well as all tests tagged [three].\n\n" + "Tags can be negated with the ~ character. This removes matching tests from the set. e.g.:\n\n" + " -g [one]~[two]\n\n" + "matches all tests tagged [one], except those also tagged [two]"; } virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { @@ -3974,7 +3974,6 @@ namespace Catch { do { do { - m_assertionInfo.lineInfo = m_runningTest->getTestCaseInfo().getLineInfo(); runCurrentTest( redirectedCout, redirectedCerr ); } while( m_runningTest->hasUntestedSections() && !aborting() ); @@ -3996,28 +3995,23 @@ namespace Catch { private: // IResultCapture - virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) { - m_assertionInfo = assertionInfo; - } - virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) { - m_assertionInfo = assertionInfo; - m_currentResult = assertionResult; - return actOnCurrentResult(); + m_lastAssertionInfo = assertionInfo; + return actOnCurrentResult( assertionResult.buildResult( assertionInfo ) ); } virtual void testEnded( const AssertionResult& result ) { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } - else if( !result.ok() ) { + else if( !result.isOk() ) { m_totals.assertions.failed++; { std::vector::const_iterator it = m_scopedInfos.begin(); std::vector::const_iterator itEnd = m_scopedInfos.end(); for(; it != itEnd; ++it ) - m_reporter->Result( (*it)->buildResult( m_assertionInfo ) ); + m_reporter->Result( (*it)->buildResult( m_lastAssertionInfo ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); @@ -4047,7 +4041,8 @@ namespace Catch { if( !m_runningTest->addSection( oss.str() ) ) return false; - m_assertionInfo.lineInfo = lineInfo; + m_lastAssertionInfo.lineInfo = lineInfo; + m_reporter->StartSection( name, description ); assertions = m_totals.assertions; @@ -4098,16 +4093,13 @@ namespace Catch { private: - ResultAction::Value actOnCurrentResult() { - m_lastResult = m_currentResult.buildResult( m_assertionInfo ); + ResultAction::Value actOnCurrentResult( const AssertionResult& result ) { + m_lastResult = result; testEnded( m_lastResult ); - m_currentResult = ExpressionResultBuilder(); - m_assertionInfo = AssertionInfo(); - ResultAction::Value action = ResultAction::None; - if( !m_lastResult.ok() ) { + if( !m_lastResult.isOk() ) { action = ResultAction::Failed; if( shouldDebugBreak() ) action = (ResultAction::Value)( action | ResultAction::Debug ); @@ -4119,6 +4111,7 @@ namespace Catch { void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { try { + m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo(), "", ResultDisposition::Normal ); m_runningTest->reset(); Counts prevAssertions = m_totals.assertions; if( m_reporter->shouldRedirectStdout() ) { @@ -4142,10 +4135,9 @@ namespace Catch { // This just means the test was aborted due to failure } catch(...) { - m_currentResult - .setResultType( ResultWas::ThrewException ) - << translateActiveException(); - actOnCurrentResult(); + ExpressionResultBuilder exResult( ResultWas::ThrewException ); + exResult << translateActiveException(); + actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) ); } m_assertionResults.clear(); } @@ -4153,7 +4145,6 @@ namespace Catch { private: IMutableContext& m_context; RunningTest* m_runningTest; - ExpressionResultBuilder m_currentResult; AssertionResult m_lastResult; const Config& m_config; @@ -4164,7 +4155,7 @@ namespace Catch { IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; - AssertionInfo m_assertionInfo; + AssertionInfo m_lastAssertionInfo; }; } // end namespace Catch @@ -4519,22 +4510,37 @@ namespace Catch { TestFunction m_fun; }; + inline std::string extractClassName( const std::string& classOrQualifiedMethodName ) { + std::string className = classOrQualifiedMethodName; + if( className[0] == '&' ) + { + std::size_t lastColons = className.rfind( "::" ); + std::size_t penultimateColons = className.rfind( "::", lastColons-1 ); + if( penultimateColons == std::string::npos ) + penultimateColons = 1; + className = className.substr( penultimateColons, lastColons-penultimateColons ); + } + return className; + } + /////////////////////////////////////////////////////////////////////////// AutoReg::AutoReg( TestFunction function, const char* name, const char* description, const SourceLineInfo& lineInfo ) { - registerTestCase( new FreeFunctionTestCase( function ), name, description, lineInfo ); + registerTestCase( new FreeFunctionTestCase( function ), "global", name, description, lineInfo ); } AutoReg::~AutoReg() {} void AutoReg::registerTestCase( ITestCase* testCase, + const char* classOrQualifiedMethodName, const char* name, const char* description, const SourceLineInfo& lineInfo ) { - getMutableRegistryHub().registerTest( TestCaseInfo( testCase, name, description, lineInfo ) ); + + getMutableRegistryHub().registerTest( TestCaseInfo( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); } } // end namespace Catch @@ -4714,8 +4720,6 @@ namespace Catch { : m_lineInfo( lineInfo ) { std::ostringstream oss; oss << lineInfo << "function "; - if( !lineInfo.function.empty() ) - oss << lineInfo.function << " "; oss << "not implemented"; m_what = oss.str(); } @@ -5077,6 +5081,19 @@ namespace Catch { namespace Catch { + AssertionInfo::AssertionInfo( const std::string& _macroName, + const SourceLineInfo& _lineInfo, + const std::string& _capturedExpression, + ResultDisposition::Flags _resultDisposition ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + capturedExpression( _capturedExpression ), + resultDisposition( _resultDisposition ) + { + if( shouldNegate( resultDisposition ) ) + capturedExpression = "!" + _capturedExpression; + } + AssertionResult::AssertionResult() {} AssertionResult::AssertionResult( const AssertionInfo& info, const AssertionResultData& data ) @@ -5086,8 +5103,14 @@ namespace Catch { AssertionResult::~AssertionResult() {} - bool AssertionResult::ok() const { - return isOk( m_resultData.resultType ); + // Result was a success + bool AssertionResult::succeeded() const { + return Catch::isOk( m_resultData.resultType ); + } + + // Result was a success, or failure is suppressed + bool AssertionResult::isOk() const { + return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition ); } ResultWas::OfType AssertionResult::getResultType() const { @@ -5158,8 +5181,8 @@ namespace Catch { m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed; return *this; } - ExpressionResultBuilder& ExpressionResultBuilder::negate( bool shouldNegate ) { - m_exprComponents.shouldNegate = shouldNegate; + ExpressionResultBuilder& ExpressionResultBuilder::endExpression( ResultDisposition::Flags resultDisposition ) { + m_exprComponents.shouldNegate = shouldNegate( resultDisposition ); return *this; } ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { @@ -5221,10 +5244,12 @@ namespace Catch { namespace Catch { TestCaseInfo::TestCaseInfo( ITestCase* testCase, - const char* name, - const char* description, + const std::string& className, + const std::string& name, + const std::string& description, const SourceLineInfo& lineInfo ) : m_test( testCase ), + m_className( className ), m_name( name ), m_description( description ), m_lineInfo( lineInfo ), @@ -5237,6 +5262,7 @@ namespace Catch { TestCaseInfo::TestCaseInfo() : m_test( NULL ), + m_className(), m_name(), m_description(), m_isHidden( false ) @@ -5244,6 +5270,7 @@ namespace Catch { TestCaseInfo::TestCaseInfo( const TestCaseInfo& other, const std::string& name ) : m_test( other.m_test ), + m_className( other.m_className ), m_name( name ), m_description( other.m_description ), m_tags( other.m_tags ), @@ -5253,6 +5280,7 @@ namespace Catch { TestCaseInfo::TestCaseInfo( const TestCaseInfo& other ) : m_test( other.m_test ), + m_className( other.m_className ), m_name( other.m_name ), m_description( other.m_description ), m_tags( other.m_tags ), @@ -5264,14 +5292,15 @@ namespace Catch { m_test->invoke(); } + const std::string& TestCaseInfo::getClassName() const { + return m_className; + } const std::string& TestCaseInfo::getName() const { return m_name; } - const std::string& TestCaseInfo::getDescription() const { return m_description; } - const SourceLineInfo& TestCaseInfo::getLineInfo() const { return m_lineInfo; } @@ -5294,13 +5323,16 @@ namespace Catch { void TestCaseInfo::swap( TestCaseInfo& other ) { m_test.swap( other.m_test ); + m_className.swap( other.m_className ); m_name.swap( other.m_name ); m_description.swap( other.m_description ); - m_lineInfo.swap( other.m_lineInfo ); + std::swap( m_lineInfo, other.m_lineInfo ); } bool TestCaseInfo::operator == ( const TestCaseInfo& other ) const { - return m_test.get() == other.m_test.get() && m_name == other.m_name; + return m_test.get() == other.m_test.get() && + m_name == other.m_name && + m_className == other.m_className; } bool TestCaseInfo::operator < ( const TestCaseInfo& other ) const { @@ -5507,13 +5539,17 @@ namespace Catch { if( assertionResult.hasExpression() ) { TextColour colour( TextColour::OriginalExpression ); m_config.stream << assertionResult.getExpression(); - if( assertionResult.ok() ) { + if( assertionResult.succeeded() ) { TextColour successColour( TextColour::Success ); m_config.stream << " succeeded"; } else { TextColour errorColour( TextColour::Error ); m_config.stream << " failed"; + if( assertionResult.isOk() ) { + TextColour okAnywayColour( TextColour::Success ); + m_config.stream << " - but was ok"; + } } } switch( assertionResult.getResultType() ) { @@ -5560,13 +5596,17 @@ namespace Catch { case ResultWas::ExpressionFailed: case ResultWas::Exception: if( !assertionResult.hasExpression() ) { - if( assertionResult.ok() ) { + if( assertionResult.succeeded() ) { TextColour colour( TextColour::Success ); m_config.stream << " succeeded"; } else { TextColour colour( TextColour::Error ); m_config.stream << " failed"; + if( assertionResult.isOk() ) { + TextColour okAnywayColour( TextColour::Success ); + m_config.stream << " - but was ok"; + } } } break; @@ -5945,7 +5985,7 @@ namespace Catch { if( assertionResult.hasExpression() ) { m_xml.startElement( "Expression" ) - .writeAttribute( "success", assertionResult.ok() ) + .writeAttribute( "success", assertionResult.succeeded() ) .writeAttribute( "filename", assertionResult.getSourceInfo().file ) .writeAttribute( "line", assertionResult.getSourceInfo().line ); @@ -5953,7 +5993,7 @@ namespace Catch { .writeText( assertionResult.getExpression() ); m_xml.scopedElement( "Expanded" ) .writeText( assertionResult.getExpandedExpression() ); - m_currentTestSuccess &= assertionResult.ok(); + m_currentTestSuccess &= assertionResult.succeeded(); } switch( assertionResult.getResultType() ) { @@ -6022,7 +6062,10 @@ namespace Catch { struct TestCaseStats { - TestCaseStats( const std::string& name = std::string() ) :m_name( name ){} + TestCaseStats( const std::string& className, const std::string& name ) + : m_className( className ), + m_name( name ) + {} double m_timeInSeconds; std::string m_status; @@ -6090,7 +6133,7 @@ namespace Catch { virtual void EndSection( const std::string&, const Counts& ) {} virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) { - m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getName() ) ); + m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getClassName(), testInfo.getName() ) ); } virtual void Result( const Catch::AssertionResult& assertionResult ) { @@ -6307,31 +6350,32 @@ int main (int argc, char * const argv[]) { // If this config identifier is defined then all CATCH macros are prefixed with CATCH_ #ifdef CATCH_CONFIG_PREFIX_ALL -#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, false, true, "CATCH_REQUIRE" ) -#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, true, "CATCH_REQUIRE_FALSE" ) +#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) +#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::NegateResult, "CATCH_REQUIRE_FALSE" ) -#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., true, "CATCH_REQUIRE_THROWS" ) -#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, true, "CATCH_REQUIRE_THROWS_AS" ) -#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, true, "CATCH_REQUIRE_NOTHROW" ) +#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" ) +#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" ) +#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" ) -#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, false, false, "CATCH_CHECK" ) -#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, false, "CATCH_CHECK_FALSE" ) -#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, false, false, "CATCH_CHECKED_IF" ) -#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, false, false, "CATCH_CHECKED_ELSE" ) +#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) +#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::NegateResult, "CATCH_CHECK_FALSE" ) +#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) +#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) +#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" ) -#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., false, "CATCH_CHECK_THROWS" ) -#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, false, "CATCH_CHECK_THROWS_AS" ) -#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, false, "CATCH_CHECK_NOTHROW" ) +#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" ) +#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" ) +#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" ) -#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, false, "CATCH_CHECK_THAT" ) -#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, true, "CATCH_REQUIRE_THAT" ) +#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" ) +#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" ) -#define CATCH_INFO( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Info, false, "CATCH_INFO" ) -#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, false, "CATCH_WARN" ) -#define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, true, "CATCH_FAIL" ) -#define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, false, "CATCH_SUCCEED" ) +#define CATCH_INFO( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "CATCH_INFO" ) +#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "CATCH_WARN" ) +#define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL" ) +#define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED" ) #define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg, "CATCH_SCOPED_INFO" ) -#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, false, "CATCH_CAPTURE" ) +#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CAPTURE" ) #define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "CATCH_SCOPED_CAPTURE" ) #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) @@ -6345,38 +6389,35 @@ int main (int argc, char * const argv[]) { #define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) -/////////////// -// Still to be implemented -//#define CHECK_NOFAIL( expr ) // !TBD - reports violation, but doesn't fail Test - // If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required #else -#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, false, true, "REQUIRE" ) -#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, true, "REQUIRE_FALSE" ) +#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" ) +#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::NegateResult, "REQUIRE_FALSE" ) -#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., true, "REQUIRE_THROWS" ) -#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, true, "REQUIRE_THROWS_AS" ) -#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, true, "REQUIRE_NOTHROW" ) +#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) +#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" ) +#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) -#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, false, false, "CHECK" ) -#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, false, "CHECK_FALSE" ) -#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, false, false, "CHECKED_IF" ) -#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, false, false, "CHECKED_ELSE" ) +#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) +#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::NegateResult, "CHECK_FALSE" ) +#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) +#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) +#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) -#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., false, "CHECK_THROWS" ) -#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, false, "CHECK_THROWS_AS" ) -#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, false, "CHECK_NOTHROW" ) +#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) +#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" ) +#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) -#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, false, "CHECK_THAT" ) -#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, true, "REQUIRE_THAT" ) +#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" ) +#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" ) -#define INFO( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Info, false, "INFO" ) -#define WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, false, "WARN" ) -#define FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, true, "FAIL" ) -#define SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, false, "SUCCEED" ) +#define INFO( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "INFO" ) +#define WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "WARN" ) +#define FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL" ) +#define SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED" ) #define SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg, "SCOPED_INFO" ) -#define CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, false, "CAPTURE" ) +#define CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "CAPTURE" ) #define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "SCOPED_CAPTURE" ) #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) From fec10533e7d1e83649a5a2a23fa486695ec83121 Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Fri, 16 Nov 2012 10:47:33 +0100 Subject: [PATCH 9/9] Fix expression compile errors. --- include/internal/catch_expression_lhs.hpp | 2 +- single_include/catch.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/internal/catch_expression_lhs.hpp b/include/internal/catch_expression_lhs.hpp index 7ee8b2ef..edc5dd84 100644 --- a/include/internal/catch_expression_lhs.hpp +++ b/include/internal/catch_expression_lhs.hpp @@ -22,7 +22,7 @@ class ExpressionLhs { void operator = ( const ExpressionLhs& ); public: - ExpressionLhs( const T& lhs ) : m_lhs( lhs ) {} + ExpressionLhs( T lhs ) : m_lhs( lhs ) {} template ExpressionResultBuilder& operator == ( const RhsT& rhs ) { diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 16894691..dbca2e61 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -938,7 +938,7 @@ class ExpressionLhs { void operator = ( const ExpressionLhs& ); public: - ExpressionLhs( const T& lhs ) : m_lhs( lhs ) {} + ExpressionLhs( T lhs ) : m_lhs( lhs ) {} template ExpressionResultBuilder& operator == ( const RhsT& rhs ) {