From 175da3ef6454b6fa0465d22c96d21d58dd9d2f90 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 12 Oct 2012 18:39:22 +0100 Subject: [PATCH 001/296] regen test 3 --- single_include/catch.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index dca88476..32309c2f 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-12 18:39:11.086583 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. From d16955f63a4a128221da41602215b5592df39eb9 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 16 Oct 2012 08:27:21 +0100 Subject: [PATCH 002/296] Renamed ResultInfo -> AssertionResult --- include/internal/catch_capture.hpp | 4 +-- include/internal/catch_expression.hpp | 24 ++++++------- include/internal/catch_expression_builder.hpp | 4 +-- include/internal/catch_interfaces_capture.h | 10 +++--- include/internal/catch_interfaces_reporter.h | 28 +++++++++++---- include/internal/catch_resultinfo.h | 14 ++++---- include/internal/catch_resultinfo.hpp | 34 +++++++++---------- include/internal/catch_resultinfo_builder.h | 30 ++++++++-------- include/internal/catch_resultinfo_builder.hpp | 32 ++++++++--------- include/internal/catch_runner_impl.hpp | 18 +++++----- include/reporters/catch_reporter_basic.hpp | 2 +- include/reporters/catch_reporter_junit.hpp | 2 +- include/reporters/catch_reporter_xml.hpp | 2 +- projects/SelfTest/catch_self_test.cpp | 2 +- projects/SelfTest/catch_self_test.hpp | 2 +- 15 files changed, 111 insertions(+), 97 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 381c0dd0..2c1552e8 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -35,8 +35,8 @@ public: return *this; } - ResultInfo getInfo () const { - return ResultInfoBuilder() + AssertionResult getInfo () const { + return AssertionResultBuilder() .setResultType( ResultWas::Info ) .setMessage( m_oss.str() ) .setMacroName( "SCOPED_INFO" ) diff --git a/include/internal/catch_expression.hpp b/include/internal/catch_expression.hpp index 0fa0920c..33958f9a 100644 --- a/include/internal/catch_expression.hpp +++ b/include/internal/catch_expression.hpp @@ -18,50 +18,50 @@ class Expression { void operator = ( const Expression& ); public: - Expression( ResultInfoBuilder& result, T lhs ) + Expression( AssertionResultBuilder& result, T lhs ) : m_result( result.setLhs( Catch::toString( lhs ) ) ), m_lhs( lhs ) {} template - ResultInfoBuilder& operator == ( const RhsT& rhs ) { + AssertionResultBuilder& operator == ( const RhsT& rhs ) { return captureExpression( rhs ); } template - ResultInfoBuilder& operator != ( const RhsT& rhs ) { + AssertionResultBuilder& operator != ( const RhsT& rhs ) { return captureExpression( rhs ); } template - ResultInfoBuilder& operator < ( const RhsT& rhs ) { + AssertionResultBuilder& operator < ( const RhsT& rhs ) { return captureExpression( rhs ); } template - ResultInfoBuilder& operator > ( const RhsT& rhs ) { + AssertionResultBuilder& operator > ( const RhsT& rhs ) { return captureExpression( rhs ); } template - ResultInfoBuilder& operator <= ( const RhsT& rhs ) { + AssertionResultBuilder& operator <= ( const RhsT& rhs ) { return captureExpression( rhs ); } template - ResultInfoBuilder& operator >= ( const RhsT& rhs ) { + AssertionResultBuilder& operator >= ( const RhsT& rhs ) { return captureExpression( rhs ); } - ResultInfoBuilder& operator == ( bool rhs ) { + AssertionResultBuilder& operator == ( bool rhs ) { return captureExpression( rhs ); } - ResultInfoBuilder& operator != ( bool rhs ) { + AssertionResultBuilder& operator != ( bool rhs ) { return captureExpression( rhs ); } - operator ResultInfoBuilder& () { + operator AssertionResultBuilder& () { return m_result.setResultType( m_lhs ? ResultWas::Ok : ResultWas::ExpressionFailed ); } @@ -73,7 +73,7 @@ public: private: template - ResultInfoBuilder& captureExpression( const RhsT& rhs ) { + AssertionResultBuilder& captureExpression( const RhsT& rhs ) { return m_result .setResultType( Internal::compare( m_lhs, rhs ) ? ResultWas::Ok : ResultWas::ExpressionFailed ) .setRhs( Catch::toString( rhs ) ) @@ -81,7 +81,7 @@ private: } private: - ResultInfoBuilder& m_result; + AssertionResultBuilder& m_result; T m_lhs; }; diff --git a/include/internal/catch_expression_builder.hpp b/include/internal/catch_expression_builder.hpp index 86f68ecb..e04dcae6 100644 --- a/include/internal/catch_expression_builder.hpp +++ b/include/internal/catch_expression_builder.hpp @@ -87,13 +87,13 @@ public: return *this; } - operator ResultInfoBuilder&() { + operator AssertionResultBuilder&() { m_result.setMessage( m_messageStream.str() ); return m_result; } private: - ResultInfoBuilder m_result; + AssertionResultBuilder m_result; std::ostringstream m_messageStream; }; diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index 07b5ccd9..e8130a82 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -17,14 +17,14 @@ namespace Catch { class TestCaseInfo; class ScopedInfo; - class ResultInfoBuilder; - class ResultInfo; + class AssertionResultBuilder; + class AssertionResult; 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, @@ -36,11 +36,11 @@ namespace Catch { virtual ResultAction::Value acceptResult( bool result ) = 0; virtual ResultAction::Value acceptResult( ResultWas::OfType result ) = 0; - virtual ResultAction::Value acceptExpression( const ResultInfoBuilder& resultInfo ) = 0; + virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& resultInfo ) = 0; virtual void acceptMessage( const std::string& msg ) = 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_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_resultinfo.h b/include/internal/catch_resultinfo.h index db4e9e6e..f6d244f6 100644 --- a/include/internal/catch_resultinfo.h +++ b/include/internal/catch_resultinfo.h @@ -5,8 +5,8 @@ * 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 +#ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED #include #include "catch_result_type.h" @@ -25,11 +25,11 @@ namespace Catch { ResultWas::OfType resultType; }; - class ResultInfo { + class AssertionResult { public: - ResultInfo(); - ResultInfo( const ResultData& data ); - ~ResultInfo(); + AssertionResult(); + AssertionResult( const ResultData& data ); + ~AssertionResult(); bool ok() const; ResultWas::OfType getResultType() const; @@ -49,4 +49,4 @@ namespace Catch { } // end namespace Catch -#endif // TWOBLUECUBES_CATCH_RESULTINFO_H_INCLUDED +#endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED diff --git a/include/internal/catch_resultinfo.hpp b/include/internal/catch_resultinfo.hpp index b7ec8c2f..bc322983 100644 --- a/include/internal/catch_resultinfo.hpp +++ b/include/internal/catch_resultinfo.hpp @@ -5,63 +5,63 @@ * 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 +#ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED #include "catch_resultinfo.h" namespace Catch { - ResultInfo::ResultInfo() {} + AssertionResult::AssertionResult() {} - ResultInfo::ResultInfo( const ResultData& data ) : m_data( data ) {} + AssertionResult::AssertionResult( const ResultData& data ) : m_data( data ) {} - ResultInfo::~ResultInfo() {} + AssertionResult::~AssertionResult() {} - bool ResultInfo::ok() const { + bool AssertionResult::ok() const { return isOk( m_data.resultType ); } - ResultWas::OfType ResultInfo::getResultType() const { + ResultWas::OfType AssertionResult::getResultType() const { return m_data.resultType; } - bool ResultInfo::hasExpression() const { + bool AssertionResult::hasExpression() const { return !m_data.capturedExpression.empty(); } - bool ResultInfo::hasMessage() const { + bool AssertionResult::hasMessage() const { return !m_data.message.empty(); } - std::string ResultInfo::getExpression() const { + std::string AssertionResult::getExpression() const { return m_data.capturedExpression; } - bool ResultInfo::hasExpandedExpression() const { + bool AssertionResult::hasExpandedExpression() const { return hasExpression() && getExpandedExpression() != getExpression(); } - std::string ResultInfo::getExpandedExpression() const { + std::string AssertionResult::getExpandedExpression() const { return m_data.reconstructedExpression; } - std::string ResultInfo::getMessage() const { + std::string AssertionResult::getMessage() const { return m_data.message; } - std::string ResultInfo::getFilename() const { + std::string AssertionResult::getFilename() const { return m_data.lineInfo.file; } - std::size_t ResultInfo::getLine() const { + std::size_t AssertionResult::getLine() const { return m_data.lineInfo.line; } - std::string ResultInfo::getTestMacroName() const { + std::string AssertionResult::getTestMacroName() const { return m_data.macroName; } } // end namespace Catch -#endif // TWOBLUECUBES_CATCH_RESULTINFO_HPP_INCLUDED +#endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED diff --git a/include/internal/catch_resultinfo_builder.h b/include/internal/catch_resultinfo_builder.h index cf2014ec..d4c42918 100644 --- a/include/internal/catch_resultinfo_builder.h +++ b/include/internal/catch_resultinfo_builder.h @@ -5,8 +5,8 @@ * 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 +#ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_H_INCLUDED +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_H_INCLUDED #include "catch_tostring.hpp" #include "catch_resultinfo.h" @@ -18,24 +18,24 @@ namespace Catch { struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; -class ResultInfoBuilder { +class AssertionResultBuilder { public: - ResultInfoBuilder(); + AssertionResultBuilder(); - 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 ); + AssertionResultBuilder& setResultType( ResultWas::OfType result ); + AssertionResultBuilder& setCapturedExpression( const std::string& capturedExpression ); + AssertionResultBuilder& setIsFalse( bool isFalse ); + AssertionResultBuilder& setMessage( const std::string& message ); + AssertionResultBuilder& setLineInfo( const SourceLineInfo& lineInfo ); + AssertionResultBuilder& setLhs( const std::string& lhs ); + AssertionResultBuilder& setRhs( const std::string& rhs ); + AssertionResultBuilder& setOp( const std::string& op ); + AssertionResultBuilder& setMacroName( const std::string& macroName ); std::string reconstructExpression() const; - ResultInfo build() const; + AssertionResult build() const; // Disable attempts to use || and && in expressions (without parantheses) template @@ -55,4 +55,4 @@ private: } // end namespace Catch -#endif // TWOBLUECUBES_CATCH_RESULTINFO_BUILDER_H_INCLUDED +#endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_H_INCLUDED diff --git a/include/internal/catch_resultinfo_builder.hpp b/include/internal/catch_resultinfo_builder.hpp index 4da4d5d2..368abe0b 100644 --- a/include/internal/catch_resultinfo_builder.hpp +++ b/include/internal/catch_resultinfo_builder.hpp @@ -5,16 +5,16 @@ * 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 +#ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_HPP_INCLUDED #include "catch_resultinfo_builder.h" namespace Catch { - ResultInfoBuilder::ResultInfoBuilder() {} + AssertionResultBuilder::AssertionResultBuilder() {} - ResultInfoBuilder& ResultInfoBuilder::setResultType( ResultWas::OfType result ) { + AssertionResultBuilder& AssertionResultBuilder::setResultType( ResultWas::OfType result ) { // Flip bool results if isFalse is set if( m_isFalse && result == ResultWas::Ok ) m_data.resultType = ResultWas::ExpressionFailed; @@ -24,46 +24,46 @@ namespace Catch { m_data.resultType = result; return *this; } - ResultInfoBuilder& ResultInfoBuilder::setCapturedExpression( const std::string& capturedExpression ) { + AssertionResultBuilder& AssertionResultBuilder::setCapturedExpression( const std::string& capturedExpression ) { m_data.capturedExpression = capturedExpression; return *this; } - ResultInfoBuilder& ResultInfoBuilder::setIsFalse( bool isFalse ) { + AssertionResultBuilder& AssertionResultBuilder::setIsFalse( bool isFalse ) { m_isFalse = isFalse; return *this; } - ResultInfoBuilder& ResultInfoBuilder::setMessage( const std::string& message ) { + AssertionResultBuilder& AssertionResultBuilder::setMessage( const std::string& message ) { m_data.message = message; return *this; } - ResultInfoBuilder& ResultInfoBuilder::setLineInfo( const SourceLineInfo& lineInfo ) { + AssertionResultBuilder& AssertionResultBuilder::setLineInfo( const SourceLineInfo& lineInfo ) { m_data.lineInfo = lineInfo; return *this; } - ResultInfoBuilder& ResultInfoBuilder::setMacroName( const std::string& macroName ) { + AssertionResultBuilder& AssertionResultBuilder::setMacroName( const std::string& macroName ) { m_data.macroName = macroName; return *this; } - ResultInfoBuilder& ResultInfoBuilder::setLhs( const std::string& lhs ) { + AssertionResultBuilder& AssertionResultBuilder::setLhs( const std::string& lhs ) { m_lhs = lhs; return *this; } - ResultInfoBuilder& ResultInfoBuilder::setRhs( const std::string& rhs ) { + AssertionResultBuilder& AssertionResultBuilder::setRhs( const std::string& rhs ) { m_rhs = rhs; return *this; } - ResultInfoBuilder& ResultInfoBuilder::setOp( const std::string& op ) { + AssertionResultBuilder& AssertionResultBuilder::setOp( const std::string& op ) { m_op = op; return *this; } - ResultInfo ResultInfoBuilder::build() const + AssertionResult AssertionResultBuilder::build() const { ResultData data = m_data; data.reconstructedExpression = reconstructExpression(); @@ -77,10 +77,10 @@ namespace Catch { data.reconstructedExpression = "!(" + data.reconstructedExpression + ")"; } } - return ResultInfo( data ); + return AssertionResult( data ); } - std::string ResultInfoBuilder::reconstructExpression() const { + std::string AssertionResultBuilder::reconstructExpression() const { if( m_op == "" ) return m_lhs.empty() ? m_data.capturedExpression : m_op + m_lhs; else if( m_op == "matches" ) @@ -99,4 +99,4 @@ namespace Catch { } // end namespace Catch -#endif // TWOBLUECUBES_CATCH_RESULTINFO_BUILDER_HPP_INCLUDED +#endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_HPP_INCLUDED diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index ef446c3a..4c7f19ad 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -140,7 +140,7 @@ namespace Catch { return actOnCurrentResult(); } - virtual ResultAction::Value acceptExpression( const ResultInfoBuilder& resultInfo ) { + virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& resultInfo ) { m_currentResult = resultInfo; return actOnCurrentResult(); } @@ -149,7 +149,7 @@ namespace Catch { 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++; } @@ -163,8 +163,8 @@ namespace Catch { m_reporter->Result( (*it)->getInfo() ); } { - std::vector::const_iterator it = m_info.begin(); - std::vector::const_iterator itEnd = m_info.end(); + std::vector::const_iterator it = m_info.begin(); + std::vector::const_iterator itEnd = m_info.end(); for(; it != itEnd; ++it ) m_reporter->Result( *it ); } @@ -229,7 +229,7 @@ namespace Catch { : ""; } - virtual const ResultInfo* getLastResult() const { + virtual const AssertionResult* getLastResult() const { return &m_lastResult; } @@ -245,7 +245,7 @@ namespace Catch { m_lastResult = m_currentResult.build(); testEnded( m_lastResult ); - m_currentResult = ResultInfoBuilder(); + m_currentResult = AssertionResultBuilder(); ResultAction::Value action = ResultAction::None; @@ -293,14 +293,14 @@ namespace Catch { private: IMutableContext& m_context; RunningTest* m_runningTest; - ResultInfoBuilder m_currentResult; - ResultInfo m_lastResult; + AssertionResultBuilder 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_info; IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 2729510c..8a09606a 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -159,7 +159,7 @@ namespace Catch { m_sectionSpans.pop_back(); } - virtual void Result( const ResultInfo& resultInfo ) { + virtual void Result( const AssertionResult& resultInfo ) { if( !m_config.includeSuccessfulResults && resultInfo.getResultType() == ResultWas::Ok ) return; diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 4e66dddf..8e35e279 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -97,7 +97,7 @@ namespace Catch { m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getName() ) ); } - virtual void Result( const Catch::ResultInfo& resultInfo ) { + virtual void Result( const Catch::AssertionResult& resultInfo ) { if( resultInfo.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults ) { TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); TestStats stats; diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index 8329b95d..d74b591b 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -75,7 +75,7 @@ namespace Catch { m_currentTestSuccess = true; } - virtual void Result( const Catch::ResultInfo& resultInfo ) { + virtual void Result( const Catch::AssertionResult& resultInfo ) { if( !m_config.includeSuccessfulResults && resultInfo.getResultType() == ResultWas::Ok ) return; diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index 7e910cd4..58c064c6 100644 --- a/projects/SelfTest/catch_self_test.cpp +++ b/projects/SelfTest/catch_self_test.cpp @@ -31,7 +31,7 @@ namespace Catch{ return totals; } - void MockReporter::Result( const ResultInfo& resultInfo ) { + void MockReporter::Result( const AssertionResult& resultInfo ) { if( resultInfo.getResultType() == ResultWas::Ok ) return; diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index 93ba26ee..c0f9a271 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& resultInfo ); private: From c597a893fa95462b8d2d5029547d4054eda1839f Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 16 Oct 2012 08:31:05 +0100 Subject: [PATCH 003/296] ResultInfo -> AssertionResult filenames and variables --- ...h_resultinfo.h => catch_assertionresult.h} | 0 ...sultinfo.hpp => catch_assertionresult.hpp} | 2 +- ...lder.h => catch_assertionresult_builder.h} | 2 +- ....hpp => catch_assertionresult_builder.hpp} | 2 +- include/internal/catch_expression.hpp | 2 +- include/internal/catch_expression_builder.hpp | 4 +- include/internal/catch_impl.hpp | 4 +- include/internal/catch_interfaces_capture.h | 2 +- include/internal/catch_runner_impl.hpp | 4 +- include/reporters/catch_reporter_basic.hpp | 40 +++++++++---------- include/reporters/catch_reporter_junit.hpp | 16 ++++---- include/reporters/catch_reporter_xml.hpp | 34 ++++++++-------- projects/SelfTest/catch_self_test.cpp | 18 ++++----- projects/SelfTest/catch_self_test.hpp | 2 +- .../CatchSelfTest.xcodeproj/project.pbxproj | 16 ++++---- 15 files changed, 74 insertions(+), 74 deletions(-) rename include/internal/{catch_resultinfo.h => catch_assertionresult.h} (100%) rename include/internal/{catch_resultinfo.hpp => catch_assertionresult.hpp} (98%) rename include/internal/{catch_resultinfo_builder.h => catch_assertionresult_builder.h} (98%) rename include/internal/{catch_resultinfo_builder.hpp => catch_assertionresult_builder.hpp} (98%) diff --git a/include/internal/catch_resultinfo.h b/include/internal/catch_assertionresult.h similarity index 100% rename from include/internal/catch_resultinfo.h rename to include/internal/catch_assertionresult.h diff --git a/include/internal/catch_resultinfo.hpp b/include/internal/catch_assertionresult.hpp similarity index 98% rename from include/internal/catch_resultinfo.hpp rename to include/internal/catch_assertionresult.hpp index bc322983..20c25005 100644 --- a/include/internal/catch_resultinfo.hpp +++ b/include/internal/catch_assertionresult.hpp @@ -8,7 +8,7 @@ #ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED #define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED -#include "catch_resultinfo.h" +#include "catch_assertionresult.h" namespace Catch { diff --git a/include/internal/catch_resultinfo_builder.h b/include/internal/catch_assertionresult_builder.h similarity index 98% rename from include/internal/catch_resultinfo_builder.h rename to include/internal/catch_assertionresult_builder.h index d4c42918..9f1f2d82 100644 --- a/include/internal/catch_resultinfo_builder.h +++ b/include/internal/catch_assertionresult_builder.h @@ -9,7 +9,7 @@ #define TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_H_INCLUDED #include "catch_tostring.hpp" -#include "catch_resultinfo.h" +#include "catch_assertionresult.h" #include "catch_result_type.h" #include "catch_evaluate.hpp" #include "catch_common.h" diff --git a/include/internal/catch_resultinfo_builder.hpp b/include/internal/catch_assertionresult_builder.hpp similarity index 98% rename from include/internal/catch_resultinfo_builder.hpp rename to include/internal/catch_assertionresult_builder.hpp index 368abe0b..6e5af250 100644 --- a/include/internal/catch_resultinfo_builder.hpp +++ b/include/internal/catch_assertionresult_builder.hpp @@ -8,7 +8,7 @@ #ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_HPP_INCLUDED #define TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_HPP_INCLUDED -#include "catch_resultinfo_builder.h" +#include "catch_assertionresult_builder.h" namespace Catch { diff --git a/include/internal/catch_expression.hpp b/include/internal/catch_expression.hpp index 33958f9a..60aaa626 100644 --- a/include/internal/catch_expression.hpp +++ b/include/internal/catch_expression.hpp @@ -8,7 +8,7 @@ #ifndef TWOBLUECUBES_CATCH_EXPRESSION_HPP_INCLUDED #define TWOBLUECUBES_CATCH_EXPRESSION_HPP_INCLUDED -#include "catch_resultinfo_builder.h" +#include "catch_assertionresult_builder.h" #include "catch_evaluate.hpp" namespace Catch { diff --git a/include/internal/catch_expression_builder.hpp b/include/internal/catch_expression_builder.hpp index e04dcae6..b342ce20 100644 --- a/include/internal/catch_expression_builder.hpp +++ b/include/internal/catch_expression_builder.hpp @@ -9,9 +9,9 @@ #define TWOBLUECUBES_CATCH_EXPRESSION_BUILDER_HPP_INCLUDED #include "catch_expression.hpp" -#include "catch_resultinfo_builder.h" +#include "catch_assertionresult_builder.h" #include "catch_tostring.hpp" -#include "catch_resultinfo.h" +#include "catch_assertionresult.h" #include "catch_result_type.h" #include "catch_context.h" #include "catch_common.h" diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index b4c4662b..64099b5d 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_assertionresult_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 e8130a82..9477017b 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -36,7 +36,7 @@ namespace Catch { virtual ResultAction::Value acceptResult( bool result ) = 0; virtual ResultAction::Value acceptResult( ResultWas::OfType result ) = 0; - virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& resultInfo ) = 0; + virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) = 0; virtual void acceptMessage( const std::string& msg ) = 0; virtual std::string getCurrentTestName() const = 0; diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 4c7f19ad..449f2467 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -140,8 +140,8 @@ namespace Catch { return actOnCurrentResult(); } - virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& resultInfo ) { - m_currentResult = resultInfo; + virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) { + m_currentResult = assertionResult; return actOnCurrentResult(); } diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 8a09606a..48939163 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 AssertionResult& 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.getFilename().empty() ) { TextColour colour( TextColour::FileName ); - m_config.stream << SourceLineInfo( resultInfo.getFilename(), resultInfo.getLine() ); + m_config.stream << SourceLineInfo( assertionResult.getFilename(), assertionResult.getLine() ); } - 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,36 +182,36 @@ namespace Catch { m_config.stream << " failed"; } } - switch( resultInfo.getResultType() ) { + switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: { TextColour colour( TextColour::Error ); - if( resultInfo.hasExpression() ) + if( assertionResult.hasExpression() ) m_config.stream << " with unexpected"; else m_config.stream << "Unexpected"; - m_config.stream << " exception with message: '" << resultInfo.getMessage() << "'"; + m_config.stream << " exception with message: '" << assertionResult.getMessage() << "'"; } break; case ResultWas::DidntThrowException: { TextColour colour( TextColour::Error ); - if( resultInfo.hasExpression() ) + 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() ); + streamVariableLengthText( "info", assertionResult.getMessage() ); break; case ResultWas::Warning: - m_config.stream << "warning:\n'" << resultInfo.getMessage() << "'"; + m_config.stream << "warning:\n'" << assertionResult.getMessage() << "'"; break; case ResultWas::ExplicitFailure: { TextColour colour( TextColour::Error ); - m_config.stream << "failed with message: '" << resultInfo.getMessage() << "'"; + m_config.stream << "failed with message: '" << assertionResult.getMessage() << "'"; } break; case ResultWas::Unknown: // These cases are here to prevent compiler warnings @@ -219,8 +219,8 @@ namespace Catch { 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 +232,14 @@ 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 ) + 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; } diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 8e35e279..e811ab73 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::AssertionResult& 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 << SourceLineInfo( assertionResult.getFilename(), assertionResult.getLine() ); 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 d74b591b..78e658ca 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::AssertionResult& 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.getFilename() ) + .writeAttribute( "line", assertionResult.getLine() ); 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.getFilename() ) + .writeAttribute( "line", assertionResult.getLine() ) + .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/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index 58c064c6..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 AssertionResult& 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 c0f9a271..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 AssertionResult& 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..bf490fdf 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; path = catch_assertionresult.h; sourceTree = ""; }; 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; path = catch_assertionresult.hpp; sourceTree = ""; }; + 4A90B59E15D2521E00EF71BC /* catch_assertionresult_builder.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_assertionresult_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_assertionresult_builder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_assertionresult_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 = ""; }; @@ -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_assertionresult_builder.hpp */, 4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */, ); name = impl; @@ -288,8 +288,8 @@ 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_assertionresult_builder.h */, 4A6D0C5F149B3E3D00DB3EAA /* catch_section.hpp */, 4A3D7DD01503869D005F9203 /* catch_matchers.hpp */, 4A9D84B11558FC0400FBB209 /* catch_tostring.hpp */, From a5fa78284d6d95770cd647a2ec10df09d378ba46 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 16 Oct 2012 08:33:13 +0100 Subject: [PATCH 004/296] ResultData -> AssertionResultData --- include/internal/catch_assertionresult.h | 8 ++++---- include/internal/catch_assertionresult.hpp | 2 +- include/internal/catch_assertionresult_builder.h | 2 +- include/internal/catch_assertionresult_builder.hpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/internal/catch_assertionresult.h b/include/internal/catch_assertionresult.h index f6d244f6..f3256510 100644 --- a/include/internal/catch_assertionresult.h +++ b/include/internal/catch_assertionresult.h @@ -13,9 +13,9 @@ namespace Catch { - struct ResultData + struct AssertionResultData { - ResultData() : resultType( ResultWas::Unknown ) {} + AssertionResultData() : resultType( ResultWas::Unknown ) {} std::string macroName; SourceLineInfo lineInfo; @@ -28,7 +28,7 @@ namespace Catch { class AssertionResult { public: AssertionResult(); - AssertionResult( const ResultData& data ); + AssertionResult( const AssertionResultData& data ); ~AssertionResult(); bool ok() const; @@ -44,7 +44,7 @@ namespace Catch { std::string getTestMacroName() const; protected: - ResultData m_data; + AssertionResultData m_data; }; } // end namespace Catch diff --git a/include/internal/catch_assertionresult.hpp b/include/internal/catch_assertionresult.hpp index 20c25005..ba46adc2 100644 --- a/include/internal/catch_assertionresult.hpp +++ b/include/internal/catch_assertionresult.hpp @@ -14,7 +14,7 @@ namespace Catch { AssertionResult::AssertionResult() {} - AssertionResult::AssertionResult( const ResultData& data ) : m_data( data ) {} + AssertionResult::AssertionResult( const AssertionResultData& data ) : m_data( data ) {} AssertionResult::~AssertionResult() {} diff --git a/include/internal/catch_assertionresult_builder.h b/include/internal/catch_assertionresult_builder.h index 9f1f2d82..8987242c 100644 --- a/include/internal/catch_assertionresult_builder.h +++ b/include/internal/catch_assertionresult_builder.h @@ -48,7 +48,7 @@ public: } private: - ResultData m_data; + AssertionResultData m_data; std::string m_lhs, m_rhs, m_op; bool m_isFalse; }; diff --git a/include/internal/catch_assertionresult_builder.hpp b/include/internal/catch_assertionresult_builder.hpp index 6e5af250..1c34b918 100644 --- a/include/internal/catch_assertionresult_builder.hpp +++ b/include/internal/catch_assertionresult_builder.hpp @@ -65,7 +65,7 @@ namespace Catch { AssertionResult AssertionResultBuilder::build() const { - ResultData data = m_data; + AssertionResultData data = m_data; data.reconstructedExpression = reconstructExpression(); if( m_isFalse ) { if( m_op == "" ) { From c96f9330a095f527673de4d8db4f434d38a7e813 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 17 Oct 2012 08:14:22 +0100 Subject: [PATCH 005/296] Collect assertion info up front --- include/internal/catch_assertionresult.h | 14 +++++++ include/internal/catch_capture.hpp | 41 +++++++++++-------- include/internal/catch_expression_builder.hpp | 11 +---- include/internal/catch_interfaces_capture.h | 2 + .../internal/catch_interfaces_registry_hub.h | 2 + include/internal/catch_registry_hub.hpp | 4 ++ include/internal/catch_runner_impl.hpp | 10 +++++ 7 files changed, 59 insertions(+), 25 deletions(-) diff --git a/include/internal/catch_assertionresult.h b/include/internal/catch_assertionresult.h index f3256510..f1155ca1 100644 --- a/include/internal/catch_assertionresult.h +++ b/include/internal/catch_assertionresult.h @@ -13,6 +13,20 @@ namespace Catch { + struct AssertionInfo + { + AssertionInfo() {} + AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + capturedExpression( _capturedExpression ) + {} + + std::string macroName; + SourceLineInfo lineInfo; + std::string capturedExpression; + }; + struct AssertionResultData { AssertionResultData() : resultType( ResultWas::Unknown ) {} diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 2c1552e8..d734dd0d 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -13,20 +13,25 @@ #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(); + } + struct TestFailureException{}; class ScopedInfo { public: ScopedInfo() : m_oss() { - getCurrentContext().getResultCapture().pushScopedInfo( this ); + getResultCapture().pushScopedInfo( this ); } ~ScopedInfo() { - getCurrentContext().getResultCapture().popScopedInfo( this ); + getResultCapture().popScopedInfo( this ); } template @@ -49,12 +54,12 @@ private: // 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( Catch::ResultAction::Value internal_catch_action = Catch::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(); \ @@ -64,59 +69,62 @@ 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::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( 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 ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder() << Catch::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() ) + if( Catch::getResultCapture().getLastResult()->ok() ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_ELSE( expr, isFalse, stopOnFailure, macroName ) \ INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ); \ - if( !Catch::getCurrentContext().getResultCapture().getLastResult()->ok() ) + if( !Catch::getResultCapture().getLastResult()->ok() ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_NO_THROW( expr, stopOnFailure, macroName ) \ try { \ + Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder( CATCH_INTERNAL_LINEINFO, macroName, #expr ).setResultType( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder().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 ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder() << Catch::translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure, false ); \ } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ try { \ + Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ 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::ExpressionBuilder().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 ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder().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 ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder() << 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 ) ); + Catch::getResultCapture().acceptExpression( ( Catch::ExpressionBuilder() << reason ).setResultType( resultType ) ); /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log ) \ @@ -126,11 +134,12 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #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::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #arg " " #matcher ) ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder().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 ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder() << Catch::translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), false, false ); \ throw; \ }}while( Catch::isTrue( false ) ) diff --git a/include/internal/catch_expression_builder.hpp b/include/internal/catch_expression_builder.hpp index b342ce20..4016f9f4 100644 --- a/include/internal/catch_expression_builder.hpp +++ b/include/internal/catch_expression_builder.hpp @@ -22,17 +22,10 @@ namespace Catch { class ExpressionBuilder { public: - ExpressionBuilder( const SourceLineInfo& lineInfo, - const char* macroName, - const char* expr = "", - bool isFalse = false ) + ExpressionBuilder( bool isFalse = false ) : m_messageStream() { - m_result - .setCapturedExpression( expr ) - .setIsFalse( isFalse ) - .setLineInfo( lineInfo ) - .setMacroName( macroName ); + m_result.setIsFalse( isFalse ); } template diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index 9477017b..4915132c 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -19,6 +19,7 @@ namespace Catch { class ScopedInfo; class AssertionResultBuilder; class AssertionResult; + struct AssertionInfo; struct IResultCapture { @@ -34,6 +35,7 @@ namespace Catch { virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; virtual bool shouldDebugBreak() const = 0; + virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0; virtual ResultAction::Value acceptResult( bool result ) = 0; virtual ResultAction::Value acceptResult( ResultWas::OfType result ) = 0; virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) = 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_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_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 449f2467..d23bb55b 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -131,6 +131,9 @@ namespace Catch { private: // IResultCapture + virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) { + m_assertionInfo = assertionInfo; + } virtual ResultAction::Value acceptResult( bool result ) { return acceptResult( result ? ResultWas::Ok : ResultWas::ExpressionFailed ); } @@ -242,10 +245,16 @@ namespace Catch { private: ResultAction::Value actOnCurrentResult() { + m_currentResult + .setMacroName( m_assertionInfo.macroName ) + .setLineInfo( m_assertionInfo.lineInfo ) + .setCapturedExpression( m_assertionInfo.capturedExpression ); + m_lastResult = m_currentResult.build(); testEnded( m_lastResult ); m_currentResult = AssertionResultBuilder(); + m_assertionInfo = AssertionInfo(); ResultAction::Value action = ResultAction::None; @@ -304,6 +313,7 @@ namespace Catch { IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; + AssertionInfo m_assertionInfo; }; } // end namespace Catch From 3ad13256e1e50a6ee4a2697e7b6d0f669ae82ab5 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 18 Oct 2012 08:39:44 +0100 Subject: [PATCH 006/296] Refactored assertion builder stuff out of expression builder --- .../internal/catch_assertionresult_builder.h | 21 ++++-- .../catch_assertionresult_builder.hpp | 56 ++++++++------- include/internal/catch_capture.hpp | 69 ++++++++++++++----- include/internal/catch_expression_builder.hpp | 56 +-------------- include/internal/catch_interfaces_capture.h | 1 - include/internal/catch_runner_impl.hpp | 10 ++- 6 files changed, 102 insertions(+), 111 deletions(-) diff --git a/include/internal/catch_assertionresult_builder.h b/include/internal/catch_assertionresult_builder.h index 8987242c..3ef2f5fd 100644 --- a/include/internal/catch_assertionresult_builder.h +++ b/include/internal/catch_assertionresult_builder.h @@ -22,17 +22,24 @@ class AssertionResultBuilder { public: AssertionResultBuilder(); + AssertionResultBuilder( const AssertionResultBuilder& other ); + AssertionResultBuilder& operator=(const AssertionResultBuilder& other ); AssertionResultBuilder& setResultType( ResultWas::OfType result ); AssertionResultBuilder& setCapturedExpression( const std::string& capturedExpression ); AssertionResultBuilder& setIsFalse( bool isFalse ); - AssertionResultBuilder& setMessage( const std::string& message ); AssertionResultBuilder& setLineInfo( const SourceLineInfo& lineInfo ); AssertionResultBuilder& setLhs( const std::string& lhs ); AssertionResultBuilder& setRhs( const std::string& rhs ); AssertionResultBuilder& setOp( const std::string& op ); AssertionResultBuilder& setMacroName( const std::string& macroName ); + template + AssertionResultBuilder& operator << ( const T& value ) { + m_stream << value; + return *this; + } + std::string reconstructExpression() const; AssertionResult build() const; @@ -43,14 +50,14 @@ public: template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( const RhsT& ); - bool getIsFalse() const { - return m_isFalse; - } - private: AssertionResultData m_data; - std::string m_lhs, m_rhs, m_op; - bool m_isFalse; + struct ExprComponents { + ExprComponents() : isFalse( false ) {} + bool isFalse; + std::string lhs, rhs, op; + } m_exprComponents; + std::ostringstream m_stream; }; } // end namespace Catch diff --git a/include/internal/catch_assertionresult_builder.hpp b/include/internal/catch_assertionresult_builder.hpp index 1c34b918..dce5af7e 100644 --- a/include/internal/catch_assertionresult_builder.hpp +++ b/include/internal/catch_assertionresult_builder.hpp @@ -13,12 +13,26 @@ namespace Catch { AssertionResultBuilder::AssertionResultBuilder() {} + AssertionResultBuilder::AssertionResultBuilder( const AssertionResultBuilder& other ) + : m_data( other.m_data ), + m_exprComponents( other.m_exprComponents ) + { + m_stream << other.m_stream.str(); + } + + AssertionResultBuilder& AssertionResultBuilder::operator=(const AssertionResultBuilder& other ) { + m_data = other.m_data; + m_exprComponents = other.m_exprComponents; + m_stream.clear(); + m_stream << other.m_stream.str(); + return *this; + } AssertionResultBuilder& AssertionResultBuilder::setResultType( ResultWas::OfType result ) { // Flip bool results if isFalse is set - if( m_isFalse && result == ResultWas::Ok ) + if( m_exprComponents.isFalse && result == ResultWas::Ok ) m_data.resultType = ResultWas::ExpressionFailed; - else if( m_isFalse && result == ResultWas::ExpressionFailed ) + else if( m_exprComponents.isFalse && result == ResultWas::ExpressionFailed ) m_data.resultType = ResultWas::Ok; else m_data.resultType = result; @@ -29,12 +43,7 @@ namespace Catch { return *this; } AssertionResultBuilder& AssertionResultBuilder::setIsFalse( bool isFalse ) { - m_isFalse = isFalse; - return *this; - } - - AssertionResultBuilder& AssertionResultBuilder::setMessage( const std::string& message ) { - m_data.message = message; + m_exprComponents.isFalse = isFalse; return *this; } @@ -49,26 +58,27 @@ namespace Catch { } AssertionResultBuilder& AssertionResultBuilder::setLhs( const std::string& lhs ) { - m_lhs = lhs; + m_exprComponents.lhs = lhs; return *this; } AssertionResultBuilder& AssertionResultBuilder::setRhs( const std::string& rhs ) { - m_rhs = rhs; + m_exprComponents.rhs = rhs; return *this; } AssertionResultBuilder& AssertionResultBuilder::setOp( const std::string& op ) { - m_op = op; + m_exprComponents.op = op; return *this; } AssertionResult AssertionResultBuilder::build() const { AssertionResultData data = m_data; + data.message = m_stream.str(); data.reconstructedExpression = reconstructExpression(); - if( m_isFalse ) { - if( m_op == "" ) { + if( m_exprComponents.isFalse ) { + if( m_exprComponents.op == "" ) { data.capturedExpression = "!" + data.capturedExpression; data.reconstructedExpression = "!" + data.reconstructedExpression; } @@ -81,17 +91,17 @@ namespace Catch { } std::string AssertionResultBuilder::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; + if( m_exprComponents.op == "" ) + return m_exprComponents.lhs.empty() ? m_data.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_lhs + "\n" + m_op + "\n" + m_rhs + "\n\n"; + 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}"; diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index d734dd0d..c43c944f 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -9,6 +9,7 @@ #define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED #include "catch_expression_builder.hpp" +#include "catch_assertionresult_builder.h" #include "catch_interfaces_capture.h" #include "catch_debugger.hpp" #include "catch_context.h" @@ -22,11 +23,44 @@ namespace Catch { return getCurrentContext().getResultCapture(); } + template + AssertionResultBuilder assertionBuilderFromMatcher( const MatcherT& matcher, + const std::string& matcherCallAsString ) { + std::string matcherAsString = matcher.toString(); + if( matcherAsString == "{?}" ) + matcherAsString = matcherCallAsString; + return AssertionResultBuilder() + .setRhs( matcherAsString ) + .setOp( "matches" ); + } + + template + AssertionResultBuilder assertionBuilderFromMatcher( const MatcherT& matcher, + const ArgT& arg, + const std::string& matcherCallAsString ) { + return assertionBuilderFromMatcher( matcher, matcherCallAsString ) + .setLhs( Catch::toString( arg ) ) + .setResultType( matcher.match( arg ) ? ResultWas::Ok : ResultWas::ExpressionFailed ); + } + + template + AssertionResultBuilder assertionBuilderFromMatcher( const MatcherT& matcher, + ArgT* arg, + const std::string& matcherCallAsString ) { + return assertionBuilderFromMatcher( matcher, matcherCallAsString ) + .setLhs( Catch::toString( arg ) ) + .setResultType( matcher.match( arg ) ? ResultWas::Ok : ResultWas::ExpressionFailed ); + } + struct TestFailureException{}; class ScopedInfo { public: - ScopedInfo() : m_oss() { + ScopedInfo() { + m_resultBuilder + .setResultType( ResultWas::Info ) + .setMacroName( "SCOPED_INFO" ); + getResultCapture().pushScopedInfo( this ); } @@ -36,30 +70,27 @@ public: template ScopedInfo& operator << ( const T& value ) { - m_oss << value; + m_resultBuilder << value; return *this; } AssertionResult getInfo () const { - return AssertionResultBuilder() - .setResultType( ResultWas::Info ) - .setMessage( m_oss.str() ) - .setMacroName( "SCOPED_INFO" ) - .build(); + return m_resultBuilder.build(); } private: + AssertionResultBuilder m_resultBuilder; std::ostringstream m_oss; }; -// 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::getResultCapture().acceptExpression( expr ) ) { \ +#define INTERNAL_CATCH_ACCEPT_EXPR( evaluatedExpr, stopOnFailure, originalExpr ) \ + if( Catch::ResultAction::Value internal_catch_action = Catch::getResultCapture().acceptExpression( evaluatedExpr ) ) { \ 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(); \ @@ -74,7 +105,7 @@ inline bool isTrue( bool value ){ return value; } } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder() << Catch::translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), false, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), false, expr ); \ throw; \ } } while( Catch::isTrue( false ) ) @@ -93,10 +124,10 @@ inline bool isTrue( bool value ){ return value; } try { \ Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder().setResultType( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::Ok ), stopOnFailure, false ); \ } \ catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder() << Catch::translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), stopOnFailure, false ); \ } /////////////////////////////////////////////////////////////////////////////// @@ -105,26 +136,26 @@ inline bool isTrue( bool value ){ return value; } Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder().setResultType( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ } \ } \ catch( Catch::TestFailureException& ) { \ throw; \ } \ catch( exceptionType ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionBuilder().setResultType( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().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::getRegistryHub().getExceptionTranslatorRegistry() ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), stopOnFailure, false ); \ } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ - Catch::getResultCapture().acceptExpression( ( Catch::ExpressionBuilder() << reason ).setResultType( resultType ) ); + Catch::getResultCapture().acceptExpression( Catch::AssertionResultBuilder().setResultType( resultType ) << reason ); /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log ) \ @@ -135,11 +166,11 @@ inline bool isTrue( bool value ){ return value; } #define INTERNAL_CHECK_THAT( arg, matcher, stopOnFailure, macroName ) \ do { try { \ Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #arg " " #matcher ) ); \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder().acceptMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::assertionBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder() << Catch::translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), false, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), false, false ); \ throw; \ }}while( Catch::isTrue( false ) ) diff --git a/include/internal/catch_expression_builder.hpp b/include/internal/catch_expression_builder.hpp index 4016f9f4..deca8022 100644 --- a/include/internal/catch_expression_builder.hpp +++ b/include/internal/catch_expression_builder.hpp @@ -10,12 +10,6 @@ #include "catch_expression.hpp" #include "catch_assertionresult_builder.h" -#include "catch_tostring.hpp" -#include "catch_assertionresult.h" -#include "catch_result_type.h" -#include "catch_context.h" -#include "catch_common.h" -#include namespace Catch { @@ -23,7 +17,6 @@ class ExpressionBuilder { public: ExpressionBuilder( bool isFalse = false ) - : m_messageStream() { m_result.setIsFalse( isFalse ); } @@ -38,56 +31,9 @@ public: 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 AssertionResultBuilder&() { - m_result.setMessage( m_messageStream.str() ); - return m_result; - } - + private: AssertionResultBuilder m_result; - std::ostringstream m_messageStream; }; } // end namespace Catch diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index 4915132c..baf5b711 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -39,7 +39,6 @@ namespace Catch { virtual ResultAction::Value acceptResult( bool result ) = 0; virtual ResultAction::Value acceptResult( ResultWas::OfType result ) = 0; virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) = 0; - virtual void acceptMessage( const std::string& msg ) = 0; virtual std::string getCurrentTestName() const = 0; virtual const AssertionResult* getLastResult() const = 0; diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index d23bb55b..048a988b 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -148,10 +148,6 @@ namespace Catch { return actOnCurrentResult(); } - virtual void acceptMessage( const std::string& msg ) { - m_currentResult.setMessage( msg ); - } - virtual void testEnded( const AssertionResult& result ) { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; @@ -293,8 +289,10 @@ 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(); } From e3b111a39a4edd3bfe4d88290c99c723b8b74417 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 18 Oct 2012 22:59:16 +0100 Subject: [PATCH 007/296] streamlined acceptResult --- include/internal/catch_capture.hpp | 2 +- include/internal/catch_interfaces_capture.h | 2 -- include/internal/catch_runner_impl.hpp | 10 +--------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index c43c944f..7c731727 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -155,7 +155,7 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ - Catch::getResultCapture().acceptExpression( Catch::AssertionResultBuilder().setResultType( resultType ) << reason ); + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( resultType ) << reason, stopOnFailure, true ); /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log ) \ diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index baf5b711..56790cb4 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -36,8 +36,6 @@ namespace Catch { virtual bool shouldDebugBreak() const = 0; virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0; - virtual ResultAction::Value acceptResult( bool result ) = 0; - virtual ResultAction::Value acceptResult( ResultWas::OfType result ) = 0; virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) = 0; virtual std::string getCurrentTestName() const = 0; diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 048a988b..05275f14 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -134,15 +134,7 @@ namespace Catch { virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) { m_assertionInfo = assertionInfo; } - virtual ResultAction::Value acceptResult( bool result ) { - return acceptResult( result ? ResultWas::Ok : ResultWas::ExpressionFailed ); - } - - virtual ResultAction::Value acceptResult( ResultWas::OfType result ) { - m_currentResult.setResultType( result ); - return actOnCurrentResult(); - } - + virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) { m_currentResult = assertionResult; return actOnCurrentResult(); From f2d5f1b3e444055ff02ed0536d5d0610b08ecb9f Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 19 Oct 2012 08:01:05 +0100 Subject: [PATCH 008/296] Expression has its own result builder - not passed in from expression builder --- include/internal/catch_expression.hpp | 17 +++++++++-------- include/internal/catch_expression_builder.hpp | 14 ++------------ 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/include/internal/catch_expression.hpp b/include/internal/catch_expression.hpp index 60aaa626..aa8d0b42 100644 --- a/include/internal/catch_expression.hpp +++ b/include/internal/catch_expression.hpp @@ -18,10 +18,9 @@ class Expression { void operator = ( const Expression& ); public: - Expression( AssertionResultBuilder& result, T lhs ) - : m_result( result.setLhs( Catch::toString( lhs ) ) ), - m_lhs( lhs ) - {} + Expression( T lhs ) : m_lhs( lhs ) { + m_result.setLhs( Catch::toString( lhs ) ); + } template AssertionResultBuilder& operator == ( const RhsT& rhs ) { @@ -61,10 +60,12 @@ public: return captureExpression( rhs ); } - operator AssertionResultBuilder& () { - return m_result.setResultType( m_lhs ? ResultWas::Ok : ResultWas::ExpressionFailed ); + AssertionResultBuilder setIsFalse( bool isFalse ) { + return m_result + .setResultType( m_lhs ? ResultWas::Ok : ResultWas::ExpressionFailed ) + .setIsFalse( isFalse ); } - + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( const RhsT& ); @@ -81,7 +82,7 @@ private: } private: - AssertionResultBuilder& m_result; + AssertionResultBuilder m_result; T m_lhs; }; diff --git a/include/internal/catch_expression_builder.hpp b/include/internal/catch_expression_builder.hpp index deca8022..a3282b95 100644 --- a/include/internal/catch_expression_builder.hpp +++ b/include/internal/catch_expression_builder.hpp @@ -16,24 +16,14 @@ namespace Catch { class ExpressionBuilder { public: - ExpressionBuilder( bool isFalse = false ) - { - m_result.setIsFalse( isFalse ); - } - template Expression operator->* ( const T & operand ) { - Expression expr( m_result, operand ); - return expr; + return Expression( operand ); } Expression operator->* ( bool value ) { - Expression expr( m_result, value ); - return expr; + return Expression( value ); } - -private: - AssertionResultBuilder m_result; }; } // end namespace Catch From 1dd56d4d2b29520cdd62f5f449a28e67f954f5db Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 19 Oct 2012 08:01:34 +0100 Subject: [PATCH 009/296] AssertionResultBuilder can be constructed from result type --- .../internal/catch_assertionresult_builder.h | 2 +- .../catch_assertionresult_builder.hpp | 32 +++++++++---------- include/internal/catch_capture.hpp | 18 +++++------ 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/include/internal/catch_assertionresult_builder.h b/include/internal/catch_assertionresult_builder.h index 3ef2f5fd..986e2079 100644 --- a/include/internal/catch_assertionresult_builder.h +++ b/include/internal/catch_assertionresult_builder.h @@ -21,7 +21,7 @@ struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; class AssertionResultBuilder { public: - AssertionResultBuilder(); + AssertionResultBuilder( ResultWas::OfType resultType = ResultWas::Unknown ); AssertionResultBuilder( const AssertionResultBuilder& other ); AssertionResultBuilder& operator=(const AssertionResultBuilder& other ); diff --git a/include/internal/catch_assertionresult_builder.hpp b/include/internal/catch_assertionresult_builder.hpp index dce5af7e..f8d91e0d 100644 --- a/include/internal/catch_assertionresult_builder.hpp +++ b/include/internal/catch_assertionresult_builder.hpp @@ -10,16 +10,19 @@ #include "catch_assertionresult_builder.h" +#include + namespace Catch { - AssertionResultBuilder::AssertionResultBuilder() {} + AssertionResultBuilder::AssertionResultBuilder( ResultWas::OfType resultType ) { + m_data.resultType = resultType; + } AssertionResultBuilder::AssertionResultBuilder( const AssertionResultBuilder& other ) : m_data( other.m_data ), m_exprComponents( other.m_exprComponents ) { m_stream << other.m_stream.str(); } - AssertionResultBuilder& AssertionResultBuilder::operator=(const AssertionResultBuilder& other ) { m_data = other.m_data; m_exprComponents = other.m_exprComponents; @@ -27,15 +30,8 @@ namespace Catch { m_stream << other.m_stream.str(); return *this; } - AssertionResultBuilder& AssertionResultBuilder::setResultType( ResultWas::OfType result ) { - // Flip bool results if isFalse is set - if( m_exprComponents.isFalse && result == ResultWas::Ok ) - m_data.resultType = ResultWas::ExpressionFailed; - else if( m_exprComponents.isFalse && result == ResultWas::ExpressionFailed ) - m_data.resultType = ResultWas::Ok; - else - m_data.resultType = result; + m_data.resultType = result; return *this; } AssertionResultBuilder& AssertionResultBuilder::setCapturedExpression( const std::string& capturedExpression ) { @@ -46,35 +42,38 @@ namespace Catch { m_exprComponents.isFalse = isFalse; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setLineInfo( const SourceLineInfo& lineInfo ) { m_data.lineInfo = lineInfo; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setMacroName( const std::string& macroName ) { m_data.macroName = macroName; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setLhs( const std::string& lhs ) { m_exprComponents.lhs = lhs; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setRhs( const std::string& rhs ) { m_exprComponents.rhs = rhs; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setOp( const std::string& op ) { m_exprComponents.op = op; return *this; } - AssertionResult AssertionResultBuilder::build() const { + assert( m_data.resultType != ResultWas::Unknown ); + AssertionResultData data = m_data; + + // Flip bool results if isFalse is set + if( m_exprComponents.isFalse && data.resultType == ResultWas::Ok ) + data.resultType = ResultWas::ExpressionFailed; + else if( m_exprComponents.isFalse && data.resultType == ResultWas::ExpressionFailed ) + data.resultType = ResultWas::Ok; + data.message = m_stream.str(); data.reconstructedExpression = reconstructExpression(); if( m_exprComponents.isFalse ) { @@ -89,7 +88,6 @@ namespace Catch { } return AssertionResult( data ); } - std::string AssertionResultBuilder::reconstructExpression() const { if( m_exprComponents.op == "" ) return m_exprComponents.lhs.empty() ? m_data.capturedExpression : m_exprComponents.op + m_exprComponents.lhs; diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 7c731727..c3a1c535 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -101,11 +101,11 @@ inline bool isTrue( bool value ){ return value; } #define INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ) \ do { try { \ Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder( isFalse )->*expr ), stopOnFailure, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder()->*expr ).setIsFalse( isFalse ), stopOnFailure, expr ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), false, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), false, expr ); \ throw; \ } } while( Catch::isTrue( false ) ) @@ -124,10 +124,10 @@ inline bool isTrue( bool value ){ return value; } try { \ Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ } \ catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), stopOnFailure, false ); \ } /////////////////////////////////////////////////////////////////////////////// @@ -136,26 +136,26 @@ inline bool isTrue( bool value ){ return value; } Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ } \ } \ catch( Catch::TestFailureException& ) { \ throw; \ } \ catch( exceptionType ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( 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::AssertionResultBuilder().setResultType( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::AssertionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), stopOnFailure, false ); \ } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( resultType ) << reason, stopOnFailure, true ); + INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( resultType ) << reason, stopOnFailure, true ); /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log ) \ @@ -170,7 +170,7 @@ inline bool isTrue( bool value ){ return value; } } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::AssertionResultBuilder().setResultType( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), false, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::AssertionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), false, false ); \ throw; \ }}while( Catch::isTrue( false ) ) From e04e74f896c714de1f03a9cc006bcd071318ea11 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 24 Oct 2012 21:59:47 +0100 Subject: [PATCH 010/296] More AssertionResult refactoring --- include/catch.hpp | 8 ++-- include/internal/catch_assertionresult.h | 18 ++++---- include/internal/catch_assertionresult.hpp | 30 ++++++------- .../internal/catch_assertionresult_builder.h | 15 +++---- .../catch_assertionresult_builder.hpp | 44 +++++++----------- include/internal/catch_capture.hpp | 45 +++++++++---------- include/internal/catch_common.h | 3 ++ include/internal/catch_expression.hpp | 17 ++++--- include/internal/catch_runner_impl.hpp | 13 ++---- include/reporters/catch_reporter_basic.hpp | 4 +- include/reporters/catch_reporter_junit.hpp | 2 +- include/reporters/catch_reporter_xml.hpp | 8 ++-- 12 files changed, 95 insertions(+), 112 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index dc66cf00..a045f123 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -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 index f1155ca1..b3baff2e 100644 --- a/include/internal/catch_assertionresult.h +++ b/include/internal/catch_assertionresult.h @@ -16,11 +16,14 @@ namespace Catch { struct AssertionInfo { AssertionInfo() {} - AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression ) + 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; @@ -31,9 +34,6 @@ namespace Catch { { AssertionResultData() : resultType( ResultWas::Unknown ) {} - std::string macroName; - SourceLineInfo lineInfo; - std::string capturedExpression; std::string reconstructedExpression; std::string message; ResultWas::OfType resultType; @@ -42,7 +42,7 @@ namespace Catch { class AssertionResult { public: AssertionResult(); - AssertionResult( const AssertionResultData& data ); + AssertionResult( const AssertionInfo& info, const AssertionResultData& data ); ~AssertionResult(); bool ok() const; @@ -53,12 +53,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: - AssertionResultData m_data; + AssertionInfo m_info; + AssertionResultData m_resultData; }; } // end namespace Catch diff --git a/include/internal/catch_assertionresult.hpp b/include/internal/catch_assertionresult.hpp index ba46adc2..f1ef9d18 100644 --- a/include/internal/catch_assertionresult.hpp +++ b/include/internal/catch_assertionresult.hpp @@ -14,28 +14,31 @@ namespace Catch { AssertionResult::AssertionResult() {} - AssertionResult::AssertionResult( const AssertionResultData& data ) : m_data( data ) {} + AssertionResult::AssertionResult( const AssertionInfo& info, const AssertionResultData& data ) + : m_info( info ), + m_resultData( data ) + {} AssertionResult::~AssertionResult() {} bool AssertionResult::ok() const { - return isOk( m_data.resultType ); + return isOk( m_resultData.resultType ); } ResultWas::OfType AssertionResult::getResultType() const { - return m_data.resultType; + return m_resultData.resultType; } bool AssertionResult::hasExpression() const { - return !m_data.capturedExpression.empty(); + return !m_info.capturedExpression.empty(); } bool AssertionResult::hasMessage() const { - return !m_data.message.empty(); + return !m_resultData.message.empty(); } std::string AssertionResult::getExpression() const { - return m_data.capturedExpression; + return m_info.capturedExpression; } bool AssertionResult::hasExpandedExpression() const { @@ -43,23 +46,18 @@ namespace Catch { } std::string AssertionResult::getExpandedExpression() const { - return m_data.reconstructedExpression; + return m_resultData.reconstructedExpression; } std::string AssertionResult::getMessage() const { - return m_data.message; + return m_resultData.message; } - - std::string AssertionResult::getFilename() const { - return m_data.lineInfo.file; - } - - std::size_t AssertionResult::getLine() const { - return m_data.lineInfo.line; + SourceLineInfo AssertionResult::getSourceInfo() const { + return m_info.lineInfo; } std::string AssertionResult::getTestMacroName() const { - return m_data.macroName; + return m_info.macroName; } } // end namespace Catch diff --git a/include/internal/catch_assertionresult_builder.h b/include/internal/catch_assertionresult_builder.h index 986e2079..fa53c25a 100644 --- a/include/internal/catch_assertionresult_builder.h +++ b/include/internal/catch_assertionresult_builder.h @@ -26,13 +26,12 @@ public: AssertionResultBuilder& operator=(const AssertionResultBuilder& other ); AssertionResultBuilder& setResultType( ResultWas::OfType result ); - AssertionResultBuilder& setCapturedExpression( const std::string& capturedExpression ); - AssertionResultBuilder& setIsFalse( bool isFalse ); - AssertionResultBuilder& setLineInfo( const SourceLineInfo& lineInfo ); + AssertionResultBuilder& setResultType( bool result ); AssertionResultBuilder& setLhs( const std::string& lhs ); AssertionResultBuilder& setRhs( const std::string& rhs ); AssertionResultBuilder& setOp( const std::string& op ); - AssertionResultBuilder& setMacroName( const std::string& macroName ); + + AssertionResultBuilder& negate( bool shouldNegate ); template AssertionResultBuilder& operator << ( const T& value ) { @@ -40,9 +39,9 @@ public: return *this; } - std::string reconstructExpression() const; + std::string reconstructExpression( const AssertionInfo& info ) const; - AssertionResult build() const; + AssertionResultData build( const AssertionInfo& info ) const; // Disable attempts to use || and && in expressions (without parantheses) template @@ -53,8 +52,8 @@ public: private: AssertionResultData m_data; struct ExprComponents { - ExprComponents() : isFalse( false ) {} - bool isFalse; + ExprComponents() : shouldNegate( false ) {} + bool shouldNegate; std::string lhs, rhs, op; } m_exprComponents; std::ostringstream m_stream; diff --git a/include/internal/catch_assertionresult_builder.hpp b/include/internal/catch_assertionresult_builder.hpp index f8d91e0d..2b03036f 100644 --- a/include/internal/catch_assertionresult_builder.hpp +++ b/include/internal/catch_assertionresult_builder.hpp @@ -34,20 +34,12 @@ namespace Catch { m_data.resultType = result; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setCapturedExpression( const std::string& capturedExpression ) { - m_data.capturedExpression = capturedExpression; + AssertionResultBuilder& AssertionResultBuilder::setResultType( bool result ) { + m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setIsFalse( bool isFalse ) { - m_exprComponents.isFalse = isFalse; - return *this; - } - AssertionResultBuilder& AssertionResultBuilder::setLineInfo( const SourceLineInfo& lineInfo ) { - m_data.lineInfo = lineInfo; - return *this; - } - AssertionResultBuilder& AssertionResultBuilder::setMacroName( const std::string& macroName ) { - m_data.macroName = macroName; + AssertionResultBuilder& AssertionResultBuilder::negate( bool shouldNegate ) { + m_exprComponents.shouldNegate = shouldNegate; return *this; } AssertionResultBuilder& AssertionResultBuilder::setLhs( const std::string& lhs ) { @@ -62,35 +54,31 @@ namespace Catch { m_exprComponents.op = op; return *this; } - AssertionResult AssertionResultBuilder::build() const + AssertionResultData AssertionResultBuilder::build( const AssertionInfo& info ) const { assert( m_data.resultType != ResultWas::Unknown ); AssertionResultData data = m_data; - // Flip bool results if isFalse is set - if( m_exprComponents.isFalse && data.resultType == ResultWas::Ok ) + // Flip bool results if shouldNegate is set + if( m_exprComponents.shouldNegate && data.resultType == ResultWas::Ok ) data.resultType = ResultWas::ExpressionFailed; - else if( m_exprComponents.isFalse && 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(); - if( m_exprComponents.isFalse ) { - if( m_exprComponents.op == "" ) { - data.capturedExpression = "!" + data.capturedExpression; + data.reconstructedExpression = reconstructExpression( info ); + if( m_exprComponents.shouldNegate ) { + if( m_exprComponents.op == "" ) data.reconstructedExpression = "!" + data.reconstructedExpression; - } - else { - data.capturedExpression = "!(" + data.capturedExpression + ")"; + else data.reconstructedExpression = "!(" + data.reconstructedExpression + ")"; - } } - return AssertionResult( data ); + return data; } - std::string AssertionResultBuilder::reconstructExpression() const { + std::string AssertionResultBuilder::reconstructExpression( const AssertionInfo& info ) const { if( m_exprComponents.op == "" ) - return m_exprComponents.lhs.empty() ? m_data.capturedExpression : m_exprComponents.op + m_exprComponents.lhs; + 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 != "!" ) { @@ -102,7 +90,7 @@ namespace Catch { 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 diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index c3a1c535..a1726f39 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -40,7 +40,7 @@ namespace Catch { const std::string& matcherCallAsString ) { return assertionBuilderFromMatcher( matcher, matcherCallAsString ) .setLhs( Catch::toString( arg ) ) - .setResultType( matcher.match( arg ) ? ResultWas::Ok : ResultWas::ExpressionFailed ); + .setResultType( matcher.match( arg ) ); } template @@ -49,38 +49,30 @@ namespace Catch { const std::string& matcherCallAsString ) { return assertionBuilderFromMatcher( matcher, matcherCallAsString ) .setLhs( Catch::toString( arg ) ) - .setResultType( matcher.match( arg ) ? ResultWas::Ok : ResultWas::ExpressionFailed ); + .setResultType( matcher.match( arg ) ); } struct TestFailureException{}; class ScopedInfo { public: - ScopedInfo() { - m_resultBuilder - .setResultType( ResultWas::Info ) - .setMacroName( "SCOPED_INFO" ); - + ScopedInfo() : m_resultBuilder( ResultWas::Info ) { getResultCapture().pushScopedInfo( this ); } - ~ScopedInfo() { getResultCapture().popScopedInfo( this ); } - template ScopedInfo& operator << ( const T& value ) { m_resultBuilder << value; return *this; } - - AssertionResult getInfo () const { - return m_resultBuilder.build(); + AssertionResultData getInfo () const { + return m_resultBuilder.build( AssertionInfo() ); // !TBD } private: AssertionResultBuilder m_resultBuilder; - std::ostringstream m_oss; }; // This is just here to avoid compiler warnings with macro constants and boolean literals @@ -98,10 +90,14 @@ inline bool isTrue( bool value ){ return value; } } /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, shouldNegate ) \ + Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr, shouldNegate ) ); + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \ do { try { \ - Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder()->*expr ).setIsFalse( isFalse ), stopOnFailure, expr ); \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder()->*expr ).negate( shouldNegate ), stopOnFailure, expr ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ @@ -110,19 +106,19 @@ inline bool isTrue( bool value ){ return value; } } } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_IF( expr, isFalse, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ); \ +#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, isFalse, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, isFalse, stopOnFailure, macroName ); \ +#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 { \ - Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ expr; \ INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ } \ @@ -133,7 +129,7 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ try { \ - Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr ) ); \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ expr; \ INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ @@ -158,14 +154,15 @@ inline bool isTrue( bool value ){ return value; } INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( 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 { \ - Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #arg " " #matcher ) ); \ + INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, false ) \ INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::assertionBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ } catch( Catch::TestFailureException& ) { \ throw; \ 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_expression.hpp b/include/internal/catch_expression.hpp index aa8d0b42..38b32d90 100644 --- a/include/internal/catch_expression.hpp +++ b/include/internal/catch_expression.hpp @@ -13,15 +13,20 @@ namespace Catch { + template + inline void setResultIfBoolean( AssertionResultBuilder&, const T& ) {} + inline void setResultIfBoolean( AssertionResultBuilder& result, bool value ) { + result.setResultType( value ); + } template class Expression { void operator = ( const Expression& ); public: Expression( T lhs ) : m_lhs( lhs ) { - m_result.setLhs( Catch::toString( lhs ) ); + setResultIfBoolean( m_result.setLhs( Catch::toString( lhs ) ), lhs ); } - + template AssertionResultBuilder& operator == ( const RhsT& rhs ) { return captureExpression( rhs ); @@ -60,10 +65,8 @@ public: return captureExpression( rhs ); } - AssertionResultBuilder setIsFalse( bool isFalse ) { - return m_result - .setResultType( m_lhs ? ResultWas::Ok : ResultWas::ExpressionFailed ) - .setIsFalse( isFalse ); + AssertionResultBuilder negate( bool shouldNegate ) { + return m_result.negate( shouldNegate ); } template @@ -76,7 +79,7 @@ private: template AssertionResultBuilder& captureExpression( const RhsT& rhs ) { return m_result - .setResultType( Internal::compare( m_lhs, rhs ) ? ResultWas::Ok : ResultWas::ExpressionFailed ) + .setResultType( Internal::compare( m_lhs, rhs ) ) .setRhs( Catch::toString( rhs ) ) .setOp( Internal::OperatorTraits::getName() ); } diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 05275f14..603aeb0d 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() ); @@ -151,7 +151,7 @@ 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( AssertionResult( m_assertionInfo, (*it)->getInfo() ) ); } { std::vector::const_iterator it = m_info.begin(); @@ -181,7 +181,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; @@ -233,12 +233,7 @@ namespace Catch { private: ResultAction::Value actOnCurrentResult() { - m_currentResult - .setMacroName( m_assertionInfo.macroName ) - .setLineInfo( m_assertionInfo.lineInfo ) - .setCapturedExpression( m_assertionInfo.capturedExpression ); - - m_lastResult = m_currentResult.build(); + m_lastResult = AssertionResult( m_assertionInfo, m_currentResult.build( m_assertionInfo ) ); testEnded( m_lastResult ); m_currentResult = AssertionResultBuilder(); diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 48939163..a8585e3f 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -165,9 +165,9 @@ namespace Catch { startSpansLazily(); - if( !assertionResult.getFilename().empty() ) { + if( !assertionResult.getSourceInfo().empty() ) { TextColour colour( TextColour::FileName ); - m_config.stream << SourceLineInfo( assertionResult.getFilename(), assertionResult.getLine() ); + m_config.stream << assertionResult.getSourceInfo(); } if( assertionResult.hasExpression() ) { diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index e811ab73..99e6ed04 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -104,7 +104,7 @@ namespace Catch { std::ostringstream oss; if( !assertionResult.getMessage().empty() ) oss << assertionResult.getMessage() << " at "; - oss << SourceLineInfo( assertionResult.getFilename(), assertionResult.getLine() ); + oss << assertionResult.getSourceInfo(); stats.m_content = oss.str(); stats.m_message = assertionResult.getExpandedExpression(); stats.m_resultType = assertionResult.getTestMacroName(); diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index 78e658ca..f2af6992 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -82,8 +82,8 @@ namespace Catch { if( assertionResult.hasExpression() ) { m_xml.startElement( "Expression" ) .writeAttribute( "success", assertionResult.ok() ) - .writeAttribute( "filename", assertionResult.getFilename() ) - .writeAttribute( "line", assertionResult.getLine() ); + .writeAttribute( "filename", assertionResult.getSourceInfo().file ) + .writeAttribute( "line", assertionResult.getSourceInfo().line ); m_xml.scopedElement( "Original" ) .writeText( assertionResult.getExpression() ); @@ -95,8 +95,8 @@ namespace Catch { switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: m_xml.scopedElement( "Exception" ) - .writeAttribute( "filename", assertionResult.getFilename() ) - .writeAttribute( "line", assertionResult.getLine() ) + .writeAttribute( "filename", assertionResult.getSourceInfo().file ) + .writeAttribute( "line", assertionResult.getSourceInfo().line ) .writeText( assertionResult.getMessage() ); m_currentTestSuccess = false; break; From 8cca2f13699aa6aa5cd4a60e293f49a1bae54629 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 24 Oct 2012 22:09:01 +0100 Subject: [PATCH 011/296] ExpressionBuilder ->ExpressionDecomposer Expression -> ExpressionLhs --- include/internal/catch_capture.hpp | 4 +-- include/internal/catch_expression_builder.hpp | 31 ------------------- .../internal/catch_expression_decomposer.hpp | 31 +++++++++++++++++++ ...xpression.hpp => catch_expression_lhs.hpp} | 6 ++-- .../CatchSelfTest.xcodeproj/project.pbxproj | 8 ++--- 5 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 include/internal/catch_expression_builder.hpp create mode 100644 include/internal/catch_expression_decomposer.hpp rename include/internal/{catch_expression.hpp => catch_expression_lhs.hpp} (96%) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index a1726f39..73ecc425 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -8,7 +8,7 @@ #ifndef TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED #define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED -#include "catch_expression_builder.hpp" +#include "catch_expression_decomposer.hpp" #include "catch_assertionresult_builder.h" #include "catch_interfaces_capture.h" #include "catch_debugger.hpp" @@ -97,7 +97,7 @@ inline bool isTrue( bool value ){ return value; } #define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \ do { try { \ INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder()->*expr ).negate( shouldNegate ), stopOnFailure, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).negate( shouldNegate ), stopOnFailure, expr ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ diff --git a/include/internal/catch_expression_builder.hpp b/include/internal/catch_expression_builder.hpp deleted file mode 100644 index a3282b95..00000000 --- a/include/internal/catch_expression_builder.hpp +++ /dev/null @@ -1,31 +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_assertionresult_builder.h" - -namespace Catch { - -class ExpressionBuilder { -public: - - template - Expression operator->* ( const T & operand ) { - return Expression( operand ); - } - - Expression operator->* ( bool value ) { - return Expression( value ); - } -}; - -} // 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..9dbd9833 --- /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" +#include "catch_assertionresult_builder.h" + +namespace Catch { + +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.hpp b/include/internal/catch_expression_lhs.hpp similarity index 96% rename from include/internal/catch_expression.hpp rename to include/internal/catch_expression_lhs.hpp index 38b32d90..7d2cc733 100644 --- a/include/internal/catch_expression.hpp +++ b/include/internal/catch_expression_lhs.hpp @@ -19,11 +19,11 @@ namespace Catch { result.setResultType( value ); } template -class Expression { - void operator = ( const Expression& ); +class ExpressionLhs { + void operator = ( const ExpressionLhs& ); public: - Expression( T lhs ) : m_lhs( lhs ) { + ExpressionLhs( T lhs ) : m_lhs( lhs ) { setResultIfBoolean( m_result.setLhs( Catch::toString( lhs ) ), lhs ); } diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index bf490fdf..68507bd1 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -134,8 +134,8 @@ 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 = ""; }; 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 = ""; }; @@ -295,8 +295,8 @@ 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; From f847186ebbf0e7eeabd99925574c8988add600fb Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 26 Oct 2012 08:45:23 +0100 Subject: [PATCH 012/296] AssertionResultBuilder -> ExpressionResultBuilder --- include/internal/catch_capture.hpp | 44 ++++++++--------- .../internal/catch_expression_decomposer.hpp | 1 - include/internal/catch_expression_lhs.hpp | 47 ++++++++++--------- ...der.h => catch_expressionresult_builder.h} | 30 +++++------- ...hpp => catch_expressionresult_builder.hpp} | 30 ++++++------ include/internal/catch_impl.hpp | 2 +- include/internal/catch_interfaces_capture.h | 4 +- include/internal/catch_runner_impl.hpp | 6 +-- .../CatchSelfTest.xcodeproj/project.pbxproj | 8 ++-- 9 files changed, 83 insertions(+), 89 deletions(-) rename include/internal/{catch_assertionresult_builder.h => catch_expressionresult_builder.h} (50%) rename include/internal/{catch_assertionresult_builder.hpp => catch_expressionresult_builder.hpp} (71%) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 73ecc425..e724cd43 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -9,7 +9,7 @@ #define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED #include "catch_expression_decomposer.hpp" -#include "catch_assertionresult_builder.h" +#include "catch_expressionresult_builder.h" #include "catch_interfaces_capture.h" #include "catch_debugger.hpp" #include "catch_context.h" @@ -24,30 +24,30 @@ namespace Catch { } template - AssertionResultBuilder assertionBuilderFromMatcher( const MatcherT& matcher, - const std::string& matcherCallAsString ) { + ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, + const std::string& matcherCallAsString ) { std::string matcherAsString = matcher.toString(); if( matcherAsString == "{?}" ) matcherAsString = matcherCallAsString; - return AssertionResultBuilder() + return ExpressionResultBuilder() .setRhs( matcherAsString ) .setOp( "matches" ); } template - AssertionResultBuilder assertionBuilderFromMatcher( const MatcherT& matcher, - const ArgT& arg, - const std::string& matcherCallAsString ) { - return assertionBuilderFromMatcher( matcher, matcherCallAsString ) + 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 - AssertionResultBuilder assertionBuilderFromMatcher( const MatcherT& matcher, - ArgT* arg, - const std::string& matcherCallAsString ) { - return assertionBuilderFromMatcher( matcher, matcherCallAsString ) + ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, + ArgT* arg, + const std::string& matcherCallAsString ) { + return expressionResultBuilderFromMatcher( matcher, matcherCallAsString ) .setLhs( Catch::toString( arg ) ) .setResultType( matcher.match( arg ) ); } @@ -72,7 +72,7 @@ public: } private: - AssertionResultBuilder m_resultBuilder; + ExpressionResultBuilder m_resultBuilder; }; // This is just here to avoid compiler warnings with macro constants and boolean literals @@ -101,7 +101,7 @@ inline bool isTrue( bool value ){ return value; } } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), false, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), false, expr ); \ throw; \ } } while( Catch::isTrue( false ) ) @@ -120,10 +120,10 @@ inline bool isTrue( bool value ){ return value; } try { \ INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ } \ catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), stopOnFailure, false ); \ } /////////////////////////////////////////////////////////////////////////////// @@ -132,26 +132,26 @@ inline bool isTrue( bool value ){ return value; } INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ expr; \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( 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::AssertionResultBuilder( Catch::ResultWas::Ok ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( 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::AssertionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), stopOnFailure, false ); \ } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder( resultType ) << reason, stopOnFailure, true ); + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ); /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \ @@ -163,11 +163,11 @@ inline bool isTrue( bool value ){ return value; } #define INTERNAL_CHECK_THAT( arg, matcher, stopOnFailure, macroName ) \ do { try { \ INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, false ) \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::assertionBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::expressionResultBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), stopOnFailure, false ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::AssertionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), false, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), false, false ); \ throw; \ }}while( Catch::isTrue( false ) ) diff --git a/include/internal/catch_expression_decomposer.hpp b/include/internal/catch_expression_decomposer.hpp index 9dbd9833..3df9c25e 100644 --- a/include/internal/catch_expression_decomposer.hpp +++ b/include/internal/catch_expression_decomposer.hpp @@ -9,7 +9,6 @@ #define TWOBLUECUBES_CATCH_EXPRESSION_DECOMPOSER_HPP_INCLUDED #include "catch_expression_lhs.hpp" -#include "catch_assertionresult_builder.h" namespace Catch { diff --git a/include/internal/catch_expression_lhs.hpp b/include/internal/catch_expression_lhs.hpp index 7d2cc733..d85579d1 100644 --- a/include/internal/catch_expression_lhs.hpp +++ b/include/internal/catch_expression_lhs.hpp @@ -5,17 +5,19 @@ * 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 +#ifndef TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED -#include "catch_assertionresult_builder.h" +#include "catch_expressionresult_builder.h" #include "catch_evaluate.hpp" namespace Catch { + struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; + template - inline void setResultIfBoolean( AssertionResultBuilder&, const T& ) {} - inline void setResultIfBoolean( AssertionResultBuilder& result, bool value ) { + inline void setResultIfBoolean( ExpressionResultBuilder&, const T& ) {} + inline void setResultIfBoolean( ExpressionResultBuilder& result, bool value ) { result.setResultType( value ); } template @@ -28,56 +30,57 @@ public: } template - AssertionResultBuilder& operator == ( const RhsT& rhs ) { + ExpressionResultBuilder& operator == ( const RhsT& rhs ) { return captureExpression( rhs ); } template - AssertionResultBuilder& operator != ( const RhsT& rhs ) { + ExpressionResultBuilder& operator != ( const RhsT& rhs ) { return captureExpression( rhs ); } template - AssertionResultBuilder& operator < ( const RhsT& rhs ) { + ExpressionResultBuilder& operator < ( const RhsT& rhs ) { return captureExpression( rhs ); } template - AssertionResultBuilder& operator > ( const RhsT& rhs ) { + ExpressionResultBuilder& operator > ( const RhsT& rhs ) { return captureExpression( rhs ); } template - AssertionResultBuilder& operator <= ( const RhsT& rhs ) { + ExpressionResultBuilder& operator <= ( const RhsT& rhs ) { return captureExpression( rhs ); } template - AssertionResultBuilder& operator >= ( const RhsT& rhs ) { + ExpressionResultBuilder& operator >= ( const RhsT& rhs ) { return captureExpression( rhs ); } - AssertionResultBuilder& operator == ( bool rhs ) { + ExpressionResultBuilder& operator == ( bool rhs ) { return captureExpression( rhs ); } - AssertionResultBuilder& operator != ( bool rhs ) { + ExpressionResultBuilder& operator != ( bool rhs ) { return captureExpression( rhs ); } - AssertionResultBuilder negate( bool shouldNegate ) { + ExpressionResultBuilder negate( bool shouldNegate ) { return m_result.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 - AssertionResultBuilder& captureExpression( const RhsT& rhs ) { + ExpressionResultBuilder& captureExpression( const RhsT& rhs ) { return m_result .setResultType( Internal::compare( m_lhs, rhs ) ) .setRhs( Catch::toString( rhs ) ) @@ -85,10 +88,10 @@ private: } private: - AssertionResultBuilder m_result; + ExpressionResultBuilder m_result; T m_lhs; }; } // end namespace Catch -#endif // TWOBLUECUBES_CATCH_EXPRESSION_HPP_INCLUDED +#endif // TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED diff --git a/include/internal/catch_assertionresult_builder.h b/include/internal/catch_expressionresult_builder.h similarity index 50% rename from include/internal/catch_assertionresult_builder.h rename to include/internal/catch_expressionresult_builder.h index fa53c25a..5c63b3ee 100644 --- a/include/internal/catch_assertionresult_builder.h +++ b/include/internal/catch_expressionresult_builder.h @@ -15,26 +15,24 @@ #include "catch_common.h" namespace Catch { - -struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; -class AssertionResultBuilder { +class ExpressionResultBuilder { public: - AssertionResultBuilder( ResultWas::OfType resultType = ResultWas::Unknown ); - AssertionResultBuilder( const AssertionResultBuilder& other ); - AssertionResultBuilder& operator=(const AssertionResultBuilder& other ); + ExpressionResultBuilder( ResultWas::OfType resultType = ResultWas::Unknown ); + ExpressionResultBuilder( const ExpressionResultBuilder& other ); + ExpressionResultBuilder& operator=(const ExpressionResultBuilder& other ); - AssertionResultBuilder& setResultType( ResultWas::OfType result ); - AssertionResultBuilder& setResultType( bool result ); - AssertionResultBuilder& setLhs( const std::string& lhs ); - AssertionResultBuilder& setRhs( const std::string& rhs ); - AssertionResultBuilder& setOp( const std::string& op ); + 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 ); - AssertionResultBuilder& negate( bool shouldNegate ); + ExpressionResultBuilder& negate( bool shouldNegate ); template - AssertionResultBuilder& operator << ( const T& value ) { + ExpressionResultBuilder& operator << ( const T& value ) { m_stream << value; return *this; } @@ -43,12 +41,6 @@ public: AssertionResultData build( const AssertionInfo& info ) 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& ); - private: AssertionResultData m_data; struct ExprComponents { diff --git a/include/internal/catch_assertionresult_builder.hpp b/include/internal/catch_expressionresult_builder.hpp similarity index 71% rename from include/internal/catch_assertionresult_builder.hpp rename to include/internal/catch_expressionresult_builder.hpp index 2b03036f..ecaeddf6 100644 --- a/include/internal/catch_assertionresult_builder.hpp +++ b/include/internal/catch_expressionresult_builder.hpp @@ -5,56 +5,56 @@ * 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_HPP_INCLUDED -#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_HPP_INCLUDED +#ifndef TWOBLUECUBES_CATCH_EXPRESSIONRESULT_BUILDER_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_EXPRESSIONRESULT_BUILDER_HPP_INCLUDED -#include "catch_assertionresult_builder.h" +#include "catch_expressionresult_builder.h" #include namespace Catch { - AssertionResultBuilder::AssertionResultBuilder( ResultWas::OfType resultType ) { + ExpressionResultBuilder::ExpressionResultBuilder( ResultWas::OfType resultType ) { m_data.resultType = resultType; } - AssertionResultBuilder::AssertionResultBuilder( const AssertionResultBuilder& other ) + ExpressionResultBuilder::ExpressionResultBuilder( const ExpressionResultBuilder& other ) : m_data( other.m_data ), m_exprComponents( other.m_exprComponents ) { m_stream << other.m_stream.str(); } - AssertionResultBuilder& AssertionResultBuilder::operator=(const AssertionResultBuilder& other ) { + ExpressionResultBuilder& ExpressionResultBuilder::operator=(const ExpressionResultBuilder& other ) { m_data = other.m_data; m_exprComponents = other.m_exprComponents; m_stream.clear(); m_stream << other.m_stream.str(); return *this; } - AssertionResultBuilder& AssertionResultBuilder::setResultType( ResultWas::OfType result ) { + ExpressionResultBuilder& ExpressionResultBuilder::setResultType( ResultWas::OfType result ) { m_data.resultType = result; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setResultType( bool result ) { + ExpressionResultBuilder& ExpressionResultBuilder::setResultType( bool result ) { m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed; return *this; } - AssertionResultBuilder& AssertionResultBuilder::negate( bool shouldNegate ) { + ExpressionResultBuilder& ExpressionResultBuilder::negate( bool shouldNegate ) { m_exprComponents.shouldNegate = shouldNegate; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setLhs( const std::string& lhs ) { + ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { m_exprComponents.lhs = lhs; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setRhs( const std::string& rhs ) { + ExpressionResultBuilder& ExpressionResultBuilder::setRhs( const std::string& rhs ) { m_exprComponents.rhs = rhs; return *this; } - AssertionResultBuilder& AssertionResultBuilder::setOp( const std::string& op ) { + ExpressionResultBuilder& ExpressionResultBuilder::setOp( const std::string& op ) { m_exprComponents.op = op; return *this; } - AssertionResultData AssertionResultBuilder::build( const AssertionInfo& info ) const + AssertionResultData ExpressionResultBuilder::build( const AssertionInfo& info ) const { assert( m_data.resultType != ResultWas::Unknown ); @@ -76,7 +76,7 @@ namespace Catch { } return data; } - std::string AssertionResultBuilder::reconstructExpression( const AssertionInfo& info ) const { + 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" ) @@ -95,4 +95,4 @@ namespace Catch { } // end namespace Catch -#endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_HPP_INCLUDED +#endif // TWOBLUECUBES_CATCH_EXPRESSIONRESULT_BUILDER_HPP_INCLUDED diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 64099b5d..8bbae1c1 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -23,7 +23,7 @@ #include "catch_console_colour_impl.hpp" #include "catch_generators_impl.hpp" #include "catch_assertionresult.hpp" -#include "catch_assertionresult_builder.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 56790cb4..db5765ca 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -17,7 +17,7 @@ namespace Catch { class TestCaseInfo; class ScopedInfo; - class AssertionResultBuilder; + class ExpressionResultBuilder; class AssertionResult; struct AssertionInfo; @@ -36,7 +36,7 @@ namespace Catch { virtual bool shouldDebugBreak() const = 0; virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0; - virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) = 0; + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult ) = 0; virtual std::string getCurrentTestName() const = 0; virtual const AssertionResult* getLastResult() const = 0; diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 603aeb0d..489bc5d7 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -135,7 +135,7 @@ namespace Catch { m_assertionInfo = assertionInfo; } - virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) { + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult ) { m_currentResult = assertionResult; return actOnCurrentResult(); } @@ -236,7 +236,7 @@ namespace Catch { m_lastResult = AssertionResult( m_assertionInfo, m_currentResult.build( m_assertionInfo ) ); testEnded( m_lastResult ); - m_currentResult = AssertionResultBuilder(); + m_currentResult = ExpressionResultBuilder(); m_assertionInfo = AssertionInfo(); ResultAction::Value action = ResultAction::None; @@ -287,7 +287,7 @@ namespace Catch { private: IMutableContext& m_context; RunningTest* m_runningTest; - AssertionResultBuilder m_currentResult; + ExpressionResultBuilder m_currentResult; AssertionResult m_lastResult; const Config& m_config; diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 68507bd1..168b721b 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -121,9 +121,9 @@ 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_assertionresult.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_assertionresult.hpp; sourceTree = ""; }; - 4A90B59E15D2521E00EF71BC /* catch_assertionresult_builder.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_assertionresult_builder.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_assertionresult_builder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_assertionresult_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 = ""; }; @@ -276,7 +276,7 @@ 4AB1C73514F97BDA00F31DF7 /* catch_console_colour_impl.hpp */, 4A4B0F9B15CEF8C400AE2392 /* catch_notimplemented_exception.hpp */, 4A90B59D15D24FE900EF71BC /* catch_assertionresult.hpp */, - 4A90B59E15D2521E00EF71BC /* catch_assertionresult_builder.hpp */, + 4A90B59E15D2521E00EF71BC /* catch_expressionresult_builder.hpp */, 4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */, ); name = impl; @@ -289,7 +289,7 @@ 4A6D0C4F149B3E3D00DB3EAA /* catch_generators.hpp */, 4A6D0C5C149B3E3D00DB3EAA /* catch_result_type.h */, 4A6D0C5D149B3E3D00DB3EAA /* catch_assertionresult.h */, - 4A9D84B315599AC900FBB209 /* catch_assertionresult_builder.h */, + 4A9D84B315599AC900FBB209 /* catch_expressionresult_builder.h */, 4A6D0C5F149B3E3D00DB3EAA /* catch_section.hpp */, 4A3D7DD01503869D005F9203 /* catch_matchers.hpp */, 4A9D84B11558FC0400FBB209 /* catch_tostring.hpp */, From 355b5e546d2f64dd0abbc0134dd3579ce6c28cea Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 26 Oct 2012 09:05:36 +0100 Subject: [PATCH 013/296] Some tidy-up --- include/internal/catch_capture.hpp | 4 ++-- include/internal/catch_expression_decomposer.hpp | 3 ++- include/internal/catch_expression_lhs.hpp | 5 ++++- .../internal/catch_expressionresult_builder.h | 6 ++++-- .../internal/catch_expressionresult_builder.hpp | 4 ++-- include/internal/catch_runner_impl.hpp | 16 ++++++++-------- .../CatchSelfTest.xcodeproj/project.pbxproj | 6 +++--- 7 files changed, 25 insertions(+), 19 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index e724cd43..43452dd7 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -67,8 +67,8 @@ public: m_resultBuilder << value; return *this; } - AssertionResultData getInfo () const { - return m_resultBuilder.build( AssertionInfo() ); // !TBD + AssertionResult buildResult( const AssertionInfo& assertionInfo ) const { + return m_resultBuilder.buildResult( assertionInfo ); } private: diff --git a/include/internal/catch_expression_decomposer.hpp b/include/internal/catch_expression_decomposer.hpp index 3df9c25e..1d8ca73d 100644 --- a/include/internal/catch_expression_decomposer.hpp +++ b/include/internal/catch_expression_decomposer.hpp @@ -11,7 +11,8 @@ #include "catch_expression_lhs.hpp" namespace Catch { - + +// Captures the LHS of the expression and wraps it in an Expression Lhs object class ExpressionDecomposer { public: diff --git a/include/internal/catch_expression_lhs.hpp b/include/internal/catch_expression_lhs.hpp index d85579d1..f7c4fb14 100644 --- a/include/internal/catch_expression_lhs.hpp +++ b/include/internal/catch_expression_lhs.hpp @@ -20,6 +20,9 @@ namespace Catch { inline void setResultIfBoolean( ExpressionResultBuilder& result, bool value ) { result.setResultType( value ); } + +// 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& ); @@ -67,7 +70,7 @@ public: return captureExpression( rhs ); } - ExpressionResultBuilder negate( bool shouldNegate ) { + ExpressionResultBuilder& negate( bool shouldNegate ) { return m_result.negate( shouldNegate ); } diff --git a/include/internal/catch_expressionresult_builder.h b/include/internal/catch_expressionresult_builder.h index 5c63b3ee..23b84646 100644 --- a/include/internal/catch_expressionresult_builder.h +++ b/include/internal/catch_expressionresult_builder.h @@ -15,7 +15,9 @@ #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: @@ -39,7 +41,7 @@ public: std::string reconstructExpression( const AssertionInfo& info ) const; - AssertionResultData build( const AssertionInfo& info ) const; + AssertionResult buildResult( const AssertionInfo& info ) const; private: AssertionResultData m_data; diff --git a/include/internal/catch_expressionresult_builder.hpp b/include/internal/catch_expressionresult_builder.hpp index ecaeddf6..69471289 100644 --- a/include/internal/catch_expressionresult_builder.hpp +++ b/include/internal/catch_expressionresult_builder.hpp @@ -54,7 +54,7 @@ namespace Catch { m_exprComponents.op = op; return *this; } - AssertionResultData ExpressionResultBuilder::build( const AssertionInfo& info ) const + AssertionResult ExpressionResultBuilder::buildResult( const AssertionInfo& info ) const { assert( m_data.resultType != ResultWas::Unknown ); @@ -74,7 +74,7 @@ namespace Catch { else data.reconstructedExpression = "!(" + data.reconstructedExpression + ")"; } - return data; + return AssertionResult( info, data ); } std::string ExpressionResultBuilder::reconstructExpression( const AssertionInfo& info ) const { if( m_exprComponents.op == "" ) diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 489bc5d7..1bae7f66 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -151,19 +151,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( AssertionResult( m_assertionInfo, (*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 ); } @@ -233,7 +233,7 @@ namespace Catch { private: ResultAction::Value actOnCurrentResult() { - m_lastResult = AssertionResult( m_assertionInfo, m_currentResult.build( m_assertionInfo ) ); + m_lastResult = m_currentResult.buildResult( m_assertionInfo ); testEnded( m_lastResult ); m_currentResult = ExpressionResultBuilder(); @@ -281,7 +281,7 @@ namespace Catch { << translateActiveException(); actOnCurrentResult(); } - m_info.clear(); + m_assertionResults.clear(); } private: @@ -294,7 +294,7 @@ namespace Catch { 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; diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 168b721b..94250631 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_assertionresult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_assertionresult.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,7 +120,7 @@ 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_assertionresult.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_assertionresult.hpp; sourceTree = ""; }; + 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_expressionresult_builder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_expressionresult_builder.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -132,7 +132,7 @@ 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_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; }; From fe1d7c1d08f06c0a83b727e9b2e00cc49e74175d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 28 Oct 2012 10:27:44 +0000 Subject: [PATCH 014/296] Small fixes and tweaks --- include/internal/catch_capture.hpp | 2 +- include/internal/catch_expressionresult_builder.hpp | 2 +- include/reporters/catch_reporter_basic.hpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 43452dd7..7d15b908 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -91,7 +91,7 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, shouldNegate ) \ - Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr, shouldNegate ) ); + Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, expr, shouldNegate ) ); /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \ diff --git a/include/internal/catch_expressionresult_builder.hpp b/include/internal/catch_expressionresult_builder.hpp index 69471289..0c0a28a8 100644 --- a/include/internal/catch_expressionresult_builder.hpp +++ b/include/internal/catch_expressionresult_builder.hpp @@ -26,7 +26,7 @@ namespace Catch { ExpressionResultBuilder& ExpressionResultBuilder::operator=(const ExpressionResultBuilder& other ) { m_data = other.m_data; m_exprComponents = other.m_exprComponents; - m_stream.clear(); + m_stream.str(""); m_stream << other.m_stream.str(); return *this; } diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index a8585e3f..d560569a 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -206,7 +206,7 @@ namespace Catch { streamVariableLengthText( "info", assertionResult.getMessage() ); break; case ResultWas::Warning: - m_config.stream << "warning:\n'" << assertionResult.getMessage() << "'"; + streamVariableLengthText( "warning", assertionResult.getMessage() ); break; case ResultWas::ExplicitFailure: { @@ -309,7 +309,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 From 82acc2ca05459ce353de71469f141ba93e9b63cf Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 28 Oct 2012 12:07:17 +0000 Subject: [PATCH 015/296] Regenerated single include --- single_include/catch.hpp | 1373 +++++++++++++++++++------------------- 1 file changed, 688 insertions(+), 685 deletions(-) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 32309c2f..96e87228 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-10-12 18:39:11.086583 + * Generated: 2012-10-28 12:06:53.944416 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -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,145 @@ 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; + + template + inline void setResultIfBoolean( ExpressionResultBuilder&, const T& ) {} + inline void setResultIfBoolean( ExpressionResultBuilder& result, bool value ) { + result.setResultType( value ); + } + +// 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 ) { + setResultIfBoolean( m_result.setLhs( Catch::toString( 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 ) { + return m_result.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 ) ) .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 +1113,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 +1131,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 ) = 0; virtual std::string getCurrentTestName() const = 0; - virtual const ResultInfo* getLastResult() const = 0; + virtual const AssertionResult* getLastResult() const = 0; }; } @@ -1285,349 +1245,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 @@ -2311,23 +1928,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 { @@ -2379,8 +2010,388 @@ 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_ACCEPT_EXPR( evaluatedExpr, stopOnFailure, originalExpr ) \ + if( Catch::ResultAction::Value internal_catch_action = Catch::getResultCapture().acceptExpression( evaluatedExpr ) ) { \ + 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::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, expr, shouldNegate ) ); + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \ + do { try { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \ + 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 ) \ + try { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ + 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 ); \ + } + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ + try { \ + INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ + 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_AS( expr, exceptionType, stopOnFailure, macroName ) \ + INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \ + catch( ... ) { \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), stopOnFailure, false ); \ + } + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ + 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 { try { \ + INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, false ) \ + 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 { @@ -3942,7 +3953,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() ); @@ -3964,25 +3975,16 @@ 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 ) { + 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++; } @@ -3993,19 +3995,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 ); } @@ -4023,7 +4025,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; @@ -4062,7 +4064,7 @@ namespace Catch { : ""; } - virtual const ResultInfo* getLastResult() const { + virtual const AssertionResult* getLastResult() const { return &m_lastResult; } @@ -4075,10 +4077,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; @@ -4117,26 +4120,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 @@ -4669,6 +4675,9 @@ namespace Catch { getTheRegistryHub() = NULL; cleanUpContext(); } + std::string translateActiveException() { + return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException(); + } } // end namespace Catch @@ -4987,151 +4996,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 @@ -5414,21 +5417,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"; } @@ -5437,36 +5440,36 @@ namespace Catch { m_config.stream << " failed"; } } - switch( resultInfo.getResultType() ) { + switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: { TextColour colour( TextColour::Error ); - if( resultInfo.hasExpression() ) + if( assertionResult.hasExpression() ) m_config.stream << " with unexpected"; else m_config.stream << "Unexpected"; - m_config.stream << " exception with message: '" << resultInfo.getMessage() << "'"; + m_config.stream << " exception with message: '" << assertionResult.getMessage() << "'"; } break; case ResultWas::DidntThrowException: { TextColour colour( TextColour::Error ); - if( resultInfo.hasExpression() ) + 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() ); + streamVariableLengthText( "info", assertionResult.getMessage() ); break; case ResultWas::Warning: - m_config.stream << "warning:\n'" << resultInfo.getMessage() << "'"; + streamVariableLengthText( "warning", assertionResult.getMessage() ); break; case ResultWas::ExplicitFailure: { TextColour colour( TextColour::Error ); - m_config.stream << "failed with message: '" << resultInfo.getMessage() << "'"; + m_config.stream << "failed with message: '" << assertionResult.getMessage() << "'"; } break; case ResultWas::Unknown: // These cases are here to prevent compiler warnings @@ -5474,8 +5477,8 @@ namespace Catch { 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"; } @@ -5487,14 +5490,14 @@ 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 ) + 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; } @@ -5564,7 +5567,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 @@ -5853,42 +5856,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: @@ -5899,7 +5902,7 @@ namespace Catch { case ResultWas::DidntThrowException: break; } - if( resultInfo.hasExpression() ) + if( assertionResult.hasExpression() ) m_xml.endElement(); } @@ -6007,19 +6010,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++; @@ -6244,9 +6247,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 ) @@ -6289,9 +6292,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 2f92db9898978ca1ee27c964d8a51fa507391935 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 28 Oct 2012 12:15:34 +0000 Subject: [PATCH 016/296] Updated the readme specifically for the Integration branch --- README | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README b/README index 7c050bf9..84859cf5 100644 --- a/README +++ b/README @@ -1 +1,7 @@ -See the wiki at: https://github.com/philsquared/Catch/wiki +CATCH is an automated test framework for C, C++ and Objective-C. + +This branch may contain code that is experimental or not yet fully tested. + +The latest stable version can be found on the Master branch - or, better still, as a single header in the Downloads section. + +For documentation see the wiki at: https://github.com/philsquared/Catch/wiki From 134e45b3ade922e5cbdb2df6b81830fbd93fe448 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 28 Oct 2012 20:57:21 +0000 Subject: [PATCH 017/296] Fixed #132 --- include/internal/catch_expression_lhs.hpp | 19 ++++++++----------- projects/SelfTest/TestMain.cpp | 2 +- projects/SelfTest/TrickyTests.cpp | 21 +++++++++++++++++++++ single_include/catch.hpp | 21 +++++++++------------ 4 files changed, 39 insertions(+), 24 deletions(-) diff --git a/include/internal/catch_expression_lhs.hpp b/include/internal/catch_expression_lhs.hpp index f7c4fb14..572c8c37 100644 --- a/include/internal/catch_expression_lhs.hpp +++ b/include/internal/catch_expression_lhs.hpp @@ -13,13 +13,7 @@ namespace Catch { - struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; - - template - inline void setResultIfBoolean( ExpressionResultBuilder&, const T& ) {} - inline void setResultIfBoolean( ExpressionResultBuilder& result, bool value ) { - result.setResultType( value ); - } +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 @@ -28,9 +22,7 @@ class ExpressionLhs { void operator = ( const ExpressionLhs& ); public: - ExpressionLhs( T lhs ) : m_lhs( lhs ) { - setResultIfBoolean( m_result.setLhs( Catch::toString( lhs ) ), lhs ); - } + ExpressionLhs( T lhs ) : m_lhs( lhs ) {} template ExpressionResultBuilder& operator == ( const RhsT& rhs ) { @@ -71,7 +63,11 @@ public: } ExpressionResultBuilder& negate( bool shouldNegate ) { - return m_result.negate( 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. @@ -86,6 +82,7 @@ private: 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() ); } 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/single_include/catch.hpp b/single_include/catch.hpp index 96e87228..c3413227 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-10-28 12:06:53.944416 + * Generated: 2012-10-28 20:56:33.944771 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -943,13 +943,7 @@ private: namespace Catch { - struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; - - template - inline void setResultIfBoolean( ExpressionResultBuilder&, const T& ) {} - inline void setResultIfBoolean( ExpressionResultBuilder& result, bool value ) { - result.setResultType( value ); - } +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 @@ -958,9 +952,7 @@ class ExpressionLhs { void operator = ( const ExpressionLhs& ); public: - ExpressionLhs( T lhs ) : m_lhs( lhs ) { - setResultIfBoolean( m_result.setLhs( Catch::toString( lhs ) ), lhs ); - } + ExpressionLhs( T lhs ) : m_lhs( lhs ) {} template ExpressionResultBuilder& operator == ( const RhsT& rhs ) { @@ -1001,7 +993,11 @@ public: } ExpressionResultBuilder& negate( bool shouldNegate ) { - return m_result.negate( 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. @@ -1016,6 +1012,7 @@ private: 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() ); } From 2e203a183474672e386f4cf840847cf29ccf90b9 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 29 Oct 2012 19:55:13 +0000 Subject: [PATCH 018/296] Fixed remaining reporting regressions --- include/internal/catch_capture.hpp | 84 +++++++++++++-------- include/internal/catch_interfaces_capture.h | 2 +- include/internal/catch_runner_impl.hpp | 3 +- include/reporters/catch_reporter_basic.hpp | 7 +- 4 files changed, 59 insertions(+), 37 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 7d15b908..484383c5 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -80,9 +80,12 @@ 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 ) ) { \ + 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(); \ @@ -91,19 +94,22 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, shouldNegate ) \ - Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, expr, 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 { try { \ + do { \ INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \ - 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 ) ) + 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 ) \ @@ -117,19 +123,20 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_NO_THROW( expr, stopOnFailure, macroName ) \ - try { \ + do { \ INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ - 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 ); \ - } + 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 { \ - INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ expr; \ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ @@ -142,15 +149,26 @@ inline bool isTrue( bool value ){ return value; } 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::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), 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 ) \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ); /////////////////////////////////////////////////////////////////////////////// @@ -161,14 +179,16 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CHECK_THAT( arg, matcher, stopOnFailure, macroName ) \ - do { try { \ - INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, false ) \ - 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 ) ) + 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_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index db5765ca..a3e08226 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -36,7 +36,7 @@ namespace Catch { virtual bool shouldDebugBreak() const = 0; virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0; - virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult ) = 0; + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; virtual const AssertionResult* getLastResult() const = 0; diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 1bae7f66..1100b23b 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -135,7 +135,8 @@ namespace Catch { m_assertionInfo = assertionInfo; } - virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult ) { + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) { + m_assertionInfo = assertionInfo; m_currentResult = assertionResult; return actOnCurrentResult(); } diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index d560569a..52c1c4b0 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -234,10 +234,11 @@ namespace Catch { if( assertionResult.hasExpandedExpression() ) { m_config.stream << " for: "; - if( assertionResult.getExpandedExpression().size() > 40 ) + if( assertionResult.getExpandedExpression().size() > 40 ) { m_config.stream << "\n"; - if( assertionResult.getExpandedExpression().size() < 70 ) - m_config.stream << "\t"; + if( assertionResult.getExpandedExpression().size() < 70 ) + m_config.stream << "\t"; + } TextColour colour( TextColour::ReconstructedExpression ); m_config.stream << assertionResult.getExpandedExpression(); } From 8f4cc541d55cf55b2a67b5d6b77b5c4ceb4d99ee Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 29 Oct 2012 19:55:34 +0000 Subject: [PATCH 019/296] Added regression test baselines --- .../SelfTest/Baselines/failingResults.txt | 169 +++++++ .../SelfTest/Baselines/successfulResults.txt | 469 ++++++++++++++++++ 2 files changed, 638 insertions(+) create mode 100644 projects/SelfTest/Baselines/failingResults.txt create mode 100644 projects/SelfTest/Baselines/successfulResults.txt 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)] + From 108f1937d8cbe04038ab8d2aaf9f6e958fe8168c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 29 Oct 2012 20:46:45 +0000 Subject: [PATCH 020/296] Added terminal colour codes for POSIX With thanks to Adam Strzelecki --- .../internal/catch_console_colour_impl.hpp | 58 ++++++++++++++++--- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 1830e182..101b3220 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -10,12 +10,57 @@ #include "catch_console_colour.hpp" -#ifdef CATCH_PLATFORM_WINDOWS +namespace Catch { + +#if defined( CATCH_CONFIG_USE_POSIX_COLOUR_CODES ) + + // use POSIX 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 ); + } + + void TextColour::set( Colours colour ) { + if( isatty( fileno(stdout) ) ) { + switch( colour ) { + case TextColour::FileName: + std::cout << "\e[1m"; // bold + break; + case TextColour::ResultError: + std::cout << "\e[1;31m"; // bright red + break; + case TextColour::ResultSuccess: + std::cout << "\e[1;32m"; // bright green + break; + case TextColour::Error: + std::cout << "\e[0;31m"; // dark red + break; + case TextColour::Success: + std::cout << "\e[0;32m"; // dark green + break; + case TextColour::OriginalExpression: + std::cout << "\e[0;36m"; // cyan + break; + case TextColour::ReconstructedExpression: + std::cout << "\e[0;33m"; // yellow + break; + case TextColour::None: + std::cout << "\e[0m"; // reset + } + } + } + +#elif defined ( CATCH_PLATFORM_WINDOWS ) #include -namespace Catch { - namespace { WORD mapConsoleColour( TextColour::Colours colour ) { @@ -78,18 +123,15 @@ 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 +} // end namespace Catch + #endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED From 5efa4bcb8a620efa13e8eb5e68d0899681919ca1 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 29 Oct 2012 20:49:22 +0000 Subject: [PATCH 021/296] Regenerated single_include --- single_include/catch.hpp | 156 +++++++++++++++++++++++++++------------ 1 file changed, 110 insertions(+), 46 deletions(-) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index c3413227..6f036e98 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-10-28 20:56:33.944771 + * Generated: 2012-10-29 20:48:55.345250 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -1129,7 +1129,7 @@ namespace Catch { virtual bool shouldDebugBreak() const = 0; virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0; - virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult ) = 0; + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; virtual const AssertionResult* getLastResult() const = 0; @@ -2076,9 +2076,12 @@ 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 ) ) { \ + 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(); \ @@ -2087,19 +2090,22 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, shouldNegate ) \ - Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, expr, 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 { try { \ + do { \ INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \ - 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 ) ) + 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 ) \ @@ -2113,19 +2119,20 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_NO_THROW( expr, stopOnFailure, macroName ) \ - try { \ + do { \ INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ - 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 ); \ - } + 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 { \ - INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \ expr; \ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), stopOnFailure, false ); \ @@ -2138,15 +2145,26 @@ inline bool isTrue( bool value ){ return value; } 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::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), 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 ) \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ); /////////////////////////////////////////////////////////////////////////////// @@ -2157,15 +2175,17 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CHECK_THAT( arg, matcher, stopOnFailure, macroName ) \ - do { try { \ - INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, false ) \ - 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 ) ) + 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 @@ -3976,7 +3996,8 @@ namespace Catch { m_assertionInfo = assertionInfo; } - virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult ) { + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) { + m_assertionInfo = assertionInfo; m_currentResult = assertionResult; return actOnCurrentResult(); } @@ -4837,12 +4858,57 @@ namespace Catch { } // end namespace Catch -#ifdef CATCH_PLATFORM_WINDOWS +namespace Catch { + +#if defined( CATCH_CONFIG_USE_POSIX_COLOUR_CODES ) + + // use POSIX 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 ); + } + + void TextColour::set( Colours colour ) { + if( isatty( fileno(stdout) ) ) { + switch( colour ) { + case TextColour::FileName: + std::cout << "\e[1m"; // bold + break; + case TextColour::ResultError: + std::cout << "\e[1;31m"; // bright red + break; + case TextColour::ResultSuccess: + std::cout << "\e[1;32m"; // bright green + break; + case TextColour::Error: + std::cout << "\e[0;31m"; // dark red + break; + case TextColour::Success: + std::cout << "\e[0;32m"; // dark green + break; + case TextColour::OriginalExpression: + std::cout << "\e[0;36m"; // cyan + break; + case TextColour::ReconstructedExpression: + std::cout << "\e[0;33m"; // yellow + break; + case TextColour::None: + std::cout << "\e[0m"; // reset + } + } + } + +#elif defined ( CATCH_PLATFORM_WINDOWS ) #include -namespace Catch { - namespace { WORD mapConsoleColour( TextColour::Colours colour ) { @@ -4906,19 +4972,16 @@ namespace Catch { m_impl->set( colour ); } -} // end namespace Catch - #else -namespace Catch { TextColour::TextColour( Colours ){} TextColour::~TextColour(){} void TextColour::set( Colours ){} -} // end namespace Catch - #endif +} // end namespace Catch + // #included from: catch_generators_impl.hpp #define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED @@ -5489,10 +5552,11 @@ namespace Catch { if( assertionResult.hasExpandedExpression() ) { m_config.stream << " for: "; - if( assertionResult.getExpandedExpression().size() > 40 ) + if( assertionResult.getExpandedExpression().size() > 40 ) { m_config.stream << "\n"; - if( assertionResult.getExpandedExpression().size() < 70 ) - m_config.stream << "\t"; + if( assertionResult.getExpandedExpression().size() < 70 ) + m_config.stream << "\t"; + } TextColour colour( TextColour::ReconstructedExpression ); m_config.stream << assertionResult.getExpandedExpression(); } From 778f9c4fc7fa66566679d9f1d8a721079d8589bf Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 30 Oct 2012 09:09:30 +0000 Subject: [PATCH 022/296] Removed "no-" from Wno-global-constructors when disabling --- include/catch.hpp | 2 +- .../CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj | 2 -- single_include/catch.hpp | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index a045f123..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" diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 94250631..63c8d5b2 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -555,7 +555,6 @@ WARNING_CFLAGS = ( "-Weverything", "-Wno-disabled-macro-expansion", - "-Wno-global-constructors", ); }; name = Debug; @@ -569,7 +568,6 @@ 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 6f036e98..6d6b891e 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-10-29 20:48:55.345250 + * Generated: 2012-10-30 09:08:37.538907 * ---------------------------------------------------------- * 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" From 355b95fda1de28ba830541768aad32c7b1790290 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 31 Oct 2012 18:04:22 +0000 Subject: [PATCH 023/296] Cleaned up ANSI colour code impl a bit --- .../internal/catch_console_colour_impl.hpp | 40 ++++++--- include/reporters/catch_reporter_basic.hpp | 48 +++++----- .../CatchSelfTest.xcodeproj/project.pbxproj | 6 ++ single_include/catch.hpp | 88 +++++++++++-------- 4 files changed, 112 insertions(+), 70 deletions(-) diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 101b3220..69470b1b 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -10,11 +10,13 @@ #include "catch_console_colour.hpp" +#if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) + +#include + namespace Catch { -#if defined( CATCH_CONFIG_USE_POSIX_COLOUR_CODES ) - - // use POSIX console terminal codes + // use POSIX/ ANSI console terminal codes // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) // https://github.com/philsquared/Catch/pull/131 @@ -27,40 +29,46 @@ namespace Catch { set( TextColour::None ); } + namespace { const char colourEscape = '\033'; } + void TextColour::set( Colours colour ) { if( isatty( fileno(stdout) ) ) { switch( colour ) { case TextColour::FileName: - std::cout << "\e[1m"; // bold + std::cout << colourEscape << "[0m"; // white break; case TextColour::ResultError: - std::cout << "\e[1;31m"; // bright red + std::cout << colourEscape << "[1;31m"; // bold red break; case TextColour::ResultSuccess: - std::cout << "\e[1;32m"; // bright green + std::cout << colourEscape << "[1;32m"; // bold green break; case TextColour::Error: - std::cout << "\e[0;31m"; // dark red + std::cout << colourEscape << "[0;31m"; // red break; case TextColour::Success: - std::cout << "\e[0;32m"; // dark green + std::cout << colourEscape << "[0;32m"; // green break; case TextColour::OriginalExpression: - std::cout << "\e[0;36m"; // cyan + std::cout << colourEscape << "[0;36m"; // cyan break; case TextColour::ReconstructedExpression: - std::cout << "\e[0;33m"; // yellow + std::cout << colourEscape << "[0;33m"; // yellow break; case TextColour::None: - std::cout << "\e[0m"; // reset + std::cout << colourEscape << "[0m"; // reset to white } } } - + +} // namespace Catch + #elif defined ( CATCH_PLATFORM_WINDOWS ) #include +namespace Catch { + namespace { WORD mapConsoleColour( TextColour::Colours colour ) { @@ -124,14 +132,18 @@ namespace Catch { m_impl->set( colour ); } +} // end namespace Catch + #else +namespace Catch { + TextColour::TextColour( Colours ){} TextColour::~TextColour(){} void TextColour::set( Colours ){} -#endif - } // end namespace Catch +#endif + #endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 52c1c4b0..63074629 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -184,35 +184,41 @@ namespace Catch { } switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: - { - 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() << "'"; - } + { + 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( 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"; - } + { + 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", assertionResult.getMessage() ); + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "info", assertionResult.getMessage() ); + } break; case ResultWas::Warning: - streamVariableLengthText( "warning", assertionResult.getMessage() ); + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "warning", assertionResult.getMessage() ); + } break; case ResultWas::ExplicitFailure: - { - TextColour colour( TextColour::Error ); - m_config.stream << "failed with message: '" << assertionResult.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: diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 63c8d5b2..7667e515 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -551,6 +551,11 @@ 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", @@ -564,6 +569,7 @@ 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", diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 6d6b891e..822ebcff 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-10-30 09:08:37.538907 + * 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. @@ -4858,11 +4858,13 @@ namespace Catch { } // end namespace Catch +#if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) + +#include + namespace Catch { -#if defined( CATCH_CONFIG_USE_POSIX_COLOUR_CODES ) - - // use POSIX console terminal codes + // use POSIX/ ANSI console terminal codes // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) // https://github.com/philsquared/Catch/pull/131 @@ -4875,40 +4877,46 @@ namespace Catch { set( TextColour::None ); } + namespace { const char colourEscape = '\033'; } + void TextColour::set( Colours colour ) { if( isatty( fileno(stdout) ) ) { switch( colour ) { case TextColour::FileName: - std::cout << "\e[1m"; // bold + std::cout << colourEscape << "[0m"; // white break; case TextColour::ResultError: - std::cout << "\e[1;31m"; // bright red + std::cout << colourEscape << "[1;31m"; // bold red break; case TextColour::ResultSuccess: - std::cout << "\e[1;32m"; // bright green + std::cout << colourEscape << "[1;32m"; // bold green break; case TextColour::Error: - std::cout << "\e[0;31m"; // dark red + std::cout << colourEscape << "[0;31m"; // red break; case TextColour::Success: - std::cout << "\e[0;32m"; // dark green + std::cout << colourEscape << "[0;32m"; // green break; case TextColour::OriginalExpression: - std::cout << "\e[0;36m"; // cyan + std::cout << colourEscape << "[0;36m"; // cyan break; case TextColour::ReconstructedExpression: - std::cout << "\e[0;33m"; // yellow + std::cout << colourEscape << "[0;33m"; // yellow break; case TextColour::None: - std::cout << "\e[0m"; // reset + std::cout << colourEscape << "[0m"; // reset to white } } } +} // namespace Catch + #elif defined ( CATCH_PLATFORM_WINDOWS ) #include +namespace Catch { + namespace { WORD mapConsoleColour( TextColour::Colours colour ) { @@ -4972,16 +4980,20 @@ namespace Catch { m_impl->set( colour ); } +} // end namespace Catch + #else +namespace Catch { + TextColour::TextColour( Colours ){} TextColour::~TextColour(){} void TextColour::set( Colours ){} -#endif - } // end namespace Catch +#endif + // #included from: catch_generators_impl.hpp #define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED @@ -5502,35 +5514,41 @@ namespace Catch { } switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: - { - 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() << "'"; - } + { + 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( 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"; - } + { + 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", assertionResult.getMessage() ); + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "info", assertionResult.getMessage() ); + } break; case ResultWas::Warning: - streamVariableLengthText( "warning", assertionResult.getMessage() ); + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "warning", assertionResult.getMessage() ); + } break; case ResultWas::ExplicitFailure: - { - TextColour colour( TextColour::Error ); - m_config.stream << "failed with message: '" << assertionResult.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: From f0f407fc3ebdcbdad50fc1f9a45f15ab3cc54c63 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 31 Oct 2012 18:28:21 +0000 Subject: [PATCH 024/296] Manually applied merge #133 from Master --- include/internal/catch_tags.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/internal/catch_tags.hpp b/include/internal/catch_tags.hpp index d6060022..591ab5ad 100644 --- a/include/internal/catch_tags.hpp +++ b/include/internal/catch_tags.hpp @@ -74,6 +74,8 @@ namespace Catch { m_remainder += c; } + TagExtracter& operator=(const TagExtracter&); + std::set& m_tags; std::string m_remainder; }; @@ -177,6 +179,8 @@ namespace Catch { m_exp.m_tagSets.push_back( m_currentTagSet ); } + TagExpressionParser& operator=(const TagExpressionParser&); + bool m_isNegated; TagSet m_currentTagSet; TagExpression& m_exp; From 2a1e8bfc6ed3bcc1e3746d717726a9e525de6369 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 1 Nov 2012 08:16:15 +0000 Subject: [PATCH 025/296] Updated colour comments --- include/internal/catch_console_colour_impl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 69470b1b..c05fd07f 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -35,7 +35,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 @@ -56,7 +56,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 a4e088c999439e9ec0fe3a4205b7520fbf258a5f Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 2 Nov 2012 08:29:03 +0000 Subject: [PATCH 026/296] Removed __FUNCTION__ from SourceLineInfo --- include/internal/catch_common.h | 6 ------ include/internal/catch_notimplemented_exception.hpp | 2 -- 2 files changed, 8 deletions(-) diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index cac5d112..48504f15 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -109,11 +109,6 @@ 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 ) @@ -126,7 +121,6 @@ namespace Catch { return file.empty(); } - std::string function; std::string file; std::size_t line; }; 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(); } From 81cb69ef1831ed29bf770254c9112b8f0465e912 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 4 Nov 2012 21:09:22 +0000 Subject: [PATCH 027/296] AssertionInfo captures more info (for test cases and sections) --- include/internal/catch_assertionresult.h | 2 +- include/internal/catch_capture.hpp | 1 - include/internal/catch_common.h | 6 +-- include/internal/catch_interfaces_capture.h | 1 - include/internal/catch_runner_impl.hpp | 41 ++++++++++----------- 5 files changed, 21 insertions(+), 30 deletions(-) diff --git a/include/internal/catch_assertionresult.h b/include/internal/catch_assertionresult.h index b3baff2e..c731c65d 100644 --- a/include/internal/catch_assertionresult.h +++ b/include/internal/catch_assertionresult.h @@ -16,7 +16,7 @@ namespace Catch { struct AssertionInfo { AssertionInfo() {} - AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression, bool _shouldNegate ) + AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression = "", bool _shouldNegate = false ) : macroName( _macroName ), lineInfo( _lineInfo ), capturedExpression( _capturedExpression ) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 484383c5..602be000 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -95,7 +95,6 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #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 ) \ diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 48504f15..58fbe0ff 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; } @@ -113,10 +113,6 @@ namespace Catch { : 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(); } 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_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 1100b23b..98fb8fb9 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,14 +130,9 @@ 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 ) { @@ -152,7 +146,7 @@ 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)->buildResult( m_assertionInfo ) ); + m_reporter->Result( (*it)->buildResult( m_lastAssertionInfo ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); @@ -179,10 +173,14 @@ namespace Catch { std::ostringstream oss; oss << name << "@" << lineInfo; + + m_assertionInfoStack.push_back( m_lastAssertionInfo ); + m_lastAssertionInfo = AssertionInfo( "SECTION", lineInfo ); + + if( !m_runningTest->addSection( oss.str() ) ) return false; - m_assertionInfo.lineInfo = lineInfo; m_reporter->StartSection( name, description ); assertions = m_totals.assertions; @@ -200,6 +198,8 @@ namespace Catch { } m_runningTest->endSection( name ); m_reporter->EndSection( name, assertions ); + m_lastAssertionInfo = m_assertionInfoStack.back(); + m_assertionInfoStack.pop_back(); } virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { @@ -233,13 +233,10 @@ 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() ) { @@ -254,6 +251,7 @@ namespace Catch { void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { try { + m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo() ); m_runningTest->reset(); Counts prevAssertions = m_totals.assertions; if( m_reporter->shouldRedirectStdout() ) { @@ -277,10 +275,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 +285,6 @@ namespace Catch { private: IMutableContext& m_context; RunningTest* m_runningTest; - ExpressionResultBuilder m_currentResult; AssertionResult m_lastResult; const Config& m_config; @@ -299,7 +295,8 @@ namespace Catch { IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; - AssertionInfo m_assertionInfo; + AssertionInfo m_lastAssertionInfo; + std::vector m_assertionInfoStack; }; } // end namespace Catch From 78fba28c4b9f48ec25c9d234a29c36e4427ca6e0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 4 Nov 2012 21:11:59 +0000 Subject: [PATCH 028/296] 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. --- 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_junit.hpp | 7 ++++-- projects/SelfTest/ClassTests.cpp | 8 +++--- projects/SelfTest/TestMain.cpp | 12 ++++----- 7 files changed, 64 insertions(+), 31 deletions(-) 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_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/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/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 6e38d44c..12287799 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -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" ) ); From b323fc7e6c57caa535d65cae31e6018822ed9e3c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 4 Nov 2012 21:39:16 +0000 Subject: [PATCH 029/296] 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) --- include/internal/catch_runner_impl.hpp | 9 ++------- projects/SelfTest/ExceptionTests.cpp | 2 +- projects/SelfTest/TestMain.cpp | 2 +- projects/SelfTest/catch_self_test.cpp | 2 ++ .../CatchSelfTest.xcodeproj/project.pbxproj | 6 +----- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 98fb8fb9..e581b909 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -174,13 +174,11 @@ namespace Catch { oss << name << "@" << lineInfo; - m_assertionInfoStack.push_back( m_lastAssertionInfo ); - m_lastAssertionInfo = AssertionInfo( "SECTION", lineInfo ); - - if( !m_runningTest->addSection( oss.str() ) ) return false; + m_lastAssertionInfo.lineInfo = lineInfo; + m_reporter->StartSection( name, description ); assertions = m_totals.assertions; @@ -198,8 +196,6 @@ namespace Catch { } m_runningTest->endSection( name ); m_reporter->EndSection( name, assertions ); - m_lastAssertionInfo = m_assertionInfoStack.back(); - m_assertionInfoStack.pop_back(); } virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { @@ -296,7 +292,6 @@ namespace Catch { IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; AssertionInfo m_lastAssertionInfo; - std::vector m_assertionInfoStack; }; } // end namespace Catch 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/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 12287799..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 ); } 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 88b70828f24bbbeae636d663b14fd0117165108a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 4 Nov 2012 21:39:38 +0000 Subject: [PATCH 030/296] Regen single include --- single_include/catch.hpp | 124 ++++++++++++++++++++++----------------- 1 file changed, 69 insertions(+), 55 deletions(-) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 822ebcff..7abf63db 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-04 21:39:24.756874 * ---------------------------------------------------------- * 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() @@ -688,7 +680,7 @@ namespace Catch { struct AssertionInfo { AssertionInfo() {} - AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression, bool _shouldNegate ) + AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression = "", bool _shouldNegate = false ) : macroName( _macroName ), lineInfo( _lineInfo ), capturedExpression( _capturedExpression ) @@ -1128,7 +1120,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 +1260,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 +1286,7 @@ namespace Catch { private: Ptr m_test; + std::string m_className; std::string m_name; std::string m_description; std::set m_tags; @@ -1369,6 +1364,8 @@ namespace Catch { m_remainder += c; } + TagExtracter& operator=(const TagExtracter&); + std::set& m_tags; std::string m_remainder; }; @@ -1472,6 +1469,8 @@ namespace Catch { m_exp.m_tagSets.push_back( m_currentTagSet ); } + TagExpressionParser& operator=(const TagExpressionParser&); + bool m_isNegated; TagSet m_currentTagSet; TagExpression& m_exp; @@ -2091,7 +2090,6 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #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 ) \ @@ -3970,7 +3968,6 @@ namespace Catch { do { do { - m_assertionInfo.lineInfo = m_runningTest->getTestCaseInfo().getLineInfo(); runCurrentTest( redirectedCout, redirectedCerr ); } while( m_runningTest->hasUntestedSections() && !aborting() ); @@ -3992,14 +3989,9 @@ 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 ) { @@ -4013,7 +4005,7 @@ 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)->buildResult( m_assertionInfo ) ); + m_reporter->Result( (*it)->buildResult( m_lastAssertionInfo ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); @@ -4043,7 +4035,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; @@ -4094,13 +4087,10 @@ 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() ) { @@ -4115,6 +4105,7 @@ namespace Catch { void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { try { + m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo() ); m_runningTest->reset(); Counts prevAssertions = m_totals.assertions; if( m_reporter->shouldRedirectStdout() ) { @@ -4138,10 +4129,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(); } @@ -4149,7 +4139,6 @@ namespace Catch { private: IMutableContext& m_context; RunningTest* m_runningTest; - ExpressionResultBuilder m_currentResult; AssertionResult m_lastResult; const Config& m_config; @@ -4160,7 +4149,7 @@ namespace Catch { IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; - AssertionInfo m_assertionInfo; + AssertionInfo m_lastAssertionInfo; }; } // end namespace Catch @@ -4515,22 +4504,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 @@ -4710,8 +4714,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(); } @@ -4883,7 +4885,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 +4906,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 } } } @@ -5217,10 +5219,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 ), @@ -5233,6 +5237,7 @@ namespace Catch { TestCaseInfo::TestCaseInfo() : m_test( NULL ), + m_className(), m_name(), m_description(), m_isHidden( false ) @@ -5240,6 +5245,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 ), @@ -5249,6 +5255,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 ), @@ -5260,14 +5267,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; } @@ -5290,13 +5298,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 { @@ -6018,7 +6029,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; @@ -6086,7 +6100,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 ) { From ec5956f47114ff8b597be85fd7654d29da93aea0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 6 Nov 2012 07:52:28 +0000 Subject: [PATCH 031/296] Fix for #134 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- include/internal/catch_capture.hpp | 6 ++++-- projects/SelfTest/MessageTests.cpp | 3 ++- single_include/catch.hpp | 8 +++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 602be000..cc05a845 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -167,8 +167,10 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ - INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ); + do { \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ) \ + } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \ diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index 776d7169..fe65f753 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" ) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 7abf63db..e92dc0cb 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-11-04 21:39:24.756874 + * Generated: 2012-11-06 07:51:06.701955 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -2162,8 +2162,10 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ - INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ); + do { \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ) \ + } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \ From b5b1b1e430c8c61dbd3162da0255a368ba9ad75f Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 6 Nov 2012 19:13:25 +0000 Subject: [PATCH 032/296] Some expression/ evaluation clean-up --- include/internal/catch_evaluate.hpp | 43 ++++++----------------- include/internal/catch_expression_lhs.hpp | 2 +- single_include/catch.hpp | 41 +++++---------------- 3 files changed, 20 insertions(+), 66 deletions(-) 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..5804d787 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 ) { diff --git a/single_include/catch.hpp b/single_include/catch.hpp index e92dc0cb..a04b2a4a 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-11-06 07:51:06.701955 + * Generated: 2012-11-06 19:13:05.717033 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -797,6 +797,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 ) { @@ -848,44 +851,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 ) ); } @@ -944,7 +921,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 ) { From 20e59ce9d133b469798c4ce2a8d681c0d9b18975 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 6 Nov 2012 19:34:10 +0000 Subject: [PATCH 033/296] Added tags docs --- include/internal/catch_commandline.hpp | 9 ++++++++- include/internal/catch_tags.hpp | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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_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 { From a1dc7e312cffb0a2d241273adcae4a126d49ff15 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 6 Nov 2012 19:34:35 +0000 Subject: [PATCH 034/296] Regen single include --- single_include/catch.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index a04b2a4a..1a8b111b 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-11-06 19:13:05.717033 + * Generated: 2012-11-06 19:34:24.321771 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -1350,12 +1350,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 { @@ -3219,7 +3219,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 ) { From 1af13dba97474c2a0b33f1ca1919c80ea4f95ca3 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 10 Nov 2012 10:20:08 +0000 Subject: [PATCH 035/296] Changed StopOnFailure boolean to an enum --- include/catch.hpp | 79 +++++++++++++++--------------- include/internal/catch_capture.hpp | 71 +++++++++++++++++---------- 2 files changed, 85 insertions(+), 65 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index 219b6172..a8fe335b 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -48,31 +48,31 @@ // 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, false, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) +#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, Catch::ResultDisposition::Normal, "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::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) +#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_FALSE" ) +#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, false, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) +#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, false, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) -#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 ) @@ -88,36 +88,37 @@ /////////////// // Still to be implemented -//#define CHECK_NOFAIL( expr ) // !TBD - reports violation, but doesn't fail Test +#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, false, Catch::ResultDisposition::Normal, "REQUIRE" ) +#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, Catch::ResultDisposition::Normal, "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, false, Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) +#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, Catch::ResultDisposition::ContinueOnFailure, "CHECK_FALSE" ) +#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, false, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) +#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, false, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) +#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, false, Catch::ResultDisposition::ContinueOnFailure, "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_capture.hpp b/include/internal/catch_capture.hpp index cc05a845..f10c43d2 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -74,9 +74,25 @@ public: private: ExpressionResultBuilder m_resultBuilder; }; - + +struct ResultDisposition { + enum Flags { + Normal = 0x00, + + ContinueOnFailure = 0x01, + NegateResult = 0x02, + SuppressFail = 0x04 + }; +}; +inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { + return static_cast( static_cast( lhs ) | static_cast( rhs ) ); +} + // This is just here to avoid compiler warnings with macro constants and boolean literals inline bool isTrue( bool value ){ return value; } +inline bool testFlag( int flags, int bitOrBitsToTest ) { return ( flags & bitOrBitsToTest ) == bitOrBitsToTest; } +inline bool setFlag( int flags, int bitOrBitsToSet ) { return static_cast( flags | bitOrBitsToSet ); } +inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast( flags & ~bitOrBitsToReset ); } } // end namespace Catch @@ -84,11 +100,11 @@ 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::testFlag( resultDisposition, Catch::ResultDisposition::ContinueOnFailure ) ) throw Catch::TestFailureException(); \ if( Catch::isTrue( false ) ){ bool this_is_here_to_invoke_warnings = ( originalExpr ); Catch::isTrue( this_is_here_to_invoke_warnings ); } \ } @@ -97,79 +113,81 @@ inline bool isTrue( bool value ){ return value; } Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, shouldNegate ); /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_TEST( expr, shouldNegate, resultDisposition, macroName ) \ do { \ INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \ try { \ - INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).negate( shouldNegate ), stopOnFailure, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).negate( shouldNegate ), 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 ); \ +#define INTERNAL_CATCH_IF( expr, shouldNegate, resultDisposition, macroName ) \ + INTERNAL_CATCH_TEST( expr, shouldNegate, resultDisposition, macroName ); \ if( Catch::getResultCapture().getLastResult()->ok() ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ELSE( expr, shouldNegate, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ); \ +#define INTERNAL_CATCH_ELSE( expr, shouldNegate, resultDisposition, macroName ) \ + INTERNAL_CATCH_TEST( expr, shouldNegate, resultDisposition, macroName ); \ if( !Catch::getResultCapture().getLastResult()->ok() ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_NO_THROW( expr, stopOnFailure, macroName ) \ +#define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \ do { \ INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, false ); \ 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_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_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 ) \ +#define INTERNAL_CATCH_MSG( reason, resultType, resultDisposition, macroName ) \ do { \ INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ) \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, resultDisposition, true ) \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// @@ -179,15 +197,16 @@ inline bool isTrue( bool value ){ return value; } 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 ); \ 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 ) ) From b2ef99882590ccd3824ebca44cb9b4cfc42f4728 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 10 Nov 2012 10:35:09 +0000 Subject: [PATCH 036/296] Changed shouldNegate boolean to use part of ResultDisposition enum --- include/catch.hpp | 26 +++++++++++++------------- include/internal/catch_capture.hpp | 14 +++++++------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index a8fe335b..d51a24a2 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -48,17 +48,17 @@ // 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, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) -#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, Catch::ResultDisposition::Normal, "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, ..., 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, Catch::ResultDisposition::ContinueOnFailure, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) -#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_FALSE" ) -#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, false, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) -#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, false, Catch::ResultDisposition::ContinueOnFailure, "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_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" ) @@ -93,18 +93,18 @@ // If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required #else -#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, false, Catch::ResultDisposition::Normal, "REQUIRE" ) -#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, Catch::ResultDisposition::Normal, "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, ..., 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, Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) -#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, true, Catch::ResultDisposition::ContinueOnFailure, "CHECK_FALSE" ) -#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, false, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) -#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, false, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) -#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, false, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOFAIL" ) +#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, "CHECK_NOFAIL" ) #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" ) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index f10c43d2..f2a6ad55 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -113,11 +113,11 @@ inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast*expr ).negate( shouldNegate ), resultDisposition, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).negate( testFlag( resultDisposition, Catch::ResultDisposition::NegateResult ) ), resultDisposition, expr ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ @@ -128,13 +128,13 @@ inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_castok() ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ELSE( expr, shouldNegate, resultDisposition, macroName ) \ - INTERNAL_CATCH_TEST( expr, shouldNegate, resultDisposition, macroName ); \ +#define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \ + INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ if( !Catch::getResultCapture().getLastResult()->ok() ) /////////////////////////////////////////////////////////////////////////////// From defca58566653fd088f615c2979d7e7a681bf107 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 10 Nov 2012 18:43:23 +0000 Subject: [PATCH 037/296] negate() -> endExpression(), takes ResultDisposition --- include/internal/catch_capture.hpp | 38 +++------- include/internal/catch_expression_lhs.hpp | 4 +- .../internal/catch_expressionresult_builder.h | 2 +- .../catch_expressionresult_builder.hpp | 4 +- include/internal/catch_result_type.h | 75 ++++++++++++------- 5 files changed, 63 insertions(+), 60 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index f2a6ad55..805d8179 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -75,24 +75,8 @@ private: ExpressionResultBuilder m_resultBuilder; }; -struct ResultDisposition { - enum Flags { - Normal = 0x00, - - ContinueOnFailure = 0x01, - NegateResult = 0x02, - SuppressFail = 0x04 - }; -}; -inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { - return static_cast( static_cast( lhs ) | static_cast( rhs ) ); -} - // This is just here to avoid compiler warnings with macro constants and boolean literals inline bool isTrue( bool value ){ return value; } -inline bool testFlag( int flags, int bitOrBitsToTest ) { return ( flags & bitOrBitsToTest ) == bitOrBitsToTest; } -inline bool setFlag( int flags, int bitOrBitsToSet ) { return static_cast( flags | bitOrBitsToSet ); } -inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast( flags & ~bitOrBitsToReset ); } } // end namespace Catch @@ -104,20 +88,20 @@ inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast*expr ).negate( testFlag( resultDisposition, Catch::ResultDisposition::NegateResult ) ), resultDisposition, expr ); \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).endExpression( resultDisposition ), resultDisposition, expr ); \ } catch( Catch::TestFailureException& ) { \ throw; \ } catch( ... ) { \ @@ -140,7 +124,7 @@ inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast( 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..1ecccad5 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 = testFlag( resultDisposition, ResultDisposition::NegateResult ); return *this; } ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { diff --git a/include/internal/catch_result_type.h b/include/internal/catch_result_type.h index e151f070..60678e27 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 - -}; }; + 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 -}; }; - -} + 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 + }; }; + + struct ResultDisposition { + enum Flags { + Normal = 0x00, + + ContinueOnFailure = 0x01, + NegateResult = 0x02, + SuppressFail = 0x04 + }; + }; + inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { + return static_cast( static_cast( lhs ) | static_cast( rhs ) ); + } + + inline bool testFlag( int flags, int bitOrBitsToTest ) { return ( flags & bitOrBitsToTest ) == bitOrBitsToTest; } + inline bool setFlag( int flags, int bitOrBitsToSet ) { return static_cast( flags | bitOrBitsToSet ); } + inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast( flags & ~bitOrBitsToReset ); } + + inline bool shouldContinueOnFailure( int flags ) { return testFlag( flags, ResultDisposition::ContinueOnFailure ); } + +} // end namespace Catch #endif // TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED From f54ac5625e4702e1c032f7b5a7f4d9346c64f502 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 10 Nov 2012 18:44:12 +0000 Subject: [PATCH 038/296] New (combined) baselines --- .../SelfTest/Baselines/failingResults.txt | 169 --------------- .../{successfulResults.txt => results.txt} | 197 ++++++++++++++++-- 2 files changed, 185 insertions(+), 181 deletions(-) delete mode 100644 projects/SelfTest/Baselines/failingResults.txt rename projects/SelfTest/Baselines/{successfulResults.txt => results.txt} (75%) diff --git a/projects/SelfTest/Baselines/failingResults.txt b/projects/SelfTest/Baselines/failingResults.txt deleted file mode 100644 index 787c246f..00000000 --- a/projects/SelfTest/Baselines/failingResults.txt +++ /dev/null @@ -1,169 +0,0 @@ -[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/results.txt similarity index 75% rename from projects/SelfTest/Baselines/successfulResults.txt rename to projects/SelfTest/Baselines/results.txt index 1c4e8fef..d7b70545 100644 --- a/projects/SelfTest/Baselines/successfulResults.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -1,5 +1,5 @@ [Started testing] -[Started group: './succeeding*'] +[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 ) @@ -48,10 +48,18 @@ /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 ) @@ -62,6 +70,22 @@ /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 @@ -76,6 +100,14 @@ /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 @@ -96,6 +128,28 @@ /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 @@ -135,12 +189,12 @@ [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:277: p != __null succeeded for: 0x7fff521a90a8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:280: cp != __null succeeded for: 0x7fff521a90a8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:283: cpc != __null succeeded for: 0x7fff521a90a8 != 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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:288: __null != p succeeded for: 0 != 0x7fff521a90a8 [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] @@ -154,19 +208,60 @@ /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 -ThrewException'custom exception' /[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] @@ -179,14 +274,26 @@ ThrewException'custom exception' /[tc] ./failing/exceptions/custom \ [s] the section2 / [s] the section2 / [s] the section -ThrewException'Exception from section' \ [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" -[End of section: 'in section' 1 assertion passed] +/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 (2 assertions in 1 test case)] +[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 @@ -343,6 +450,27 @@ ThrewException'Exception from section' \ [s] the section /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/Misc/Sections] [Started section: 's1'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:25: a != b succeeded for: 1 != 2 @@ -372,16 +500,32 @@ ThrewException'Exception from section' \ [s] the section /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)] @@ -397,6 +541,26 @@ ThrewException'Exception from section' \ [s] the section "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" @@ -410,6 +574,15 @@ ThrewException'Exception from section' \ [s] the section 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: 0x7fff521a9878 == 0x7fff521a9870 +/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 @@ -428,7 +601,7 @@ ThrewException'Exception from section' \ [s] the section [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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff521a9870 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] @@ -462,8 +635,8 @@ ThrewException'Exception from section' \ [s] the section /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)] +[End of group: './failing* ./succeeding*'. 25 of 66 test cases failed (72 of 361 assertions failed)] -[Testing completed. All tests passed (288 assertions in 41 test cases)] +[Testing completed. 25 of 66 test cases failed (72 of 361 assertions failed)] From af1a321860a8b63fb57fcade75ba7f33cad7400c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 10 Nov 2012 18:46:39 +0000 Subject: [PATCH 039/296] Regen single include --- single_include/catch.hpp | 225 +++++++++++++++++++++------------------ 1 file changed, 124 insertions(+), 101 deletions(-) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 1a8b111b..bb6ab776 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-11-06 19:34:24.321771 + * Generated: 2012-11-10 18:44:32.330710 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -643,36 +643,55 @@ inline std::string toString( std::nullptr_t ) { namespace Catch { -struct ResultWas { enum OfType { - Unknown = -1, - Ok = 0, - Info = 1, - Warning = 2, + 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 -}; }; + 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 + }; }; -} + struct ResultDisposition { + enum Flags { + Normal = 0x00, + + ContinueOnFailure = 0x01, + NegateResult = 0x02, + SuppressFail = 0x04 + }; + }; + inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { + return static_cast( static_cast( lhs ) | static_cast( rhs ) ); + } + + inline bool testFlag( int flags, int bitOrBitsToTest ) { return ( flags & bitOrBitsToTest ) == bitOrBitsToTest; } + inline bool setFlag( int flags, int bitOrBitsToSet ) { return static_cast( flags | bitOrBitsToSet ); } + inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast( flags & ~bitOrBitsToReset ); } + + inline bool shouldContinueOnFailure( int flags ) { return testFlag( flags, ResultDisposition::ContinueOnFailure ); } + +} // end namespace Catch namespace Catch { @@ -886,7 +905,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 ) { @@ -961,12 +980,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. @@ -2056,110 +2075,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 ); +#define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, resultDisposition ) \ + Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, testFlag( resultDisposition, Catch::ResultDisposition::NegateResult ) ); /////////////////////////////////////////////////////////////////////////////// -#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 ); \ +#define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \ + INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ if( Catch::getResultCapture().getLastResult()->ok() ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ELSE( expr, shouldNegate, stopOnFailure, macroName ) \ - INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ); \ +#define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \ + INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ if( !Catch::getResultCapture().getLastResult()->ok() ) /////////////////////////////////////////////////////////////////////////////// -#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 ) \ +#define INTERNAL_CATCH_MSG( reason, resultType, resultDisposition, macroName ) \ do { \ - INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ) \ + 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 ) ) @@ -5142,8 +5164,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 = testFlag( resultDisposition, ResultDisposition::NegateResult ); return *this; } ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { @@ -6303,31 +6325,31 @@ 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_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 ) @@ -6343,36 +6365,37 @@ int main (int argc, char * const argv[]) { /////////////// // Still to be implemented -//#define CHECK_NOFAIL( expr ) // !TBD - reports violation, but doesn't fail Test +#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, "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 d539da903032e5a6f2bf40d6d7d8e7874c860088 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 13 Nov 2012 09:44:52 +0000 Subject: [PATCH 040/296] Implemented CHECK_NO_FAIL --- include/catch.hpp | 2 +- include/internal/catch_assertionresult.h | 16 ++-- include/internal/catch_assertionresult.hpp | 24 +++++- include/internal/catch_capture.hpp | 6 +- .../catch_expressionresult_builder.hpp | 2 +- include/internal/catch_result_type.h | 2 + include/internal/catch_runner_impl.hpp | 6 +- include/reporters/catch_reporter_basic.hpp | 12 ++- include/reporters/catch_reporter_xml.hpp | 4 +- projects/SelfTest/Baselines/results.txt | 20 +++-- projects/SelfTest/MessageTests.cpp | 5 ++ single_include/catch.hpp | 75 +++++++++++++------ 12 files changed, 119 insertions(+), 55 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index d51a24a2..1c330192 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -104,7 +104,7 @@ #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, "CHECK_NOFAIL" ) +#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) #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" ) diff --git a/include/internal/catch_assertionresult.h b/include/internal/catch_assertionresult.h index c731c65d..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 = false ) - : 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 805d8179..e2919848 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -94,7 +94,7 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, resultDisposition ) \ - Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, testFlag( resultDisposition, Catch::ResultDisposition::NegateResult ) ); + Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, resultDisposition ); /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ) \ @@ -114,12 +114,12 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \ INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ - if( Catch::getResultCapture().getLastResult()->ok() ) + if( Catch::getResultCapture().getLastResult()->succeeded() ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \ INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ - if( !Catch::getResultCapture().getLastResult()->ok() ) + if( !Catch::getResultCapture().getLastResult()->succeeded() ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \ diff --git a/include/internal/catch_expressionresult_builder.hpp b/include/internal/catch_expressionresult_builder.hpp index 1ecccad5..f0a8cccc 100644 --- a/include/internal/catch_expressionresult_builder.hpp +++ b/include/internal/catch_expressionresult_builder.hpp @@ -39,7 +39,7 @@ namespace Catch { return *this; } ExpressionResultBuilder& ExpressionResultBuilder::endExpression( ResultDisposition::Flags resultDisposition ) { - m_exprComponents.shouldNegate = testFlag( resultDisposition, ResultDisposition::NegateResult ); + m_exprComponents.shouldNegate = shouldNegate( resultDisposition ); return *this; } ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { diff --git a/include/internal/catch_result_type.h b/include/internal/catch_result_type.h index 60678e27..051dde5f 100644 --- a/include/internal/catch_result_type.h +++ b/include/internal/catch_result_type.h @@ -57,6 +57,8 @@ namespace Catch { inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast( flags & ~bitOrBitsToReset ); } inline bool shouldContinueOnFailure( int flags ) { return testFlag( flags, ResultDisposition::ContinueOnFailure ); } + inline bool shouldNegate( int flags ) { return testFlag( flags, ResultDisposition::NegateResult ); } + inline bool shouldSuppressFailure( int flags ) { return testFlag( flags, ResultDisposition::SuppressFail ); } } // end namespace Catch diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index e581b909..f72d5768 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -139,7 +139,7 @@ namespace Catch { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } - else if( !result.ok() ) { + else if( !result.isOk() ) { m_totals.assertions.failed++; { @@ -235,7 +235,7 @@ namespace Catch { ResultAction::Value action = ResultAction::None; - if( !m_lastResult.ok() ) { + if( !m_lastResult.isOk() ) { action = ResultAction::Failed; if( shouldDebugBreak() ) action = (ResultAction::Value)( action | ResultAction::Debug ); @@ -247,7 +247,7 @@ namespace Catch { void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { try { - m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo() ); + m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo(), "", ResultDisposition::Normal ); m_runningTest->reset(); Counts prevAssertions = m_totals.assertions; if( m_reporter->shouldRedirectStdout() ) { 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_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 index d7b70545..8a15495d 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -189,12 +189,12 @@ [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: 0x7fff521a90a8 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:280: cp != __null succeeded for: 0x7fff521a90a8 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:283: cpc != __null succeeded for: 0x7fff521a90a8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:277: p != __null succeeded for: 0x7fff50472078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:280: cp != __null succeeded for: 0x7fff50472078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:283: cpc != __null succeeded for: 0x7fff50472078 != 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 != 0x7fff521a90a8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:288: __null != p succeeded for: 0 != 0x7fff50472078 [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] @@ -471,6 +471,10 @@ [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 @@ -575,7 +579,7 @@ [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: 0x7fff521a9878 == 0x7fff521a9870 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff50472858 == 0x7fff50472850 /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)] @@ -601,7 +605,7 @@ [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: 0x7fff521a9870 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff50472850 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] @@ -635,8 +639,8 @@ /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 66 test cases failed (72 of 361 assertions failed)] +[End of group: './failing* ./succeeding*'. 25 of 67 test cases failed (72 of 361 assertions failed)] -[Testing completed. 25 of 66 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/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index fe65f753..bcd52d71 100644 --- a/projects/SelfTest/MessageTests.cpp +++ b/projects/SelfTest/MessageTests.cpp @@ -82,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/single_include/catch.hpp b/single_include/catch.hpp index bb6ab776..3ba3e5a4 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-11-10 18:44:32.330710 + * Generated: 2012-11-12 19:04:30.724994 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -690,6 +690,8 @@ namespace Catch { inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast( flags & ~bitOrBitsToReset ); } inline bool shouldContinueOnFailure( int flags ) { return testFlag( flags, ResultDisposition::ContinueOnFailure ); } + inline bool shouldNegate( int flags ) { return testFlag( flags, ResultDisposition::NegateResult ); } + inline bool shouldSuppressFailure( int flags ) { return testFlag( flags, ResultDisposition::SuppressFail ); } } // end namespace Catch @@ -699,18 +701,15 @@ namespace Catch { struct AssertionInfo { AssertionInfo() {} - AssertionInfo( const std::string& _macroName, const SourceLineInfo& _lineInfo, const std::string& _capturedExpression = "", bool _shouldNegate = false ) - : 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 @@ -728,7 +727,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; @@ -2085,7 +2085,7 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, resultDisposition ) \ - Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, testFlag( resultDisposition, Catch::ResultDisposition::NegateResult ) ); + Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, resultDisposition ); /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ) \ @@ -2105,12 +2105,12 @@ inline bool isTrue( bool value ){ return value; } /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \ INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ - if( Catch::getResultCapture().getLastResult()->ok() ) + if( Catch::getResultCapture().getLastResult()->succeeded() ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \ INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ - if( !Catch::getResultCapture().getLastResult()->ok() ) + if( !Catch::getResultCapture().getLastResult()->succeeded() ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \ @@ -4006,7 +4006,7 @@ namespace Catch { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } - else if( !result.ok() ) { + else if( !result.isOk() ) { m_totals.assertions.failed++; { @@ -4101,7 +4101,7 @@ namespace Catch { ResultAction::Value action = ResultAction::None; - if( !m_lastResult.ok() ) { + if( !m_lastResult.isOk() ) { action = ResultAction::Failed; if( shouldDebugBreak() ) action = (ResultAction::Value)( action | ResultAction::Debug ); @@ -4113,7 +4113,7 @@ namespace Catch { void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { try { - m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo() ); + m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo(), "", ResultDisposition::Normal ); m_runningTest->reset(); Counts prevAssertions = m_totals.assertions; if( m_reporter->shouldRedirectStdout() ) { @@ -5083,6 +5083,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 ) @@ -5092,8 +5105,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 { @@ -5165,7 +5184,7 @@ namespace Catch { return *this; } ExpressionResultBuilder& ExpressionResultBuilder::endExpression( ResultDisposition::Flags resultDisposition ) { - m_exprComponents.shouldNegate = testFlag( resultDisposition, ResultDisposition::NegateResult ); + m_exprComponents.shouldNegate = shouldNegate( resultDisposition ); return *this; } ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { @@ -5522,13 +5541,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() ) { @@ -5575,13 +5598,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; @@ -5960,7 +5987,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 ); @@ -5968,7 +5995,7 @@ namespace Catch { .writeText( assertionResult.getExpression() ); m_xml.scopedElement( "Expanded" ) .writeText( assertionResult.getExpandedExpression() ); - m_currentTestSuccess &= assertionResult.ok(); + m_currentTestSuccess &= assertionResult.succeeded(); } switch( assertionResult.getResultType() ) { @@ -6381,7 +6408,7 @@ int main (int argc, char * const argv[]) { #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, "CHECK_NOFAIL" ) +#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) #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" ) From 7717c29072013fd45e36d1bc48527927fa94cbed Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 13 Nov 2012 09:45:29 +0000 Subject: [PATCH 041/296] Implemented CHECK_NOFAIL Previous commit missed some files --- include/catch.hpp | 5 +---- projects/SelfTest/Baselines/results.txt | 12 ++++++------ single_include/catch.hpp | 7 ++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index 1c330192..54acd738 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -59,6 +59,7 @@ #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, ..., 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" ) @@ -86,10 +87,6 @@ #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 diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index 8a15495d..0f2a40c6 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -189,12 +189,12 @@ [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: 0x7fff50472078 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:280: cp != __null succeeded for: 0x7fff50472078 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:283: cpc != __null succeeded for: 0x7fff50472078 != 0 +/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 != 0x7fff50472078 +/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] @@ -579,7 +579,7 @@ [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: 0x7fff50472858 == 0x7fff50472850 +/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)] @@ -605,7 +605,7 @@ [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: 0x7fff50472850 != 0 +/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] diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 3ba3e5a4..26fec610 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-11-12 19:04:30.724994 + * Generated: 2012-11-12 19:06:00.464911 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -6363,6 +6363,7 @@ int main (int argc, char * const argv[]) { #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, ..., 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" ) @@ -6390,10 +6391,6 @@ 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 From 4ea535e5059a664cc393404b454f29e6dad0886e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 13 Nov 2012 09:56:30 +0000 Subject: [PATCH 042/296] Tidied up result enums --- include/internal/catch_result_type.h | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/include/internal/catch_result_type.h b/include/internal/catch_result_type.h index 051dde5f..9fd23861 100644 --- a/include/internal/catch_result_type.h +++ b/include/internal/catch_result_type.h @@ -10,6 +10,7 @@ namespace Catch { + // ResultWas::OfType enum struct ResultWas { enum OfType { Unknown = -1, Ok = 0, @@ -32,6 +33,7 @@ namespace Catch { return ( resultType & ResultWas::FailureBit ) == 0; } + // ResultAction::Value enum struct ResultAction { enum Value { None, Failed = 1, // Failure - but no debug break if Debug bit not set @@ -39,26 +41,22 @@ namespace Catch { Abort = 4 // Test run should abort }; }; - struct ResultDisposition { - enum Flags { + // ResultDisposition::Flags enum + struct ResultDisposition { enum Flags { Normal = 0x00, - ContinueOnFailure = 0x01, - NegateResult = 0x02, - SuppressFail = 0x04 - }; - }; + 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 testFlag( int flags, int bitOrBitsToTest ) { return ( flags & bitOrBitsToTest ) == bitOrBitsToTest; } - inline bool setFlag( int flags, int bitOrBitsToSet ) { return static_cast( flags | bitOrBitsToSet ); } - inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast( flags & ~bitOrBitsToReset ); } - - inline bool shouldContinueOnFailure( int flags ) { return testFlag( flags, ResultDisposition::ContinueOnFailure ); } - inline bool shouldNegate( int flags ) { return testFlag( flags, ResultDisposition::NegateResult ); } - inline bool shouldSuppressFailure( int flags ) { return testFlag( flags, ResultDisposition::SuppressFail ); } + 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 From 70c5ef9eede41e7061ff1af45b5babe0d7cde4ba Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 13 Nov 2012 21:46:01 +0000 Subject: [PATCH 043/296] Regen single include --- single_include/catch.hpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 26fec610..e7625571 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-11-12 19:06:00.464911 + * Generated: 2012-11-13 21:45:42.830677 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -643,6 +643,7 @@ inline std::string toString( std::nullptr_t ) { namespace Catch { + // ResultWas::OfType enum struct ResultWas { enum OfType { Unknown = -1, Ok = 0, @@ -665,6 +666,7 @@ namespace Catch { return ( resultType & ResultWas::FailureBit ) == 0; } + // ResultAction::Value enum struct ResultAction { enum Value { None, Failed = 1, // Failure - but no debug break if Debug bit not set @@ -672,26 +674,22 @@ namespace Catch { Abort = 4 // Test run should abort }; }; - struct ResultDisposition { - enum Flags { + // ResultDisposition::Flags enum + struct ResultDisposition { enum Flags { Normal = 0x00, - ContinueOnFailure = 0x01, - NegateResult = 0x02, - SuppressFail = 0x04 - }; - }; + 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 testFlag( int flags, int bitOrBitsToTest ) { return ( flags & bitOrBitsToTest ) == bitOrBitsToTest; } - inline bool setFlag( int flags, int bitOrBitsToSet ) { return static_cast( flags | bitOrBitsToSet ); } - inline bool resetFlag( int flags, int bitOrBitsToReset ) { return static_cast( flags & ~bitOrBitsToReset ); } - - inline bool shouldContinueOnFailure( int flags ) { return testFlag( flags, ResultDisposition::ContinueOnFailure ); } - inline bool shouldNegate( int flags ) { return testFlag( flags, ResultDisposition::NegateResult ); } - inline bool shouldSuppressFailure( int flags ) { return testFlag( flags, ResultDisposition::SuppressFail ); } + 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 From 7673a308d971e4bdf38b7e7c9bd336384eb5a48e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 15 Nov 2012 22:15:41 +0000 Subject: [PATCH 044/296] Added versioning --- generateSingleHeader.py | 98 +++++++++++++++++++ glueHeaders.py | 54 ---------- include/catch_runner.hpp | 9 +- include/internal/catch_impl.hpp | 1 + include/internal/catch_version.h | 24 +++++ include/internal/catch_version.hpp | 19 ++++ .../CatchSelfTest.xcodeproj/project.pbxproj | 4 + single_include/catch.hpp | 36 ++++++- 8 files changed, 188 insertions(+), 57 deletions(-) create mode 100644 generateSingleHeader.py delete mode 100644 glueHeaders.py create mode 100644 include/internal/catch_version.h create mode 100644 include/internal/catch_version.hpp diff --git a/generateSingleHeader.py b/generateSingleHeader.py new file mode 100644 index 00000000..581fb146 --- /dev/null +++ b/generateSingleHeader.py @@ -0,0 +1,98 @@ +import os +import sys +import re +import datetime + +versionParser = re.compile( r'(\s*Version\slibraryVersion\s*=)\s*{\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*}.*' ) +includesParser = re.compile( r'\s*#include\s*"(.*)"' ) +guardParser = re.compile( r'\s*#.*_INCLUDED') +defineParser = re.compile( r'\s*#define') +commentParser1 = re.compile( r'^\s*/\*') +commentParser2 = re.compile( r'^\s*\*') +blankParser = re.compile( r'^\s*$') +seenHeaders = set([]) +catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) +rootPath = os.path.join( catchPath, 'include/' ) +versionPath = os.path.join( rootPath, "internal/catch_version.hpp" ) +#outputPath = os.path.join( catchPath, 'single_include/catch.hpp' ) + +def parseFile( path, filename ): + f = open( path + filename, 'r' ) + blanks = 0 + for line in f: + m = includesParser.match( line ) + if m: + header = m.group(1) + headerPath, sep, headerFile = header.rpartition( "/" ) + if not headerFile in seenHeaders: + seenHeaders.add( headerFile ) + print "// #included from: " + header + if( headerPath == "internal" and path.endswith( "internal/" ) ): + headerPath = "" + sep = "" + if os.path.exists( path + headerPath + sep + headerFile ): + parseFile( path + headerPath + sep, headerFile ) + else: + parseFile( rootPath + headerPath + sep, headerFile ) + elif (not guardParser.match( line ) or defineParser.match( line ) ) and not commentParser1.match( line )and not commentParser2.match( line ): + if blankParser.match( line ): + blanks = blanks + 1 + else: + blanks = 0 + if blanks < 2: + print line.rstrip() + +class Version: + def __init__(self): + f = open( versionPath, 'r' ) + for line in f: + m = versionParser.match( line ) + if m: + self.variableDecl = m.group(1) + self.majorVersion = int(m.group(2)) + self.minorVersion = int(m.group(3)) + self.buildNumber = int(m.group(4)) + self.branchName = m.group(5) + f.close() + + def incrementBuildNumber(self): + self.buildNumber = self.buildNumber+1 + + def updateVersionFile(self): + f = open( versionPath, 'r' ) + lines = [] + for line in f: + m = versionParser.match( line ) + if m: + lines.append( '{0} {{ {1}, {2}, {3}, "{4}" }};'.format( self.variableDecl, self.majorVersion, self.minorVersion, self.buildNumber, self.branchName ) ) + else: + lines.append( line.rstrip() ) + f.close() + f = open( versionPath, 'w' ) + for line in lines: + f.write( line + "\n" ) + +def generateSingleInclude(): + v = Version() + v.incrementBuildNumber() + v.updateVersionFile() + print "/*" + print " * CATCH v{0}.{1} build {2} ({3} branch)".format( v.majorVersion, v.minorVersion, v.buildNumber, v.branchName ) + print " * Generated: " + str( datetime.datetime.now() ) + print " * ----------------------------------------------------------" + print " * This file has been merged from multiple headers. Please don't edit it directly" + print " * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved." + print " *" + print " * Distributed under the Boost Software License, Version 1.0. (See accompanying" + print " * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)" + print " */" + print '#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED' + print '#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED' + parseFile( rootPath, 'catch.hpp' ) + print '#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED' + print + +#v = Version() +#v.incrementBuildNumber() +#v.updateVersionFile() +generateSingleInclude() diff --git a/glueHeaders.py b/glueHeaders.py deleted file mode 100644 index 11c1ab75..00000000 --- a/glueHeaders.py +++ /dev/null @@ -1,54 +0,0 @@ -import os -import sys -import re -import datetime - -includesParser = re.compile( r'\s*#include\s*"(.*)"' ) -guardParser = re.compile( r'\s*#.*_INCLUDED') -defineParser = re.compile( r'\s*#define') -commentParser1 = re.compile( r'^\s*/\*') -commentParser2 = re.compile( r'^\s*\*') -blankParser = re.compile( r'^\s*$') -seenHeaders = set([]) -rootPath = os.path.join( os.path.realpath(os.path.dirname(sys.argv[0])), 'include/' ) - -def parseFile( path, filename ): - f = open( path + filename, 'r' ) - blanks = 0 - for line in f: - m = includesParser.match( line ) - if m: - header = m.group(1) - headerPath, sep, headerFile = header.rpartition( "/" ) - if not headerFile in seenHeaders: - seenHeaders.add( headerFile ) - print "// #included from: " + header - if( headerPath == "internal" and path.endswith( "internal/" ) ): - headerPath = "" - sep = "" - if os.path.exists( path + headerPath + sep + headerFile ): - parseFile( path + headerPath + sep, headerFile ) - else: - parseFile( rootPath + headerPath + sep, headerFile ) - elif (not guardParser.match( line ) or defineParser.match( line ) ) and not commentParser1.match( line )and not commentParser2.match( line ): - if blankParser.match( line ): - blanks = blanks + 1 - else: - blanks = 0 - if blanks < 2: - print line.rstrip() - -print "/*" -print " * Generated: " + str( datetime.datetime.now() ) -print " * ----------------------------------------------------------" -print " * This file has been merged from multiple headers. Please don't edit it directly" -print " * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved." -print " *" -print " * Distributed under the Boost Software License, Version 1.0. (See accompanying" -print " * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)" -print " */" -print '#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED' -print '#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED' -parseFile( rootPath, 'catch.hpp' ) -print '#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED' -print \ No newline at end of file diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 8f18267a..b1684020 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -12,6 +12,7 @@ #include "internal/catch_list.hpp" #include "internal/catch_runner_impl.hpp" #include "internal/catch_test_spec.h" +#include "internal/catch_version.h" #include #include @@ -219,7 +220,13 @@ namespace Catch { } if( !displayedSpecificOption ) { - std::cout << exeName << " is a CATCH host application. Options are as follows:\n\n"; + std::cout << "\nCATCH v" << libraryVersion.MajorVersion << "." + << libraryVersion.MinorVersion << " build " + << libraryVersion.BuildNumber; + if( libraryVersion.BranchName != "master" ) + std::cout << " (" << libraryVersion.BranchName << " branch)"; + + std::cout << "\n\n" << exeName << " is a CATCH host application. Options are as follows:\n\n"; showUsage( std::cout ); } } diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 8bbae1c1..18555e5e 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -26,6 +26,7 @@ #include "catch_expressionresult_builder.hpp" #include "catch_test_case_info.hpp" #include "catch_tags.hpp" +#include "catch_version.hpp" #include "../reporters/catch_reporter_basic.hpp" #include "../reporters/catch_reporter_xml.hpp" diff --git a/include/internal/catch_version.h b/include/internal/catch_version.h new file mode 100644 index 00000000..ec767996 --- /dev/null +++ b/include/internal/catch_version.h @@ -0,0 +1,24 @@ +/* + * Created by Phil on 13/11/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_VERSION_H_INCLUDED +#define TWOBLUECUBES_CATCH_VERSION_H_INCLUDED + +namespace Catch { + + // Versioning information + struct Version { + const unsigned int MajorVersion; + const unsigned int MinorVersion; + const unsigned int BuildNumber; + const std::string BranchName; + }; + + extern Version libraryVersion; +} + +#endif // TWOBLUECUBES_CATCH_VERSION_H_INCLUDED diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp new file mode 100644 index 00000000..e7573191 --- /dev/null +++ b/include/internal/catch_version.hpp @@ -0,0 +1,19 @@ +/* + * Created by Phil on 14/11/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_VERSION_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED + +#include "catch_version.h" + +namespace Catch { + + // These numbers are maintained by a script + Version libraryVersion = { 0, 9, 1, "integration" }; +} + +#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 3878491a..f7ae405d 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -117,6 +117,7 @@ 4A6D0C67149B3E3D00DB3EAA /* catch_reporter_junit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_junit.hpp; sourceTree = ""; }; 4A6D0C68149B3E3D00DB3EAA /* catch_reporter_xml.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_xml.hpp; sourceTree = ""; }; 4A7ADB4314F631E10094FE10 /* catch_totals.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_totals.hpp; sourceTree = ""; }; + 4A7DB2CD1652FE4B00FA6523 /* catch_version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = catch_version.h; path = ../../../../include/internal/catch_version.h; sourceTree = ""; }; 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 = ""; }; @@ -124,6 +125,7 @@ 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_expressionresult_builder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_expressionresult_builder.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 4AA7B8B4165428BA003155F6 /* catch_version.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = catch_version.hpp; path = ../../../../include/internal/catch_version.hpp; sourceTree = ""; }; 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 = ""; }; @@ -204,6 +206,8 @@ 4A6D0C41149B3DE900DB3EAA /* Catch */ = { isa = PBXGroup; children = ( + 4A7DB2CD1652FE4B00FA6523 /* catch_version.h */, + 4AA7B8B4165428BA003155F6 /* catch_version.hpp */, 4A8E4DCF160A34E200194CBD /* SurrogateCpps */, 4A6D0C44149B3E1500DB3EAA /* catch.hpp */, 4A6D0C42149B3E1500DB3EAA /* catch_runner.hpp */, diff --git a/single_include/catch.hpp b/single_include/catch.hpp index e7625571..7ea226ac 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,6 @@ /* - * Generated: 2012-11-13 21:45:42.830677 + * CATCH v0.9 build 1 (integration branch) + * Generated: 2012-11-15 22:13:35.214657 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -4160,6 +4161,22 @@ namespace Catch { } // end namespace Catch +// #included from: internal/catch_version.h +#define TWOBLUECUBES_CATCH_VERSION_H_INCLUDED + +namespace Catch { + + // Versioning information + struct Version { + const unsigned int MajorVersion; + const unsigned int MinorVersion; + const unsigned int BuildNumber; + const std::string BranchName; + }; + + extern Version libraryVersion; +} + #include #include #include @@ -4366,7 +4383,13 @@ namespace Catch { } if( !displayedSpecificOption ) { - std::cout << exeName << " is a CATCH host application. Options are as follows:\n\n"; + std::cout << "\nCATCH v" << libraryVersion.MajorVersion << "." + << libraryVersion.MinorVersion << " build " + << libraryVersion.BuildNumber; + if( libraryVersion.BranchName != "master" ) + std::cout << " (" << libraryVersion.BranchName << " branch)"; + + std::cout << "\n\n" << exeName << " is a CATCH host application. Options are as follows:\n\n"; showUsage( std::cout ); } } @@ -5346,6 +5369,15 @@ namespace Catch { } // end namespace Catch +// #included from: catch_version.hpp +#define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED + +namespace Catch { + + // These numbers are maintained by a script + Version libraryVersion = { 0, 9, 1, "integration" }; +} + // #included from: ../reporters/catch_reporter_basic.hpp #define TWOBLUECUBES_CATCH_REPORTER_BASIC_HPP_INCLUDED From be1cddb7ee0b2c76edc5380afe170ca302b2d8d9 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 16 Nov 2012 08:24:13 +0000 Subject: [PATCH 045/296] Removed commented out cruft from script --- generateSingleHeader.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/generateSingleHeader.py b/generateSingleHeader.py index 581fb146..ba4243a2 100644 --- a/generateSingleHeader.py +++ b/generateSingleHeader.py @@ -92,7 +92,4 @@ def generateSingleInclude(): print '#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED' print -#v = Version() -#v.incrementBuildNumber() -#v.updateVersionFile() generateSingleInclude() From ef60d54671981f86b0c94bd597f8acf8382b4ba2 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 16 Nov 2012 08:47:03 +0000 Subject: [PATCH 046/296] Fix (hopefully) for #5 (reopened) Adds name to JUnit reporter's testsuite element, even when running all tests. Also removes redundant comment from the output. --- include/internal/catch_version.hpp | 2 +- include/reporters/catch_reporter_junit.hpp | 9 +++++---- single_include/catch.hpp | 13 +++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index e7573191..9c293e77 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion = { 0, 9, 1, "integration" }; + Version libraryVersion = { 0, 9, 2, "integration" }; } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 93c48360..d9b1a47a 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -79,8 +79,11 @@ namespace Catch { virtual void StartTesting(){} - virtual void StartGroup( const std::string& groupName ) { - m_statsForSuites.push_back( Stats( groupName ) ); + virtual void StartGroup( const std::string& groupName ) { + if( groupName.empty() ) + m_statsForSuites.push_back( Stats( "all tests" ) ); + else + m_statsForSuites.push_back( Stats( groupName ) ); m_currentStats = &m_statsForSuites.back(); } @@ -188,8 +191,6 @@ namespace Catch { std::vector::const_iterator it = stats.m_testCaseStats.begin(); std::vector::const_iterator itEnd = stats.m_testCaseStats.end(); for(; it != itEnd; ++it ) { - xml.writeBlankLine(); - xml.writeComment( "Test case" ); XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); xml.writeAttribute( "classname", it->m_className ); diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 7ea226ac..bade257f 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 1 (integration branch) - * Generated: 2012-11-15 22:13:35.214657 + * CATCH v0.9 build 2 (integration branch) + * Generated: 2012-11-16 08:44:53.410120 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -5375,7 +5375,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion = { 0, 9, 1, "integration" }; + Version libraryVersion = { 0, 9, 2, "integration" }; } // #included from: ../reporters/catch_reporter_basic.hpp @@ -6148,7 +6148,10 @@ namespace Catch { virtual void StartTesting(){} virtual void StartGroup( const std::string& groupName ) { - m_statsForSuites.push_back( Stats( groupName ) ); + if( groupName.empty() ) + m_statsForSuites.push_back( Stats( "all tests" ) ); + else + m_statsForSuites.push_back( Stats( groupName ) ); m_currentStats = &m_statsForSuites.back(); } @@ -6256,8 +6259,6 @@ namespace Catch { std::vector::const_iterator it = stats.m_testCaseStats.begin(); std::vector::const_iterator itEnd = stats.m_testCaseStats.end(); for(; it != itEnd; ++it ) { - xml.writeBlankLine(); - xml.writeComment( "Test case" ); XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); xml.writeAttribute( "classname", it->m_className ); From 0c90ab3572e91a6fc598bbabdb91c5f57c47b69d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 16 Nov 2012 20:43:27 +0000 Subject: [PATCH 047/296] Added version number to README (and update it from script) --- README | 3 +++ generateSingleHeader.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README b/README index 84859cf5..ba4f6cfc 100644 --- a/README +++ b/README @@ -1,3 +1,6 @@ +CATCH v0.9 build 2 (integration branch) +--------------------------------------------- + CATCH is an automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/generateSingleHeader.py b/generateSingleHeader.py index ba4243a2..835d7dad 100644 --- a/generateSingleHeader.py +++ b/generateSingleHeader.py @@ -14,6 +14,7 @@ seenHeaders = set([]) catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) rootPath = os.path.join( catchPath, 'include/' ) versionPath = os.path.join( rootPath, "internal/catch_version.hpp" ) +readmePath = os.path.join( catchPath, "README" ) #outputPath = os.path.join( catchPath, 'single_include/catch.hpp' ) def parseFile( path, filename ): @@ -72,10 +73,22 @@ class Version: for line in lines: f.write( line + "\n" ) + def updateReadmeFile(self): + f = open( readmePath, 'r' ) + lines = [] + for line in f: + lines.append( line.rstrip() ) + f.close() + f = open( readmePath, 'w' ) + f.write( 'CATCH v{0}.{1} build {2} ({3} branch)\n'.format( self.majorVersion, self.minorVersion, self.buildNumber, self.branchName ) ) + for line in lines[1:]: + f.write( line + "\n" ) + def generateSingleInclude(): v = Version() v.incrementBuildNumber() v.updateVersionFile() + v.updateReadmeFile() print "/*" print " * CATCH v{0}.{1} build {2} ({3} branch)".format( v.majorVersion, v.minorVersion, v.buildNumber, v.branchName ) print " * Generated: " + str( datetime.datetime.now() ) From f825d67d71a042c1de20b0a7fdf130eb71b13e27 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 17 Nov 2012 10:47:17 +0000 Subject: [PATCH 048/296] Tweaked bitfield tests to avoid warnings --- include/internal/catch_result_type.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/internal/catch_result_type.h b/include/internal/catch_result_type.h index 9fd23861..5492531e 100644 --- a/include/internal/catch_result_type.h +++ b/include/internal/catch_result_type.h @@ -54,9 +54,9 @@ namespace Catch { 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; } + inline bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } + inline bool shouldNegate( int flags ) { return ( flags & ResultDisposition::NegateResult ) != 0; } + inline bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } } // end namespace Catch From 75b89a9763fda51ef69a8e85ec2a3cbefc042de1 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 17 Nov 2012 10:48:37 +0000 Subject: [PATCH 049/296] New baselines As well as some new tests these baselines were generated using > instead of -o, so includes messages sent to stdout and not visible in the directed output --- projects/SelfTest/Baselines/results.txt | 102 +++++++++++++++--------- 1 file changed, 66 insertions(+), 36 deletions(-) diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index 0f2a40c6..b3d4affa 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -1,5 +1,5 @@ [Started testing] -[Started group: './failing* ./succeeding*'] +[Started group: '*succeeding* *failing*'] [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 ) @@ -173,50 +173,57 @@ /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/const ints to int literal] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:237: unsigned_char_var == 1 succeeded for:  == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:238: unsigned_short_var == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:239: unsigned_int_var == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:240: unsigned_long_var == 1 succeeded for: 1 == 1 +[Finished: './succeeding/conditions/const ints to int literal' 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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:246: ( -1 > 2u ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:247: -1 > 2u succeeded for: -1 > 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:249: ( 2u < -1 ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:250: 2u < -1 succeeded for: 2 < -1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:253: ( minInt > 2u ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:254: 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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:269: 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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: p == __null succeeded for: __null == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff5eb450b8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff5eb450b8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff5eb450b8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff5eb450b8 [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) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:317: false == false succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:318: true == true succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:319: !false succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:320: !false succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:322: !falseValue succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:323: !falseValue succeeded for: !false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:325: !(1 == 2) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:326: !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) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:334: false != false failed +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:335: true != true failed +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:336: !true failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:337: !true failed +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:339: !trueValue failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:340: !trueValue failed for: !true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:342: !(1 == 1) failed for: false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:343: !1 == 1 failed for: !(1 == 1) [Finished: './failing/conditions/not' 1 test case failed (All 8 assertions failed)] [Running: ./succeeding/exceptions/explicit] @@ -470,6 +477,8 @@ [End of section: 'two' 1 assertion failed] [Finished: './failing/message/sections' 1 test case failed (All 2 assertions failed)] +Message from section one +Message from section two [Running: ./succeeding/nofail] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:88: 1 == 2 failed - but was ok @@ -498,6 +507,7 @@ [End of section: 's1' All 3 assertions passed] [Finished: './succeeding/Misc/Sections/nested' All tests passed (3 assertions in 1 test case)] +Some information [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} @@ -565,6 +575,18 @@ "this string contains 'abc' as a substring" equals: "something else" [Finished: './failing/matchers/Equals' 1 test case failed (1 assertion failed)] +[Running: /succeeding/matchers/AllOf] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:275: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: +"this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) +[Finished: '/succeeding/matchers/AllOf' All tests passed (1 assertion in 1 test case)] + +[Running: /succeeding/matchers/AnyOf] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:279: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: +"this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:280: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: +"this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) +[Finished: '/succeeding/matchers/AnyOf' All tests passed (2 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" @@ -578,8 +600,16 @@ std::pair( 1, 2 ) [Finished: './succeeding/Tricky/std::pair' All tests passed (1 assertion in 1 test case)] +[Running: ./inprogress/failing/Tricky/trailing expression] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:55: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] +[Finished: './inprogress/failing/Tricky/trailing expression' No tests ran] + +[Running: ./inprogress/failing/Tricky/compound lhs] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:71: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] +[Finished: './inprogress/failing/Tricky/compound lhs' No tests ran] + [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:95: &o1 == &o2 failed for: 0x7fff5eb45898 == 0x7fff5eb45890 /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)] @@ -605,7 +635,7 @@ [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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff5eb45890 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] @@ -639,8 +669,8 @@ /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)] +[End of group: '*succeeding* *failing*'. 25 of 72 test cases failed (72 of 368 assertions failed)] -[Testing completed. 25 of 67 test cases failed (72 of 361 assertions failed)] +[Testing completed. 25 of 72 test cases failed (72 of 368 assertions failed)] From 3e2e318eeb91d8e5417c9c93761ebfc1595d6154 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 17 Nov 2012 10:49:24 +0000 Subject: [PATCH 050/296] Build 4 --- README | 2 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README b/README index a3673d18..6eacf7db 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 3 (integration branch) +CATCH v0.9 build 4 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index a8172af4..8e6ee42f 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion = { 0, 9, 3, "integration" }; + Version libraryVersion = { 0, 9, 4, "integration" }; } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 8243c349..355ac1eb 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 3 (integration branch) - * Generated: 2012-11-16 21:01:18.673384 + * CATCH v0.9 build 4 (integration branch) + * Generated: 2012-11-17 10:48:52.075284 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -688,9 +688,9 @@ namespace Catch { 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; } + inline bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } + inline bool shouldNegate( int flags ) { return ( flags & ResultDisposition::NegateResult ) != 0; } + inline bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } } // end namespace Catch @@ -5375,7 +5375,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion = { 0, 9, 3, "integration" }; + Version libraryVersion = { 0, 9, 4, "integration" }; } // #included from: ../reporters/catch_reporter_basic.hpp From d0cc33f2849f500eb4d5123adde6e9daa830d10a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 17 Nov 2012 17:22:37 +0000 Subject: [PATCH 051/296] Unchecked exceptions don't report previous assertions message (only its line number) --- include/internal/catch_runner_impl.hpp | 3 ++ projects/SelfTest/Baselines/results.txt | 47 ++++++++++++++----------- projects/SelfTest/ExceptionTests.cpp | 7 ++++ 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index f72d5768..98381ccd 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -161,6 +161,9 @@ namespace Catch { m_assertionResults.push_back( result ); else m_reporter->Result( result ); + + // Reset AssertionInfo + m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); } virtual bool sectionStarted ( diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index b3d4affa..714beaab 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -196,12 +196,12 @@ [Running: ./succeeding/conditions/ptr] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: p == __null succeeded for: __null == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff5eb450b8 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff5eb450b8 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff5eb450b8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff523800e8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff523800e8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff523800e8 != 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff5eb450b8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff523800e8 [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] @@ -242,68 +242,73 @@ /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/implicit/2] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:60: 1 == 1 succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:60: {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' +[Finished: './failing/exceptions/implicit/2' 1 test case failed (1 of 2 assertions failed)] + [Running: ./failing/exceptions/custom] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:95: Unexpected exception with message: 'custom exception' +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:102: 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' +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:109: 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' +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:114: 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' +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:118: 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' +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:132: 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: +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:152: 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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:102: 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: +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:160: 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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:132: 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: +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:161: 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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:132: 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: " +" contains: "/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:132: " [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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:172: thisFunctionNotImplemented( 7 ) succeeded [Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/generators/1] @@ -609,7 +614,7 @@ Some information [Finished: './inprogress/failing/Tricky/compound lhs' No tests ran] [Running: ./failing/Tricky/non streamable type] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff5eb45898 == 0x7fff5eb45890 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff523808c8 == 0x7fff523808c0 /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)] @@ -635,7 +640,7 @@ Some information [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: 0x7fff5eb45890 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff523808c0 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] @@ -669,8 +674,8 @@ Some information /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* *failing*'. 25 of 72 test cases failed (72 of 368 assertions failed)] +[End of group: '*succeeding* *failing*'. 26 of 73 test cases failed (73 of 370 assertions failed)] -[Testing completed. 25 of 72 test cases failed (72 of 368 assertions failed)] +[Testing completed. 26 of 73 test cases failed (73 of 370 assertions failed)] diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp index 73354cbc..7747eb73 100644 --- a/projects/SelfTest/ExceptionTests.cpp +++ b/projects/SelfTest/ExceptionTests.cpp @@ -55,6 +55,13 @@ TEST_CASE_NORETURN( "./failing/exceptions/implicit", "When unchecked exceptions /*NOTREACHED*/ } +TEST_CASE_NORETURN( "./failing/exceptions/implicit/2", "An unchecked exception reports the line of the last assertion" ) +{ + CHECK( 1 == 1 ); + throw std::domain_error( "unexpected exception" ); + /*NOTREACHED*/ +} + TEST_CASE( "./succeeding/exceptions/implicit", "When unchecked exceptions are thrown, but caught, they do not affect the test" ) { try From a90a88adcdd9930443e7ba3419729000c54a009e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 19 Nov 2012 19:59:10 +0000 Subject: [PATCH 052/296] Junit reporter uses filename for suite name if no explicit groups --- README | 2 +- include/catch_runner.hpp | 8 +------ include/internal/catch_commandline.hpp | 9 ++++++- include/internal/catch_version.hpp | 2 +- include/reporters/catch_reporter_junit.hpp | 2 +- projects/SelfTest/TestMain.cpp | 4 ++-- projects/SelfTest/catch_self_test.hpp | 2 +- single_include/catch.hpp | 28 ++++++++++++---------- 8 files changed, 31 insertions(+), 26 deletions(-) diff --git a/README b/README index 6eacf7db..475362fd 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 4 (integration branch) +CATCH v0.9 build 5 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index b1684020..d8311968 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -199,12 +199,6 @@ namespace Catch { } inline void showHelp( const CommandParser& parser ) { - std::string exeName = parser.exeName(); - std::string::size_type pos = exeName.find_last_of( "/\\" ); - if( pos != std::string::npos ) { - exeName = exeName.substr( pos+1 ); - } - AllOptions options; Options::HelpOptionParser helpOpt; bool displayedSpecificOption = false; @@ -226,7 +220,7 @@ namespace Catch { if( libraryVersion.BranchName != "master" ) std::cout << " (" << libraryVersion.BranchName << " branch)"; - std::cout << "\n\n" << exeName << " is a CATCH host application. Options are as follows:\n\n"; + std::cout << "\n\n" << parser.exeName() << " is a CATCH host application. Options are as follows:\n\n"; showUsage( std::cout ); } } diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 4df98531..cd774059 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -70,7 +70,11 @@ namespace Catch { CommandParser( int argc, char const * const * argv ) : m_argc( static_cast( argc ) ), m_argv( argv ) {} std::string exeName() const { - return m_argv[0]; + std::string exeName = m_argv[0]; + std::string::size_type pos = exeName.find_last_of( "/\\" ); + if( pos != std::string::npos ) + exeName = exeName.substr( pos+1 ); + return exeName; } Command find( const std::string& arg1, const std::string& arg2, const std::string& arg3 ) const { return find( arg1 ) + find( arg2 ) + find( arg3 ); @@ -644,6 +648,9 @@ namespace Catch { } void parseIntoConfig( const CommandParser& parser, ConfigData& config ) { + config.name = parser.exeName(); + if( endsWith( config.name, ".exe" ) ) + config.name = config.name.substr( 0, config.name.size()-4 ); for( const_iterator it = m_parsers.begin(); it != m_parsers.end(); ++it ) (*it)->parseIntoConfig( parser, config ); } diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 8e6ee42f..4bfe44c8 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion = { 0, 9, 4, "integration" }; + Version libraryVersion = { 0, 9, 5, "integration" }; } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index d9b1a47a..e72b7981 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -81,7 +81,7 @@ namespace Catch { virtual void StartGroup( const std::string& groupName ) { if( groupName.empty() ) - m_statsForSuites.push_back( Stats( "all tests" ) ); + m_statsForSuites.push_back( Stats( m_config.name ) ); else m_statsForSuites.push_back( Stats( groupName ) ); m_currentStats = &m_statsForSuites.back(); diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 9677e752..90116c61 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -44,8 +44,8 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" SECTION( "selftest/test counts/failing tests", "Number of 'failing' tests is fixed" ) { Totals totals = runner.runMatching( "./failing/*" ); - CHECK( totals.assertions.passed == 0 ); - CHECK( totals.assertions.failed == 72 ); + CHECK( totals.assertions.passed == 1 ); + CHECK( totals.assertions.failed == 73 ); } } } diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index f31a8e99..12ad282e 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -170,7 +170,7 @@ namespace Catch { } break; case Expected::ToFail: - if( totals.assertions.passed > 0 ) { + if( totals.assertions.failed == 0 ) { INFO( runner.getOutput() ); FAIL( "Expected test case '" << testCase.getName() diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 355ac1eb..ec51c728 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 4 (integration branch) - * Generated: 2012-11-17 10:48:52.075284 + * CATCH v0.9 build 5 (integration branch) + * Generated: 2012-11-19 19:58:11.700412 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -3029,7 +3029,11 @@ namespace Catch { CommandParser( int argc, char const * const * argv ) : m_argc( static_cast( argc ) ), m_argv( argv ) {} std::string exeName() const { - return m_argv[0]; + std::string exeName = m_argv[0]; + std::string::size_type pos = exeName.find_last_of( "/\\" ); + if( pos != std::string::npos ) + exeName = exeName.substr( pos+1 ); + return exeName; } Command find( const std::string& arg1, const std::string& arg2, const std::string& arg3 ) const { return find( arg1 ) + find( arg2 ) + find( arg3 ); @@ -3601,6 +3605,9 @@ namespace Catch { } void parseIntoConfig( const CommandParser& parser, ConfigData& config ) { + config.name = parser.exeName(); + if( endsWith( config.name, ".exe" ) ) + config.name = config.name.substr( 0, config.name.size()-4 ); for( const_iterator it = m_parsers.begin(); it != m_parsers.end(); ++it ) (*it)->parseIntoConfig( parser, config ); } @@ -4027,6 +4034,9 @@ namespace Catch { m_assertionResults.push_back( result ); else m_reporter->Result( result ); + + // Reset AssertionInfo + m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); } virtual bool sectionStarted ( @@ -4362,12 +4372,6 @@ namespace Catch { } inline void showHelp( const CommandParser& parser ) { - std::string exeName = parser.exeName(); - std::string::size_type pos = exeName.find_last_of( "/\\" ); - if( pos != std::string::npos ) { - exeName = exeName.substr( pos+1 ); - } - AllOptions options; Options::HelpOptionParser helpOpt; bool displayedSpecificOption = false; @@ -4389,7 +4393,7 @@ namespace Catch { if( libraryVersion.BranchName != "master" ) std::cout << " (" << libraryVersion.BranchName << " branch)"; - std::cout << "\n\n" << exeName << " is a CATCH host application. Options are as follows:\n\n"; + std::cout << "\n\n" << parser.exeName() << " is a CATCH host application. Options are as follows:\n\n"; showUsage( std::cout ); } } @@ -5375,7 +5379,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion = { 0, 9, 4, "integration" }; + Version libraryVersion = { 0, 9, 5, "integration" }; } // #included from: ../reporters/catch_reporter_basic.hpp @@ -6149,7 +6153,7 @@ namespace Catch { virtual void StartGroup( const std::string& groupName ) { if( groupName.empty() ) - m_statsForSuites.push_back( Stats( "all tests" ) ); + m_statsForSuites.push_back( Stats( m_config.name ) ); else m_statsForSuites.push_back( Stats( groupName ) ); m_currentStats = &m_statsForSuites.back(); From 5497cd816f93f7691d460b493740540366a0b5b4 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 20 Nov 2012 08:28:21 +0000 Subject: [PATCH 053/296] Expanded baseline to include all tests --- projects/SelfTest/Baselines/results.txt | 589 +++++++++++++++++++++++- 1 file changed, 579 insertions(+), 10 deletions(-) diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index 714beaab..d95928bc 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -1,5 +1,5 @@ -[Started testing] -[Started group: '*succeeding* *failing*'] +[Started testing: CatchSelfTest] +[Started group: '~dummy'] [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 ) @@ -196,12 +196,12 @@ [Running: ./succeeding/conditions/ptr] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: p == __null succeeded for: __null == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff523800e8 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff523800e8 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff523800e8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff516500f8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff516500f8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff516500f8 != 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff523800e8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff516500f8 [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] @@ -468,6 +468,16 @@ /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: ./mixed/message/info/2] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:29: a == 2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:27: [info: this message should be logged] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:31: [info: this message should be logged, too] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:33: a == 1 failed for: 2 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:35: [info: and this, but later] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:37: a == 0 failed for: 2 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:41: a == 2 succeeded for: 2 == 2 +[Finished: './mixed/message/info/2' 1 test case failed (2 of 4 assertions 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)] @@ -485,6 +495,22 @@ Message from section one Message from section two +[Running: ./mixed/message/scoped] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 0 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 1 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 2 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 3 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 4 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 5 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 6 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 7 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 8 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 9 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded[info: current counter 10] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded[info: i := 10] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 failed for: 10 < 10 +[Finished: './mixed/message/scoped' 1 test case failed (1 of 11 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] @@ -512,6 +538,98 @@ Message from section two [End of section: 's1' All 3 assertions passed] [Finished: './succeeding/Misc/Sections/nested' All tests passed (3 assertions in 1 test case)] + +[Running: ./mixed/Misc/Sections/nested2] +[Started section: 's1'] +[Started section: 's2'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:61: a == b failed for: 1 == 2 +[End of section: 's2' 1 assertion failed] + +[End of section: 's1' 1 assertion failed] + +[Started section: 's1'] +[Started section: 's3'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:66: a != b succeeded for: 1 != 2 +[End of section: 's3' 1 assertion passed] + +[End of section: 's1' 1 assertion passed] + +[Started section: 's1'] +[Started section: 's4'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:70: a < b succeeded for: 1 < 2 +[End of section: 's4' 1 assertion passed] + +[End of section: 's1' 1 assertion passed] + +[Finished: './mixed/Misc/Sections/nested2' 1 test case failed (1 of 3 assertions failed)] + +[Running: Sections/nested3] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:119: runner.getLog() == "\\[g] ./Sections/nested/a/b\n" " \\[tc] ./Sections/nested/a/b\n" " \\ [s] c\n" " \\ [s] d (leaf)\n" " / [s] d (leaf)\n" " / [s] c\n" " \\ [s] c\n" " \\ [s] e (leaf)\n" " / [s] e (leaf)\n" " / [s] c\n" " \\ [s] c\n" " / [s] c\n" " \\ [s] f (leaf)\n" " / [s] f (leaf)\n" " /[tc] ./Sections/nested/a/b\n" "/[g] ./Sections/nested/a/b\n" succeeded for: + +"\[g] ./Sections/nested/a/b + \[tc] ./Sections/nested/a/b + \ [s] c + \ [s] d (leaf) + / [s] d (leaf) + / [s] c + \ [s] c + \ [s] e (leaf) + / [s] e (leaf) + / [s] c + \ [s] c + / [s] c + \ [s] f (leaf) + / [s] f (leaf) + /[tc] ./Sections/nested/a/b +/[g] ./Sections/nested/a/b +" +== +"\[g] ./Sections/nested/a/b + \[tc] ./Sections/nested/a/b + \ [s] c + \ [s] d (leaf) + / [s] d (leaf) + / [s] c + \ [s] c + \ [s] e (leaf) + / [s] e (leaf) + / [s] c + \ [s] c + / [s] c + \ [s] f (leaf) + / [s] f (leaf) + /[tc] ./Sections/nested/a/b +/[g] ./Sections/nested/a/b +" + + +[Finished: 'Sections/nested3' All tests passed (1 assertion in 1 test case)] + +[Running: ./mixed/Misc/Sections/loops] +[Started section: 's1'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:133: b > a failed for: 0 > 1 +[End of section: 's1' 1 assertion failed] + +[Finished: './mixed/Misc/Sections/loops' 1 test case failed (1 assertion failed)] + +[Running: ./mixed/Misc/loops] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[0] (1) is even] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[1] (1) is even] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[2] (2) is even] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[3] (3) is even] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[4] (5) is even] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[5] (8) is even] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[6] (13) is even] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[7] (21) is even] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +[Finished: './mixed/Misc/loops' 1 test case failed (6 of 8 assertions failed)] Some information [Running: ./succeeding/Misc/null strings] @@ -545,6 +663,11 @@ Some information /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: ./manual/onechar] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:225: [info: 3] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:226: false failed +[Finished: './manual/onechar' 1 test case failed (1 assertion 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)] @@ -597,6 +720,439 @@ Some information "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: example/factorial] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:296: Factorial(0) == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:297: Factorial(1) == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:298: Factorial(2) == 2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:299: Factorial(3) == 6 succeeded for: 6 == 6 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:300: Factorial(10) == 3628800 succeeded for: 0x375f00 == 3628800 +[Finished: 'example/factorial' All tests passed (5 assertions in 1 test case)] + +[Running: Nice descriptive name] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:309: [warning: This one ran] +[Finished: 'Nice descriptive name' No tests ran] + +[Running: selftest/main] +[Started section: 'selftest/expected result'] +[Started section: 'selftest/expected result/failing tests'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[End of section: 'selftest/expected result/failing tests' All 26 assertions passed] + +[End of section: 'selftest/expected result' All 26 assertions passed] + +[Started section: 'selftest/expected result'] +[Started section: 'selftest/expected result/succeeding tests'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +Message from section one +Message from section two +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +Some information +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[End of section: 'selftest/expected result/succeeding tests' All 43 assertions passed] + +[End of section: 'selftest/expected result' All 43 assertions passed] + +Message from section one +Message from section two +Some information +[Started section: 'selftest/test counts'] +[Started section: 'selftest/test counts/succeeding tests'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:40: totals.assertions.passed == 293 succeeded for: 293 == 293 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 +[End of section: 'selftest/test counts/succeeding tests' All 2 assertions passed] + +[End of section: 'selftest/test counts' All 2 assertions passed] + +[Started section: 'selftest/test counts'] +[Started section: 'selftest/test counts/failing tests'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:48: totals.assertions.failed == 73 succeeded for: 73 == 73 +[End of section: 'selftest/test counts/failing tests' All 2 assertions passed] + +[End of section: 'selftest/test counts' All 2 assertions passed] + +[Finished: 'selftest/main' All tests passed (73 assertions in 1 test case)] + +[Running: meta/Misc/Sections] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:58: totals.assertions.failed == 1 succeeded for: 1 == 1 +[Finished: 'meta/Misc/Sections' All tests passed (2 assertions in 1 test case)] + +[Running: selftest/parser/2] +[Started section: 'default'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:97: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:99: config.shouldDebugBreak == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:100: config.cutoff == -1 succeeded for: -1 == -1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:101: config.allowThrows == true succeeded for: true == true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:102: config.reporter.empty() succeeded for: true +[End of section: 'default' All 5 assertions passed] + +[Started section: 'test lists'] +[Started section: '-t/1'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:108: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:110: config.filters.size() == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:111: config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:112: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) succeeded for: true +[End of section: '-t/1' All 4 assertions passed] + +[End of section: 'test lists' All 4 assertions passed] + +[Started section: 'test lists'] +[Started section: '-t/exclude:1'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:116: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:118: config.filters.size() == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:119: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:120: config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) succeeded for: true +[End of section: '-t/exclude:1' All 4 assertions passed] + +[End of section: 'test lists' All 4 assertions passed] + +[Started section: 'test lists'] +[Started section: '--test/1'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:125: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:127: config.filters.size() == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:128: config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:129: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) succeeded for: true +[End of section: '--test/1' All 4 assertions passed] + +[End of section: 'test lists' All 4 assertions passed] + +[Started section: 'test lists'] +[Started section: '--test/exclude:1'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:134: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:136: config.filters.size() == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:137: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:138: config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) succeeded for: true +[End of section: '--test/exclude:1' All 4 assertions passed] + +[End of section: 'test lists' All 4 assertions passed] + +[Started section: 'test lists'] +[Started section: '--test/exclude:2'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:143: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:145: config.filters.size() == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:146: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:147: config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) succeeded for: true +[End of section: '--test/exclude:2' All 4 assertions passed] + +[End of section: 'test lists' All 4 assertions passed] + +[Started section: 'test lists'] +[Started section: '-t/2'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:152: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:154: config.filters.size() == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:155: config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:156: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:157: config.filters[0].shouldInclude( makeTestCase( "test2" ) ) succeeded for: true +[End of section: '-t/2' All 5 assertions passed] + +[End of section: 'test lists' All 5 assertions passed] + +[Started section: 'test lists'] +[Started section: '-t/0'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: +"Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" +[End of section: '-t/0' 1 assertion passed] + +[End of section: 'test lists' 1 assertion passed] + +[Started section: 'reporter'] +[Started section: '-r/basic'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:169: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:171: config.reporter == "basic" succeeded for: "basic" == "basic" +[End of section: '-r/basic' All 2 assertions passed] + +[End of section: 'reporter' All 2 assertions passed] + +[Started section: 'reporter'] +[Started section: '-r/xml'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:175: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:177: config.reporter == "xml" succeeded for: "xml" == "xml" +[End of section: '-r/xml' All 2 assertions passed] + +[End of section: 'reporter' All 2 assertions passed] + +[Started section: 'reporter'] +[Started section: '--reporter/junit'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:181: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:183: config.reporter == "junit" succeeded for: "junit" == "junit" +[End of section: '--reporter/junit' All 2 assertions passed] + +[End of section: 'reporter' All 2 assertions passed] + +[Started section: 'reporter'] +[Started section: '-r/error'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: +"Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" +[End of section: '-r/error' 1 assertion passed] + +[End of section: 'reporter' 1 assertion passed] + +[Started section: 'debugger'] +[Started section: '-b'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:194: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:196: config.shouldDebugBreak == true succeeded for: true == true +[End of section: '-b' All 2 assertions passed] + +[End of section: 'debugger' All 2 assertions passed] + +[Started section: 'debugger'] +[Started section: '--break'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:200: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:202: config.shouldDebugBreak succeeded for: true +[End of section: '--break' All 2 assertions passed] + +[End of section: 'debugger' All 2 assertions passed] + +[Started section: 'debugger'] +[Started section: '-b'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: +"Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" +[End of section: '-b' 1 assertion passed] + +[End of section: 'debugger' 1 assertion passed] + +[Started section: 'abort'] +[Started section: '-a'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:213: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:215: config.cutoff == 1 succeeded for: 1 == 1 +[End of section: '-a' All 2 assertions passed] + +[End of section: 'abort' All 2 assertions passed] + +[Started section: 'abort'] +[Started section: '-a/2'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:219: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:221: config.cutoff == 2 succeeded for: 2 == 2 +[End of section: '-a/2' All 2 assertions passed] + +[End of section: 'abort' All 2 assertions passed] + +[Started section: 'abort'] +[Started section: '-a/error/0'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +"Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" +[End of section: '-a/error/0' 1 assertion passed] + +[End of section: 'abort' 1 assertion passed] + +[Started section: 'abort'] +[Started section: '-a/error/non numeric'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +"Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" +[End of section: '-a/error/non numeric' 1 assertion passed] + +[End of section: 'abort' 1 assertion passed] + +[Started section: 'abort'] +[Started section: '-a/error/two args'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: +"Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" +[End of section: '-a/error/two args' 1 assertion passed] + +[End of section: 'abort' 1 assertion passed] + +[Started section: 'nothrow'] +[Started section: '-nt'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:240: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:242: config.allowThrows == false succeeded for: false == false +[End of section: '-nt' All 2 assertions passed] + +[End of section: 'nothrow' All 2 assertions passed] + +[Started section: 'nothrow'] +[Started section: '--nothrow'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:246: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:248: config.allowThrows == false succeeded for: false == false +[End of section: '--nothrow' All 2 assertions passed] + +[End of section: 'nothrow' All 2 assertions passed] + +[Started section: 'streams'] +[Started section: '-o filename'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:255: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:257: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:258: config.stream.empty() succeeded for: true +[End of section: '-o filename' All 3 assertions passed] + +[End of section: 'streams' All 3 assertions passed] + +[Started section: 'streams'] +[Started section: '-o %stdout'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:264: config.stream == "stdout" succeeded for: "stdout" == "stdout" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:265: config.outputFilename.empty() succeeded for: true +[End of section: '-o %stdout' All 3 assertions passed] + +[End of section: 'streams' All 3 assertions passed] + +[Started section: 'streams'] +[Started section: '--out'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:271: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +[End of section: '--out' All 2 assertions passed] + +[End of section: 'streams' All 2 assertions passed] + +[Started section: 'combinations'] +[Started section: '-a -b'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:278: parseIntoConfig( argv, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:280: config.cutoff == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:281: config.shouldDebugBreak succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:282: config.allowThrows == false succeeded for: false == false +[End of section: '-a -b' All 4 assertions passed] + +[End of section: 'combinations' All 4 assertions passed] + +[Finished: 'selftest/parser/2' All tests passed (66 assertions in 1 test case)] + +[Running: selftest/test filter] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:291: matchAny.shouldInclude( makeTestCase( "any" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:292: matchNone.shouldInclude( makeTestCase( "any" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:297: matchHidden.shouldInclude( makeTestCase( "any" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:298: matchNonHidden.shouldInclude( makeTestCase( "any" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:300: matchHidden.shouldInclude( makeTestCase( "./any" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:301: matchNonHidden.shouldInclude( makeTestCase( "./any" ) ) == false succeeded for: false == false +[Finished: 'selftest/test filter' All tests passed (6 assertions in 1 test case)] + +[Running: selftest/test filters] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:312: matchHidden.shouldInclude( makeTestCase( "./something" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:314: filters.shouldInclude( makeTestCase( "any" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:315: filters.shouldInclude( makeTestCase( "./something" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:316: filters.shouldInclude( makeTestCase( "./anything" ) ) == false succeeded for: false == false +[Finished: 'selftest/test filters' All tests passed (4 assertions in 1 test case)] + +[Running: selftest/filter/prefix wildcard] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:322: matchBadgers.shouldInclude( makeTestCase( "big badger" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:323: matchBadgers.shouldInclude( makeTestCase( "little badgers" ) ) == false succeeded for: false == false +[Finished: 'selftest/filter/prefix wildcard' All tests passed (2 assertions in 1 test case)] + +[Running: selftest/filter/wildcard at both ends] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:328: matchBadgers.shouldInclude( makeTestCase( "big badger" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:329: matchBadgers.shouldInclude( makeTestCase( "little badgers" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:330: matchBadgers.shouldInclude( makeTestCase( "badgers are big" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:331: matchBadgers.shouldInclude( makeTestCase( "hedgehogs" ) ) == false succeeded for: false == false +[Finished: 'selftest/filter/wildcard at both ends' All tests passed (4 assertions in 1 test case)] + +[Running: selftest/option parsers] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:351: opt.parseIntoConfig( parser, config ) succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:353: config.filters.size() == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:354: config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:355: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) succeeded for: true +[Finished: 'selftest/option parsers' All tests passed (4 assertions in 1 test case)] + +[Running: selftest/tags] +[Started section: 'one tag'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:369: oneTag.getDescription() == "" succeeded for: "" == "" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:370: oneTag.hasTag( "one" ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:371: oneTag.getTags().size() == 1 succeeded for: 1 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:373: oneTag.matchesTags( p1 ) == true succeeded for: true == true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:374: oneTag.matchesTags( p2 ) == true succeeded for: true == true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:375: oneTag.matchesTags( p3 ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:376: oneTag.matchesTags( p4 ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:377: oneTag.matchesTags( p5 ) == false succeeded for: false == false +[End of section: 'one tag' All 8 assertions passed] + +[Started section: 'two tags'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:383: twoTags.getDescription() == "" succeeded for: "" == "" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:384: twoTags.hasTag( "one" ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:385: twoTags.hasTag( "two" ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:386: twoTags.hasTag( "three" ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:387: twoTags.getTags().size() == 2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:389: twoTags.matchesTags( p1 ) == true succeeded for: true == true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:390: twoTags.matchesTags( p2 ) == true succeeded for: true == true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:391: twoTags.matchesTags( p3 ) == true succeeded for: true == true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:392: twoTags.matchesTags( p4 ) == true succeeded for: true == true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:393: twoTags.matchesTags( p5 ) == true succeeded for: true == true +[End of section: 'two tags' All 10 assertions passed] + +[Started section: 'one tag with characters either side'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:399: oneTagWithExtras.getDescription() == "1234" succeeded for: "1234" == "1234" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:400: oneTagWithExtras.hasTag( "one" ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:401: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:402: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 +[End of section: 'one tag with characters either side' All 4 assertions passed] + +[Started section: 'start of a tag, but not closed'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:409: oneTagOpen.getDescription() == "[one" succeeded for: "[one" == "[one" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:410: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:411: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 +[End of section: 'start of a tag, but not closed' All 3 assertions passed] + +[Started section: 'hidden'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:417: oneTag.getDescription() == "" succeeded for: "" == "" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:418: oneTag.hasTag( "hide" ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:419: oneTag.isHidden() succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:421: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false +[End of section: 'hidden' All 4 assertions passed] + +[Finished: 'selftest/tags' All tests passed (29 assertions 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: @@ -614,7 +1170,7 @@ Some information [Finished: './inprogress/failing/Tricky/compound lhs' No tests ran] [Running: ./failing/Tricky/non streamable type] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff523808c8 == 0x7fff523808c0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff516508d8 == 0x7fff516508d0 /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)] @@ -640,7 +1196,7 @@ Some information [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: 0x7fff523808c0 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff516508d0 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] @@ -674,8 +1230,21 @@ Some information /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* *failing*'. 26 of 73 test cases failed (73 of 370 assertions failed)] + +[Running: scenario name] +[Started section: 'This stuff exists'] +[Started section: 'I do this'] +[Started section: 'it should this this'] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp:37: itDoesThis() succeeded for: true +[End of section: 'it should this this' 1 assertion passed] + +[End of section: 'I do this' 1 assertion passed] + +[End of section: 'This stuff exists' 1 assertion passed] + +[Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] +[End of group: '~dummy'. 32 of 97 test cases failed (85 of 595 assertions failed)] -[Testing completed. 26 of 73 test cases failed (73 of 370 assertions failed)] +[Testing completed. 32 of 97 test cases failed (85 of 595 assertions failed)] From db48a6dfdafcc970eac39f085526a12c23a2fd9b Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 20 Nov 2012 21:13:21 +0000 Subject: [PATCH 054/296] Updated baselines to include NoAssertions warning --- projects/SelfTest/Baselines/results.txt | 141 +++++++++++++++++++++--- 1 file changed, 126 insertions(+), 15 deletions(-) diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index d95928bc..5a43a3c2 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -196,12 +196,12 @@ [Running: ./succeeding/conditions/ptr] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: p == __null succeeded for: __null == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff516500f8 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff516500f8 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff516500f8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff54a840d8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff54a840d8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff54a840d8 != 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff516500f8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff54a840d8 [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] @@ -247,6 +247,12 @@ /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:60: {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' [Finished: './failing/exceptions/implicit/2' 1 test case failed (1 of 2 assertions failed)] +[Running: ./succeeding/exceptions/implicit] + +No assertions in test case, './succeeding/exceptions/implicit' + +[Finished: './succeeding/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:102: Unexpected exception with message: 'custom exception' [Finished: './failing/exceptions/custom' 1 test case failed (1 assertion failed)] @@ -264,11 +270,20 @@ [Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/in-section] + +[Started section: 'the section'] +[Started section: 'the section2'] + +No assertions in section, 'the section2' + +[End of section: 'the section2' 1 assertion failed] + +[End of section: 'the section' 1 assertion failed] + /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:132: Unexpected exception with message: 'Exception from section' -[Finished: './failing/exceptions/in-section' 1 test case failed (1 assertion failed)] +[Finished: './failing/exceptions/in-section' 1 test case failed (All 2 assertions failed)] [Running: ./succeeding/exceptions/error messages] - [Started section: 'custom, unexpected'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:152: runner.getLog() Contains( "custom exception" ) succeeded for: "\[g] ./failing/exceptions/custom @@ -460,7 +475,10 @@ [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] + +No assertions in test case, './succeeding/message' + +[Finished: './succeeding/message' 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] @@ -493,7 +511,22 @@ [Finished: './failing/message/sections' 1 test case failed (All 2 assertions failed)] Message from section one + +[Running: ./succeeding/message/sections/stdout] +[Started section: 'one'] + +No assertions in section, 'one' + +[End of section: 'one' 1 assertion failed] + Message from section two +[Started section: 'two'] + +No assertions in section, 'two' + +[End of section: 'two' 1 assertion failed] + +[Finished: './succeeding/message/sections/stdout' 1 test case failed (All 2 assertions failed)] [Running: ./mixed/message/scoped] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 0 < 10 @@ -513,7 +546,10 @@ Message from section two [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] + +No assertions in test case, './succeeding/nofail' + +[Finished: './succeeding/nofail' 1 test case failed (1 assertion failed)] [Running: ./succeeding/Misc/Sections] [Started section: 's1'] @@ -563,6 +599,33 @@ Message from section two [Finished: './mixed/Misc/Sections/nested2' 1 test case failed (1 of 3 assertions failed)] +[Running: ./Sections/nested/a/b] +[Started section: 'c'] +[Started section: 'd (leaf)'] + +No assertions in section, 'd (leaf)' + +[End of section: 'd (leaf)' 1 assertion failed] + +[End of section: 'c' 1 assertion failed] + +[Started section: 'c'] +[Started section: 'e (leaf)'] + +No assertions in section, 'e (leaf)' + +[End of section: 'e (leaf)' 1 assertion failed] + +[End of section: 'c' 1 assertion failed] + +[Started section: 'f (leaf)'] + +No assertions in section, 'f (leaf)' + +[End of section: 'f (leaf)' 1 assertion failed] + +[Finished: './Sections/nested/a/b' 1 test case failed (All 3 assertions failed)] + [Running: Sections/nested3] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:119: runner.getLog() == "\\[g] ./Sections/nested/a/b\n" " \\[tc] ./Sections/nested/a/b\n" " \\ [s] c\n" " \\ [s] d (leaf)\n" " / [s] d (leaf)\n" " / [s] c\n" " \\ [s] c\n" " \\ [s] e (leaf)\n" " / [s] e (leaf)\n" " / [s] c\n" " \\ [s] c\n" " / [s] c\n" " \\ [s] f (leaf)\n" " / [s] f (leaf)\n" " /[tc] ./Sections/nested/a/b\n" "/[g] ./Sections/nested/a/b\n" succeeded for: @@ -632,6 +695,12 @@ Message from section two [Finished: './mixed/Misc/loops' 1 test case failed (6 of 8 assertions failed)] Some information +[Running: ./succeeding/Misc/stdout,stderr] + +No assertions in test case, './succeeding/Misc/stdout,stderr' + +[Finished: './succeeding/Misc/stdout,stderr' 1 test case failed (1 assertion failed)] + [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} @@ -663,6 +732,21 @@ Some information /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: ./misc/xmlentitycheck] +[Started section: 'embedded xml'] + +No assertions in section, 'embedded xml' + +[End of section: 'embedded xml' 1 assertion failed] + +[Started section: 'encoded chars'] + +No assertions in section, 'encoded chars' + +[End of section: 'encoded chars' 1 assertion failed] + +[Finished: './misc/xmlentitycheck' 1 test case failed (All 2 assertions failed)] + [Running: ./manual/onechar] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:225: [info: 3] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:226: false failed @@ -728,9 +812,30 @@ Some information /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:300: Factorial(10) == 3628800 succeeded for: 0x375f00 == 3628800 [Finished: 'example/factorial' All tests passed (5 assertions in 1 test case)] +[Running: empty] + +No assertions in test case, 'empty' + +[Finished: 'empty' 1 test case failed (1 assertion failed)] + [Running: Nice descriptive name] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:309: [warning: This one ran] -[Finished: 'Nice descriptive name' No tests ran] + +No assertions in test case, 'Nice descriptive name' + +[Finished: 'Nice descriptive name' 1 test case failed (1 assertion failed)] + +[Running: first tag] + +No assertions in test case, 'first tag' + +[Finished: 'first tag' 1 test case failed (1 assertion failed)] + +[Running: second tag] + +No assertions in test case, 'second tag' + +[Finished: 'second tag' 1 test case failed (1 assertion failed)] [Running: selftest/main] [Started section: 'selftest/expected result'] @@ -1163,14 +1268,20 @@ Some information [Running: ./inprogress/failing/Tricky/trailing expression] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:55: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] -[Finished: './inprogress/failing/Tricky/trailing expression' No tests ran] + +No assertions in test case, './inprogress/failing/Tricky/trailing expression' + +[Finished: './inprogress/failing/Tricky/trailing expression' 1 test case failed (1 assertion failed)] [Running: ./inprogress/failing/Tricky/compound lhs] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:71: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] -[Finished: './inprogress/failing/Tricky/compound lhs' No tests ran] + +No assertions in test case, './inprogress/failing/Tricky/compound lhs' + +[Finished: './inprogress/failing/Tricky/compound lhs' 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: 0x7fff516508d8 == 0x7fff516508d0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff54a848b8 == 0x7fff54a848b0 /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)] @@ -1196,7 +1307,7 @@ Some information [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: 0x7fff516508d0 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff54a848b0 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] @@ -1243,8 +1354,8 @@ Some information [End of section: 'This stuff exists' 1 assertion passed] [Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 32 of 97 test cases failed (85 of 595 assertions failed)] +[End of group: '~dummy'. 45 of 97 test cases failed (103 of 613 assertions failed)] -[Testing completed. 32 of 97 test cases failed (85 of 595 assertions failed)] +[Testing completed. 45 of 97 test cases failed (103 of 613 assertions failed)] From 5d248c98bfb5974cd624cc95e94a9c149fa3348a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 21 Nov 2012 08:19:23 +0000 Subject: [PATCH 055/296] Moved code that detects absence of assertions closer to where end of test case is reported (ready for merging). Also now considers info macros when warning (i.e. an empty test case with an INFO() will not warn). --- include/internal/catch_runner_impl.hpp | 27 +++++++++++++++---------- include/internal/catch_totals.hpp | 5 ++++- projects/SelfTest/Baselines/results.txt | 21 +++++++++---------- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 98381ccd..303f958c 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -115,12 +115,22 @@ namespace Catch { } while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() ); + Totals deltaTotals = m_totals.delta( prevTotals ); + if( deltaTotals.assertions.total() == 0 && + deltaTotals.assertions.info == 0 && + ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) ) { + m_totals.assertions.failed++; + deltaTotals = m_totals.delta( prevTotals ); + m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCaseInfo().getName() ); + } + m_totals.testCases += deltaTotals.testCases; + + m_reporter->EndTestCase( testInfo, deltaTotals, redirectedCout, redirectedCerr ); + + delete m_runningTest; m_runningTest = NULL; - Totals deltaTotals = m_totals.delta( prevTotals ); - m_totals.testCases += deltaTotals.testCases; - m_reporter->EndTestCase( testInfo, deltaTotals, redirectedCout, redirectedCerr ); return deltaTotals; } @@ -158,7 +168,10 @@ namespace Catch { } if( result.getResultType() == ResultWas::Info ) + { m_assertionResults.push_back( result ); + m_totals.assertions.info++; + } else m_reporter->Result( result ); @@ -252,7 +265,6 @@ namespace Catch { try { m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo(), "", ResultDisposition::Normal ); m_runningTest->reset(); - Counts prevAssertions = m_totals.assertions; if( m_reporter->shouldRedirectStdout() ) { StreamRedirect coutRedir( std::cout, redirectedCout ); StreamRedirect cerrRedir( std::cerr, redirectedCerr ); @@ -261,13 +273,6 @@ namespace Catch { else { m_runningTest->getTestCaseInfo().invoke(); } - Counts assertions = m_totals.assertions - prevAssertions; - if( assertions.total() == 0 && - ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) && - !m_runningTest->hasSections() ) { - m_totals.assertions.failed++; - m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCaseInfo().getName() ); - } m_runningTest->ranToCompletion(); } catch( TestFailureException& ) { diff --git a/include/internal/catch_totals.hpp b/include/internal/catch_totals.hpp index 03832a2e..9f854580 100644 --- a/include/internal/catch_totals.hpp +++ b/include/internal/catch_totals.hpp @@ -13,17 +13,19 @@ namespace Catch { struct Counts { - Counts() : passed( 0 ), failed( 0 ) {} + Counts() : passed( 0 ), failed( 0 ), info( 0 ) {} Counts operator - ( const Counts& other ) const { Counts diff; diff.passed = passed - other.passed; diff.failed = failed - other.failed; + diff.info = info - other.info; return diff; } Counts& operator += ( const Counts& other ) { passed += other.passed; failed += other.failed; + info += other.info; return *this; } @@ -33,6 +35,7 @@ namespace Catch { std::size_t passed; std::size_t failed; + std::size_t info; }; struct Totals { diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index 5a43a3c2..f2e5e7bf 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -196,12 +196,12 @@ [Running: ./succeeding/conditions/ptr] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: p == __null succeeded for: __null == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff54a840d8 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff54a840d8 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff54a840d8 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff5c6b3078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff5c6b3078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff5c6b3078 != 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff54a840d8 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff5c6b3078 [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] @@ -475,10 +475,7 @@ No assertions in section, 'the section2' [Running: ./succeeding/message] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:14: [warning: this is a warning] - -No assertions in test case, './succeeding/message' - -[Finished: './succeeding/message' 1 test case failed (1 assertion failed)] +[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] @@ -1281,7 +1278,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [Finished: './inprogress/failing/Tricky/compound lhs' 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: 0x7fff54a848b8 == 0x7fff54a848b0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff5c6b3858 == 0x7fff5c6b3850 /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)] @@ -1307,7 +1304,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [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: 0x7fff54a848b0 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff5c6b3850 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] @@ -1354,8 +1351,8 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [End of section: 'This stuff exists' 1 assertion passed] [Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 45 of 97 test cases failed (103 of 613 assertions failed)] +[End of group: '~dummy'. 44 of 97 test cases failed (102 of 612 assertions failed)] -[Testing completed. 45 of 97 test cases failed (103 of 613 assertions failed)] +[Testing completed. 44 of 97 test cases failed (102 of 612 assertions failed)] From deb3e9d4c496b47c084c3ad6022d171efa1a23f2 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 21 Nov 2012 08:49:20 +0000 Subject: [PATCH 056/296] Fixed SUCCEED so it logs message in basic reporter Reverted previous change so that tests with no assertions but INFO macros now warn again (but an explicit SUCCEED does not) --- include/internal/catch_runner_impl.hpp | 3 +- include/reporters/catch_reporter_basic.hpp | 5 + projects/SelfTest/Baselines/results.txt | 163 +++++++++++++++------ projects/SelfTest/MessageTests.cpp | 4 + 4 files changed, 131 insertions(+), 44 deletions(-) diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 303f958c..5d4c2145 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -117,7 +117,6 @@ namespace Catch { Totals deltaTotals = m_totals.delta( prevTotals ); if( deltaTotals.assertions.total() == 0 && - deltaTotals.assertions.info == 0 && ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) ) { m_totals.assertions.failed++; deltaTotals = m_totals.delta( prevTotals ); @@ -203,7 +202,7 @@ namespace Catch { virtual void sectionEnded( const std::string& name, const Counts& prevAssertions ) { Counts assertions = m_totals.assertions - prevAssertions; - if( assertions.total() == 0 && + if( assertions.total() == 0 && ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) && !m_runningTest->isBranchSection() ) { m_reporter->NoAssertionsInSection( name ); diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 7a55d3be..647fede5 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -243,6 +243,11 @@ namespace Catch { } } } + if( assertionResult.hasMessage() ) { + m_config.stream << "\n"; + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "with message", assertionResult.getMessage() ); + } break; } diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index f2e5e7bf..7c0d287e 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -196,12 +196,12 @@ [Running: ./succeeding/conditions/ptr] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: p == __null succeeded for: __null == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff5c6b3078 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff5c6b3078 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff5c6b3078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff5d60b078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff5d60b078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff5d60b078 != 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff5c6b3078 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff5d60b078 [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] @@ -475,35 +475,43 @@ No assertions in section, 'the section2' [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] + +No assertions in test case, './succeeding/message' + +[Finished: './succeeding/message' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/succeed] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:18: succeeded +[with message: this is a success] +[Finished: './succeeding/succeed' All tests passed (1 assertion in 1 test case)] [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 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:23: [info: this message should be logged] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:24: [info: so should this] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:26: a == 1 failed for: 2 == 1 [Finished: './failing/message/info/1' 1 test case failed (1 assertion failed)] [Running: ./mixed/message/info/2] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:29: a == 2 succeeded for: 2 == 2 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:27: [info: this message should be logged] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:31: [info: this message should be logged, too] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:33: a == 1 failed for: 2 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:35: [info: and this, but later] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:37: a == 0 failed for: 2 == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:41: a == 2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:31: [info: this message should be logged] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:35: [info: this message should be logged, too] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:37: a == 1 failed for: 2 == 1 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:39: [info: and this, but later] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:41: a == 0 failed for: 2 == 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:45: a == 2 succeeded for: 2 == 2 [Finished: './mixed/message/info/2' 1 test case failed (2 of 4 assertions 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' +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:51: 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' +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:58: 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' +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:63: 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)] @@ -526,23 +534,23 @@ No assertions in section, 'two' [Finished: './succeeding/message/sections/stdout' 1 test case failed (All 2 assertions failed)] [Running: ./mixed/message/scoped] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 0 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 1 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 2 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 3 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 4 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 5 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 6 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 7 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 8 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded for: 9 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded[info: current counter 10] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 succeeded[info: i := 10] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:82: i < 10 failed for: 10 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 0 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 1 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 2 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 3 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 4 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 5 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 6 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 7 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 8 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 9 < 10 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded[info: current counter 10] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded[info: i := 10] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 failed for: 10 < 10 [Finished: './mixed/message/scoped' 1 test case failed (1 of 11 assertions failed)] [Running: ./succeeding/nofail] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:88: 1 == 2 failed - but was ok +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:92: 1 == 2 failed - but was ok No assertions in test case, './succeeding/nofail' @@ -838,31 +846,57 @@ No assertions in test case, 'second tag' [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/failing tests'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +[with message: Tests failed, as expected] [End of section: 'selftest/expected result/failing tests' All 26 assertions passed] [End of section: 'selftest/expected result' All 26 assertions passed] @@ -870,65 +904,110 @@ No assertions in test case, 'second tag' [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/succeeding tests'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] Message from section one Message from section two /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] Some information /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +[with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded -[End of section: 'selftest/expected result/succeeding tests' All 43 assertions passed] +[with message: Tests passed, as expected] +[End of section: 'selftest/expected result/succeeding tests' All 44 assertions passed] -[End of section: 'selftest/expected result' All 43 assertions passed] +[End of section: 'selftest/expected result' All 44 assertions passed] Message from section one Message from section two Some information [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/succeeding tests'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:40: totals.assertions.passed == 293 succeeded for: 293 == 293 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:40: totals.assertions.passed == 293 failed for: 294 == 293 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 -[End of section: 'selftest/test counts/succeeding tests' All 2 assertions passed] +[End of section: 'selftest/test counts/succeeding tests' 1 of 2 assertions failed] -[End of section: 'selftest/test counts' All 2 assertions passed] +[End of section: 'selftest/test counts' 1 of 2 assertions failed] [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/failing tests'] @@ -938,7 +1017,7 @@ Some information [End of section: 'selftest/test counts' All 2 assertions passed] -[Finished: 'selftest/main' All tests passed (73 assertions in 1 test case)] +[Finished: 'selftest/main' 1 test case failed (1 of 74 assertions failed)] [Running: meta/Misc/Sections] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 @@ -1278,7 +1357,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [Finished: './inprogress/failing/Tricky/compound lhs' 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: 0x7fff5c6b3858 == 0x7fff5c6b3850 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff5d60b858 == 0x7fff5d60b850 /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)] @@ -1304,7 +1383,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [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: 0x7fff5c6b3850 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff5d60b850 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] @@ -1351,8 +1430,8 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [End of section: 'This stuff exists' 1 assertion passed] [Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 44 of 97 test cases failed (102 of 612 assertions failed)] +[End of group: '~dummy'. 46 of 98 test cases failed (104 of 615 assertions failed)] -[Testing completed. 44 of 97 test cases failed (102 of 612 assertions failed)] +[Testing completed. 46 of 98 test cases failed (104 of 615 assertions failed)] diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index bcd52d71..f7cfea35 100644 --- a/projects/SelfTest/MessageTests.cpp +++ b/projects/SelfTest/MessageTests.cpp @@ -13,6 +13,10 @@ TEST_CASE( "./succeeding/message", "INFO and WARN do not abort tests" ) INFO( "this is a " << "message" ); // This should output the message if a failure occurs WARN( "this is a " << "warning" ); // This should always output the message but then continue } +TEST_CASE( "./succeeding/succeed", "SUCCEED counts as a test pass" ) +{ + SUCCEED( "this is a " << "success" ); +} TEST_CASE( "./failing/message/info/1", "INFO gets logged on failure" ) { From fe6d1a5838f6fed188694e7d509e90de66ece5b1 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 21 Nov 2012 18:04:10 +0000 Subject: [PATCH 057/296] Write stdOut/stdErr for each test car in JUnit reporter (for GitHub #5) --- include/reporters/catch_reporter_junit.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index e72b7981..39c6e92a 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -35,6 +35,8 @@ namespace Catch { std::string m_status; std::string m_className; std::string m_name; + std::string m_stdOut; + std::string m_stdErr; std::vector m_testStats; }; @@ -148,6 +150,9 @@ namespace Catch { } virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string& stdOut, const std::string& stdErr ) { + TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); + testCaseStats.m_stdOut = stdOut; + testCaseStats.m_stdErr = stdErr; if( !stdOut.empty() ) m_stdOut << stdOut << "\n"; if( !stdErr.empty() ) @@ -198,6 +203,13 @@ namespace Catch { xml.writeAttribute( "time", "tbd" ); OutputTestResult( xml, *it ); + + std::string stdOut = trim( it->m_stdOut ); + if( !stdOut.empty() ) + xml.scopedElement( "system-out" ).writeText( stdOut ); + std::string stdErr = trim( it->m_stdErr ); + if( !stdErr.empty() ) + xml.scopedElement( "system-err" ).writeText( stdErr ); } } From 28463671094abb8387f71c6783cf7ee3a3722ede Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 21 Nov 2012 18:06:13 +0000 Subject: [PATCH 058/296] build 6 --- README | 2 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 55 +++++++++++++++++++++--------- 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/README b/README index 475362fd..150f5135 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 5 (integration branch) +CATCH v0.9 build 6 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 4bfe44c8..081d578f 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion = { 0, 9, 5, "integration" }; + Version libraryVersion = { 0, 9, 6, "integration" }; } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index ec51c728..1d9f11e2 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 5 (integration branch) - * Generated: 2012-11-19 19:58:11.700412 + * CATCH v0.9 build 6 (integration branch) + * Generated: 2012-11-21 18:04:49.655014 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -1041,17 +1041,19 @@ public: namespace Catch { struct Counts { - Counts() : passed( 0 ), failed( 0 ) {} + Counts() : passed( 0 ), failed( 0 ), info( 0 ) {} Counts operator - ( const Counts& other ) const { Counts diff; diff.passed = passed - other.passed; diff.failed = failed - other.failed; + diff.info = info - other.info; return diff; } Counts& operator += ( const Counts& other ) { passed += other.passed; failed += other.failed; + info += other.info; return *this; } @@ -1061,6 +1063,7 @@ namespace Catch { std::size_t passed; std::size_t failed; + std::size_t info; }; struct Totals { @@ -3988,12 +3991,20 @@ namespace Catch { } while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() ); + Totals deltaTotals = m_totals.delta( prevTotals ); + if( deltaTotals.assertions.total() == 0 && + ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) ) { + m_totals.assertions.failed++; + deltaTotals = m_totals.delta( prevTotals ); + m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCaseInfo().getName() ); + } + m_totals.testCases += deltaTotals.testCases; + + m_reporter->EndTestCase( testInfo, deltaTotals, redirectedCout, redirectedCerr ); + delete m_runningTest; m_runningTest = NULL; - Totals deltaTotals = m_totals.delta( prevTotals ); - m_totals.testCases += deltaTotals.testCases; - m_reporter->EndTestCase( testInfo, deltaTotals, redirectedCout, redirectedCerr ); return deltaTotals; } @@ -4031,7 +4042,10 @@ namespace Catch { } if( result.getResultType() == ResultWas::Info ) + { m_assertionResults.push_back( result ); + m_totals.assertions.info++; + } else m_reporter->Result( result ); @@ -4062,7 +4076,7 @@ namespace Catch { virtual void sectionEnded( const std::string& name, const Counts& prevAssertions ) { Counts assertions = m_totals.assertions - prevAssertions; - if( assertions.total() == 0 && + if( assertions.total() == 0 && ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) && !m_runningTest->isBranchSection() ) { m_reporter->NoAssertionsInSection( name ); @@ -4124,7 +4138,6 @@ namespace Catch { try { m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo(), "", ResultDisposition::Normal ); m_runningTest->reset(); - Counts prevAssertions = m_totals.assertions; if( m_reporter->shouldRedirectStdout() ) { StreamRedirect coutRedir( std::cout, redirectedCout ); StreamRedirect cerrRedir( std::cerr, redirectedCerr ); @@ -4133,13 +4146,6 @@ namespace Catch { else { m_runningTest->getTestCaseInfo().invoke(); } - Counts assertions = m_totals.assertions - prevAssertions; - if( assertions.total() == 0 && - ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) && - !m_runningTest->hasSections() ) { - m_totals.assertions.failed++; - m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCaseInfo().getName() ); - } m_runningTest->ranToCompletion(); } catch( TestFailureException& ) { @@ -5379,7 +5385,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion = { 0, 9, 5, "integration" }; + Version libraryVersion = { 0, 9, 6, "integration" }; } // #included from: ../reporters/catch_reporter_basic.hpp @@ -5645,6 +5651,11 @@ namespace Catch { } } } + if( assertionResult.hasMessage() ) { + m_config.stream << "\n"; + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "with message", assertionResult.getMessage() ); + } break; } @@ -6107,6 +6118,8 @@ namespace Catch { std::string m_status; std::string m_className; std::string m_name; + std::string m_stdOut; + std::string m_stdErr; std::vector m_testStats; }; @@ -6220,6 +6233,9 @@ namespace Catch { } virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string& stdOut, const std::string& stdErr ) { + TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); + testCaseStats.m_stdOut = stdOut; + testCaseStats.m_stdErr = stdErr; if( !stdOut.empty() ) m_stdOut << stdOut << "\n"; if( !stdErr.empty() ) @@ -6270,6 +6286,13 @@ namespace Catch { xml.writeAttribute( "time", "tbd" ); OutputTestResult( xml, *it ); + + std::string stdOut = trim( it->m_stdOut ); + if( !stdOut.empty() ) + xml.scopedElement( "system-out" ).writeText( stdOut ); + std::string stdErr = trim( it->m_stdErr ); + if( !stdErr.empty() ) + xml.scopedElement( "system-err" ).writeText( stdErr ); } } From 37f3820747eb7fd4e1d937e100de6f5fafcdb83c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 22 Nov 2012 09:02:24 +0000 Subject: [PATCH 059/296] Don't indent stdout/ stderr in JUnit reporter --- include/internal/catch_xmlwriter.hpp | 8 ++++---- include/reporters/catch_reporter_junit.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/internal/catch_xmlwriter.hpp b/include/internal/catch_xmlwriter.hpp index f929f601..98e827f4 100644 --- a/include/internal/catch_xmlwriter.hpp +++ b/include/internal/catch_xmlwriter.hpp @@ -34,8 +34,8 @@ namespace Catch { m_writer->endElement(); } - ScopedElement& writeText( const std::string& text ) { - m_writer->writeText( text ); + ScopedElement& writeText( const std::string& text, bool indent = true ) { + m_writer->writeText( text, indent ); return *this; } @@ -131,11 +131,11 @@ namespace Catch { return *this; } - XmlWriter& writeText( const std::string& text ) { + XmlWriter& writeText( const std::string& text, bool indent = true ) { if( !text.empty() ){ bool tagWasOpen = m_tagIsOpen; ensureTagClosed(); - if( tagWasOpen ) + if( tagWasOpen && indent ) stream() << m_indent; writeEncodedText( text ); m_needsNewline = true; diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 39c6e92a..8fac30d1 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -187,8 +187,8 @@ namespace Catch { OutputTestCases( xml, *it ); } - xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ) ); - xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ) ); + xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ), false ); + xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ), false ); } } @@ -206,10 +206,10 @@ namespace Catch { std::string stdOut = trim( it->m_stdOut ); if( !stdOut.empty() ) - xml.scopedElement( "system-out" ).writeText( stdOut ); + xml.scopedElement( "system-out" ).writeText( stdOut, false ); std::string stdErr = trim( it->m_stdErr ); if( !stdErr.empty() ) - xml.scopedElement( "system-err" ).writeText( stdErr ); + xml.scopedElement( "system-err" ).writeText( stdErr, false ); } } From 06a671a34909c19a1a4849a9d9c55ef141b654d2 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 22 Nov 2012 19:17:20 +0000 Subject: [PATCH 060/296] Renamed TestCaseInfo -> TestCase --- include/catch_runner.hpp | 6 +-- include/internal/catch_context.h | 2 +- include/internal/catch_interfaces_capture.h | 2 +- .../internal/catch_interfaces_registry_hub.h | 4 +- include/internal/catch_interfaces_reporter.h | 54 +++++++++++++++++-- include/internal/catch_interfaces_runner.h | 2 +- include/internal/catch_interfaces_testcase.h | 6 +-- include/internal/catch_list.hpp | 6 +-- include/internal/catch_objc.hpp | 2 +- include/internal/catch_registry_hub.hpp | 2 +- include/internal/catch_runner_impl.hpp | 18 +++---- include/internal/catch_running_test.hpp | 6 +-- include/internal/catch_test_case_info.h | 20 +++---- include/internal/catch_test_case_info.hpp | 36 ++++++------- .../catch_test_case_registry_impl.hpp | 34 ++++++------ include/internal/catch_test_spec.h | 6 +-- include/reporters/catch_reporter_basic.hpp | 4 +- include/reporters/catch_reporter_junit.hpp | 9 +++- include/reporters/catch_reporter_xml.hpp | 4 +- projects/SelfTest/TestMain.cpp | 12 ++--- projects/SelfTest/catch_self_test.hpp | 6 +-- 21 files changed, 146 insertions(+), 95 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index d8311968..7c993c09 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -56,8 +56,8 @@ namespace Catch { Totals runTestsForGroup( Runner& context, const TestCaseFilters& filterGroup ) { Totals totals; - std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); - std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); + std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); + std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); int testsRunForGroup = 0; for(; it != itEnd; ++it ) { if( filterGroup.shouldInclude( *it ) ) { @@ -114,7 +114,7 @@ namespace Catch { const ConfigData& m_config; std::ofstream m_ofs; Ptr m_reporter; - std::set m_testsAlreadyRun; + std::set m_testsAlreadyRun; }; inline int Main( Config& configWrapper ) { diff --git a/include/internal/catch_context.h b/include/internal/catch_context.h index 51716733..831d22a3 100644 --- a/include/internal/catch_context.h +++ b/include/internal/catch_context.h @@ -16,7 +16,7 @@ namespace Catch { - class TestCaseInfo; + class TestCase; class Stream; struct IResultCapture; struct IRunner; diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index 3cbbb88e..3f01bd0b 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -15,7 +15,7 @@ namespace Catch { - class TestCaseInfo; + class TestCase; class ScopedInfo; class ExpressionResultBuilder; class AssertionResult; diff --git a/include/internal/catch_interfaces_registry_hub.h b/include/internal/catch_interfaces_registry_hub.h index da2d7fd4..7d932bde 100644 --- a/include/internal/catch_interfaces_registry_hub.h +++ b/include/internal/catch_interfaces_registry_hub.h @@ -15,7 +15,7 @@ namespace Catch { - class TestCaseInfo; + class TestCase; struct ITestCaseRegistry; struct IExceptionTranslatorRegistry; struct IExceptionTranslator; @@ -31,7 +31,7 @@ namespace Catch { struct IMutableRegistryHub { virtual ~IMutableRegistryHub(); virtual void registerReporter( const std::string& name, IReporterFactory* factory ) = 0; - virtual void registerTest( const TestCaseInfo& testInfo ) = 0; + virtual void registerTest( const TestCase& testInfo ) = 0; virtual void registerTranslator( const IExceptionTranslator* translator ) = 0; }; diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 847016ad..96075933 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -12,6 +12,8 @@ #include "catch_totals.hpp" #include "catch_ptr.hpp" #include "catch_config.hpp" +#include "catch_test_case_info.h" +#include "catch_assertionresult.h" #include #include @@ -47,10 +49,54 @@ namespace Catch private: void operator=(const ReporterConfig&); }; + + struct AssertionStats { + AssertionInfo assertionInfo; + AssertionResult assertionResult; + Totals totals; + }; + + struct TestCaseStats { + TestCase testInfo; + Totals totals; + std::string stdOut; + std::string stdErr; + bool aborting; + }; - class TestCaseInfo; - class AssertionResult; + struct TestGroupStats { + std::string groupName; + Totals totals; + bool aborting; + }; + struct TestRunStats { + std::string runName; + Totals totals; + bool aborting; + }; + + // !Work In progress + struct IStreamingReporter : IShared { + virtual void testRunStarting( const std::string& runName ) = 0; + virtual void testGroupStarting( const std::string& groupName ) = 0; + + // !TBD: include section info (perhaps TestCase has an isSection flag and/ or a parent pointer + virtual void testCaseStarting( const TestCase& testInfo ) = 0; + virtual void assertionStarting( const AssertionInfo& assertionInfo ) = 0; + + virtual void assertionEnding( const AssertionStats& assertionStats ) = 0; + virtual void testCaseEnding( const TestCaseStats& testCaseStats ) = 0; + virtual void testGroupEnding( const TestGroupStats& testGroupStats ) = 0; + virtual void testRunEnding( const TestRunStats& testRunStats ) = 0; + }; + // !TBD: Derived helper that implements the streaming interface but holds the stats + // - declares a new interface where methods are called at the end of each event + // - this would be used by the JUnit reporter, for example. + // - it may be used by the basic reporter, too, but that would clear down the stack + // as it goes + + struct IReporter : IShared { virtual ~IReporter(); @@ -62,9 +108,9 @@ namespace Catch 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; + virtual void StartTestCase( const TestCase& testInfo ) = 0; // TestCaseResult - virtual void EndTestCase( const TestCaseInfo& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0; + virtual void EndTestCase( const TestCase& 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; diff --git a/include/internal/catch_interfaces_runner.h b/include/internal/catch_interfaces_runner.h index e59d64f2..bb81ffb4 100644 --- a/include/internal/catch_interfaces_runner.h +++ b/include/internal/catch_interfaces_runner.h @@ -13,7 +13,7 @@ #include namespace Catch { - class TestCaseInfo; + class TestCase; struct IRunner { virtual ~IRunner(); diff --git a/include/internal/catch_interfaces_testcase.h b/include/internal/catch_interfaces_testcase.h index 94ddf6f7..3f0c7078 100644 --- a/include/internal/catch_interfaces_testcase.h +++ b/include/internal/catch_interfaces_testcase.h @@ -22,12 +22,12 @@ namespace Catch { virtual ~ITestCase(); }; - class TestCaseInfo; + class TestCase; struct ITestCaseRegistry { virtual ~ITestCaseRegistry(); - virtual const std::vector& getAllTests() const = 0; - virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const = 0; + virtual const std::vector& getAllTests() const = 0; + virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const = 0; }; } diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 82586a1b..2b41cda8 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -12,7 +12,7 @@ #include namespace Catch { - inline bool matchesFilters( const std::vector& filters, const TestCaseInfo& testCase ) { + inline bool matchesFilters( const std::vector& filters, const TestCase& testCase ) { std::vector::const_iterator it = filters.begin(); std::vector::const_iterator itEnd = filters.end(); for(; it != itEnd; ++it ) @@ -38,8 +38,8 @@ namespace Catch { std::cout << "All available test cases:\n"; else std::cout << "Matching test cases:\n"; - std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); - std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); + std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); + std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); std::size_t matchedTests = 0; for(; it != itEnd; ++it ) { if( matchesFilters( config.filters, *it ) ) { diff --git a/include/internal/catch_objc.hpp b/include/internal/catch_objc.hpp index fabfda8f..dbc5a97f 100644 --- a/include/internal/catch_objc.hpp +++ b/include/internal/catch_objc.hpp @@ -93,7 +93,7 @@ namespace Catch { std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); - getMutableRegistryHub().registerTest( TestCaseInfo( new OcMethod( cls, selector ), name.c_str(), desc.c_str(), SourceLineInfo() ) ); + getMutableRegistryHub().registerTest( TestCase( new OcMethod( cls, selector ), name.c_str(), desc.c_str(), SourceLineInfo() ) ); noTestMethods++; } } diff --git a/include/internal/catch_registry_hub.hpp b/include/internal/catch_registry_hub.hpp index d66205de..05d602e1 100644 --- a/include/internal/catch_registry_hub.hpp +++ b/include/internal/catch_registry_hub.hpp @@ -40,7 +40,7 @@ namespace Catch { virtual void registerReporter( const std::string& name, IReporterFactory* factory ) { m_reporterRegistry.registerReporter( name, factory ); } - virtual void registerTest( const TestCaseInfo& testInfo ) { + virtual void registerTest( const TestCase& testInfo ) { m_testCaseRegistry.registerTest( testInfo ); } virtual void registerTranslator( const IExceptionTranslator* translator ) { diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 5d4c2145..596fc1b8 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -81,14 +81,14 @@ namespace Catch { Totals runMatching( const std::string& testSpec ) { - std::vector matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ); + std::vector matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ); Totals totals; m_reporter->StartGroup( testSpec ); - std::vector::const_iterator it = matchingTests.begin(); - std::vector::const_iterator itEnd = matchingTests.end(); + std::vector::const_iterator it = matchingTests.begin(); + std::vector::const_iterator itEnd = matchingTests.end(); for(; it != itEnd; ++it ) totals += runTest( *it ); // !TBD use std::accumulate? @@ -97,7 +97,7 @@ namespace Catch { return totals; } - Totals runTest( const TestCaseInfo& testInfo ) { + Totals runTest( const TestCase& testInfo ) { Totals prevTotals = m_totals; std::string redirectedCout; @@ -120,7 +120,7 @@ namespace Catch { ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) ) { m_totals.assertions.failed++; deltaTotals = m_totals.delta( prevTotals ); - m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCaseInfo().getName() ); + m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCase().getName() ); } m_totals.testCases += deltaTotals.testCases; @@ -228,7 +228,7 @@ namespace Catch { virtual std::string getCurrentTestName() const { return m_runningTest - ? m_runningTest->getTestCaseInfo().getName() + ? m_runningTest->getTestCase().getName() : ""; } @@ -262,15 +262,15 @@ namespace Catch { void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { try { - m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo(), "", ResultDisposition::Normal ); + m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getLineInfo(), "", ResultDisposition::Normal ); m_runningTest->reset(); if( m_reporter->shouldRedirectStdout() ) { StreamRedirect coutRedir( std::cout, redirectedCout ); StreamRedirect cerrRedir( std::cerr, redirectedCerr ); - m_runningTest->getTestCaseInfo().invoke(); + m_runningTest->getTestCase().invoke(); } else { - m_runningTest->getTestCaseInfo().invoke(); + m_runningTest->getTestCase().invoke(); } m_runningTest->ranToCompletion(); } diff --git a/include/internal/catch_running_test.hpp b/include/internal/catch_running_test.hpp index 3fce399e..2bda148c 100644 --- a/include/internal/catch_running_test.hpp +++ b/include/internal/catch_running_test.hpp @@ -24,7 +24,7 @@ namespace Catch { }; public: - explicit RunningTest( const TestCaseInfo* info = NULL ) + explicit RunningTest( const TestCase* info = NULL ) : m_info( info ), m_runStatus( RanAtLeastOneSection ), m_currentSection( &m_rootSection ), @@ -97,7 +97,7 @@ namespace Catch { m_currentSection = m_currentSection->getParent(); } - const TestCaseInfo& getTestCaseInfo() const { + const TestCase& getTestCase() const { return *m_info; } @@ -107,7 +107,7 @@ namespace Catch { } private: - const TestCaseInfo* m_info; + const TestCase* m_info; RunStatus m_runStatus; SectionInfo m_rootSection; SectionInfo* m_currentSection; diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h index 1fce27fb..5a7d7438 100644 --- a/include/internal/catch_test_case_info.h +++ b/include/internal/catch_test_case_info.h @@ -16,20 +16,20 @@ namespace Catch { struct ITestCase; - - class TestCaseInfo { + + class TestCase { public: - TestCaseInfo(); + TestCase(); - TestCaseInfo( ITestCase* testCase, + TestCase( ITestCase* testCase, 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 ); + TestCase( const TestCase& other, const std::string& name ); + TestCase( const TestCase& other ); void invoke() const; @@ -42,10 +42,10 @@ namespace Catch { bool matchesTags( const std::string& tagPattern ) const; const std::set& getTags() const; - void swap( TestCaseInfo& other ); - bool operator == ( const TestCaseInfo& other ) const; - bool operator < ( const TestCaseInfo& other ) const; - TestCaseInfo& operator = ( const TestCaseInfo& other ); + void swap( TestCase& other ); + bool operator == ( const TestCase& other ) const; + bool operator < ( const TestCase& other ) const; + TestCase& operator = ( const TestCase& other ); private: Ptr m_test; diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index bb50759a..3d782e11 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -15,7 +15,7 @@ namespace Catch { - TestCaseInfo::TestCaseInfo( ITestCase* testCase, + TestCase::TestCase( ITestCase* testCase, const std::string& className, const std::string& name, const std::string& description, @@ -32,7 +32,7 @@ namespace Catch { m_isHidden = true; } - TestCaseInfo::TestCaseInfo() + TestCase::TestCase() : m_test( NULL ), m_className(), m_name(), @@ -40,7 +40,7 @@ namespace Catch { m_isHidden( false ) {} - TestCaseInfo::TestCaseInfo( const TestCaseInfo& other, const std::string& name ) + TestCase::TestCase( const TestCase& other, const std::string& name ) : m_test( other.m_test ), m_className( other.m_className ), m_name( name ), @@ -50,7 +50,7 @@ namespace Catch { m_isHidden( other.m_isHidden ) {} - TestCaseInfo::TestCaseInfo( const TestCaseInfo& other ) + TestCase::TestCase( const TestCase& other ) : m_test( other.m_test ), m_className( other.m_className ), m_name( other.m_name ), @@ -60,40 +60,40 @@ namespace Catch { m_isHidden( other.m_isHidden ) {} - void TestCaseInfo::invoke() const { + void TestCase::invoke() const { m_test->invoke(); } - const std::string& TestCaseInfo::getClassName() const { + const std::string& TestCase::getClassName() const { return m_className; } - const std::string& TestCaseInfo::getName() const { + const std::string& TestCase::getName() const { return m_name; } - const std::string& TestCaseInfo::getDescription() const { + const std::string& TestCase::getDescription() const { return m_description; } - const SourceLineInfo& TestCaseInfo::getLineInfo() const { + const SourceLineInfo& TestCase::getLineInfo() const { return m_lineInfo; } - bool TestCaseInfo::isHidden() const { + bool TestCase::isHidden() const { return m_isHidden; } - bool TestCaseInfo::hasTag( const std::string& tag ) const { + bool TestCase::hasTag( const std::string& tag ) const { return m_tags.find( tag ) != m_tags.end(); } - bool TestCaseInfo::matchesTags( const std::string& tagPattern ) const { + bool TestCase::matchesTags( const std::string& tagPattern ) const { TagExpression exp; TagExpressionParser( exp ).parse( tagPattern ); return exp.matches( m_tags ); } - const std::set& TestCaseInfo::getTags() const { + const std::set& TestCase::getTags() const { return m_tags; } - void TestCaseInfo::swap( TestCaseInfo& other ) { + void TestCase::swap( TestCase& other ) { m_test.swap( other.m_test ); m_className.swap( other.m_className ); m_name.swap( other.m_name ); @@ -101,17 +101,17 @@ namespace Catch { std::swap( m_lineInfo, other.m_lineInfo ); } - bool TestCaseInfo::operator == ( const TestCaseInfo& other ) const { + bool TestCase::operator == ( const TestCase& other ) const { 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 { + bool TestCase::operator < ( const TestCase& other ) const { return m_name < other.m_name; } - TestCaseInfo& TestCaseInfo::operator = ( const TestCaseInfo& other ) { - TestCaseInfo temp( other ); + TestCase& TestCase::operator = ( const TestCase& other ) { + TestCase temp( other ); swap( temp ); return *this; } diff --git a/include/internal/catch_test_case_registry_impl.hpp b/include/internal/catch_test_case_registry_impl.hpp index adaefc35..715a96e9 100644 --- a/include/internal/catch_test_case_registry_impl.hpp +++ b/include/internal/catch_test_case_registry_impl.hpp @@ -25,11 +25,11 @@ namespace Catch { TestRegistry() : m_unnamedCount( 0 ) {} virtual ~TestRegistry(); - virtual void registerTest( const TestCaseInfo& testInfo ) { + virtual void registerTest( const TestCase& testInfo ) { if( testInfo.getName() == "" ) { std::ostringstream oss; oss << testInfo.getName() << "unnamed/" << ++m_unnamedCount; - return registerTest( TestCaseInfo( testInfo, oss.str() ) ); + return registerTest( TestCase( testInfo, oss.str() ) ); } if( m_functions.find( testInfo ) == m_functions.end() ) { @@ -39,7 +39,7 @@ namespace Catch { m_nonHiddenFunctions.push_back( testInfo ); } else { - const TestCaseInfo& prev = *m_functions.find( testInfo ); + const TestCase& prev = *m_functions.find( testInfo ); std::cerr << "error: TEST_CASE( \"" << testInfo.getName() << "\" ) already defined.\n" << "\tFirst seen at " << SourceLineInfo( prev.getLineInfo() ) << "\n" << "\tRedefined at " << SourceLineInfo( testInfo.getLineInfo() ) << std::endl; @@ -47,36 +47,36 @@ namespace Catch { } } - virtual const std::vector& getAllTests() const { + virtual const std::vector& getAllTests() const { return m_functionsInOrder; } - virtual const std::vector& getAllNonHiddenTests() const { + virtual const std::vector& getAllNonHiddenTests() const { return m_nonHiddenFunctions; } // !TBD deprecated - virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const { - std::vector matchingTests; + virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const { + std::vector matchingTests; getMatchingTestCases( rawTestSpec, matchingTests ); return matchingTests; } // !TBD deprecated - virtual void getMatchingTestCases( const std::string& rawTestSpec, std::vector& matchingTestsOut ) const { + virtual void getMatchingTestCases( const std::string& rawTestSpec, std::vector& matchingTestsOut ) const { TestCaseFilter filter( rawTestSpec ); - std::vector::const_iterator it = m_functionsInOrder.begin(); - std::vector::const_iterator itEnd = m_functionsInOrder.end(); + std::vector::const_iterator it = m_functionsInOrder.begin(); + std::vector::const_iterator itEnd = m_functionsInOrder.end(); for(; it != itEnd; ++it ) { if( filter.shouldInclude( *it ) ) { matchingTestsOut.push_back( *it ); } } } - virtual void getMatchingTestCases( const TestCaseFilters& filters, std::vector& matchingTestsOut ) const { - std::vector::const_iterator it = m_functionsInOrder.begin(); - std::vector::const_iterator itEnd = m_functionsInOrder.end(); + virtual void getMatchingTestCases( const TestCaseFilters& filters, std::vector& matchingTestsOut ) const { + std::vector::const_iterator it = m_functionsInOrder.begin(); + std::vector::const_iterator itEnd = m_functionsInOrder.end(); // !TBD: replace with algorithm for(; it != itEnd; ++it ) if( filters.shouldInclude( *it ) ) @@ -85,9 +85,9 @@ namespace Catch { private: - std::set m_functions; - std::vector m_functionsInOrder; - std::vector m_nonHiddenFunctions; + std::set m_functions; + std::vector m_functionsInOrder; + std::vector m_nonHiddenFunctions; size_t m_unnamedCount; }; @@ -138,7 +138,7 @@ namespace Catch { const char* description, const SourceLineInfo& lineInfo ) { - getMutableRegistryHub().registerTest( TestCaseInfo( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); + getMutableRegistryHub().registerTest( TestCase( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); } } // end namespace Catch diff --git a/include/internal/catch_test_spec.h b/include/internal/catch_test_spec.h index 2c028d4e..3e726d8c 100644 --- a/include/internal/catch_test_spec.h +++ b/include/internal/catch_test_spec.h @@ -64,7 +64,7 @@ namespace Catch { return m_filterType; } - bool shouldInclude( const TestCaseInfo& testCase ) const { + bool shouldInclude( const TestCase& testCase ) const { return isMatch( testCase ) == (m_filterType == IfFilterMatches::IncludeTests); } private: @@ -74,7 +74,7 @@ namespace Catch { #pragma clang diagnostic ignored "-Wunreachable-code" #endif - bool isMatch( const TestCaseInfo& testCase ) const { + bool isMatch( const TestCase& testCase ) const { const std::string& name = testCase.getName(); switch( m_wildcardPosition ) { @@ -121,7 +121,7 @@ namespace Catch { m_tagExpressions.push_back( exp ); } - bool shouldInclude( const TestCaseInfo& testCase ) const { + bool shouldInclude( const TestCase& testCase ) const { if( !m_tagExpressions.empty() ) { std::vector::const_iterator it = m_tagExpressions.begin(); std::vector::const_iterator itEnd = m_tagExpressions.end(); diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 647fede5..508d18e5 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -120,7 +120,7 @@ namespace Catch { } } - virtual void StartTestCase( const TestCaseInfo& testInfo ) { + virtual void StartTestCase( const TestCase& testInfo ) { m_testSpan = testInfo.getName(); } @@ -264,7 +264,7 @@ namespace Catch { m_config.stream << std::endl; } - virtual void EndTestCase( const TestCaseInfo& testInfo, + virtual void EndTestCase( const TestCase& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) { diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 8fac30d1..e39e6896 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -38,6 +38,7 @@ namespace Catch { std::string m_stdOut; std::string m_stdErr; std::vector m_testStats; + std::vector m_sections; }; struct Stats { @@ -101,8 +102,9 @@ namespace Catch { virtual void EndSection( const std::string&, const Counts& ) {} - virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) { + virtual void StartTestCase( const Catch::TestCase& testInfo ) { m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getClassName(), testInfo.getName() ) ); + m_currentTestCaseStats.push_back( &m_currentStats->m_testCaseStats.back() ); } virtual void Result( const Catch::AssertionResult& assertionResult ) { @@ -149,7 +151,9 @@ namespace Catch { } } - virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string& stdOut, const std::string& stdErr ) { + virtual void EndTestCase( const Catch::TestCase&, const Totals&, const std::string& stdOut, const std::string& stdErr ) { + m_currentTestCaseStats.pop_back(); + assert( m_currentTestCaseStats.empty() ); TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); testCaseStats.m_stdOut = stdOut; testCaseStats.m_stdErr = stdErr; @@ -236,6 +240,7 @@ namespace Catch { Stats m_testSuiteStats; Stats* m_currentStats; std::vector m_statsForSuites; + std::vector m_currentTestCaseStats; std::ostringstream m_stdOut; std::ostringstream m_stdErr; }; diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index d2163dd3..a38b1031 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -70,7 +70,7 @@ namespace Catch { m_xml.endElement(); } - virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) { + virtual void StartTestCase( const Catch::TestCase& testInfo ) { m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.getName() ); m_currentTestSuccess = true; } @@ -129,7 +129,7 @@ namespace Catch { // !TBD } - virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string&, const std::string& ) { + virtual void EndTestCase( const Catch::TestCase&, const Totals&, const std::string&, const std::string& ) { m_xml.scopedElement( "OverallResult" ).writeAttribute( "success", m_currentTestSuccess ); m_xml.endElement(); } diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 90116c61..229e7405 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -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::TestCase makeTestCase( const char* name ){ return Catch::TestCase( 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::TestCase 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::TestCase 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::TestCase 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::TestCase 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::TestCase oneTag( NULL, "", "test", "[hide]", CATCH_INTERNAL_LINEINFO ); CHECK( oneTag.getDescription() == "" ); CHECK( oneTag.hasTag( "hide" ) ); diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index 12ad282e..5c30dd63 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -82,13 +82,13 @@ namespace Catch { closeLabel( recordSections, sectionName ); } - virtual void StartTestCase( const TestCaseInfo& testInfo ) { + virtual void StartTestCase( const TestCase& testInfo ) { openLabel( recordTestCases, testInfo.getName() ); } virtual void Aborted(){} - virtual void EndTestCase( const TestCaseInfo& testInfo, + virtual void EndTestCase( const TestCase& testInfo, const Totals&, const std::string&, const std::string& ) { @@ -153,7 +153,7 @@ namespace Catch { MetaTestRunner( expectedResult ) ); } - void operator()( const TestCaseInfo& testCase ) { + void operator()( const TestCase& testCase ) { EmbeddedRunner runner; Totals totals = runner.runMatching( testCase.getName() ); switch( m_expectedResult ) { From 8baa06c63e2684abf46c3179754ce2dfae00c9e4 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 25 Nov 2012 11:19:55 +0000 Subject: [PATCH 061/296] Split TestCaseInfo into a data only component and the test case function and behaviour. Reporters only get to see the former --- include/internal/catch_interfaces_reporter.h | 4 +- include/internal/catch_list.hpp | 4 +- include/internal/catch_runner_impl.hpp | 12 +- include/internal/catch_test_case_info.h | 52 ++-- include/internal/catch_test_case_info.hpp | 123 +++++---- .../catch_test_case_registry_impl.hpp | 29 +-- include/internal/catch_test_spec.h | 2 +- include/reporters/catch_reporter_basic.hpp | 8 +- include/reporters/catch_reporter_junit.hpp | 6 +- include/reporters/catch_reporter_xml.hpp | 6 +- projects/SelfTest/Baselines/results.txt | 236 +++++++++--------- projects/SelfTest/TestMain.cpp | 86 +++---- projects/SelfTest/catch_self_test.hpp | 15 +- 13 files changed, 298 insertions(+), 285 deletions(-) diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 96075933..6a5bf648 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -108,9 +108,9 @@ namespace Catch virtual void StartGroup( const std::string& groupName ) = 0; virtual void EndGroup( const std::string& groupName, const Totals& totals ) = 0; - virtual void StartTestCase( const TestCase& testInfo ) = 0; + virtual void StartTestCase( const TestCaseInfo& testInfo ) = 0; // TestCaseResult - virtual void EndTestCase( const TestCase& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0; + 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; diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 2b41cda8..50fce992 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -45,9 +45,9 @@ namespace Catch { if( matchesFilters( config.filters, *it ) ) { matchedTests++; // !TBD: consider listAs() - std::cout << "\t" << it->getName() << "\n"; + std::cout << "\t" << it->getTestCaseInfo().name << "\n"; if( ( config.listSpec & List::TestNames ) != List::TestNames ) - std::cout << "\t\t '" << it->getDescription() << "'\n"; + std::cout << "\t\t '" << it->getTestCaseInfo().description << "'\n"; } } if( config.filters.empty() ) diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 596fc1b8..6dea6afe 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -97,15 +97,17 @@ namespace Catch { return totals; } - Totals runTest( const TestCase& testInfo ) { + Totals runTest( const TestCase& testCase ) { Totals prevTotals = m_totals; std::string redirectedCout; std::string redirectedCerr; + + TestCaseInfo testInfo = testCase.getTestCaseInfo(); m_reporter->StartTestCase( testInfo ); - m_runningTest = new RunningTest( &testInfo ); + m_runningTest = new RunningTest( &testCase ); do { do { @@ -120,7 +122,7 @@ namespace Catch { ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) ) { m_totals.assertions.failed++; deltaTotals = m_totals.delta( prevTotals ); - m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCase().getName() ); + m_reporter->NoAssertionsInTestCase( testInfo.name ); } m_totals.testCases += deltaTotals.testCases; @@ -228,7 +230,7 @@ namespace Catch { virtual std::string getCurrentTestName() const { return m_runningTest - ? m_runningTest->getTestCase().getName() + ? m_runningTest->getTestCase().getTestCaseInfo().name : ""; } @@ -262,7 +264,7 @@ namespace Catch { void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { try { - m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getLineInfo(), "", ResultDisposition::Normal ); + m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getTestCaseInfo().lineInfo, "", ResultDisposition::Normal ); m_runningTest->reset(); if( m_reporter->shouldRedirectStdout() ) { StreamRedirect coutRedir( std::cout, redirectedCout ); diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h index 5a7d7438..b3f133b4 100644 --- a/include/internal/catch_test_case_info.h +++ b/include/internal/catch_test_case_info.h @@ -16,27 +16,37 @@ namespace Catch { struct ITestCase; + + struct TestCaseInfo { + TestCaseInfo( const std::string& _name, + const std::string& _className, + const std::string& _description, + const std::set& _tags, + bool _isHidden, + const SourceLineInfo& _lineInfo ); + + TestCaseInfo( const TestCaseInfo& other ); + + std::string name; + std::string className; + std::string description; + std::set tags; + bool isHidden; + SourceLineInfo lineInfo; + }; - class TestCase { + class TestCase : protected TestCaseInfo { public: - TestCase(); - TestCase( ITestCase* testCase, - const std::string& className, - const std::string& name, - const std::string& description, - const SourceLineInfo& lineInfo ); - - - TestCase( const TestCase& other, const std::string& name ); + TestCase( ITestCase* testCase, const TestCaseInfo& info ); TestCase( const TestCase& other ); + TestCase withName( const std::string& _newName ) const; + void invoke() const; - const std::string& getClassName() const; - const std::string& getName() const; - const std::string& getDescription() const; - const SourceLineInfo& getLineInfo() const; + const TestCaseInfo& getTestCaseInfo() const; + bool isHidden() const; bool hasTag( const std::string& tag ) const; bool matchesTags( const std::string& tagPattern ) const; @@ -48,14 +58,14 @@ namespace Catch { TestCase& operator = ( const TestCase& other ); private: - Ptr m_test; - std::string m_className; - std::string m_name; - std::string m_description; - std::set m_tags; - SourceLineInfo m_lineInfo; - bool m_isHidden; + Ptr test; }; + + TestCase makeTestCase( ITestCase* testCase, + const std::string& className, + const std::string& name, + const std::string& description, + const SourceLineInfo& lineInfo ); } #endif // TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index 3d782e11..695793ab 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -14,101 +14,95 @@ namespace Catch { - - TestCase::TestCase( ITestCase* testCase, - 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 ), - m_isHidden( startsWith( name, "./" ) ) + TestCase makeTestCase( ITestCase* _testCase, + const std::string& _className, + const std::string& _name, + const std::string& _descOrTags, + const SourceLineInfo& _lineInfo ) { - TagExtracter( m_tags ).parse( m_description ); - if( hasTag( "hide" ) ) - m_isHidden = true; + std::string desc = _descOrTags; + bool isHidden( startsWith( _name, "./" ) ); + std::set tags; + TagExtracter( tags ).parse( desc ); + if( tags.find( "hide" ) != tags.end() ) + isHidden = true; + + TestCaseInfo info( _name, _className, desc, tags, isHidden, _lineInfo ); + return TestCase( _testCase, info ); } - TestCase::TestCase() - : m_test( NULL ), - m_className(), - m_name(), - m_description(), - m_isHidden( false ) + TestCaseInfo::TestCaseInfo( const std::string& _name, + const std::string& _className, + const std::string& _description, + const std::set& _tags, + bool _isHidden, + const SourceLineInfo& _lineInfo ) + : name( _name ), + className( _className ), + description( _description ), + tags( _tags ), + isHidden( _isHidden ), + lineInfo( _lineInfo ) {} - TestCase::TestCase( const TestCase& 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 ), - m_lineInfo( other.m_lineInfo ), - m_isHidden( other.m_isHidden ) + TestCaseInfo::TestCaseInfo( const TestCaseInfo& other ) + : name( other.name ), + className( other.className ), + description( other.description ), + tags( other.tags ), + isHidden( other.isHidden ), + lineInfo( other.lineInfo ) {} + TestCase::TestCase( ITestCase* testCase, const TestCaseInfo& info ) : TestCaseInfo( info ), test( testCase ) {} + TestCase::TestCase( const TestCase& 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 ), - m_lineInfo( other.m_lineInfo ), - m_isHidden( other.m_isHidden ) + : TestCaseInfo( other ), + test( other.test ) {} - void TestCase::invoke() const { - m_test->invoke(); + TestCase TestCase::withName( const std::string& _newName ) const { + TestCase other( *this ); + other.name = _newName; + return other; } - const std::string& TestCase::getClassName() const { - return m_className; - } - const std::string& TestCase::getName() const { - return m_name; - } - const std::string& TestCase::getDescription() const { - return m_description; - } - const SourceLineInfo& TestCase::getLineInfo() const { - return m_lineInfo; + void TestCase::invoke() const { + test->invoke(); } bool TestCase::isHidden() const { - return m_isHidden; + return TestCaseInfo::isHidden; } bool TestCase::hasTag( const std::string& tag ) const { - return m_tags.find( tag ) != m_tags.end(); + return tags.find( tag ) != tags.end(); } bool TestCase::matchesTags( const std::string& tagPattern ) const { TagExpression exp; TagExpressionParser( exp ).parse( tagPattern ); - return exp.matches( m_tags ); + return exp.matches( tags ); } const std::set& TestCase::getTags() const { - return m_tags; + return tags; } void TestCase::swap( TestCase& 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 ); - std::swap( m_lineInfo, other.m_lineInfo ); + test.swap( other.test ); + className.swap( other.className ); + name.swap( other.name ); + description.swap( other.description ); + std::swap( lineInfo, other.lineInfo ); } bool TestCase::operator == ( const TestCase& other ) const { - return m_test.get() == other.m_test.get() && - m_name == other.m_name && - m_className == other.m_className; + return test.get() == other.test.get() && + name == other.name && + className == other.className; } bool TestCase::operator < ( const TestCase& other ) const { - return m_name < other.m_name; + return name < other.name; } TestCase& TestCase::operator = ( const TestCase& other ) { TestCase temp( other ); @@ -116,6 +110,11 @@ namespace Catch { return *this; } + const TestCaseInfo& TestCase::getTestCaseInfo() const + { + return *this; + } + } // end namespace Catch #endif // TWOBLUECUBES_CATCH_TEST_CASE_INFO_HPP_INCLUDED diff --git a/include/internal/catch_test_case_registry_impl.hpp b/include/internal/catch_test_case_registry_impl.hpp index 715a96e9..5404766c 100644 --- a/include/internal/catch_test_case_registry_impl.hpp +++ b/include/internal/catch_test_case_registry_impl.hpp @@ -25,24 +25,25 @@ namespace Catch { TestRegistry() : m_unnamedCount( 0 ) {} virtual ~TestRegistry(); - virtual void registerTest( const TestCase& testInfo ) { - if( testInfo.getName() == "" ) { + virtual void registerTest( const TestCase& testCase ) { + std::string name = testCase.getTestCaseInfo().name; + if( name == "" ) { std::ostringstream oss; - oss << testInfo.getName() << "unnamed/" << ++m_unnamedCount; - return registerTest( TestCase( testInfo, oss.str() ) ); + oss << name << "unnamed/" << ++m_unnamedCount; + return registerTest( testCase.withName( oss.str() ) ); } - if( m_functions.find( testInfo ) == m_functions.end() ) { - m_functions.insert( testInfo ); - m_functionsInOrder.push_back( testInfo ); - if( !testInfo.isHidden() ) - m_nonHiddenFunctions.push_back( testInfo ); + if( m_functions.find( testCase ) == m_functions.end() ) { + m_functions.insert( testCase ); + m_functionsInOrder.push_back( testCase ); + if( !testCase.isHidden() ) + m_nonHiddenFunctions.push_back( testCase ); } else { - const TestCase& prev = *m_functions.find( testInfo ); - std::cerr << "error: TEST_CASE( \"" << testInfo.getName() << "\" ) already defined.\n" - << "\tFirst seen at " << SourceLineInfo( prev.getLineInfo() ) << "\n" - << "\tRedefined at " << SourceLineInfo( testInfo.getLineInfo() ) << std::endl; + const TestCase& prev = *m_functions.find( testCase ); + std::cerr << "error: TEST_CASE( \"" << name << "\" ) already defined.\n" + << "\tFirst seen at " << SourceLineInfo( prev.getTestCaseInfo().lineInfo ) << "\n" + << "\tRedefined at " << SourceLineInfo( testCase.getTestCaseInfo().lineInfo ) << std::endl; exit(1); } } @@ -138,7 +139,7 @@ namespace Catch { const char* description, const SourceLineInfo& lineInfo ) { - getMutableRegistryHub().registerTest( TestCase( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); + getMutableRegistryHub().registerTest( makeTestCase( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); } } // end namespace Catch diff --git a/include/internal/catch_test_spec.h b/include/internal/catch_test_spec.h index 3e726d8c..3a30c4ea 100644 --- a/include/internal/catch_test_spec.h +++ b/include/internal/catch_test_spec.h @@ -75,7 +75,7 @@ namespace Catch { #endif bool isMatch( const TestCase& testCase ) const { - const std::string& name = testCase.getName(); + const std::string& name = testCase.getTestCaseInfo().name; switch( m_wildcardPosition ) { case NoWildcard: diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 508d18e5..cfb23ee9 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -120,8 +120,8 @@ namespace Catch { } } - virtual void StartTestCase( const TestCase& testInfo ) { - m_testSpan = testInfo.getName(); + virtual void StartTestCase( const TestCaseInfo& testInfo ) { + m_testSpan = testInfo.name; } virtual void StartSection( const std::string& sectionName, const std::string& ) { @@ -264,7 +264,7 @@ namespace Catch { m_config.stream << std::endl; } - virtual void EndTestCase( const TestCase& testInfo, + virtual void EndTestCase( const TestCaseInfo& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) { @@ -279,7 +279,7 @@ namespace Catch { } if( m_testSpan.emitted ) { - m_config.stream << "[Finished: '" << testInfo.getName() << "' "; + m_config.stream << "[Finished: '" << testInfo.name << "' "; ReportCounts( totals ); m_config.stream << "]" << std::endl; } diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index e39e6896..10d1964b 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -102,8 +102,8 @@ namespace Catch { virtual void EndSection( const std::string&, const Counts& ) {} - virtual void StartTestCase( const Catch::TestCase& testInfo ) { - m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getClassName(), testInfo.getName() ) ); + virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) { + m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.className, testInfo.name ) ); m_currentTestCaseStats.push_back( &m_currentStats->m_testCaseStats.back() ); } @@ -151,7 +151,7 @@ namespace Catch { } } - virtual void EndTestCase( const Catch::TestCase&, const Totals&, const std::string& stdOut, const std::string& stdErr ) { + virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string& stdOut, const std::string& stdErr ) { m_currentTestCaseStats.pop_back(); assert( m_currentTestCaseStats.empty() ); TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index a38b1031..27d848e8 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -70,8 +70,8 @@ namespace Catch { m_xml.endElement(); } - virtual void StartTestCase( const Catch::TestCase& testInfo ) { - m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.getName() ); + virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) { + m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.name ); m_currentTestSuccess = true; } @@ -129,7 +129,7 @@ namespace Catch { // !TBD } - virtual void EndTestCase( const Catch::TestCase&, const Totals&, const std::string&, const std::string& ) { + virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string&, const std::string& ) { m_xml.scopedElement( "OverallResult" ).writeAttribute( "success", m_currentTestSuccess ); m_xml.endElement(); } diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index 7c0d287e..57cb29f1 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -196,12 +196,12 @@ [Running: ./succeeding/conditions/ptr] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: p == __null succeeded for: __null == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff5d60b078 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff5d60b078 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff5d60b078 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff57d28028 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff57d28028 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff57d28028 != 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff5d60b078 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff57d28028 [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] @@ -845,57 +845,57 @@ No assertions in test case, 'second tag' [Running: selftest/main] [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/failing tests'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:181: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded [with message: Tests failed, as expected] [End of section: 'selftest/expected result/failing tests' All 26 assertions passed] @@ -903,96 +903,96 @@ No assertions in test case, 'second tag' [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/succeeding tests'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] Message from section one Message from section two -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] Some information -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:169: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] [End of section: 'selftest/expected result/succeeding tests' All 44 assertions passed] @@ -1003,11 +1003,11 @@ Message from section two Some information [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/succeeding tests'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:40: totals.assertions.passed == 293 failed for: 294 == 293 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:40: totals.assertions.passed == 294 succeeded for: 294 == 294 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 -[End of section: 'selftest/test counts/succeeding tests' 1 of 2 assertions failed] +[End of section: 'selftest/test counts/succeeding tests' All 2 assertions passed] -[End of section: 'selftest/test counts' 1 of 2 assertions failed] +[End of section: 'selftest/test counts' All 2 assertions passed] [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/failing tests'] @@ -1017,7 +1017,7 @@ Some information [End of section: 'selftest/test counts' All 2 assertions passed] -[Finished: 'selftest/main' 1 test case failed (1 of 74 assertions failed)] +[Finished: 'selftest/main' All tests passed (74 assertions in 1 test case)] [Running: meta/Misc/Sections] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 @@ -1037,8 +1037,8 @@ Some information [Started section: '-t/1'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:108: parseIntoConfig( argv, config ) succeeded /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:110: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:111: config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:112: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:111: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:112: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [End of section: '-t/1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] @@ -1047,8 +1047,8 @@ Some information [Started section: '-t/exclude:1'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:116: parseIntoConfig( argv, config ) succeeded /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:118: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:119: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:120: config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:119: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:120: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '-t/exclude:1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] @@ -1057,8 +1057,8 @@ Some information [Started section: '--test/1'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:125: parseIntoConfig( argv, config ) succeeded /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:127: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:128: config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:129: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:128: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:129: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [End of section: '--test/1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] @@ -1067,8 +1067,8 @@ Some information [Started section: '--test/exclude:1'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:134: parseIntoConfig( argv, config ) succeeded /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:136: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:137: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:138: config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:137: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:138: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '--test/exclude:1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] @@ -1077,8 +1077,8 @@ Some information [Started section: '--test/exclude:2'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:143: parseIntoConfig( argv, config ) succeeded /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:145: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:146: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:147: config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:146: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:147: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '--test/exclude:2' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] @@ -1087,9 +1087,9 @@ Some information [Started section: '-t/2'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:152: parseIntoConfig( argv, config ) succeeded /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:154: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:155: config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:156: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:157: config.filters[0].shouldInclude( makeTestCase( "test2" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:155: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:156: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:157: config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true [End of section: '-t/2' All 5 assertions passed] [End of section: 'test lists' All 5 assertions passed] @@ -1253,43 +1253,43 @@ Some information [Finished: 'selftest/parser/2' All tests passed (66 assertions in 1 test case)] [Running: selftest/test filter] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:291: matchAny.shouldInclude( makeTestCase( "any" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:292: matchNone.shouldInclude( makeTestCase( "any" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:297: matchHidden.shouldInclude( makeTestCase( "any" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:298: matchNonHidden.shouldInclude( makeTestCase( "any" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:300: matchHidden.shouldInclude( makeTestCase( "./any" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:301: matchNonHidden.shouldInclude( makeTestCase( "./any" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:291: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:292: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:297: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:298: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:300: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:301: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false [Finished: 'selftest/test filter' All tests passed (6 assertions in 1 test case)] [Running: selftest/test filters] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:312: matchHidden.shouldInclude( makeTestCase( "./something" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:314: filters.shouldInclude( makeTestCase( "any" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:315: filters.shouldInclude( makeTestCase( "./something" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:316: filters.shouldInclude( makeTestCase( "./anything" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:312: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:314: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:316: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false [Finished: 'selftest/test filters' All tests passed (4 assertions in 1 test case)] [Running: selftest/filter/prefix wildcard] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:322: matchBadgers.shouldInclude( makeTestCase( "big badger" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:323: matchBadgers.shouldInclude( makeTestCase( "little badgers" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:323: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/prefix wildcard' All tests passed (2 assertions in 1 test case)] [Running: selftest/filter/wildcard at both ends] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:328: matchBadgers.shouldInclude( makeTestCase( "big badger" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:329: matchBadgers.shouldInclude( makeTestCase( "little badgers" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:330: matchBadgers.shouldInclude( makeTestCase( "badgers are big" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:331: matchBadgers.shouldInclude( makeTestCase( "hedgehogs" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:331: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/wildcard at both ends' All tests passed (4 assertions in 1 test case)] [Running: selftest/option parsers] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:351: opt.parseIntoConfig( parser, config ) succeeded /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:353: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:354: config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:355: config.filters[0].shouldInclude( makeTestCase( "test1" ) ) succeeded for: true +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:354: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:355: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [Finished: 'selftest/option parsers' All tests passed (4 assertions in 1 test case)] [Running: selftest/tags] [Started section: 'one tag'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:369: oneTag.getDescription() == "" succeeded for: "" == "" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:370: oneTag.hasTag( "one" ) succeeded for: true /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:371: oneTag.getTags().size() == 1 succeeded for: 1 == 1 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:373: oneTag.matchesTags( p1 ) == true succeeded for: true == true @@ -1300,7 +1300,7 @@ Some information [End of section: 'one tag' All 8 assertions passed] [Started section: 'two tags'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:383: twoTags.getDescription() == "" succeeded for: "" == "" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:384: twoTags.hasTag( "one" ) succeeded for: true /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:385: twoTags.hasTag( "two" ) succeeded for: true /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:386: twoTags.hasTag( "three" ) == false succeeded for: false == false @@ -1313,20 +1313,20 @@ Some information [End of section: 'two tags' All 10 assertions passed] [Started section: 'one tag with characters either side'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:399: oneTagWithExtras.getDescription() == "1234" succeeded for: "1234" == "1234" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:399: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:400: oneTagWithExtras.hasTag( "one" ) succeeded for: true /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:401: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:402: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 [End of section: 'one tag with characters either side' All 4 assertions passed] [Started section: 'start of a tag, but not closed'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:409: oneTagOpen.getDescription() == "[one" succeeded for: "[one" == "[one" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:409: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:410: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:411: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 [End of section: 'start of a tag, but not closed' All 3 assertions passed] [Started section: 'hidden'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:417: oneTag.getDescription() == "" succeeded for: "" == "" +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:417: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:418: oneTag.hasTag( "hide" ) succeeded for: true /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:419: oneTag.isHidden() succeeded for: true /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:421: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false @@ -1357,7 +1357,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [Finished: './inprogress/failing/Tricky/compound lhs' 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: 0x7fff5d60b858 == 0x7fff5d60b850 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff57d28808 == 0x7fff57d28800 /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)] @@ -1383,7 +1383,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [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: 0x7fff5d60b850 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff57d28800 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] @@ -1430,8 +1430,8 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [End of section: 'This stuff exists' 1 assertion passed] [Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 46 of 98 test cases failed (104 of 615 assertions failed)] +[End of group: '~dummy'. 45 of 98 test cases failed (103 of 615 assertions failed)] -[Testing completed. 46 of 98 test cases failed (104 of 615 assertions failed)] +[Testing completed. 45 of 98 test cases failed (103 of 615 assertions failed)] diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 229e7405..19fcbd48 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 == 293 ); + CHECK( totals.assertions.passed == 294 ); CHECK( totals.assertions.failed == 0 ); } @@ -86,7 +86,7 @@ std::string parseIntoConfigAndReturnError( const char * (&argv)[size], Catch::Co return ""; } -inline Catch::TestCase makeTestCase( const char* name ){ return Catch::TestCase( NULL, "", name, "", CATCH_INTERNAL_LINEINFO ); } +inline Catch::TestCase fakeTestCase( const char* name ){ return Catch::makeTestCase( NULL, "", name, "", CATCH_INTERNAL_LINEINFO ); } TEST_CASE( "selftest/parser/2", "ConfigData" ) { @@ -108,16 +108,16 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { CHECK_NOTHROW( parseIntoConfig( argv, config ) ); REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "test1" ) ) ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ); } SECTION( "-t/exclude:1", "Specify one test case exclusion using -t exclude:" ) { const char* argv[] = { "test", "-t", "exclude:test1" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "test1" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); } SECTION( "--test/1", "Specify one test case using --test" ) { @@ -125,8 +125,8 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { CHECK_NOTHROW( parseIntoConfig( argv, config ) ); REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "test1" ) ) ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ); } SECTION( "--test/exclude:1", "Specify one test case exclusion using --test exclude:" ) { @@ -134,8 +134,8 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { CHECK_NOTHROW( parseIntoConfig( argv, config ) ); REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "test1" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); } SECTION( "--test/exclude:2", "Specify one test case exclusion using --test ~" ) { @@ -143,8 +143,8 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { CHECK_NOTHROW( parseIntoConfig( argv, config ) ); REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "test1" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); } SECTION( "-t/2", "Specify two test cases using -t" ) { @@ -152,9 +152,9 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { CHECK_NOTHROW( parseIntoConfig( argv, config ) ); REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "test1" ) ) ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "test2" ) ) ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ); } SECTION( "-t/0", "When no test names are supplied it is an error" ) { @@ -288,17 +288,17 @@ TEST_CASE( "selftest/test filter", "Individual filters" ) { Catch::TestCaseFilter matchAny( "*" ); Catch::TestCaseFilter matchNone( "*", Catch::IfFilterMatches::ExcludeTests ); - CHECK( matchAny.shouldInclude( makeTestCase( "any" ) )); - CHECK( matchNone.shouldInclude( makeTestCase( "any" ) ) == false ); + CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) )); + CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ); Catch::TestCaseFilter matchHidden( "./*" ); Catch::TestCaseFilter matchNonHidden( "./*", Catch::IfFilterMatches::ExcludeTests ); - CHECK( matchHidden.shouldInclude( makeTestCase( "any" ) ) == false ); - CHECK( matchNonHidden.shouldInclude( makeTestCase( "any" ) ) ); + CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ); + CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ); - CHECK( matchHidden.shouldInclude( makeTestCase( "./any" ) ) ); - CHECK( matchNonHidden.shouldInclude( makeTestCase( "./any" ) ) == false ); + CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ); + CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ); } TEST_CASE( "selftest/test filters", "Sets of filters" ) { @@ -309,26 +309,26 @@ TEST_CASE( "selftest/test filters", "Sets of filters" ) { filters.addFilter( matchHidden ); filters.addFilter( dontMatchA ); - CHECK( matchHidden.shouldInclude( makeTestCase( "./something" ) ) ); + CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ); - CHECK( filters.shouldInclude( makeTestCase( "any" ) ) == false ); - CHECK( filters.shouldInclude( makeTestCase( "./something" ) ) ); - CHECK( filters.shouldInclude( makeTestCase( "./anything" ) ) == false ); + CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ); + CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ); + CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ); } TEST_CASE( "selftest/filter/prefix wildcard", "Individual filters with wildcards at the start" ) { Catch::TestCaseFilter matchBadgers( "*badger" ); - CHECK( matchBadgers.shouldInclude( makeTestCase( "big badger" ) )); - CHECK( matchBadgers.shouldInclude( makeTestCase( "little badgers" ) ) == false ); + CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) )); + CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ); } TEST_CASE( "selftest/filter/wildcard at both ends", "Individual filters with wildcards at both ends" ) { Catch::TestCaseFilter matchBadgers( "*badger*" ); - CHECK( matchBadgers.shouldInclude( makeTestCase( "big badger" ) )); - CHECK( matchBadgers.shouldInclude( makeTestCase( "little badgers" ) ) ); - CHECK( matchBadgers.shouldInclude( makeTestCase( "badgers are big" ) ) ); - CHECK( matchBadgers.shouldInclude( makeTestCase( "hedgehogs" ) ) == false ); + CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) )); + CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ); + CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ); + CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ); } @@ -351,8 +351,8 @@ TEST_CASE( "selftest/option parsers", "" ) CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ); REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "notIncluded" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( makeTestCase( "test1" ) ) ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ); } TEST_CASE( "selftest/tags", "" ) { @@ -364,9 +364,9 @@ TEST_CASE( "selftest/tags", "" ) { std::string p5 = "[one][two]~[hide],[three]"; SECTION( "one tag", "" ) { - Catch::TestCase oneTag( NULL, "", "test", "[one]", CATCH_INTERNAL_LINEINFO ); + Catch::TestCase oneTag = makeTestCase( NULL, "", "test", "[one]", CATCH_INTERNAL_LINEINFO ); - CHECK( oneTag.getDescription() == "" ); + CHECK( oneTag.getTestCaseInfo().description == "" ); CHECK( oneTag.hasTag( "one" ) ); CHECK( oneTag.getTags().size() == 1 ); @@ -378,9 +378,9 @@ TEST_CASE( "selftest/tags", "" ) { } SECTION( "two tags", "" ) { - Catch::TestCase twoTags( NULL, "", "test", "[one][two]", CATCH_INTERNAL_LINEINFO ); + Catch::TestCase twoTags= makeTestCase( NULL, "", "test", "[one][two]", CATCH_INTERNAL_LINEINFO ); - CHECK( twoTags.getDescription() == "" ); + CHECK( twoTags.getTestCaseInfo().description == "" ); CHECK( twoTags.hasTag( "one" ) ); CHECK( twoTags.hasTag( "two" ) ); CHECK( twoTags.hasTag( "three" ) == false ); @@ -395,8 +395,8 @@ TEST_CASE( "selftest/tags", "" ) { SECTION( "one tag with characters either side", "" ) { - Catch::TestCase oneTagWithExtras( NULL, "", "test", "12[one]34", CATCH_INTERNAL_LINEINFO ); - CHECK( oneTagWithExtras.getDescription() == "1234" ); + Catch::TestCase oneTagWithExtras = makeTestCase( NULL, "", "test", "12[one]34", CATCH_INTERNAL_LINEINFO ); + CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ); CHECK( oneTagWithExtras.hasTag( "one" ) ); CHECK( oneTagWithExtras.hasTag( "two" ) == false ); CHECK( oneTagWithExtras.getTags().size() == 1 ); @@ -404,17 +404,17 @@ TEST_CASE( "selftest/tags", "" ) { SECTION( "start of a tag, but not closed", "" ) { - Catch::TestCase oneTagOpen( NULL, "", "test", "[one", CATCH_INTERNAL_LINEINFO ); + Catch::TestCase oneTagOpen = makeTestCase( NULL, "", "test", "[one", CATCH_INTERNAL_LINEINFO ); - CHECK( oneTagOpen.getDescription() == "[one" ); + CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ); CHECK( oneTagOpen.hasTag( "one" ) == false ); CHECK( oneTagOpen.getTags().size() == 0 ); } SECTION( "hidden", "" ) { - Catch::TestCase oneTag( NULL, "", "test", "[hide]", CATCH_INTERNAL_LINEINFO ); + Catch::TestCase oneTag = makeTestCase( NULL, "", "test", "[hide]", CATCH_INTERNAL_LINEINFO ); - CHECK( oneTag.getDescription() == "" ); + CHECK( oneTag.getTestCaseInfo().description == "" ); CHECK( oneTag.hasTag( "hide" ) ); CHECK( oneTag.isHidden() ); diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index 5c30dd63..6f926814 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -82,17 +82,17 @@ namespace Catch { closeLabel( recordSections, sectionName ); } - virtual void StartTestCase( const TestCase& testInfo ) { - openLabel( recordTestCases, testInfo.getName() ); + virtual void StartTestCase( const TestCaseInfo& testInfo ) { + openLabel( recordTestCases, testInfo.name ); } virtual void Aborted(){} - virtual void EndTestCase( const TestCase& testInfo, + virtual void EndTestCase( const TestCaseInfo& testInfo, const Totals&, const std::string&, const std::string& ) { - closeLabel( recordTestCases, testInfo.getName() ); + closeLabel( recordTestCases, testInfo.name ); } virtual void Result( const AssertionResult& assertionResult ); @@ -155,13 +155,14 @@ namespace Catch { void operator()( const TestCase& testCase ) { EmbeddedRunner runner; - Totals totals = runner.runMatching( testCase.getName() ); + std::string name = testCase.getTestCaseInfo().name; + Totals totals = runner.runMatching( name ); switch( m_expectedResult ) { case Expected::ToSucceed: if( totals.assertions.failed > 0 ) { INFO( runner.getOutput() ); FAIL( "Expected test case '" - << testCase.getName() + << name << "' to succeed but there was/ were " << totals.assertions.failed << " failure(s)" ); } @@ -173,7 +174,7 @@ namespace Catch { if( totals.assertions.failed == 0 ) { INFO( runner.getOutput() ); FAIL( "Expected test case '" - << testCase.getName() + << name << "' to fail but there was/ were " << totals.assertions.passed << " success(es)" ); } From f9d92634f581ee80992e45d6dd339b8875d9a22c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 25 Nov 2012 21:43:36 +0000 Subject: [PATCH 062/296] First cut of using new streaming reporter interface - using an adapter to map back to the legacy interface Doesn't do sections or the query functions (e.g. shouldRedirectStdOut) --- include/catch_runner.hpp | 9 ++- include/internal/catch_impl.hpp | 3 + include/internal/catch_interfaces_reporter.h | 83 +++++++++++++++++++- include/internal/catch_runner_impl.hpp | 26 +++--- include/internal/catch_test_case_info.hpp | 12 +-- projects/SelfTest/Baselines/results.txt | 12 +-- 6 files changed, 115 insertions(+), 30 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 7c993c09..b5ccb2f1 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -44,12 +44,13 @@ namespace Catch { std::vector::const_iterator it = filterGroups.begin(); std::vector::const_iterator itEnd = filterGroups.end(); + + LegacyReporterAdapter reporter( m_reporter ); + for(; it != itEnd && !context.aborting(); ++it ) { - m_reporter->StartGroup( it->getName() ); + reporter.testGroupStarting( it->getName() ); totals += runTestsForGroup( context, *it ); - if( context.aborting() ) - m_reporter->Aborted(); - m_reporter->EndGroup( it->getName(), totals ); + reporter.testGroupEnding( TestGroupStats( it->getName(), totals, context.aborting() ) ); } return totals; } diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 18555e5e..15bdd3b6 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -47,6 +47,9 @@ namespace Catch { IReporter::~IReporter() {} IReporterFactory::~IReporterFactory() {} IReporterRegistry::~IReporterRegistry() {} + IStreamingReporter::~IStreamingReporter() {} + LegacyReporterAdapter::~LegacyReporterAdapter() {} + BasicReporter::~BasicReporter() {} IRunner::~IRunner() {} IMutableContext::~IMutableContext() {} diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 6a5bf648..3b5093f3 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -51,13 +51,31 @@ namespace Catch }; struct AssertionStats { - AssertionInfo assertionInfo; + AssertionStats( const AssertionResult& _assertionResult, + const Totals& _totals ) + : assertionResult( _assertionResult ), + totals( _totals ) + {} + +// AssertionInfo assertionInfo; // !TBD: needed? It's in the result AssertionResult assertionResult; Totals totals; }; struct TestCaseStats { - TestCase testInfo; + TestCaseStats( const TestCaseInfo& _testInfo, + const Totals& _totals, + const std::string& _stdOut, + const std::string& _stdErr, + bool _aborting ) + : testInfo( _testInfo ), + totals( _totals ), + stdOut( _stdOut ), + stdErr( _stdErr ), + aborting( _aborting ) + {} + + TestCaseInfo testInfo; Totals totals; std::string stdOut; std::string stdErr; @@ -65,12 +83,28 @@ namespace Catch }; struct TestGroupStats { + TestGroupStats( const std::string& _groupName, + const Totals& _totals, + bool _aborting ) + : groupName( _groupName ), + totals( _totals ), + aborting( _aborting ) + {} + std::string groupName; Totals totals; bool aborting; }; struct TestRunStats { + TestRunStats( const std::string& _runName, + const Totals& _totals, + bool _aborting ) + : runName( _runName ), + totals( _totals ), + aborting( _aborting ) + {} + std::string runName; Totals totals; bool aborting; @@ -78,11 +112,12 @@ namespace Catch // !Work In progress struct IStreamingReporter : IShared { + virtual ~IStreamingReporter(); virtual void testRunStarting( const std::string& runName ) = 0; virtual void testGroupStarting( const std::string& groupName ) = 0; // !TBD: include section info (perhaps TestCase has an isSection flag and/ or a parent pointer - virtual void testCaseStarting( const TestCase& testInfo ) = 0; + virtual void testCaseStarting( const TestCaseInfo& testInfo ) = 0; virtual void assertionStarting( const AssertionInfo& assertionInfo ) = 0; virtual void assertionEnding( const AssertionStats& assertionStats ) = 0; @@ -127,6 +162,48 @@ namespace Catch // AssertionReslt virtual void Result( const AssertionResult& result ) = 0; }; + + class LegacyReporterAdapter : public SharedImpl + { + public: + LegacyReporterAdapter( const Ptr& legacyReporter ) + : m_legacyReporter( legacyReporter ) + {} + virtual ~LegacyReporterAdapter(); + + + virtual void testRunStarting( const std::string& ) { + m_legacyReporter->StartTesting(); + } + virtual void testGroupStarting( const std::string& groupName ) { + m_legacyReporter->StartGroup( groupName ); + } + virtual void testCaseStarting( const TestCaseInfo& testInfo ) { + m_legacyReporter->StartTestCase( testInfo ); + } + virtual void assertionStarting( const AssertionInfo& ) { + // Not on legacy interface + } + + virtual void assertionEnding( const AssertionStats& assertionStats ) { + m_legacyReporter->Result( assertionStats.assertionResult ); + } + virtual void testCaseEnding( const TestCaseStats& testCaseStats ) { + m_legacyReporter->EndTestCase( testCaseStats.testInfo, testCaseStats.totals, testCaseStats.stdOut, testCaseStats.stdErr ); + } + virtual void testGroupEnding( const TestGroupStats& testGroupStats ) { + if( testGroupStats.aborting ) + m_legacyReporter->Aborted(); + m_legacyReporter->EndGroup( testGroupStats.groupName, testGroupStats.totals ); + } + virtual void testRunEnding( const TestRunStats& testRunStats ) { + m_legacyReporter->EndTesting( testRunStats.totals ); + } + + private: + Ptr m_legacyReporter; + }; + struct IReporterFactory { virtual ~IReporterFactory(); diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 6dea6afe..4220daeb 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -68,11 +68,11 @@ namespace Catch { m_context.setRunner( this ); m_context.setConfig( &m_config ); m_context.setResultCapture( this ); - m_reporter->StartTesting(); + LegacyReporterAdapter( m_reporter ).testRunStarting( "" ); // !TBD - name } virtual ~Runner() { - m_reporter->EndTesting( m_totals ); + LegacyReporterAdapter( m_reporter ).testRunEnding( TestRunStats( "", m_totals, aborting() ) ); // !TBD - name m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); @@ -85,15 +85,16 @@ namespace Catch { Totals totals; - m_reporter->StartGroup( testSpec ); + LegacyReporterAdapter reporter( m_reporter ); + + reporter.testGroupStarting( testSpec ); std::vector::const_iterator it = matchingTests.begin(); std::vector::const_iterator itEnd = matchingTests.end(); for(; it != itEnd; ++it ) totals += runTest( *it ); - // !TBD use std::accumulate? - m_reporter->EndGroup( testSpec, totals ); + reporter.testGroupEnding( TestGroupStats( testSpec, totals, aborting() ) ); return totals; } @@ -104,8 +105,9 @@ namespace Catch { std::string redirectedCerr; TestCaseInfo testInfo = testCase.getTestCaseInfo(); - - m_reporter->StartTestCase( testInfo ); + + LegacyReporterAdapter reporter( m_reporter ); + reporter.testCaseStarting( testInfo ); m_runningTest = new RunningTest( &testCase ); @@ -126,7 +128,8 @@ namespace Catch { } m_totals.testCases += deltaTotals.testCases; - m_reporter->EndTestCase( testInfo, deltaTotals, redirectedCout, redirectedCerr ); + TestCaseStats stats( testInfo, deltaTotals, redirectedCout, redirectedCerr , aborting() ); + reporter.testCaseEnding( stats ); delete m_runningTest; @@ -147,6 +150,7 @@ namespace Catch { } virtual void testEnded( const AssertionResult& result ) { + LegacyReporterAdapter reporter( m_reporter ); if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } @@ -157,13 +161,13 @@ 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)->buildResult( m_lastAssertionInfo ) ); + reporter.assertionEnding( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); std::vector::const_iterator itEnd = m_assertionResults.end(); for(; it != itEnd; ++it ) - m_reporter->Result( *it ); + reporter.assertionEnding( AssertionStats( *it, m_totals ) ); } m_assertionResults.clear(); } @@ -174,7 +178,7 @@ namespace Catch { m_totals.assertions.info++; } else - m_reporter->Result( result ); + reporter.assertionEnding( AssertionStats( result, m_totals ) ); // Reset AssertionInfo m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index 695793ab..e7e12166 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -31,12 +31,12 @@ namespace Catch { return TestCase( _testCase, info ); } - TestCaseInfo::TestCaseInfo( const std::string& _name, - const std::string& _className, - const std::string& _description, - const std::set& _tags, - bool _isHidden, - const SourceLineInfo& _lineInfo ) + TestCaseInfo::TestCaseInfo( const std::string& _name, + const std::string& _className, + const std::string& _description, + const std::set& _tags, + bool _isHidden, + const SourceLineInfo& _lineInfo ) : name( _name ), className( _className ), description( _description ), diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index 57cb29f1..c8457c53 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -196,12 +196,12 @@ [Running: ./succeeding/conditions/ptr] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: p == __null succeeded for: __null == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff57d28028 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff57d28028 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff57d28028 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff5c7c3f58 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff5c7c3f58 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff5c7c3f58 != 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff57d28028 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff5c7c3f58 [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] @@ -1357,7 +1357,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [Finished: './inprogress/failing/Tricky/compound lhs' 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: 0x7fff57d28808 == 0x7fff57d28800 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff5c7c4738 == 0x7fff5c7c4730 /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)] @@ -1383,7 +1383,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [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: 0x7fff57d28800 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff5c7c4730 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] From 4b360016986e1126476490d401acb8b41b5d6e75 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 26 Nov 2012 23:28:00 +0000 Subject: [PATCH 063/296] Tightened up ReporterConfig and added it to LegacyReporterAdapter --- include/catch_runner.hpp | 4 +- include/internal/catch_interfaces_reporter.h | 41 ++++----- include/internal/catch_runner_impl.hpp | 16 ++-- include/reporters/catch_reporter_basic.hpp | 96 ++++++++++---------- include/reporters/catch_reporter_junit.hpp | 49 +++++----- include/reporters/catch_reporter_xml.hpp | 8 +- projects/SelfTest/Baselines/results.txt | 12 +-- 7 files changed, 109 insertions(+), 117 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index b5ccb2f1..13d085b5 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -45,7 +45,7 @@ namespace Catch { std::vector::const_iterator it = filterGroups.begin(); std::vector::const_iterator itEnd = filterGroups.end(); - LegacyReporterAdapter reporter( m_reporter ); + LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_configWrapper.stream(), m_config ) ); for(; it != itEnd && !context.aborting(); ++it ) { reporter.testGroupStarting( it->getName() ); @@ -100,7 +100,7 @@ namespace Catch { ? "basic" : m_config.reporter; - ReporterConfig reporterConfig( m_config.name, m_configWrapper.stream(), m_config.includeWhichResults == Include::SuccessfulResults, m_config ); + ReporterConfig reporterConfig( m_configWrapper.stream(), m_config ); m_reporter = getRegistryHub().getReporterRegistry().create( reporterName, reporterConfig ); if( !m_reporter ) { diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 3b5093f3..0ea59ef9 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -23,31 +23,17 @@ namespace Catch { struct ReporterConfig { - ReporterConfig( const std::string& _name, - std::ostream& _stream, - bool _includeSuccessfulResults, - const ConfigData& _fullConfig ) - : name( _name ), - stream( _stream ), - includeSuccessfulResults( _includeSuccessfulResults ), - fullConfig( _fullConfig ) - {} - - ReporterConfig( const ReporterConfig& other ) - : name( other.name ), - stream( other.stream ), - includeSuccessfulResults( other.includeSuccessfulResults ), - fullConfig( other.fullConfig ) - {} - + ReporterConfig( std::ostream& _stream, const ConfigData& _fullConfig ) + : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} - std::string name; - std::ostream& stream; - bool includeSuccessfulResults; - ConfigData fullConfig; + std::ostream& stream() { return *m_stream; } + std::string name() const { return m_fullConfig.name; } + bool includeSuccessfulResults() const { return m_fullConfig.includeWhichResults == Include::SuccessfulResults; } + bool warnAboutMissingAssertions() const { return m_fullConfig.warnings & ConfigData::WarnAbout::NoAssertions; } private: - void operator=(const ReporterConfig&); + std::ostream* m_stream; + ConfigData m_fullConfig; }; struct AssertionStats { @@ -67,11 +53,13 @@ namespace Catch const Totals& _totals, const std::string& _stdOut, const std::string& _stdErr, + bool _missingAssertions, bool _aborting ) : testInfo( _testInfo ), totals( _totals ), stdOut( _stdOut ), stdErr( _stdErr ), + missingAssertions( _missingAssertions ), aborting( _aborting ) {} @@ -79,6 +67,7 @@ namespace Catch Totals totals; std::string stdOut; std::string stdErr; + bool missingAssertions; bool aborting; }; @@ -166,8 +155,9 @@ namespace Catch class LegacyReporterAdapter : public SharedImpl { public: - LegacyReporterAdapter( const Ptr& legacyReporter ) - : m_legacyReporter( legacyReporter ) + LegacyReporterAdapter( const Ptr& legacyReporter, const ReporterConfig& config ) + : m_legacyReporter( legacyReporter ), + m_config( config ) {} virtual ~LegacyReporterAdapter(); @@ -189,6 +179,8 @@ namespace Catch m_legacyReporter->Result( assertionStats.assertionResult ); } virtual void testCaseEnding( const TestCaseStats& testCaseStats ) { + if( testCaseStats.missingAssertions ) + m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name ); m_legacyReporter->EndTestCase( testCaseStats.testInfo, testCaseStats.totals, testCaseStats.stdOut, testCaseStats.stdErr ); } virtual void testGroupEnding( const TestGroupStats& testGroupStats ) { @@ -202,6 +194,7 @@ namespace Catch private: Ptr m_legacyReporter; + ReporterConfig m_config; }; diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 4220daeb..039a3e38 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -68,11 +68,11 @@ namespace Catch { m_context.setRunner( this ); m_context.setConfig( &m_config ); m_context.setResultCapture( this ); - LegacyReporterAdapter( m_reporter ).testRunStarting( "" ); // !TBD - name + LegacyReporterAdapter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ).testRunStarting( "" ); // !TBD - name } virtual ~Runner() { - LegacyReporterAdapter( m_reporter ).testRunEnding( TestRunStats( "", m_totals, aborting() ) ); // !TBD - name + LegacyReporterAdapter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ).testRunEnding( TestRunStats( "", m_totals, aborting() ) ); // !TBD - name m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); @@ -85,7 +85,7 @@ namespace Catch { Totals totals; - LegacyReporterAdapter reporter( m_reporter ); + LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ); reporter.testGroupStarting( testSpec ); @@ -106,7 +106,7 @@ namespace Catch { TestCaseInfo testInfo = testCase.getTestCaseInfo(); - LegacyReporterAdapter reporter( m_reporter ); + LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ); reporter.testCaseStarting( testInfo ); m_runningTest = new RunningTest( &testCase ); @@ -120,15 +120,17 @@ namespace Catch { while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() ); Totals deltaTotals = m_totals.delta( prevTotals ); + bool missingAssertions = false; if( deltaTotals.assertions.total() == 0 && ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) ) { m_totals.assertions.failed++; deltaTotals = m_totals.delta( prevTotals ); - m_reporter->NoAssertionsInTestCase( testInfo.name ); + missingAssertions = true; } + m_totals.testCases += deltaTotals.testCases; - TestCaseStats stats( testInfo, deltaTotals, redirectedCout, redirectedCerr , aborting() ); + TestCaseStats stats( testInfo, deltaTotals, redirectedCout, redirectedCerr, missingAssertions, aborting() ); reporter.testCaseEnding( stats ); @@ -150,7 +152,7 @@ namespace Catch { } virtual void testEnded( const AssertionResult& result ) { - LegacyReporterAdapter reporter( m_reporter ); + LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ); if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index cfb23ee9..e8e1895a 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -54,27 +54,27 @@ namespace Catch { void ReportCounts( const std::string& label, const Counts& counts, const std::string& allPrefix = "All " ) { if( counts.passed ) - m_config.stream << counts.failed << " of " << counts.total() << " " << label << "s failed"; + m_config.stream() << counts.failed << " of " << counts.total() << " " << label << "s failed"; else - m_config.stream << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed"; + m_config.stream() << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed"; } void ReportCounts( const Totals& totals, const std::string& allPrefix = "All " ) { if( totals.assertions.total() == 0 ) { - m_config.stream << "No tests ran"; + m_config.stream() << "No tests ran"; } else if( totals.assertions.failed ) { TextColour colour( TextColour::ResultError ); ReportCounts( "test case", totals.testCases, allPrefix ); if( totals.testCases.failed > 0 ) { - m_config.stream << " ("; + m_config.stream() << " ("; ReportCounts( "assertion", totals.assertions, allPrefix ); - m_config.stream << ")"; + m_config.stream() << ")"; } } else { TextColour colour( TextColour::ResultSuccess ); - m_config.stream << allPrefix << "tests passed (" + m_config.stream() << allPrefix << "tests passed (" << pluralise( totals.assertions.passed, "assertion" ) << " in " << pluralise( totals.testCases.passed, "test case" ) << ")"; } @@ -97,14 +97,14 @@ namespace Catch { virtual void EndTesting( const Totals& totals ) { // Output the overall test results even if "Started Testing" was not emitted if( m_aborted ) { - m_config.stream << "\n[Testing aborted. "; + m_config.stream() << "\n[Testing aborted. "; ReportCounts( totals, "The first " ); } else { - m_config.stream << "\n[Testing completed. "; + m_config.stream() << "\n[Testing completed. "; ReportCounts( totals ); } - m_config.stream << "]\n" << std::endl; + m_config.stream() << "]\n" << std::endl; } virtual void StartGroup( const std::string& groupName ) { @@ -113,9 +113,9 @@ namespace Catch { virtual void EndGroup( const std::string& groupName, const Totals& totals ) { if( m_groupSpan.emitted && !groupName.empty() ) { - m_config.stream << "[End of group: '" << groupName << "'. "; + m_config.stream() << "[End of group: '" << groupName << "'. "; ReportCounts( totals ); - m_config.stream << "]\n" << std::endl; + m_config.stream() << "]\n" << std::endl; m_groupSpan = SpanInfo(); } } @@ -131,19 +131,19 @@ namespace Catch { virtual void NoAssertionsInSection( const std::string& sectionName ) { startSpansLazily(); TextColour colour( TextColour::ResultError ); - m_config.stream << "\nNo assertions in section, '" << sectionName << "'\n" << std::endl; + m_config.stream() << "\nNo assertions in section, '" << sectionName << "'\n" << std::endl; } virtual void NoAssertionsInTestCase( const std::string& testName ) { startSpansLazily(); TextColour colour( TextColour::ResultError ); - m_config.stream << "\nNo assertions in test case, '" << testName << "'\n" << std::endl; + m_config.stream() << "\nNo assertions in test case, '" << testName << "'\n" << std::endl; } virtual void EndSection( const std::string& sectionName, const Counts& assertions ) { SpanInfo& sectionSpan = m_sectionSpans.back(); if( sectionSpan.emitted && !sectionSpan.name.empty() ) { - m_config.stream << "[End of section: '" << sectionName << "' "; + m_config.stream() << "[End of section: '" << sectionName << "' "; if( assertions.failed ) { TextColour colour( TextColour::ResultError ); @@ -151,38 +151,38 @@ namespace Catch { } else { TextColour colour( TextColour::ResultSuccess ); - m_config.stream << ( assertions.passed > 1 ? "All " : "" ) + m_config.stream() << ( assertions.passed > 1 ? "All " : "" ) << pluralise( assertions.passed, "assertion" ) << " passed" ; } - m_config.stream << "]\n" << std::endl; + m_config.stream() << "]\n" << std::endl; } m_sectionSpans.pop_back(); } virtual void Result( const AssertionResult& assertionResult ) { - if( !m_config.includeSuccessfulResults && assertionResult.getResultType() == ResultWas::Ok ) + if( !m_config.includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok ) return; startSpansLazily(); if( !assertionResult.getSourceInfo().empty() ) { TextColour colour( TextColour::FileName ); - m_config.stream << assertionResult.getSourceInfo(); + m_config.stream() << assertionResult.getSourceInfo(); } if( assertionResult.hasExpression() ) { TextColour colour( TextColour::OriginalExpression ); - m_config.stream << assertionResult.getExpression(); + m_config.stream() << assertionResult.getExpression(); if( assertionResult.succeeded() ) { TextColour successColour( TextColour::Success ); - m_config.stream << " succeeded"; + m_config.stream() << " succeeded"; } else { TextColour errorColour( TextColour::Error ); - m_config.stream << " failed"; + m_config.stream() << " failed"; if( assertionResult.isOk() ) { TextColour okAnywayColour( TextColour::Success ); - m_config.stream << " - but was ok"; + m_config.stream() << " - but was ok"; } } } @@ -191,19 +191,19 @@ namespace Catch { { TextColour colour( TextColour::Error ); if( assertionResult.hasExpression() ) - m_config.stream << " with unexpected"; + m_config.stream() << " with unexpected"; else - m_config.stream << "Unexpected"; - m_config.stream << " exception with message: '" << assertionResult.getMessage() << "'"; + m_config.stream() << "Unexpected"; + m_config.stream() << " exception with message: '" << assertionResult.getMessage() << "'"; } break; case ResultWas::DidntThrowException: { TextColour colour( TextColour::Error ); if( assertionResult.hasExpression() ) - m_config.stream << " because no exception was thrown where one was expected"; + m_config.stream() << " because no exception was thrown where one was expected"; else - m_config.stream << "No exception thrown where one was expected"; + m_config.stream() << "No exception thrown where one was expected"; } break; case ResultWas::Info: @@ -221,7 +221,7 @@ namespace Catch { case ResultWas::ExplicitFailure: { TextColour colour( TextColour::Error ); - m_config.stream << "failed with message: '" << assertionResult.getMessage() << "'"; + m_config.stream() << "failed with message: '" << assertionResult.getMessage() << "'"; } break; case ResultWas::Unknown: // These cases are here to prevent compiler warnings @@ -232,19 +232,19 @@ namespace Catch { if( !assertionResult.hasExpression() ) { if( assertionResult.succeeded() ) { TextColour colour( TextColour::Success ); - m_config.stream << " succeeded"; + m_config.stream() << " succeeded"; } else { TextColour colour( TextColour::Error ); - m_config.stream << " failed"; + m_config.stream() << " failed"; if( assertionResult.isOk() ) { TextColour okAnywayColour( TextColour::Success ); - m_config.stream << " - but was ok"; + m_config.stream() << " - but was ok"; } } } if( assertionResult.hasMessage() ) { - m_config.stream << "\n"; + m_config.stream() << "\n"; TextColour colour( TextColour::ReconstructedExpression ); streamVariableLengthText( "with message", assertionResult.getMessage() ); } @@ -252,16 +252,16 @@ namespace Catch { } if( assertionResult.hasExpandedExpression() ) { - m_config.stream << " for: "; + m_config.stream() << " for: "; if( assertionResult.getExpandedExpression().size() > 40 ) { - m_config.stream << "\n"; + m_config.stream() << "\n"; if( assertionResult.getExpandedExpression().size() < 70 ) - m_config.stream << "\t"; + m_config.stream() << "\t"; } TextColour colour( TextColour::ReconstructedExpression ); - m_config.stream << assertionResult.getExpandedExpression(); + m_config.stream() << assertionResult.getExpandedExpression(); } - m_config.stream << std::endl; + m_config.stream() << std::endl; } virtual void EndTestCase( const TestCaseInfo& testInfo, @@ -279,9 +279,9 @@ namespace Catch { } if( m_testSpan.emitted ) { - m_config.stream << "[Finished: '" << testInfo.name << "' "; + m_config.stream() << "[Finished: '" << testInfo.name << "' "; ReportCounts( totals ); - m_config.stream << "]" << std::endl; + m_config.stream() << "]" << std::endl; } } @@ -289,20 +289,20 @@ namespace Catch { void startSpansLazily() { if( !m_testingSpan.emitted ) { - if( m_config.name.empty() ) - m_config.stream << "[Started testing]" << std::endl; + if( m_config.name().empty() ) + m_config.stream() << "[Started testing]" << std::endl; else - m_config.stream << "[Started testing: " << m_config.name << "]" << std::endl; + m_config.stream() << "[Started testing: " << m_config.name() << "]" << std::endl; m_testingSpan.emitted = true; } if( !m_groupSpan.emitted && !m_groupSpan.name.empty() ) { - m_config.stream << "[Started group: '" << m_groupSpan.name << "']" << std::endl; + m_config.stream() << "[Started group: '" << m_groupSpan.name << "']" << std::endl; m_groupSpan.emitted = true; } if( !m_testSpan.emitted ) { - m_config.stream << std::endl << "[Running: " << m_testSpan.name << "]" << std::endl; + m_config.stream() << std::endl << "[Running: " << m_testSpan.name << "]" << std::endl; m_testSpan.emitted = true; } @@ -310,7 +310,7 @@ namespace Catch { SpanInfo& sectionSpan = m_sectionSpans.back(); if( !sectionSpan.emitted && !sectionSpan.name.empty() ) { if( m_firstSectionInTestCase ) { - m_config.stream << "\n"; + m_config.stream() << "\n"; m_firstSectionInTestCase = false; } std::vector::iterator it = m_sectionSpans.begin(); @@ -318,7 +318,7 @@ namespace Catch { for(; it != itEnd; ++it ) { SpanInfo& prevSpan = *it; if( !prevSpan.emitted && !prevSpan.name.empty() ) { - m_config.stream << "[Started section: '" << prevSpan.name << "']" << std::endl; + m_config.stream() << "[Started section: '" << prevSpan.name << "']" << std::endl; prevSpan.emitted = true; } } @@ -329,10 +329,10 @@ 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 << "]"; + m_config.stream() << "[" << prefix << ": " << trimmed << "]"; } else { - m_config.stream << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed + m_config.stream() << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed << "\n[end of " << prefix << "] <<<<<<<<<<<<<<<<<<<<<<<<\n"; } } diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 10d1964b..9d4b6388 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -84,7 +84,7 @@ namespace Catch { virtual void StartGroup( const std::string& groupName ) { if( groupName.empty() ) - m_statsForSuites.push_back( Stats( m_config.name ) ); + m_statsForSuites.push_back( Stats( m_config.name() ) ); else m_statsForSuites.push_back( Stats( groupName ) ); m_currentStats = &m_statsForSuites.back(); @@ -108,7 +108,7 @@ namespace Catch { } virtual void Result( const Catch::AssertionResult& assertionResult ) { - if( assertionResult.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults ) { + if( assertionResult.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults() ) { TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); TestStats stats; std::ostringstream oss; @@ -168,32 +168,29 @@ namespace Catch { } virtual void EndTesting( const Totals& ) { - std::ostream& str = m_config.stream; - { - XmlWriter xml( str ); + XmlWriter xml( m_config.stream() ); + + if( m_statsForSuites.size() > 0 ) + xml.startElement( "testsuites" ); + + std::vector::const_iterator it = m_statsForSuites.begin(); + std::vector::const_iterator itEnd = m_statsForSuites.end(); + + for(; it != itEnd; ++it ) { + XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); + xml.writeAttribute( "name", it->m_name ); + xml.writeAttribute( "errors", it->m_errorsCount ); + xml.writeAttribute( "failures", it->m_failuresCount ); + xml.writeAttribute( "tests", it->m_testsCount ); + xml.writeAttribute( "hostname", "tbd" ); + xml.writeAttribute( "time", "tbd" ); + xml.writeAttribute( "timestamp", "tbd" ); - if( m_statsForSuites.size() > 0 ) - xml.startElement( "testsuites" ); - - std::vector::const_iterator it = m_statsForSuites.begin(); - std::vector::const_iterator itEnd = m_statsForSuites.end(); - - for(; it != itEnd; ++it ) { - XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); - xml.writeAttribute( "name", it->m_name ); - xml.writeAttribute( "errors", it->m_errorsCount ); - xml.writeAttribute( "failures", it->m_failuresCount ); - xml.writeAttribute( "tests", it->m_testsCount ); - xml.writeAttribute( "hostname", "tbd" ); - xml.writeAttribute( "time", "tbd" ); - xml.writeAttribute( "timestamp", "tbd" ); - - OutputTestCases( xml, *it ); - } - - xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ), false ); - xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ), false ); + OutputTestCases( xml, *it ); } + + xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ), false ); + xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ), false ); } void OutputTestCases( XmlWriter& xml, const Stats& stats ) { diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index 27d848e8..ae3af3c6 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -30,10 +30,10 @@ namespace Catch { } virtual void StartTesting() { - m_xml = XmlWriter( m_config.stream ); + m_xml = XmlWriter( m_config.stream() ); m_xml.startElement( "Catch" ); - if( !m_config.name.empty() ) - m_xml.writeAttribute( "name", m_config.name ); + if( !m_config.name().empty() ) + m_xml.writeAttribute( "name", m_config.name() ); } virtual void EndTesting( const Totals& totals ) { @@ -76,7 +76,7 @@ namespace Catch { } virtual void Result( const Catch::AssertionResult& assertionResult ) { - if( !m_config.includeSuccessfulResults && assertionResult.getResultType() == ResultWas::Ok ) + if( !m_config.includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok ) return; if( assertionResult.hasExpression() ) { diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index c8457c53..0a7eb8f1 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -196,12 +196,12 @@ [Running: ./succeeding/conditions/ptr] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:285: p == __null succeeded for: __null == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff5c7c3f58 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff5c7c3f58 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff5c7c3f58 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff55ab3d88 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff55ab3d88 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff55ab3d88 != 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff5c7c3f58 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff55ab3d88 [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] @@ -1357,7 +1357,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [Finished: './inprogress/failing/Tricky/compound lhs' 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: 0x7fff5c7c4738 == 0x7fff5c7c4730 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:95: &o1 == &o2 failed for: 0x7fff55ab4568 == 0x7fff55ab4560 /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)] @@ -1383,7 +1383,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' [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: 0x7fff5c7c4730 != 0 +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x7fff55ab4560 != 0 [Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/unimplemented static bool] From 22694335a5594ebdb2d7b8c9508d34211e823257 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 29 Nov 2012 08:41:17 +0000 Subject: [PATCH 064/296] Scripts for running approval tests using diff. Runs CATCH, filters results (truncates paths, removes hex digits which are probably pointers) then diffs the results) --- approvalTests.py | 46 + approve.py | 13 + projects/SelfTest/Baselines/results.txt | 1113 ++++++++++++----------- 3 files changed, 617 insertions(+), 555 deletions(-) create mode 100644 approvalTests.py create mode 100644 approve.py diff --git a/approvalTests.py b/approvalTests.py new file mode 100644 index 00000000..bb6f1222 --- /dev/null +++ b/approvalTests.py @@ -0,0 +1,46 @@ +import os +import sys +import subprocess +import re + +filenameParser = re.compile( r'\s*.*/(.*\.cpp)(.*)' ) +hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' ) + +catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) +baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/results.txt' ) +rawResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/_rawResults.tmp' ) +filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/newResults.txt' ) + +cmdPath = sys.argv[1] + +f = open( rawResultsPath, 'w' ) +subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions" ], stdout=f, stderr=f ) +f.close() + +rawFile = open( rawResultsPath, 'r' ) +filteredFile = open( filteredResultsPath, 'w' ) +for line in rawFile: + m = filenameParser.match( line ) + if m: + line = m.group(1) + m.group(2) + + while True: + m = hexParser.match( line ) + if m: + line = m.group(1) + "0x" + m.group(3) + else: + break + filteredFile.write( line.rstrip() + "\n" ) +filteredFile.close() +rawFile.close() + +os.remove( rawResultsPath ) +print +diffResult = subprocess.call([ "diff", baselinesPath, filteredResultsPath ] ) +if diffResult == 0: + os.remove( filteredResultsPath ) + print "\033[92mResults matched" +else: + print "\n****************************\n\033[91mResults differed" +print "\033[0m" +exit( diffResult) \ No newline at end of file diff --git a/approve.py b/approve.py new file mode 100644 index 00000000..0d46ddae --- /dev/null +++ b/approve.py @@ -0,0 +1,13 @@ +import os +import sys +import shutil + +catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) +baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/results.txt' ) +filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/newResults.txt' ) + +if os.path.isfile( filteredResultsPath ): + os.remove( baselinesPath ) + os.rename( filteredResultsPath, baselinesPath ) +else: + print "approval file " + filteredResultsPath + " does not exist" diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index 0a7eb8f1..0767ebcd 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -2,249 +2,249 @@ [Started group: '~dummy'] [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 +ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) +ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) +ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 +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 ) +ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) +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 ) +ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) +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 +ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded +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 ) +ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) +ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) +ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) +ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) +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 +ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) +ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) +ApproxTests.cpp:96: d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) +ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 +ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 +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" +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" +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 +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 +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 ) +ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 +ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) +ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) +ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" +ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" +ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 +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 ) +ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 +ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 +ConditionTests.cpp:73: data.int_seven == 0 failed for: 7 == 0 +ConditionTests.cpp:74: data.float_nine_point_one == Approx( 9.11f ) failed for: 9.1 == Approx( 9.11 ) +ConditionTests.cpp:75: data.float_nine_point_one == Approx( 9.0f ) failed for: 9.1 == Approx( 9 ) +ConditionTests.cpp:76: data.float_nine_point_one == Approx( 1 ) failed for: 9.1 == Approx( 1 ) +ConditionTests.cpp:77: data.float_nine_point_one == Approx( 0 ) failed for: 9.1 == Approx( 0 ) +ConditionTests.cpp:78: data.double_pi == Approx( 3.1415 ) failed for: 3.14159 == Approx( 3.1415 ) +ConditionTests.cpp:79: data.str_hello == "goodbye" failed for: "hello" == "goodbye" +ConditionTests.cpp:80: data.str_hello == "hell" failed for: "hello" == "hell" +ConditionTests.cpp:81: data.str_hello == "hello1" failed for: "hello" == "hello1" +ConditionTests.cpp:82: data.str_hello.size() == 6 failed for: 5 == 6 +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 +ConditionTests.cpp:93: data.int_seven != 6 succeeded for: 7 != 6 +ConditionTests.cpp:94: data.int_seven != 8 succeeded for: 7 != 8 +ConditionTests.cpp:95: data.float_nine_point_one != Approx( 9.11f ) succeeded for: 9.1 != Approx( 9.11 ) +ConditionTests.cpp:96: data.float_nine_point_one != Approx( 9.0f ) succeeded for: 9.1 != Approx( 9 ) +ConditionTests.cpp:97: data.float_nine_point_one != Approx( 1 ) succeeded for: 9.1 != Approx( 1 ) +ConditionTests.cpp:98: data.float_nine_point_one != Approx( 0 ) succeeded for: 9.1 != Approx( 0 ) +ConditionTests.cpp:99: data.double_pi != Approx( 3.1415 ) succeeded for: 3.14159 != Approx( 3.1415 ) +ConditionTests.cpp:100: data.str_hello != "goodbye" succeeded for: "hello" != "goodbye" +ConditionTests.cpp:101: data.str_hello != "hell" succeeded for: "hello" != "hell" +ConditionTests.cpp:102: data.str_hello != "hello1" succeeded for: "hello" != "hello1" +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 +ConditionTests.cpp:111: data.int_seven != 7 failed for: 7 != 7 +ConditionTests.cpp:112: data.float_nine_point_one != Approx( 9.1f ) failed for: 9.1 != Approx( 9.1 ) +ConditionTests.cpp:113: data.double_pi != Approx( 3.1415926535 ) failed for: 3.14159 != Approx( 3.14159 ) +ConditionTests.cpp:114: data.str_hello != "hello" failed for: "hello" != "hello" +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" +ConditionTests.cpp:124: data.int_seven < 8 succeeded for: 7 < 8 +ConditionTests.cpp:125: data.int_seven > 6 succeeded for: 7 > 6 +ConditionTests.cpp:126: data.int_seven > 0 succeeded for: 7 > 0 +ConditionTests.cpp:127: data.int_seven > -1 succeeded for: 7 > -1 +ConditionTests.cpp:129: data.int_seven >= 7 succeeded for: 7 >= 7 +ConditionTests.cpp:130: data.int_seven >= 6 succeeded for: 7 >= 6 +ConditionTests.cpp:131: data.int_seven <= 7 succeeded for: 7 <= 7 +ConditionTests.cpp:132: data.int_seven <= 8 succeeded for: 7 <= 8 +ConditionTests.cpp:134: data.float_nine_point_one > 9 succeeded for: 9.1 > 9 +ConditionTests.cpp:135: data.float_nine_point_one < 10 succeeded for: 9.1 < 10 +ConditionTests.cpp:136: data.float_nine_point_one < 9.2 succeeded for: 9.1 < 9.2 +ConditionTests.cpp:138: data.str_hello <= "hello" succeeded for: "hello" <= "hello" +ConditionTests.cpp:139: data.str_hello >= "hello" succeeded for: "hello" >= "hello" +ConditionTests.cpp:141: data.str_hello < "hellp" succeeded for: "hello" < "hellp" +ConditionTests.cpp:142: data.str_hello < "zebra" succeeded for: "hello" < "zebra" +ConditionTests.cpp:143: data.str_hello > "hellm" succeeded for: "hello" > "hellm" +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" +ConditionTests.cpp:152: data.int_seven > 7 failed for: 7 > 7 +ConditionTests.cpp:153: data.int_seven < 7 failed for: 7 < 7 +ConditionTests.cpp:154: data.int_seven > 8 failed for: 7 > 8 +ConditionTests.cpp:155: data.int_seven < 6 failed for: 7 < 6 +ConditionTests.cpp:156: data.int_seven < 0 failed for: 7 < 0 +ConditionTests.cpp:157: data.int_seven < -1 failed for: 7 < -1 +ConditionTests.cpp:159: data.int_seven >= 8 failed for: 7 >= 8 +ConditionTests.cpp:160: data.int_seven <= 6 failed for: 7 <= 6 +ConditionTests.cpp:162: data.float_nine_point_one < 9 failed for: 9.1 < 9 +ConditionTests.cpp:163: data.float_nine_point_one > 10 failed for: 9.1 > 10 +ConditionTests.cpp:164: data.float_nine_point_one > 9.2 failed for: 9.1 > 9.2 +ConditionTests.cpp:166: data.str_hello > "hello" failed for: "hello" > "hello" +ConditionTests.cpp:167: data.str_hello < "hello" failed for: "hello" < "hello" +ConditionTests.cpp:168: data.str_hello > "hellp" failed for: "hello" > "hellp" +ConditionTests.cpp:169: data.str_hello > "z" failed for: "hello" > "z" +ConditionTests.cpp:170: data.str_hello < "hellm" failed for: "hello" < "hellm" +ConditionTests.cpp:171: data.str_hello < "a" failed for: "hello" < "a" +ConditionTests.cpp:173: data.str_hello >= "z" failed for: "hello" >= "z" +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 +ConditionTests.cpp:188: i == 1 succeeded for: 1 == 1 +ConditionTests.cpp:189: ui == 2 succeeded for: 2 == 2 +ConditionTests.cpp:190: l == 3 succeeded for: 3 == 3 +ConditionTests.cpp:191: ul == 4 succeeded for: 4 == 4 +ConditionTests.cpp:192: c == 5 succeeded for: 5 == 5 +ConditionTests.cpp:193: uc == 6 succeeded for:  == 6 +ConditionTests.cpp:195: 1 == i succeeded for: 1 == 1 +ConditionTests.cpp:196: 2 == ui succeeded for: 2 == 2 +ConditionTests.cpp:197: 3 == l succeeded for: 3 == 3 +ConditionTests.cpp:198: 4 == ul succeeded for: 4 == 4 +ConditionTests.cpp:199: 5 == c succeeded for: 5 == 5 +ConditionTests.cpp:200: 6 == uc succeeded for: 6 ==  +ConditionTests.cpp:202: (std::numeric_limits::max)() > ul succeeded for: 0x > 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 +ConditionTests.cpp:223: long_var == unsigned_char_var succeeded for: 1 ==  +ConditionTests.cpp:224: long_var == unsigned_short_var succeeded for: 1 == 1 +ConditionTests.cpp:225: long_var == unsigned_int_var succeeded for: 1 == 1 +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/const ints to int literal] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:237: unsigned_char_var == 1 succeeded for:  == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:238: unsigned_short_var == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:239: unsigned_int_var == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:240: unsigned_long_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:237: unsigned_char_var == 1 succeeded for:  == 1 +ConditionTests.cpp:238: unsigned_short_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:239: unsigned_int_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:240: unsigned_long_var == 1 succeeded for: 1 == 1 [Finished: './succeeding/conditions/const ints to int literal' 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:246: ( -1 > 2u ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:247: -1 > 2u succeeded for: -1 > 2 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:249: ( 2u < -1 ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:250: 2u < -1 succeeded for: 2 < -1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:253: ( minInt > 2u ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:254: minInt > 2u succeeded for: -2147483648 > 2 +ConditionTests.cpp:246: ( -1 > 2u ) succeeded for: true +ConditionTests.cpp:247: -1 > 2u succeeded for: -1 > 2 +ConditionTests.cpp:249: ( 2u < -1 ) succeeded for: true +ConditionTests.cpp:250: 2u < -1 succeeded for: 2 < -1 +ConditionTests.cpp:253: ( minInt > 2u ) succeeded for: true +ConditionTests.cpp:254: 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:269: 54 == 6*9 succeeded for: 54 == 54 +ConditionTests.cpp:269: 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:285: p == __null succeeded for: __null == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:291: p != __null succeeded for: 0x7fff55ab3d88 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:294: cp != __null succeeded for: 0x7fff55ab3d88 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:297: cpc != __null succeeded for: 0x7fff55ab3d88 != 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x7fff55ab3d88 +ConditionTests.cpp:285: p == __null succeeded for: __null == 0 +ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null +ConditionTests.cpp:291: p != __null succeeded for: 0x != 0 +ConditionTests.cpp:294: cp != __null succeeded for: 0x != 0 +ConditionTests.cpp:297: cpc != __null succeeded for: 0x != 0 +ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 +ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 +ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x [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:317: false == false succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:318: true == true succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:319: !false succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:320: !false succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:322: !falseValue succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:323: !falseValue succeeded for: !false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:325: !(1 == 2) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:326: !1 == 2 succeeded for: !(1 == 2) +ConditionTests.cpp:317: false == false succeeded +ConditionTests.cpp:318: true == true succeeded +ConditionTests.cpp:319: !false succeeded for: true +ConditionTests.cpp:320: !false succeeded +ConditionTests.cpp:322: !falseValue succeeded for: true +ConditionTests.cpp:323: !falseValue succeeded for: !false +ConditionTests.cpp:325: !(1 == 2) succeeded for: true +ConditionTests.cpp:326: !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:334: false != false failed -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:335: true != true failed -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:336: !true failed for: false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:337: !true failed -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:339: !trueValue failed for: false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:340: !trueValue failed for: !true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:342: !(1 == 1) failed for: false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ConditionTests.cpp:343: !1 == 1 failed for: !(1 == 1) +ConditionTests.cpp:334: false != false failed +ConditionTests.cpp:335: true != true failed +ConditionTests.cpp:336: !true failed for: false +ConditionTests.cpp:337: !true failed +ConditionTests.cpp:339: !trueValue failed for: false +ConditionTests.cpp:340: !trueValue failed for: !true +ConditionTests.cpp:342: !(1 == 1) failed for: false +ConditionTests.cpp:343: !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 +ExceptionTests.cpp:39: thisThrows() succeeded +ExceptionTests.cpp:40: thisDoesntThrow() succeeded +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' +ExceptionTests.cpp:47: thisThrows() failed with unexpected exception with message: 'expected exception' +ExceptionTests.cpp:48: thisDoesntThrow() failed because no exception was thrown where one was expected +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' +ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' [Finished: './failing/exceptions/implicit' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/implicit/2] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:60: 1 == 1 succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:60: {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:60: 1 == 1 succeeded +ExceptionTests.cpp:60: {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' [Finished: './failing/exceptions/implicit/2' 1 test case failed (1 of 2 assertions failed)] [Running: ./succeeding/exceptions/implicit] @@ -254,19 +254,19 @@ No assertions in test case, './succeeding/exceptions/implicit' [Finished: './succeeding/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:102: Unexpected exception with message: 'custom exception' +ExceptionTests.cpp:102: 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:109: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' +ExceptionTests.cpp:109: 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:114: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' +ExceptionTests.cpp:114: 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:118: Unexpected exception with message: '3.14' +ExceptionTests.cpp:118: Unexpected exception with message: '3.14' [Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/in-section] @@ -280,238 +280,238 @@ No assertions in section, 'the section2' [End of section: 'the section' 1 assertion failed] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:132: Unexpected exception with message: 'Exception from section' +ExceptionTests.cpp:132: Unexpected exception with message: 'Exception from section' [Finished: './failing/exceptions/in-section' 1 test case failed (All 2 assertions failed)] [Running: ./succeeding/exceptions/error messages] [Started section: 'custom, unexpected'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/ExceptionTests.cpp:152: runner.getLog() Contains( "custom exception" ) succeeded for: +ExceptionTests.cpp:152: 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:102: ThrewException'custom exception' /[tc] ./failing/exceptions/custom +ExceptionTests.cpp:102: 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:160: runner.getLog() Contains( "Exception from section" ) succeeded for: +ExceptionTests.cpp:160: 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:132: ThrewException'Exception from section' \ [s] the section +ExceptionTests.cpp:132: 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:161: runner.getLog() Contains( ::Catch::LineInfoRegistry::get().infoForName( "the section2" ) ) succeeded for: +ExceptionTests.cpp:161: 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:132: ThrewException'Exception from section' \ [s] the section +ExceptionTests.cpp:132: 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:132: " +ExceptionTests.cpp:132: " [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:172: thisFunctionNotImplemented( 7 ) succeeded +ExceptionTests.cpp:172: 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 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +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] +MessageTests.cpp:14: [warning: this is a warning] No assertions in test case, './succeeding/message' [Finished: './succeeding/message' 1 test case failed (1 assertion failed)] [Running: ./succeeding/succeed] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:18: succeeded +MessageTests.cpp:18: succeeded [with message: this is a success] [Finished: './succeeding/succeed' All tests passed (1 assertion in 1 test case)] [Running: ./failing/message/info/1] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:23: [info: this message should be logged] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:24: [info: so should this] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:26: a == 1 failed for: 2 == 1 +MessageTests.cpp:23: [info: this message should be logged] +MessageTests.cpp:24: [info: so should this] +MessageTests.cpp:26: a == 1 failed for: 2 == 1 [Finished: './failing/message/info/1' 1 test case failed (1 assertion failed)] [Running: ./mixed/message/info/2] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:31: [info: this message should be logged] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:35: [info: this message should be logged, too] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:37: a == 1 failed for: 2 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:39: [info: and this, but later] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:41: a == 0 failed for: 2 == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:45: a == 2 succeeded for: 2 == 2 +MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 +MessageTests.cpp:31: [info: this message should be logged] +MessageTests.cpp:35: [info: this message should be logged, too] +MessageTests.cpp:37: a == 1 failed for: 2 == 1 +MessageTests.cpp:39: [info: and this, but later] +MessageTests.cpp:41: a == 0 failed for: 2 == 0 +MessageTests.cpp:45: a == 2 succeeded for: 2 == 2 [Finished: './mixed/message/info/2' 1 test case failed (2 of 4 assertions failed)] [Running: ./failing/message/fail] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:51: failed with message: 'This is a failure' +MessageTests.cpp:51: 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:58: failed with message: 'Message from section one' +MessageTests.cpp:58: 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:63: failed with message: 'Message from section two' +MessageTests.cpp:63: 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)] @@ -534,23 +534,23 @@ No assertions in section, 'two' [Finished: './succeeding/message/sections/stdout' 1 test case failed (All 2 assertions failed)] [Running: ./mixed/message/scoped] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 0 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 1 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 2 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 3 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 4 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 5 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 6 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 7 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 8 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded for: 9 < 10 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded[info: current counter 10] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 succeeded[info: i := 10] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:86: i < 10 failed for: 10 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 0 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 1 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 2 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 3 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 4 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 5 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 6 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 7 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 8 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 9 < 10 +MessageTests.cpp:86: i < 10 succeeded[info: current counter 10] +MessageTests.cpp:86: i < 10 succeeded[info: i := 10] +MessageTests.cpp:86: i < 10 failed for: 10 < 10 [Finished: './mixed/message/scoped' 1 test case failed (1 of 11 assertions failed)] [Running: ./succeeding/nofail] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MessageTests.cpp:92: 1 == 2 failed - but was ok +MessageTests.cpp:92: 1 == 2 failed - but was ok No assertions in test case, './succeeding/nofail' @@ -558,22 +558,22 @@ No assertions in test case, './succeeding/nofail' [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 +MiscTests.cpp:25: a != b succeeded for: 1 != 2 +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 +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 +MiscTests.cpp:42: a != b succeeded for: 1 != 2 +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 +MiscTests.cpp:47: a != b succeeded for: 1 != 2 [End of section: 's2' 1 assertion passed] [End of section: 's1' All 3 assertions passed] @@ -583,21 +583,21 @@ No assertions in test case, './succeeding/nofail' [Running: ./mixed/Misc/Sections/nested2] [Started section: 's1'] [Started section: 's2'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:61: a == b failed for: 1 == 2 +MiscTests.cpp:61: a == b failed for: 1 == 2 [End of section: 's2' 1 assertion failed] [End of section: 's1' 1 assertion failed] [Started section: 's1'] [Started section: 's3'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:66: a != b succeeded for: 1 != 2 +MiscTests.cpp:66: a != b succeeded for: 1 != 2 [End of section: 's3' 1 assertion passed] [End of section: 's1' 1 assertion passed] [Started section: 's1'] [Started section: 's4'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:70: a < b succeeded for: 1 < 2 +MiscTests.cpp:70: a < b succeeded for: 1 < 2 [End of section: 's4' 1 assertion passed] [End of section: 's1' 1 assertion passed] @@ -632,7 +632,7 @@ No assertions in section, 'f (leaf)' [Finished: './Sections/nested/a/b' 1 test case failed (All 3 assertions failed)] [Running: Sections/nested3] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:119: runner.getLog() == "\\[g] ./Sections/nested/a/b\n" " \\[tc] ./Sections/nested/a/b\n" " \\ [s] c\n" " \\ [s] d (leaf)\n" " / [s] d (leaf)\n" " / [s] c\n" " \\ [s] c\n" " \\ [s] e (leaf)\n" " / [s] e (leaf)\n" " / [s] c\n" " \\ [s] c\n" " / [s] c\n" " \\ [s] f (leaf)\n" " / [s] f (leaf)\n" " /[tc] ./Sections/nested/a/b\n" "/[g] ./Sections/nested/a/b\n" succeeded for: +MiscTests.cpp:119: runner.getLog() == "\\[g] ./Sections/nested/a/b\n" " \\[tc] ./Sections/nested/a/b\n" " \\ [s] c\n" " \\ [s] d (leaf)\n" " / [s] d (leaf)\n" " / [s] c\n" " \\ [s] c\n" " \\ [s] e (leaf)\n" " / [s] e (leaf)\n" " / [s] c\n" " \\ [s] c\n" " / [s] c\n" " \\ [s] f (leaf)\n" " / [s] f (leaf)\n" " /[tc] ./Sections/nested/a/b\n" "/[g] ./Sections/nested/a/b\n" succeeded for: "\[g] ./Sections/nested/a/b \[tc] ./Sections/nested/a/b @@ -675,30 +675,31 @@ No assertions in section, 'f (leaf)' [Running: ./mixed/Misc/Sections/loops] [Started section: 's1'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:133: b > a failed for: 0 > 1 +MiscTests.cpp:133: b > a failed for: 0 > 1 [End of section: 's1' 1 assertion failed] [Finished: './mixed/Misc/Sections/loops' 1 test case failed (1 assertion failed)] [Running: ./mixed/Misc/loops] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[0] (1) is even] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[1] (1) is even] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[2] (2) is even] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[3] (3) is even] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[4] (5) is even] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[5] (8) is even] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[6] (13) is even] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:144: [info: Testing if fib[7] (21) is even] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:144: [info: Testing if fib[0] (1) is even] +MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:144: [info: Testing if fib[1] (1) is even] +MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:145: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +MiscTests.cpp:144: [info: Testing if fib[2] (2) is even] +MiscTests.cpp:144: [info: Testing if fib[3] (3) is even] +MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:144: [info: Testing if fib[4] (5) is even] +MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:145: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +MiscTests.cpp:144: [info: Testing if fib[5] (8) is even] +MiscTests.cpp:144: [info: Testing if fib[6] (13) is even] +MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:144: [info: Testing if fib[7] (21) is even] +MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 [Finished: './mixed/Misc/loops' 1 test case failed (6 of 8 assertions failed)] Some information +An error [Running: ./succeeding/Misc/stdout,stderr] @@ -707,34 +708,34 @@ No assertions in test case, './succeeding/Misc/stdout,stderr' [Finished: './succeeding/Misc/stdout,stderr' 1 test case failed (1 assertion failed)] [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} +MiscTests.cpp:163: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} +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 +MiscTests.cpp:169: [info: hi] +MiscTests.cpp:171: [info: i := 7] +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 +MiscTests.cpp:177: flag succeeded for: true +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 +MiscTests.cpp:177: flag failed for: false +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 +MiscTests.cpp:195: flag succeeded for: true +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 +MiscTests.cpp:195: flag failed for: false +MiscTests.cpp:208: testCheckedElse( false ) failed for: false [Finished: './failing/checkedelse' 1 test case failed (All 2 assertions failed)] [Running: ./misc/xmlentitycheck] @@ -753,68 +754,68 @@ No assertions in section, 'encoded chars' [Finished: './misc/xmlentitycheck' 1 test case failed (All 2 assertions failed)] [Running: ./manual/onechar] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:225: [info: 3] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:226: false failed +MiscTests.cpp:225: [info: 3] +MiscTests.cpp:226: false failed [Finished: './manual/onechar' 1 test case failed (1 assertion failed)] [Running: ./succeeding/atomic if] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:236: x == 0 succeeded for: 0 == 0 +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: +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: +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: +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: +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: +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: +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: +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: +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/AllOf] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:275: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: +MiscTests.cpp:275: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) [Finished: '/succeeding/matchers/AllOf' All tests passed (1 assertion in 1 test case)] [Running: /succeeding/matchers/AnyOf] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:279: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: +MiscTests.cpp:279: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:280: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: +MiscTests.cpp:280: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) [Finished: '/succeeding/matchers/AnyOf' All tests passed (2 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: +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: example/factorial] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:296: Factorial(0) == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:297: Factorial(1) == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:298: Factorial(2) == 2 succeeded for: 2 == 2 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:299: Factorial(3) == 6 succeeded for: 6 == 6 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:300: Factorial(10) == 3628800 succeeded for: 0x375f00 == 3628800 +MiscTests.cpp:296: Factorial(0) == 1 succeeded for: 1 == 1 +MiscTests.cpp:297: Factorial(1) == 1 succeeded for: 1 == 1 +MiscTests.cpp:298: Factorial(2) == 2 succeeded for: 2 == 2 +MiscTests.cpp:299: Factorial(3) == 6 succeeded for: 6 == 6 +MiscTests.cpp:300: Factorial(10) == 3628800 succeeded for: 0x == 3628800 [Finished: 'example/factorial' All tests passed (5 assertions in 1 test case)] [Running: empty] @@ -824,7 +825,7 @@ No assertions in test case, 'empty' [Finished: 'empty' 1 test case failed (1 assertion failed)] [Running: Nice descriptive name] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/MiscTests.cpp:309: [warning: This one ran] +MiscTests.cpp:309: [warning: This one ran] No assertions in test case, 'Nice descriptive name' @@ -964,6 +965,7 @@ Message from section two /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] Some information +An error /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded [with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded @@ -1001,18 +1003,19 @@ Some information Message from section one Message from section two Some information +An error [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/succeeding tests'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:40: totals.assertions.passed == 294 succeeded for: 294 == 294 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 +TestMain.cpp:40: totals.assertions.passed == 294 succeeded for: 294 == 294 +TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 [End of section: 'selftest/test counts/succeeding tests' All 2 assertions passed] [End of section: 'selftest/test counts' All 2 assertions passed] [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/failing tests'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:48: totals.assertions.failed == 73 succeeded for: 73 == 73 +TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 +TestMain.cpp:48: totals.assertions.failed == 73 succeeded for: 73 == 73 [End of section: 'selftest/test counts/failing tests' All 2 assertions passed] [End of section: 'selftest/test counts' All 2 assertions passed] @@ -1020,83 +1023,83 @@ Some information [Finished: 'selftest/main' All tests passed (74 assertions in 1 test case)] [Running: meta/Misc/Sections] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:58: totals.assertions.failed == 1 succeeded for: 1 == 1 +TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 +TestMain.cpp:58: totals.assertions.failed == 1 succeeded for: 1 == 1 [Finished: 'meta/Misc/Sections' All tests passed (2 assertions in 1 test case)] [Running: selftest/parser/2] [Started section: 'default'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:97: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:99: config.shouldDebugBreak == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:100: config.cutoff == -1 succeeded for: -1 == -1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:101: config.allowThrows == true succeeded for: true == true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:102: config.reporter.empty() succeeded for: true +TestMain.cpp:97: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:99: config.shouldDebugBreak == false succeeded for: false == false +TestMain.cpp:100: config.cutoff == -1 succeeded for: -1 == -1 +TestMain.cpp:101: config.allowThrows == true succeeded for: true == true +TestMain.cpp:102: config.reporter.empty() succeeded for: true [End of section: 'default' All 5 assertions passed] [Started section: 'test lists'] [Started section: '-t/1'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:108: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:110: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:111: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:112: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:108: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:110: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:111: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:112: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [End of section: '-t/1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '-t/exclude:1'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:116: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:118: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:119: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:120: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:116: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:118: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:119: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:120: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '-t/exclude:1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '--test/1'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:125: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:127: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:128: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:129: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:125: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:127: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:128: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:129: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [End of section: '--test/1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '--test/exclude:1'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:134: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:136: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:137: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:138: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:134: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:136: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:137: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:138: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '--test/exclude:1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '--test/exclude:2'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:143: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:145: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:146: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:147: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:143: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:145: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:146: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:147: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '--test/exclude:2' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '-t/2'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:152: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:154: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:155: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:156: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:157: config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true +TestMain.cpp:152: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:154: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:155: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:156: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:157: config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true [End of section: '-t/2' All 5 assertions passed] [End of section: 'test lists' All 5 assertions passed] [Started section: 'test lists'] [Started section: '-t/0'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: +TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" [End of section: '-t/0' 1 assertion passed] @@ -1104,31 +1107,31 @@ Some information [Started section: 'reporter'] [Started section: '-r/basic'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:169: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:171: config.reporter == "basic" succeeded for: "basic" == "basic" +TestMain.cpp:169: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:171: config.reporter == "basic" succeeded for: "basic" == "basic" [End of section: '-r/basic' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '-r/xml'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:175: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:177: config.reporter == "xml" succeeded for: "xml" == "xml" +TestMain.cpp:175: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:177: config.reporter == "xml" succeeded for: "xml" == "xml" [End of section: '-r/xml' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '--reporter/junit'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:181: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:183: config.reporter == "junit" succeeded for: "junit" == "junit" +TestMain.cpp:181: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:183: config.reporter == "junit" succeeded for: "junit" == "junit" [End of section: '--reporter/junit' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '-r/error'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: +TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" [End of section: '-r/error' 1 assertion passed] @@ -1136,23 +1139,23 @@ Some information [Started section: 'debugger'] [Started section: '-b'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:194: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:196: config.shouldDebugBreak == true succeeded for: true == true +TestMain.cpp:194: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:196: config.shouldDebugBreak == true succeeded for: true == true [End of section: '-b' All 2 assertions passed] [End of section: 'debugger' All 2 assertions passed] [Started section: 'debugger'] [Started section: '--break'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:200: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:202: config.shouldDebugBreak succeeded for: true +TestMain.cpp:200: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:202: config.shouldDebugBreak succeeded for: true [End of section: '--break' All 2 assertions passed] [End of section: 'debugger' All 2 assertions passed] [Started section: 'debugger'] [Started section: '-b'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: +TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" [End of section: '-b' 1 assertion passed] @@ -1160,23 +1163,23 @@ Some information [Started section: 'abort'] [Started section: '-a'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:213: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:215: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:213: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:215: config.cutoff == 1 succeeded for: 1 == 1 [End of section: '-a' All 2 assertions passed] [End of section: 'abort' All 2 assertions passed] [Started section: 'abort'] [Started section: '-a/2'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:219: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:221: config.cutoff == 2 succeeded for: 2 == 2 +TestMain.cpp:219: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:221: config.cutoff == 2 succeeded for: 2 == 2 [End of section: '-a/2' All 2 assertions passed] [End of section: 'abort' All 2 assertions passed] [Started section: 'abort'] [Started section: '-a/error/0'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" [End of section: '-a/error/0' 1 assertion passed] @@ -1184,7 +1187,7 @@ Some information [Started section: 'abort'] [Started section: '-a/error/non numeric'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" [End of section: '-a/error/non numeric' 1 assertion passed] @@ -1192,7 +1195,7 @@ Some information [Started section: 'abort'] [Started section: '-a/error/two args'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: +TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" [End of section: '-a/error/two args' 1 assertion passed] @@ -1200,52 +1203,52 @@ Some information [Started section: 'nothrow'] [Started section: '-nt'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:240: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:242: config.allowThrows == false succeeded for: false == false +TestMain.cpp:240: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:242: config.allowThrows == false succeeded for: false == false [End of section: '-nt' All 2 assertions passed] [End of section: 'nothrow' All 2 assertions passed] [Started section: 'nothrow'] [Started section: '--nothrow'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:246: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:248: config.allowThrows == false succeeded for: false == false +TestMain.cpp:246: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:248: config.allowThrows == false succeeded for: false == false [End of section: '--nothrow' All 2 assertions passed] [End of section: 'nothrow' All 2 assertions passed] [Started section: 'streams'] [Started section: '-o filename'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:255: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:257: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:258: config.stream.empty() succeeded for: true +TestMain.cpp:255: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:257: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:258: config.stream.empty() succeeded for: true [End of section: '-o filename' All 3 assertions passed] [End of section: 'streams' All 3 assertions passed] [Started section: 'streams'] [Started section: '-o %stdout'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:264: config.stream == "stdout" succeeded for: "stdout" == "stdout" -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:265: config.outputFilename.empty() succeeded for: true +TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:264: config.stream == "stdout" succeeded for: "stdout" == "stdout" +TestMain.cpp:265: config.outputFilename.empty() succeeded for: true [End of section: '-o %stdout' All 3 assertions passed] [End of section: 'streams' All 3 assertions passed] [Started section: 'streams'] [Started section: '--out'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:271: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:271: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" [End of section: '--out' All 2 assertions passed] [End of section: 'streams' All 2 assertions passed] [Started section: 'combinations'] [Started section: '-a -b'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:278: parseIntoConfig( argv, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:280: config.cutoff == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:281: config.shouldDebugBreak succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:282: config.allowThrows == false succeeded for: false == false +TestMain.cpp:278: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:280: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:281: config.shouldDebugBreak succeeded for: true +TestMain.cpp:282: config.allowThrows == false succeeded for: false == false [End of section: '-a -b' All 4 assertions passed] [End of section: 'combinations' All 4 assertions passed] @@ -1253,176 +1256,176 @@ Some information [Finished: 'selftest/parser/2' All tests passed (66 assertions in 1 test case)] [Running: selftest/test filter] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:291: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:292: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:297: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:298: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:300: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:301: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false +TestMain.cpp:291: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:292: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:297: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:298: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:300: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true +TestMain.cpp:301: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false [Finished: 'selftest/test filter' All tests passed (6 assertions in 1 test case)] [Running: selftest/test filters] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:312: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:314: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:316: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false +TestMain.cpp:312: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:314: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:316: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false [Finished: 'selftest/test filters' All tests passed (4 assertions in 1 test case)] [Running: selftest/filter/prefix wildcard] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:323: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false +TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:323: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/prefix wildcard' All tests passed (2 assertions in 1 test case)] [Running: selftest/filter/wildcard at both ends] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:331: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false +TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true +TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true +TestMain.cpp:331: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/wildcard at both ends' All tests passed (4 assertions in 1 test case)] [Running: selftest/option parsers] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:351: opt.parseIntoConfig( parser, config ) succeeded -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:353: config.filters.size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:354: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:355: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:351: opt.parseIntoConfig( parser, config ) succeeded +TestMain.cpp:353: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:354: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:355: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [Finished: 'selftest/option parsers' All tests passed (4 assertions in 1 test case)] [Running: selftest/tags] [Started section: 'one tag'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:370: oneTag.hasTag( "one" ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:371: oneTag.getTags().size() == 1 succeeded for: 1 == 1 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:373: oneTag.matchesTags( p1 ) == true succeeded for: true == true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:374: oneTag.matchesTags( p2 ) == true succeeded for: true == true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:375: oneTag.matchesTags( p3 ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:376: oneTag.matchesTags( p4 ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:377: oneTag.matchesTags( p5 ) == false succeeded for: false == false +TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:370: oneTag.hasTag( "one" ) succeeded for: true +TestMain.cpp:371: oneTag.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:373: oneTag.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:374: oneTag.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:375: oneTag.matchesTags( p3 ) == false succeeded for: false == false +TestMain.cpp:376: oneTag.matchesTags( p4 ) == false succeeded for: false == false +TestMain.cpp:377: oneTag.matchesTags( p5 ) == false succeeded for: false == false [End of section: 'one tag' All 8 assertions passed] [Started section: 'two tags'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:384: twoTags.hasTag( "one" ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:385: twoTags.hasTag( "two" ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:386: twoTags.hasTag( "three" ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:387: twoTags.getTags().size() == 2 succeeded for: 2 == 2 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:389: twoTags.matchesTags( p1 ) == true succeeded for: true == true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:390: twoTags.matchesTags( p2 ) == true succeeded for: true == true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:391: twoTags.matchesTags( p3 ) == true succeeded for: true == true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:392: twoTags.matchesTags( p4 ) == true succeeded for: true == true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:393: twoTags.matchesTags( p5 ) == true succeeded for: true == true +TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:384: twoTags.hasTag( "one" ) succeeded for: true +TestMain.cpp:385: twoTags.hasTag( "two" ) succeeded for: true +TestMain.cpp:386: twoTags.hasTag( "three" ) == false succeeded for: false == false +TestMain.cpp:387: twoTags.getTags().size() == 2 succeeded for: 2 == 2 +TestMain.cpp:389: twoTags.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:390: twoTags.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:391: twoTags.matchesTags( p3 ) == true succeeded for: true == true +TestMain.cpp:392: twoTags.matchesTags( p4 ) == true succeeded for: true == true +TestMain.cpp:393: twoTags.matchesTags( p5 ) == true succeeded for: true == true [End of section: 'two tags' All 10 assertions passed] [Started section: 'one tag with characters either side'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:399: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:400: oneTagWithExtras.hasTag( "one" ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:401: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:402: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:399: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" +TestMain.cpp:400: oneTagWithExtras.hasTag( "one" ) succeeded for: true +TestMain.cpp:401: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false +TestMain.cpp:402: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 [End of section: 'one tag with characters either side' All 4 assertions passed] [Started section: 'start of a tag, but not closed'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:409: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:410: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:411: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 +TestMain.cpp:409: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" +TestMain.cpp:410: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false +TestMain.cpp:411: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 [End of section: 'start of a tag, but not closed' All 3 assertions passed] [Started section: 'hidden'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:417: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:418: oneTag.hasTag( "hide" ) succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:419: oneTag.isHidden() succeeded for: true -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TestMain.cpp:421: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false +TestMain.cpp:417: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:418: oneTag.hasTag( "hide" ) succeeded for: true +TestMain.cpp:419: oneTag.isHidden() succeeded for: true +TestMain.cpp:421: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false [End of section: 'hidden' All 4 assertions passed] [Finished: 'selftest/tags' All tests passed (29 assertions 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: - +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: ./inprogress/failing/Tricky/trailing expression] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:55: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] +TrickyTests.cpp:55: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] No assertions in test case, './inprogress/failing/Tricky/trailing expression' [Finished: './inprogress/failing/Tricky/trailing expression' 1 test case failed (1 assertion failed)] [Running: ./inprogress/failing/Tricky/compound lhs] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:71: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] +TrickyTests.cpp:71: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] No assertions in test case, './inprogress/failing/Tricky/compound lhs' [Finished: './inprogress/failing/Tricky/compound lhs' 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: 0x7fff55ab4568 == 0x7fff55ab4560 -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/TrickyTests.cpp:96: o1 == o2 failed for: {?} == {?} +TrickyTests.cpp:95: &o1 == &o2 failed for: 0x == 0x +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" +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 +TrickyTests.cpp:119: i++ == 7 succeeded for: 7 == 7 +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 == {?} +TrickyTests.cpp:186: 0x == o succeeded for: 0x == {?} [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 +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 +TrickyTests.cpp:224: 0x == bit30and31 succeeded for: 0x == 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: 0x7fff55ab4560 != 0 +TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x != 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 +TrickyTests.cpp:259: is_true::value == true succeeded for: true == true +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 +TrickyTests.cpp:264: is_true::value == false succeeded for: false == false +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 +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 +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 +TrickyTests.cpp:280: is_true::value succeeded for: true +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 +TrickyTests.cpp:313: True succeeded for: true +TrickyTests.cpp:314: !False succeeded for: true +TrickyTests.cpp:315: !False succeeded for: !false [Finished: './succeeding/SafeBool' All tests passed (3 assertions in 1 test case)] [Running: scenario name] [Started section: 'This stuff exists'] [Started section: 'I do this'] [Started section: 'it should this this'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp:37: itDoesThis() succeeded for: true +BDDTests.cpp:37: itDoesThis() succeeded for: true [End of section: 'it should this this' 1 assertion passed] [End of section: 'I do this' 1 assertion passed] From 994e64c2170efeb9cba6c310ddecdd7366c771f9 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 29 Nov 2012 08:49:32 +0000 Subject: [PATCH 065/296] Added xml and junit output - also fixed a typo in a test name --- approvalTests.py | 2 + projects/SelfTest/Baselines/results.txt | 5474 ++++++++++++++++- .../CatchSelfTest/CatchSelfTest/BDDTests.cpp | 2 +- 3 files changed, 5475 insertions(+), 3 deletions(-) diff --git a/approvalTests.py b/approvalTests.py index bb6f1222..09a104d9 100644 --- a/approvalTests.py +++ b/approvalTests.py @@ -15,6 +15,8 @@ cmdPath = sys.argv[1] f = open( rawResultsPath, 'w' ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions" ], stdout=f, stderr=f ) +subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "junit" ], stdout=f, stderr=f ) +subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "xml" ], stdout=f, stderr=f ) f.close() rawFile = open( rawResultsPath, 'r' ) diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index 0767ebcd..8b19b879 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -1424,9 +1424,9 @@ TrickyTests.cpp:315: !False succeeded for: !false [Running: scenario name] [Started section: 'This stuff exists'] [Started section: 'I do this'] -[Started section: 'it should this this'] +[Started section: 'it should do this'] BDDTests.cpp:37: itDoesThis() succeeded for: true -[End of section: 'it should this this' 1 assertion passed] +[End of section: 'it should do this' 1 assertion passed] [End of section: 'I do this' 1 assertion passed] @@ -1438,3 +1438,5473 @@ BDDTests.cpp:37: itDoesThis() succeeded for: true [Testing completed. 45 of 98 test cases failed (103 of 615 assertions failed)] + + + + + + + + + + + +ClassTests.cpp:28: + + + + + +ClassTests.cpp:55: + + + + + +ConditionTests.cpp:71: + + +ConditionTests.cpp:72: + + +ConditionTests.cpp:73: + + +ConditionTests.cpp:74: + + +ConditionTests.cpp:75: + + +ConditionTests.cpp:76: + + +ConditionTests.cpp:77: + + +ConditionTests.cpp:78: + + +ConditionTests.cpp:79: + + +ConditionTests.cpp:80: + + +ConditionTests.cpp:81: + + +ConditionTests.cpp:82: + + +ConditionTests.cpp:85: + + + + + +ConditionTests.cpp:111: + + +ConditionTests.cpp:112: + + +ConditionTests.cpp:113: + + +ConditionTests.cpp:114: + + +ConditionTests.cpp:115: + + + + + +ConditionTests.cpp:152: + + +ConditionTests.cpp:153: + + +ConditionTests.cpp:154: + + +ConditionTests.cpp:155: + + +ConditionTests.cpp:156: + + +ConditionTests.cpp:157: + + +ConditionTests.cpp:159: + + +ConditionTests.cpp:160: + + +ConditionTests.cpp:162: + + +ConditionTests.cpp:163: + + +ConditionTests.cpp:164: + + +ConditionTests.cpp:166: + + +ConditionTests.cpp:167: + + +ConditionTests.cpp:168: + + +ConditionTests.cpp:169: + + +ConditionTests.cpp:170: + + +ConditionTests.cpp:171: + + +ConditionTests.cpp:173: + + +ConditionTests.cpp:174: + + + + + + + + + + + +ConditionTests.cpp:334: + + +ConditionTests.cpp:335: + + +ConditionTests.cpp:336: + + +ConditionTests.cpp:337: + + +ConditionTests.cpp:339: + + +ConditionTests.cpp:340: + + +ConditionTests.cpp:342: + + +ConditionTests.cpp:343: + + + + + +ExceptionTests.cpp:47: + + < message="thisDoesntThrow()" type="CHECK_THROWS_AS"> +ExceptionTests.cpp:48: + + +ExceptionTests.cpp:49: + + + + +ExceptionTests.cpp:52: + + + + +ExceptionTests.cpp:60: + + + + + +ExceptionTests.cpp:102: + + + + +ExceptionTests.cpp:109: + + + + +ExceptionTests.cpp:114: + + + + +ExceptionTests.cpp:118: + + + + +ExceptionTests.cpp:132: + + + + + + + +MessageTests.cpp:14: + + + + + +MessageTests.cpp:23: + + +MessageTests.cpp:24: + + +MessageTests.cpp:26: + + + + +MessageTests.cpp:31: + + +MessageTests.cpp:35: + + +MessageTests.cpp:37: + + +MessageTests.cpp:39: + + +MessageTests.cpp:41: + + + + +MessageTests.cpp:51: + + + + +MessageTests.cpp:58: + + +MessageTests.cpp:63: + + + + +Message from section one +Message from section two + + + + +MessageTests.cpp:86: + + +MessageTests.cpp:86: + + +MessageTests.cpp:86: + + + + +MessageTests.cpp:92: + + + + + + +MiscTests.cpp:61: + + + + + + +MiscTests.cpp:133: + + + + +MiscTests.cpp:144: + + +MiscTests.cpp:145: + + +MiscTests.cpp:144: + + +MiscTests.cpp:145: + + +MiscTests.cpp:144: + + +MiscTests.cpp:144: + + +MiscTests.cpp:145: + + +MiscTests.cpp:144: + + +MiscTests.cpp:145: + + +MiscTests.cpp:144: + + +MiscTests.cpp:144: + + +MiscTests.cpp:145: + + +MiscTests.cpp:144: + + +MiscTests.cpp:145: + + + + +Some information + + +An error + + + + + +MiscTests.cpp:169: + + +MiscTests.cpp:171: + + +MiscTests.cpp:172: + + + + + +MiscTests.cpp:177: + + +MiscTests.cpp:190: + + + + + +MiscTests.cpp:195: + + +MiscTests.cpp:208: + + + + + +MiscTests.cpp:225: + + +MiscTests.cpp:226: + + + + + + +MiscTests.cpp:255: + + + + +MiscTests.cpp:260: + + + + +MiscTests.cpp:265: + + + + +MiscTests.cpp:270: + + + + + + + + + +MiscTests.cpp:309: + + + + + + +Message from section one +Message from section two +Some information +Message from section one +Message from section two +Some information + + +An error +An error + + + + + + + + + + + + + +TrickyTests.cpp:55: + + + + +TrickyTests.cpp:71: + + + + +TrickyTests.cpp:95: + + +TrickyTests.cpp:96: + + + + +TrickyTests.cpp:106: + + + + + + + + + + + + +Message from section one +Message from section two + +Some information + +Message from section one +Message from section two +Some information +Message from section one +Message from section two +Some information + + +An error + +An error +An error + + + + + +ApproxTests.cpp" line="20"> + + d == Approx( 1.23 ) + + + 1.23 == Approx( 1.23 ) + + +ApproxTests.cpp" line="21"> + + d != Approx( 1.22 ) + + + 1.23 != Approx( 1.22 ) + + +ApproxTests.cpp" line="22"> + + d != Approx( 1.24 ) + + + 1.23 != Approx( 1.24 ) + + +ApproxTests.cpp" line="24"> + + Approx( d ) == 1.23 + + + Approx( 1.23 ) == 1.23 + + +ApproxTests.cpp" line="25"> + + Approx( d ) != 1.22 + + + Approx( 1.23 ) != 1.22 + + +ApproxTests.cpp" line="26"> + + Approx( d ) != 1.24 + + + Approx( 1.23 ) != 1.24 + + + + + +ApproxTests.cpp" line="38"> + + d != Approx( 1.231 ) + + + 1.23 != Approx( 1.231 ) + + +ApproxTests.cpp" line="39"> + + d == Approx( 1.231 ).epsilon( 0.1 ) + + + 1.23 == Approx( 1.231 ) + + + + + +ApproxTests.cpp" line="49"> + + 1.23f == Approx( 1.23f ) + + + 1.23 == Approx( 1.23 ) + + +ApproxTests.cpp" line="50"> + + 0.0f == Approx( 0.0f ) + + + 0 == Approx( 0 ) + + + + + +ApproxTests.cpp" line="60"> + + 1 == Approx( 1 ) + + + 1 == Approx( 1 ) + + +ApproxTests.cpp" line="61"> + + 0 == Approx( 0 ) + + + 0 == Approx( 0 ) + + + + + +ApproxTests.cpp" line="75"> + + 1.0f == Approx( 1 ) + + + 1 == Approx( 1 ) + + +ApproxTests.cpp" line="76"> + + 0 == Approx( dZero) + + + 0 == Approx( 0 ) + + +ApproxTests.cpp" line="77"> + + 0 == Approx( dSmall ).epsilon( 0.001 ) + + + 0 == Approx( 1e-05 ) + + +ApproxTests.cpp" line="78"> + + 1.234f == Approx( dMedium ) + + + 1.234 == Approx( 1.234 ) + + +ApproxTests.cpp" line="79"> + + dMedium == Approx( 1.234f ) + + + 1.234 == Approx( 1.234 ) + + + + + +ApproxTests.cpp" line="93"> + + d == approx( 1.23 ) + + + 1.23 == Approx( 1.23 ) + + +ApproxTests.cpp" line="94"> + + d == approx( 1.22 ) + + + 1.23 == Approx( 1.22 ) + + +ApproxTests.cpp" line="95"> + + d == approx( 1.24 ) + + + 1.23 == Approx( 1.24 ) + + +ApproxTests.cpp" line="96"> + + d != approx( 1.25 ) + + + 1.23 != Approx( 1.25 ) + + +ApproxTests.cpp" line="98"> + + approx( d ) == 1.23 + + + Approx( 1.23 ) == 1.23 + + +ApproxTests.cpp" line="99"> + + approx( d ) == 1.22 + + + Approx( 1.23 ) == 1.22 + + +ApproxTests.cpp" line="100"> + + approx( d ) == 1.24 + + + Approx( 1.23 ) == 1.24 + + +ApproxTests.cpp" line="101"> + + approx( d ) != 1.25 + + + Approx( 1.23 ) != 1.25 + + + + + +ClassTests.cpp" line="24"> + + s == "hello" + + + "hello" == "hello" + + + + + +ClassTests.cpp" line="28"> + + s == "world" + + + "hello" == "world" + + + + + +ClassTests.cpp" line="47"> + + m_a == 1 + + + 1 == 1 + + + + + +ClassTests.cpp" line="55"> + + m_a == 2 + + + 1 == 2 + + + + + +ConditionTests.cpp" line="55"> + + data.int_seven == 7 + + + 7 == 7 + + +ConditionTests.cpp" line="56"> + + data.float_nine_point_one == Approx( 9.1f ) + + + 9.1 == Approx( 9.1 ) + + +ConditionTests.cpp" line="57"> + + data.double_pi == Approx( 3.1415926535 ) + + + 3.14159 == Approx( 3.14159 ) + + +ConditionTests.cpp" line="58"> + + data.str_hello == "hello" + + + "hello" == "hello" + + +ConditionTests.cpp" line="59"> + + "hello" == data.str_hello + + + "hello" == "hello" + + +ConditionTests.cpp" line="60"> + + data.str_hello.size() == 5 + + + 5 == 5 + + +ConditionTests.cpp" line="63"> + + x == Approx( 1.3 ) + + + 1.3 == Approx( 1.3 ) + + + + + +ConditionTests.cpp" line="71"> + + data.int_seven == 6 + + + 7 == 6 + + +ConditionTests.cpp" line="72"> + + data.int_seven == 8 + + + 7 == 8 + + +ConditionTests.cpp" line="73"> + + data.int_seven == 0 + + + 7 == 0 + + +ConditionTests.cpp" line="74"> + + data.float_nine_point_one == Approx( 9.11f ) + + + 9.1 == Approx( 9.11 ) + + +ConditionTests.cpp" line="75"> + + data.float_nine_point_one == Approx( 9.0f ) + + + 9.1 == Approx( 9 ) + + +ConditionTests.cpp" line="76"> + + data.float_nine_point_one == Approx( 1 ) + + + 9.1 == Approx( 1 ) + + +ConditionTests.cpp" line="77"> + + data.float_nine_point_one == Approx( 0 ) + + + 9.1 == Approx( 0 ) + + +ConditionTests.cpp" line="78"> + + data.double_pi == Approx( 3.1415 ) + + + 3.14159 == Approx( 3.1415 ) + + +ConditionTests.cpp" line="79"> + + data.str_hello == "goodbye" + + + "hello" == "goodbye" + + +ConditionTests.cpp" line="80"> + + data.str_hello == "hell" + + + "hello" == "hell" + + +ConditionTests.cpp" line="81"> + + data.str_hello == "hello1" + + + "hello" == "hello1" + + +ConditionTests.cpp" line="82"> + + data.str_hello.size() == 6 + + + 5 == 6 + + +ConditionTests.cpp" line="85"> + + x == Approx( 1.301 ) + + + 1.3 == Approx( 1.301 ) + + + + + +ConditionTests.cpp" line="93"> + + data.int_seven != 6 + + + 7 != 6 + + +ConditionTests.cpp" line="94"> + + data.int_seven != 8 + + + 7 != 8 + + +ConditionTests.cpp" line="95"> + + data.float_nine_point_one != Approx( 9.11f ) + + + 9.1 != Approx( 9.11 ) + + +ConditionTests.cpp" line="96"> + + data.float_nine_point_one != Approx( 9.0f ) + + + 9.1 != Approx( 9 ) + + +ConditionTests.cpp" line="97"> + + data.float_nine_point_one != Approx( 1 ) + + + 9.1 != Approx( 1 ) + + +ConditionTests.cpp" line="98"> + + data.float_nine_point_one != Approx( 0 ) + + + 9.1 != Approx( 0 ) + + +ConditionTests.cpp" line="99"> + + data.double_pi != Approx( 3.1415 ) + + + 3.14159 != Approx( 3.1415 ) + + +ConditionTests.cpp" line="100"> + + data.str_hello != "goodbye" + + + "hello" != "goodbye" + + +ConditionTests.cpp" line="101"> + + data.str_hello != "hell" + + + "hello" != "hell" + + +ConditionTests.cpp" line="102"> + + data.str_hello != "hello1" + + + "hello" != "hello1" + + +ConditionTests.cpp" line="103"> + + data.str_hello.size() != 6 + + + 5 != 6 + + + + + +ConditionTests.cpp" line="111"> + + data.int_seven != 7 + + + 7 != 7 + + +ConditionTests.cpp" line="112"> + + data.float_nine_point_one != Approx( 9.1f ) + + + 9.1 != Approx( 9.1 ) + + +ConditionTests.cpp" line="113"> + + data.double_pi != Approx( 3.1415926535 ) + + + 3.14159 != Approx( 3.14159 ) + + +ConditionTests.cpp" line="114"> + + data.str_hello != "hello" + + + "hello" != "hello" + + +ConditionTests.cpp" line="115"> + + data.str_hello.size() != 5 + + + 5 != 5 + + + + + +ConditionTests.cpp" line="124"> + + data.int_seven < 8 + + + 7 < 8 + + +ConditionTests.cpp" line="125"> + + data.int_seven > 6 + + + 7 > 6 + + +ConditionTests.cpp" line="126"> + + data.int_seven > 0 + + + 7 > 0 + + +ConditionTests.cpp" line="127"> + + data.int_seven > -1 + + + 7 > -1 + + +ConditionTests.cpp" line="129"> + + data.int_seven >= 7 + + + 7 >= 7 + + +ConditionTests.cpp" line="130"> + + data.int_seven >= 6 + + + 7 >= 6 + + +ConditionTests.cpp" line="131"> + + data.int_seven <= 7 + + + 7 <= 7 + + +ConditionTests.cpp" line="132"> + + data.int_seven <= 8 + + + 7 <= 8 + + +ConditionTests.cpp" line="134"> + + data.float_nine_point_one > 9 + + + 9.1 > 9 + + +ConditionTests.cpp" line="135"> + + data.float_nine_point_one < 10 + + + 9.1 < 10 + + +ConditionTests.cpp" line="136"> + + data.float_nine_point_one < 9.2 + + + 9.1 < 9.2 + + +ConditionTests.cpp" line="138"> + + data.str_hello <= "hello" + + + "hello" <= "hello" + + +ConditionTests.cpp" line="139"> + + data.str_hello >= "hello" + + + "hello" >= "hello" + + +ConditionTests.cpp" line="141"> + + data.str_hello < "hellp" + + + "hello" < "hellp" + + +ConditionTests.cpp" line="142"> + + data.str_hello < "zebra" + + + "hello" < "zebra" + + +ConditionTests.cpp" line="143"> + + data.str_hello > "hellm" + + + "hello" > "hellm" + + +ConditionTests.cpp" line="144"> + + data.str_hello > "a" + + + "hello" > "a" + + + + + +ConditionTests.cpp" line="152"> + + data.int_seven > 7 + + + 7 > 7 + + +ConditionTests.cpp" line="153"> + + data.int_seven < 7 + + + 7 < 7 + + +ConditionTests.cpp" line="154"> + + data.int_seven > 8 + + + 7 > 8 + + +ConditionTests.cpp" line="155"> + + data.int_seven < 6 + + + 7 < 6 + + +ConditionTests.cpp" line="156"> + + data.int_seven < 0 + + + 7 < 0 + + +ConditionTests.cpp" line="157"> + + data.int_seven < -1 + + + 7 < -1 + + +ConditionTests.cpp" line="159"> + + data.int_seven >= 8 + + + 7 >= 8 + + +ConditionTests.cpp" line="160"> + + data.int_seven <= 6 + + + 7 <= 6 + + +ConditionTests.cpp" line="162"> + + data.float_nine_point_one < 9 + + + 9.1 < 9 + + +ConditionTests.cpp" line="163"> + + data.float_nine_point_one > 10 + + + 9.1 > 10 + + +ConditionTests.cpp" line="164"> + + data.float_nine_point_one > 9.2 + + + 9.1 > 9.2 + + +ConditionTests.cpp" line="166"> + + data.str_hello > "hello" + + + "hello" > "hello" + + +ConditionTests.cpp" line="167"> + + data.str_hello < "hello" + + + "hello" < "hello" + + +ConditionTests.cpp" line="168"> + + data.str_hello > "hellp" + + + "hello" > "hellp" + + +ConditionTests.cpp" line="169"> + + data.str_hello > "z" + + + "hello" > "z" + + +ConditionTests.cpp" line="170"> + + data.str_hello < "hellm" + + + "hello" < "hellm" + + +ConditionTests.cpp" line="171"> + + data.str_hello < "a" + + + "hello" < "a" + + +ConditionTests.cpp" line="173"> + + data.str_hello >= "z" + + + "hello" >= "z" + + +ConditionTests.cpp" line="174"> + + data.str_hello <= "a" + + + "hello" <= "a" + + + + + +ConditionTests.cpp" line="188"> + + i == 1 + + + 1 == 1 + + +ConditionTests.cpp" line="189"> + + ui == 2 + + + 2 == 2 + + +ConditionTests.cpp" line="190"> + + l == 3 + + + 3 == 3 + + +ConditionTests.cpp" line="191"> + + ul == 4 + + + 4 == 4 + + +ConditionTests.cpp" line="192"> + + c == 5 + + + 5 == 5 + + +ConditionTests.cpp" line="193"> + + uc == 6 + + +  == 6 + + +ConditionTests.cpp" line="195"> + + 1 == i + + + 1 == 1 + + +ConditionTests.cpp" line="196"> + + 2 == ui + + + 2 == 2 + + +ConditionTests.cpp" line="197"> + + 3 == l + + + 3 == 3 + + +ConditionTests.cpp" line="198"> + + 4 == ul + + + 4 == 4 + + +ConditionTests.cpp" line="199"> + + 5 == c + + + 5 == 5 + + +ConditionTests.cpp" line="200"> + + 6 == uc + + + 6 ==  + + +ConditionTests.cpp" line="202"> + + (std::numeric_limits<unsigned long>::max)() > ul + + + 0x > 4 + + + + + +ConditionTests.cpp" line="223"> + + long_var == unsigned_char_var + + + 1 ==  + + +ConditionTests.cpp" line="224"> + + long_var == unsigned_short_var + + + 1 == 1 + + +ConditionTests.cpp" line="225"> + + long_var == unsigned_int_var + + + 1 == 1 + + +ConditionTests.cpp" line="226"> + + long_var == unsigned_long_var + + + 1 == 1 + + + + + +ConditionTests.cpp" line="237"> + + unsigned_char_var == 1 + + +  == 1 + + +ConditionTests.cpp" line="238"> + + unsigned_short_var == 1 + + + 1 == 1 + + +ConditionTests.cpp" line="239"> + + unsigned_int_var == 1 + + + 1 == 1 + + +ConditionTests.cpp" line="240"> + + unsigned_long_var == 1 + + + 1 == 1 + + + + + +ConditionTests.cpp" line="246"> + + ( -1 > 2u ) + + + true + + +ConditionTests.cpp" line="247"> + + -1 > 2u + + + -1 > 2 + + +ConditionTests.cpp" line="249"> + + ( 2u < -1 ) + + + true + + +ConditionTests.cpp" line="250"> + + 2u < -1 + + + 2 < -1 + + +ConditionTests.cpp" line="253"> + + ( minInt > 2u ) + + + true + + +ConditionTests.cpp" line="254"> + + minInt > 2u + + + -2147483648 > 2 + + + + + +ConditionTests.cpp" line="269"> + + 54 == 6*9 + + + 54 == 54 + + + + + +ConditionTests.cpp" line="285"> + + p == __null + + + __null == 0 + + +ConditionTests.cpp" line="286"> + + p == pNULL + + + __null == __null + + +ConditionTests.cpp" line="291"> + + p != __null + + + 0x != 0 + + +ConditionTests.cpp" line="294"> + + cp != __null + + + 0x != 0 + + +ConditionTests.cpp" line="297"> + + cpc != __null + + + 0x != 0 + + +ConditionTests.cpp" line="299"> + + returnsNull() == __null + + + {null string} == 0 + + +ConditionTests.cpp" line="300"> + + returnsConstNull() == __null + + + {null string} == 0 + + +ConditionTests.cpp" line="302"> + + __null != p + + + 0 != 0x + + + + + +ConditionTests.cpp" line="317"> + + false == false + + + false == false + + +ConditionTests.cpp" line="318"> + + true == true + + + true == true + + +ConditionTests.cpp" line="319"> + + !false + + + true + + +ConditionTests.cpp" line="320"> + + !false + + + !false + + +ConditionTests.cpp" line="322"> + + !falseValue + + + true + + +ConditionTests.cpp" line="323"> + + !falseValue + + + !false + + +ConditionTests.cpp" line="325"> + + !(1 == 2) + + + true + + +ConditionTests.cpp" line="326"> + + !1 == 2 + + + !(1 == 2) + + + + + +ConditionTests.cpp" line="334"> + + false != false + + + false != false + + +ConditionTests.cpp" line="335"> + + true != true + + + true != true + + +ConditionTests.cpp" line="336"> + + !true + + + false + + +ConditionTests.cpp" line="337"> + + !true + + + !true + + +ConditionTests.cpp" line="339"> + + !trueValue + + + false + + +ConditionTests.cpp" line="340"> + + !trueValue + + + !true + + +ConditionTests.cpp" line="342"> + + !(1 == 1) + + + false + + +ConditionTests.cpp" line="343"> + + !1 == 1 + + + !(1 == 1) + + + + + +ExceptionTests.cpp" line="39"> + + thisThrows() + + + thisThrows() + + +ExceptionTests.cpp" line="40"> + + thisDoesntThrow() + + + thisDoesntThrow() + + +ExceptionTests.cpp" line="41"> + + thisThrows() + + + thisThrows() + + + + + +ExceptionTests.cpp" line="47"> + + thisThrows() + + + thisThrows() + +ExceptionTests.cpp" line="47"> + expected exception + + +ExceptionTests.cpp" line="48"> + + thisDoesntThrow() + + + thisDoesntThrow() + + +ExceptionTests.cpp" line="49"> + + thisThrows() + + + thisThrows() + +ExceptionTests.cpp" line="49"> + expected exception + + + + + +ExceptionTests.cpp" line="52"> + unexpected exception + + + + +ExceptionTests.cpp" line="60"> + + 1 == 1 + + + 1 == 1 + + +ExceptionTests.cpp" line="60"> + + {Unknown expression after this line} + + + {Unknown expression after this line} + +ExceptionTests.cpp" line="60"> + unexpected exception + + + + + + + + +ExceptionTests.cpp" line="102"> + custom exception + + + + +ExceptionTests.cpp" line="109"> + + throw CustomException( "unexpected custom exception" ) + + + throw CustomException( "unexpected custom exception" ) + +ExceptionTests.cpp" line="109"> + unexpected custom exception + + + + + +ExceptionTests.cpp" line="114"> + + throw CustomException( "custom exception - not std" ) + + + throw CustomException( "custom exception - not std" ) + +ExceptionTests.cpp" line="114"> + custom exception - not std + + + + + +ExceptionTests.cpp" line="118"> + 3.14 + + + + +
+
+ +
+ +
+ExceptionTests.cpp" line="132"> + Exception from section + +
+ +
+ +
+ +
+ExceptionTests.cpp" line="152"> + + runner.getLog() Contains( "custom exception" ) + + + "\[g] ./failing/exceptions/custom + \[tc] ./failing/exceptions/custom +ExceptionTests.cpp:102: ThrewException'custom exception' /[tc] ./failing/exceptions/custom +/[g] ./failing/exceptions/custom +" contains: "custom exception" + + + +
+
+ExceptionTests.cpp" line="160"> + + runner.getLog() Contains( "Exception from section" ) + + + "\[g] ./failing/exceptions/in-section + \[tc] ./failing/exceptions/in-section + \ [s] the section + \ [s] the section2 + / [s] the section2 + / [s] the section +ExceptionTests.cpp:132: ThrewException'Exception from section' \ [s] the section + / [s] the section + /[tc] ./failing/exceptions/in-section +/[g] ./failing/exceptions/in-section +" contains: "Exception from section" + + +ExceptionTests.cpp" line="161"> + + runner.getLog() Contains( ::Catch::LineInfoRegistry::get().infoForName( "the section2" ) ) + + + "\[g] ./failing/exceptions/in-section + \[tc] ./failing/exceptions/in-section + \ [s] the section + \ [s] the section2 + / [s] the section2 + / [s] the section +ExceptionTests.cpp:132: ThrewException'Exception from section' \ [s] the section + / [s] the section + /[tc] ./failing/exceptions/in-section +/[g] ./failing/exceptions/in-section +ExceptionTests.cpp:132: " + + + +
+ +
+ +ExceptionTests.cpp" line="172"> + + thisFunctionNotImplemented( 7 ) + + + thisFunctionNotImplemented( 7 ) + + + + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 2 == 2 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 200 == 200 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 4 == 4 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 200 == 200 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 6 == 6 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 200 == 200 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 8 == 8 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 200 == 200 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 10 == 10 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 200 == 200 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 30 == 30 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 200 == 200 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 40 == 40 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 200 == 200 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 42 == 42 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 200 == 200 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 72 == 72 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 200 == 200 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 2 == 2 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 202 == 202 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 4 == 4 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 202 == 202 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 6 == 6 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 202 == 202 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 8 == 8 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 202 == 202 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 10 == 10 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 202 == 202 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 30 == 30 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 202 == 202 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 40 == 40 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 202 == 202 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 42 == 42 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 202 == 202 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 72 == 72 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 202 == 202 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 2 == 2 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 204 == 204 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 4 == 4 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 204 == 204 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 6 == 6 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 204 == 204 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 8 == 8 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 204 == 204 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 10 == 10 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 204 == 204 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 30 == 30 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 204 == 204 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 40 == 40 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 204 == 204 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 42 == 42 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 204 == 204 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 72 == 72 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 204 == 204 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 2 == 2 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 206 == 206 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 4 == 4 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 206 == 206 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 6 == 6 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 206 == 206 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 8 == 8 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 206 == 206 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 10 == 10 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 206 == 206 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 30 == 30 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 206 == 206 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 40 == 40 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 206 == 206 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 42 == 42 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 206 == 206 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 72 == 72 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 206 == 206 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 2 == 2 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 208 == 208 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 4 == 4 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 208 == 208 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 6 == 6 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 208 == 208 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 8 == 8 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 208 == 208 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 10 == 10 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 208 == 208 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 30 == 30 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 208 == 208 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 40 == 40 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 208 == 208 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 42 == 42 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 208 == 208 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 72 == 72 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 208 == 208 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 2 == 2 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 210 == 210 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 4 == 4 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 210 == 210 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 6 == 6 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 210 == 210 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 8 == 8 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 210 == 210 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 10 == 10 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 210 == 210 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 30 == 30 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 210 == 210 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 40 == 40 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 210 == 210 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 42 == 42 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 210 == 210 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 72 == 72 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 210 == 210 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 2 == 2 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 212 == 212 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 4 == 4 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 212 == 212 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 6 == 6 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 212 == 212 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 8 == 8 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 212 == 212 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 10 == 10 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 212 == 212 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 30 == 30 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 212 == 212 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 40 == 40 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 212 == 212 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 42 == 42 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 212 == 212 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 72 == 72 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 212 == 212 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 2 == 2 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 214 == 214 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 4 == 4 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 214 == 214 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 6 == 6 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 214 == 214 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 8 == 8 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 214 == 214 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 10 == 10 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 214 == 214 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 30 == 30 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 214 == 214 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 40 == 40 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 214 == 214 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 42 == 42 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 214 == 214 + + +GeneratorTests.cpp" line="26"> + + multiply( i, 2 ) == i*2 + + + 72 == 72 + + +GeneratorTests.cpp" line="27"> + + multiply( j, 2 ) == j*2 + + + 214 == 214 + + + + + + + this is a warning + + + + + + + + + this message should be logged + + + so should this + +MessageTests.cpp" line="26"> + + a == 1 + + + 2 == 1 + + + + + +MessageTests.cpp" line="33"> + + a == 2 + + + 2 == 2 + + + + this message should be logged + + + this message should be logged, too + +MessageTests.cpp" line="37"> + + a == 1 + + + 2 == 1 + + + + and this, but later + +MessageTests.cpp" line="41"> + + a == 0 + + + 2 == 0 + + +MessageTests.cpp" line="45"> + + a == 2 + + + 2 == 2 + + + + + + + This is a failure + + + + +
+ + Message from section one + + +
+
+ + Message from section two + + +
+ +
+ +
+ +
+
+ +
+ +
+ +MessageTests.cpp" line="86"> + + i < 10 + + + 0 < 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + 1 < 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + 2 < 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + 3 < 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + 4 < 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + 5 < 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + 6 < 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + 7 < 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + 8 < 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + 9 < 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + i < 10 + + + current counter 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + i < 10 + + + i := 10 + + +MessageTests.cpp" line="86"> + + i < 10 + + + 10 < 10 + + + + + +MessageTests.cpp" line="92"> + + 1 == 2 + + + 1 == 2 + + + + + +
+MiscTests.cpp" line="25"> + + a != b + + + 1 != 2 + + +MiscTests.cpp" line="26"> + + b != a + + + 2 != 1 + + + +
+
+MiscTests.cpp" line="31"> + + a != b + + + 1 != 2 + + + +
+ +
+ +
+MiscTests.cpp" line="42"> + + a != b + + + 1 != 2 + + +MiscTests.cpp" line="43"> + + b != a + + + 2 != 1 + + +
+MiscTests.cpp" line="47"> + + a != b + + + 1 != 2 + + + +
+ +
+ +
+ +
+
+MiscTests.cpp" line="61"> + + a == b + + + 1 == 2 + + + +
+ +
+
+
+MiscTests.cpp" line="66"> + + a != b + + + 1 != 2 + + + +
+ +
+
+
+MiscTests.cpp" line="70"> + + a < b + + + 1 < 2 + + + +
+ +
+ +
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+ +
+ +MiscTests.cpp" line="119"> + + runner.getLog() == "\\[g] ./Sections/nested/a/b\n" " \\[tc] ./Sections/nested/a/b\n" " \\ [s] c\n" " \\ [s] d (leaf)\n" " / [s] d (leaf)\n" " / [s] c\n" " \\ [s] c\n" " \\ [s] e (leaf)\n" " / [s] e (leaf)\n" " / [s] c\n" " \\ [s] c\n" " / [s] c\n" " \\ [s] f (leaf)\n" " / [s] f (leaf)\n" " /[tc] ./Sections/nested/a/b\n" "/[g] ./Sections/nested/a/b\n" + + + +"\[g] ./Sections/nested/a/b + \[tc] ./Sections/nested/a/b + \ [s] c + \ [s] d (leaf) + / [s] d (leaf) + / [s] c + \ [s] c + \ [s] e (leaf) + / [s] e (leaf) + / [s] c + \ [s] c + / [s] c + \ [s] f (leaf) + / [s] f (leaf) + /[tc] ./Sections/nested/a/b +/[g] ./Sections/nested/a/b +" +== +"\[g] ./Sections/nested/a/b + \[tc] ./Sections/nested/a/b + \ [s] c + \ [s] d (leaf) + / [s] d (leaf) + / [s] c + \ [s] c + \ [s] e (leaf) + / [s] e (leaf) + / [s] c + \ [s] c + / [s] c + \ [s] f (leaf) + / [s] f (leaf) + /[tc] ./Sections/nested/a/b +/[g] ./Sections/nested/a/b +" + + + + + + + +
+MiscTests.cpp" line="133"> + + b > a + + + 0 > 1 + + + +
+ +
+ + + Testing if fib[0] (1) is even + +MiscTests.cpp" line="145"> + + ( fib[i] % 2 ) == 0 + + + 1 == 0 + + + + Testing if fib[1] (1) is even + +MiscTests.cpp" line="145"> + + ( fib[i] % 2 ) == 0 + + + 1 == 0 + + +MiscTests.cpp" line="145"> + + ( fib[i] % 2 ) == 0 + + + 0 == 0 + + + + Testing if fib[2] (2) is even + + + Testing if fib[3] (3) is even + +MiscTests.cpp" line="145"> + + ( fib[i] % 2 ) == 0 + + + 1 == 0 + + + + Testing if fib[4] (5) is even + +MiscTests.cpp" line="145"> + + ( fib[i] % 2 ) == 0 + + + 1 == 0 + + +MiscTests.cpp" line="145"> + + ( fib[i] % 2 ) == 0 + + + 0 == 0 + + + + Testing if fib[5] (8) is even + + + Testing if fib[6] (13) is even + +MiscTests.cpp" line="145"> + + ( fib[i] % 2 ) == 0 + + + 1 == 0 + + + + Testing if fib[7] (21) is even + +MiscTests.cpp" line="145"> + + ( fib[i] % 2 ) == 0 + + + 1 == 0 + + + + + + + + +MiscTests.cpp" line="163"> + + makeString( false ) != static_cast<char*>(__null) + + + "valid string" != {null string} + + +MiscTests.cpp" line="164"> + + makeString( true ) == static_cast<char*>(__null) + + + {null string} == {null string} + + + + + + + hi + + + i := 7 + +MiscTests.cpp" line="172"> + + false + + + false + + + + + +MiscTests.cpp" line="177"> + + flag + + + true + + +MiscTests.cpp" line="185"> + + testCheckedIf( true ) + + + true + + + + + +MiscTests.cpp" line="177"> + + flag + + + false + + +MiscTests.cpp" line="190"> + + testCheckedIf( false ) + + + false + + + + + +MiscTests.cpp" line="195"> + + flag + + + true + + +MiscTests.cpp" line="203"> + + testCheckedElse( true ) + + + true + + + + + +MiscTests.cpp" line="195"> + + flag + + + false + + +MiscTests.cpp" line="208"> + + testCheckedElse( false ) + + + false + + + + + +
+ +
+
+ +
+ +
+ + + 3 + +MiscTests.cpp" line="226"> + + false + + + false + + + + + +MiscTests.cpp" line="236"> + + x == 0 + + + 0 == 0 + + + + + +MiscTests.cpp" line="246"> + + testStringForMatching() Contains( "string" ) + + + "this string contains 'abc' as a substring" contains: "string" + + +MiscTests.cpp" line="247"> + + testStringForMatching() Contains( "abc" ) + + + "this string contains 'abc' as a substring" contains: "abc" + + +MiscTests.cpp" line="249"> + + testStringForMatching() StartsWith( "this" ) + + + "this string contains 'abc' as a substring" starts with: "this" + + +MiscTests.cpp" line="250"> + + testStringForMatching() EndsWith( "substring" ) + + + "this string contains 'abc' as a substring" ends with: "substring" + + + + + +MiscTests.cpp" line="255"> + + testStringForMatching() Contains( "not there" ) + + + "this string contains 'abc' as a substring" contains: "not there" + + + + + +MiscTests.cpp" line="260"> + + testStringForMatching() StartsWith( "string" ) + + + "this string contains 'abc' as a substring" starts with: "string" + + + + + +MiscTests.cpp" line="265"> + + testStringForMatching() EndsWith( "this" ) + + + "this string contains 'abc' as a substring" ends with: "this" + + + + + +MiscTests.cpp" line="270"> + + testStringForMatching() Equals( "something else" ) + + + "this string contains 'abc' as a substring" equals: "something else" + + + + + +MiscTests.cpp" line="275"> + + testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) + + + "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) + + + + + +MiscTests.cpp" line="279"> + + testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) + + + "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) + + +MiscTests.cpp" line="280"> + + testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) + + + "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) + + + + + +MiscTests.cpp" line="285"> + + testStringForMatching() Equals( "this string contains 'abc' as a substring" ) + + + "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" + + + + + +MiscTests.cpp" line="296"> + + Factorial(0) == 1 + + + 1 == 1 + + +MiscTests.cpp" line="297"> + + Factorial(1) == 1 + + + 1 == 1 + + +MiscTests.cpp" line="298"> + + Factorial(2) == 2 + + + 2 == 2 + + +MiscTests.cpp" line="299"> + + Factorial(3) == 6 + + + 6 == 6 + + +MiscTests.cpp" line="300"> + + Factorial(10) == 3628800 + + + 0x == 3628800 + + + + + + + + + + This one ran + + + + + + + + + + +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+TestMain.cpp" line="40"> + + totals.assertions.passed == 294 + + + 294 == 294 + + +TestMain.cpp" line="41"> + + totals.assertions.failed == 0 + + + 0 == 0 + + + +
+ +
+
+
+TestMain.cpp" line="47"> + + totals.assertions.passed == 1 + + + 1 == 1 + + +TestMain.cpp" line="48"> + + totals.assertions.failed == 73 + + + 73 == 73 + + + +
+ +
+ +
+ +TestMain.cpp" line="57"> + + totals.assertions.passed == 2 + + + 2 == 2 + + +TestMain.cpp" line="58"> + + totals.assertions.failed == 1 + + + 1 == 1 + + + + + +
+TestMain.cpp" line="97"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="99"> + + config.shouldDebugBreak == false + + + false == false + + +TestMain.cpp" line="100"> + + config.cutoff == -1 + + + -1 == -1 + + +TestMain.cpp" line="101"> + + config.allowThrows == true + + + true == true + + +TestMain.cpp" line="102"> + + config.reporter.empty() + + + true + + + +
+
+
+TestMain.cpp" line="108"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="110"> + + config.filters.size() == 1 + + + 1 == 1 + + +TestMain.cpp" line="111"> + + config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false + + + false == false + + +TestMain.cpp" line="112"> + + config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) + + + true + + + +
+ +
+
+
+TestMain.cpp" line="116"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="118"> + + config.filters.size() == 1 + + + 1 == 1 + + +TestMain.cpp" line="119"> + + config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false + + + false == false + + +TestMain.cpp" line="120"> + + config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) + + + true + + + +
+ +
+
+
+TestMain.cpp" line="125"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="127"> + + config.filters.size() == 1 + + + 1 == 1 + + +TestMain.cpp" line="128"> + + config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false + + + false == false + + +TestMain.cpp" line="129"> + + config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) + + + true + + + +
+ +
+
+
+TestMain.cpp" line="134"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="136"> + + config.filters.size() == 1 + + + 1 == 1 + + +TestMain.cpp" line="137"> + + config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false + + + false == false + + +TestMain.cpp" line="138"> + + config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) + + + true + + + +
+ +
+
+
+TestMain.cpp" line="143"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="145"> + + config.filters.size() == 1 + + + 1 == 1 + + +TestMain.cpp" line="146"> + + config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false + + + false == false + + +TestMain.cpp" line="147"> + + config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) + + + true + + + +
+ +
+
+
+TestMain.cpp" line="152"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="154"> + + config.filters.size() == 1 + + + 1 == 1 + + +TestMain.cpp" line="155"> + + config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false + + + false == false + + +TestMain.cpp" line="156"> + + config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) + + + true + + +TestMain.cpp" line="157"> + + config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) + + + true + + + +
+ +
+
+
+TestMain.cpp" line="162"> + + parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) + + + "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" + + + +
+ +
+
+ +
+
+
+TestMain.cpp" line="169"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="171"> + + config.reporter == "basic" + + + "basic" == "basic" + + + +
+ +
+
+
+TestMain.cpp" line="175"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="177"> + + config.reporter == "xml" + + + "xml" == "xml" + + + +
+ +
+
+
+TestMain.cpp" line="181"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="183"> + + config.reporter == "junit" + + + "junit" == "junit" + + + +
+ +
+
+
+TestMain.cpp" line="187"> + + parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) + + + "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" + + + +
+ +
+
+ +
+
+
+TestMain.cpp" line="194"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="196"> + + config.shouldDebugBreak == true + + + true == true + + + +
+ +
+
+
+TestMain.cpp" line="200"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="202"> + + config.shouldDebugBreak + + + true + + + +
+ +
+
+
+TestMain.cpp" line="206"> + + parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) + + + "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" + + + +
+ +
+
+ +
+
+
+TestMain.cpp" line="213"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="215"> + + config.cutoff == 1 + + + 1 == 1 + + + +
+ +
+
+
+TestMain.cpp" line="219"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="221"> + + config.cutoff == 2 + + + 2 == 2 + + + +
+ +
+
+
+TestMain.cpp" line="225"> + + parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) + + + "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" + + + +
+ +
+
+
+TestMain.cpp" line="229"> + + parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) + + + "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" + + + +
+ +
+
+
+TestMain.cpp" line="233"> + + parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) + + + "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" + + + +
+ +
+
+ +
+
+
+TestMain.cpp" line="240"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="242"> + + config.allowThrows == false + + + false == false + + + +
+ +
+
+
+TestMain.cpp" line="246"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="248"> + + config.allowThrows == false + + + false == false + + + +
+ +
+
+ +
+
+
+TestMain.cpp" line="255"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="257"> + + config.outputFilename == "filename.ext" + + + "filename.ext" == "filename.ext" + + +TestMain.cpp" line="258"> + + config.stream.empty() + + + true + + + +
+ +
+
+
+TestMain.cpp" line="262"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="264"> + + config.stream == "stdout" + + + "stdout" == "stdout" + + +TestMain.cpp" line="265"> + + config.outputFilename.empty() + + + true + + + +
+ +
+
+
+TestMain.cpp" line="269"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="271"> + + config.outputFilename == "filename.ext" + + + "filename.ext" == "filename.ext" + + + +
+ +
+
+ +
+
+
+TestMain.cpp" line="278"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="280"> + + config.cutoff == 1 + + + 1 == 1 + + +TestMain.cpp" line="281"> + + config.shouldDebugBreak + + + true + + +TestMain.cpp" line="282"> + + config.allowThrows == false + + + false == false + + + +
+ +
+ +
+ +TestMain.cpp" line="291"> + + matchAny.shouldInclude( fakeTestCase( "any" ) ) + + + true + + +TestMain.cpp" line="292"> + + matchNone.shouldInclude( fakeTestCase( "any" ) ) == false + + + false == false + + +TestMain.cpp" line="297"> + + matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false + + + false == false + + +TestMain.cpp" line="298"> + + matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) + + + true + + +TestMain.cpp" line="300"> + + matchHidden.shouldInclude( fakeTestCase( "./any" ) ) + + + true + + +TestMain.cpp" line="301"> + + matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false + + + false == false + + + + + +TestMain.cpp" line="312"> + + matchHidden.shouldInclude( fakeTestCase( "./something" ) ) + + + true + + +TestMain.cpp" line="314"> + + filters.shouldInclude( fakeTestCase( "any" ) ) == false + + + false == false + + +TestMain.cpp" line="315"> + + filters.shouldInclude( fakeTestCase( "./something" ) ) + + + true + + +TestMain.cpp" line="316"> + + filters.shouldInclude( fakeTestCase( "./anything" ) ) == false + + + false == false + + + + + +TestMain.cpp" line="322"> + + matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) + + + true + + +TestMain.cpp" line="323"> + + matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false + + + false == false + + + + + +TestMain.cpp" line="328"> + + matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) + + + true + + +TestMain.cpp" line="329"> + + matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) + + + true + + +TestMain.cpp" line="330"> + + matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) + + + true + + +TestMain.cpp" line="331"> + + matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false + + + false == false + + + + + +TestMain.cpp" line="351"> + + opt.parseIntoConfig( parser, config ) + + + opt.parseIntoConfig( parser, config ) + + +TestMain.cpp" line="353"> + + config.filters.size() == 1 + + + 1 == 1 + + +TestMain.cpp" line="354"> + + config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false + + + false == false + + +TestMain.cpp" line="355"> + + config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) + + + true + + + + + +
+TestMain.cpp" line="369"> + + oneTag.getTestCaseInfo().description == "" + + + "" == "" + + +TestMain.cpp" line="370"> + + oneTag.hasTag( "one" ) + + + true + + +TestMain.cpp" line="371"> + + oneTag.getTags().size() == 1 + + + 1 == 1 + + +TestMain.cpp" line="373"> + + oneTag.matchesTags( p1 ) == true + + + true == true + + +TestMain.cpp" line="374"> + + oneTag.matchesTags( p2 ) == true + + + true == true + + +TestMain.cpp" line="375"> + + oneTag.matchesTags( p3 ) == false + + + false == false + + +TestMain.cpp" line="376"> + + oneTag.matchesTags( p4 ) == false + + + false == false + + +TestMain.cpp" line="377"> + + oneTag.matchesTags( p5 ) == false + + + false == false + + + +
+
+TestMain.cpp" line="383"> + + twoTags.getTestCaseInfo().description == "" + + + "" == "" + + +TestMain.cpp" line="384"> + + twoTags.hasTag( "one" ) + + + true + + +TestMain.cpp" line="385"> + + twoTags.hasTag( "two" ) + + + true + + +TestMain.cpp" line="386"> + + twoTags.hasTag( "three" ) == false + + + false == false + + +TestMain.cpp" line="387"> + + twoTags.getTags().size() == 2 + + + 2 == 2 + + +TestMain.cpp" line="389"> + + twoTags.matchesTags( p1 ) == true + + + true == true + + +TestMain.cpp" line="390"> + + twoTags.matchesTags( p2 ) == true + + + true == true + + +TestMain.cpp" line="391"> + + twoTags.matchesTags( p3 ) == true + + + true == true + + +TestMain.cpp" line="392"> + + twoTags.matchesTags( p4 ) == true + + + true == true + + +TestMain.cpp" line="393"> + + twoTags.matchesTags( p5 ) == true + + + true == true + + + +
+
+TestMain.cpp" line="399"> + + oneTagWithExtras.getTestCaseInfo().description == "1234" + + + "1234" == "1234" + + +TestMain.cpp" line="400"> + + oneTagWithExtras.hasTag( "one" ) + + + true + + +TestMain.cpp" line="401"> + + oneTagWithExtras.hasTag( "two" ) == false + + + false == false + + +TestMain.cpp" line="402"> + + oneTagWithExtras.getTags().size() == 1 + + + 1 == 1 + + + +
+
+TestMain.cpp" line="409"> + + oneTagOpen.getTestCaseInfo().description == "[one" + + + "[one" == "[one" + + +TestMain.cpp" line="410"> + + oneTagOpen.hasTag( "one" ) == false + + + false == false + + +TestMain.cpp" line="411"> + + oneTagOpen.getTags().size() == 0 + + + 0 == 0 + + + +
+
+TestMain.cpp" line="417"> + + oneTag.getTestCaseInfo().description == "" + + + "" == "" + + +TestMain.cpp" line="418"> + + oneTag.hasTag( "hide" ) + + + true + + +TestMain.cpp" line="419"> + + oneTag.isHidden() + + + true + + +TestMain.cpp" line="421"> + + oneTag.matchesTags( "~[hide]" ) == false + + + false == false + + + +
+ +
+ +TrickyTests.cpp" line="37"> + + (std::pair<int, int>( 1, 2 )) == aNicePair + + + + std::pair( 1, 2 ) + == + std::pair( 1, 2 ) + + + + + + + Uncomment the code in this test to check that it gives a sensible compiler error + + + + + + Uncomment the code in this test to check that it gives a sensible compiler error + + + + +TrickyTests.cpp" line="95"> + + &o1 == &o2 + + + 0x == 0x + + +TrickyTests.cpp" line="96"> + + o1 == o2 + + + {?} == {?} + + + + + +TrickyTests.cpp" line="106"> + + std::string( "first" ) == "second" + + + "first" == "second" + + + + + +TrickyTests.cpp" line="119"> + + i++ == 7 + + + 7 == 7 + + +TrickyTests.cpp" line="120"> + + i++ == 8 + + + 8 == 8 + + + + + +TrickyTests.cpp" line="186"> + + 0x == o + + + 0x == {?} + + + + + +TrickyTests.cpp" line="212"> + + t == 1u + + + {?} == 1 + + + + + +TrickyTests.cpp" line="224"> + + 0x == bit30and31 + + + 0x == 3221225472 + + + + + +TrickyTests.cpp" line="239"> + + obj.prop != __null + + + 0x != 0 + + + + + +
+TrickyTests.cpp" line="259"> + + is_true<true>::value == true + + + true == true + + +TrickyTests.cpp" line="260"> + + true == is_true<true>::value + + + true == true + + + +
+
+TrickyTests.cpp" line="264"> + + is_true<false>::value == false + + + false == false + + +TrickyTests.cpp" line="265"> + + false == is_true<false>::value + + + false == false + + + +
+
+TrickyTests.cpp" line="270"> + + !is_true<false>::value + + + true + + + +
+
+TrickyTests.cpp" line="275"> + + !!is_true<true>::value + + + true + + + +
+
+TrickyTests.cpp" line="280"> + + is_true<true>::value + + + true + + +TrickyTests.cpp" line="281"> + + !is_true<false>::value + + + !false + + + +
+ +
+ +TrickyTests.cpp" line="313"> + + True + + + true + + +TrickyTests.cpp" line="314"> + + !False + + + true + + +TrickyTests.cpp" line="315"> + + !False + + + !false + + + + + +
+
+
+BDDTests.cpp" line="37"> + + itDoesThis() + + + true + + + +
+ +
+ +
+ +
+ +
+ +
diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index bc88849c..a54595a2 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -32,7 +32,7 @@ SCENARIO( storyName, "scenario name" ) { // do this - THEN( "it should this this") + THEN( "it should do this") { REQUIRE( itDoesThis() ); } From c4ba6757d91776a3d5da91499688b6ff29f4316d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 29 Nov 2012 09:05:51 +0000 Subject: [PATCH 066/296] Added ReporterPreferences and started some SectionInfo refactoring --- include/internal/catch_interfaces_reporter.h | 20 +++- include/internal/catch_runner_impl.hpp | 9 +- include/internal/catch_running_test.hpp | 17 ++- include/internal/catch_section_info.hpp | 105 +++++++++++-------- 4 files changed, 93 insertions(+), 58 deletions(-) diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 0ea59ef9..a0b274ab 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -36,6 +36,15 @@ namespace Catch ConfigData m_fullConfig; }; + struct ReporterPreferences + { + ReporterPreferences() + : shouldRedirectStdOut( false ) + {} + + bool shouldRedirectStdOut; + }; + struct AssertionStats { AssertionStats( const AssertionResult& _assertionResult, const Totals& _totals ) @@ -102,6 +111,8 @@ namespace Catch // !Work In progress struct IStreamingReporter : IShared { virtual ~IStreamingReporter(); + virtual ReporterPreferences getPreferences() const = 0; + virtual void testRunStarting( const std::string& runName ) = 0; virtual void testGroupStarting( const std::string& groupName ) = 0; @@ -160,8 +171,13 @@ namespace Catch m_config( config ) {} virtual ~LegacyReporterAdapter(); - - + + virtual ReporterPreferences getPreferences() const { + ReporterPreferences prefs; + prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout(); + return prefs; + } + virtual void testRunStarting( const std::string& ) { m_legacyReporter->StartTesting(); } diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 039a3e38..e307a164 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -109,7 +109,7 @@ namespace Catch { LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ); reporter.testCaseStarting( testInfo ); - m_runningTest = new RunningTest( &testCase ); + m_runningTest = new RunningTest( testCase ); do { do { @@ -202,6 +202,10 @@ namespace Catch { m_lastAssertionInfo.lineInfo = lineInfo; + // !TBD: ------------ + std::string className = m_runningTest->getTestCase().getTestCaseInfo().className; + TestCaseInfo sectionInfo( name, className, description, std::set(), false, lineInfo ); + m_reporter->StartSection( name, description ); assertions = m_totals.assertions; @@ -272,7 +276,8 @@ namespace Catch { try { m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getTestCaseInfo().lineInfo, "", ResultDisposition::Normal ); m_runningTest->reset(); - if( m_reporter->shouldRedirectStdout() ) { + LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ); + if( reporter.getPreferences().shouldRedirectStdOut ) { StreamRedirect coutRedir( std::cout, redirectedCout ); StreamRedirect cerrRedir( std::cerr, redirectedCerr ); m_runningTest->getTestCase().invoke(); diff --git a/include/internal/catch_running_test.hpp b/include/internal/catch_running_test.hpp index 2bda148c..6f0ec7bf 100644 --- a/include/internal/catch_running_test.hpp +++ b/include/internal/catch_running_test.hpp @@ -24,9 +24,10 @@ namespace Catch { }; public: - explicit RunningTest( const TestCase* info = NULL ) + explicit RunningTest( const TestCase& info ) : m_info( info ), m_runStatus( RanAtLeastOneSection ), + m_rootSection( info.getTestCaseInfo().name ), m_currentSection( &m_rootSection ), m_changed( false ) {} @@ -71,12 +72,8 @@ namespace Catch { if( m_runStatus == NothingRun ) m_runStatus = EncounteredASection; - SectionInfo* thisSection = m_currentSection->findSubSection( name ); - if( !thisSection ) { - thisSection = m_currentSection->addSubSection( name ); - m_changed = true; - } - + SectionInfo* thisSection = m_currentSection->findOrAddSubSection( name, m_changed ); + if( !wasSectionSeen() && thisSection->shouldRun() ) { m_currentSection = thisSection; m_lastSectionToRun = NULL; @@ -98,16 +95,16 @@ namespace Catch { } const TestCase& getTestCase() const { - return *m_info; + return m_info; } - + bool hasUntestedSections() const { return m_runStatus == RanAtLeastOneSection || ( m_rootSection.hasUntestedSections() && m_changed ); } private: - const TestCase* m_info; + const TestCase& m_info; RunStatus m_runStatus; SectionInfo m_rootSection; SectionInfo* m_currentSection; diff --git a/include/internal/catch_section_info.hpp b/include/internal/catch_section_info.hpp index 2d4d0edc..9cdcd679 100644 --- a/include/internal/catch_section_info.hpp +++ b/include/internal/catch_section_info.hpp @@ -15,10 +15,17 @@ namespace Catch { - class SectionInfo { + struct ISectionInfo { + virtual ~ISectionInfo() {} + + virtual std::string getName() const = 0; + virtual const ISectionInfo* getParent() const = 0; + }; + + class SectionInfo : ISectionInfo { public: - enum Status { + enum State { Root, Unknown, Branch, @@ -26,61 +33,40 @@ namespace Catch { TestedLeaf }; - SectionInfo( SectionInfo* parent ) - : m_status( Unknown ), - m_parent( parent ) + SectionInfo( SectionInfo* parent, const std::string& name ) + : m_state( Unknown ), + m_parent( parent ), + m_name( name ) {} - SectionInfo() - : m_status( Root ), - m_parent( NULL ) + SectionInfo( const std::string& name ) + : m_state( Root ), + m_parent( NULL ), + m_name( name ) {} ~SectionInfo() { deleteAllValues( m_subSections ); } - + + virtual std::string getName() const { + return m_name; + } + bool shouldRun() const { - return m_status < TestedBranch; + return m_state < TestedBranch; } - bool ran() { - if( m_status < Branch ) { - m_status = TestedLeaf; - return true; - } - return false; - } - bool isBranch() const { - return m_status == Branch; + return m_state == Branch; } - void ranToCompletion() { - if( m_status == Branch && !hasUntestedSections() ) - m_status = TestedBranch; - } - - SectionInfo* findSubSection( const std::string& name ) { - std::map::const_iterator it = m_subSections.find( name ); - return it != m_subSections.end() - ? it->second - : NULL; - } - - SectionInfo* addSubSection( const std::string& name ) { - SectionInfo* subSection = new SectionInfo( this ); - m_subSections.insert( std::make_pair( name, subSection ) ); - m_status = Branch; - return subSection; - } - - SectionInfo* getParent() { + const SectionInfo* getParent() const { return m_parent; } - + bool hasUntestedSections() const { - if( m_status == Unknown ) + if( m_state == Unknown ) return true; std::map::const_iterator it = m_subSections.begin(); @@ -91,11 +77,42 @@ namespace Catch { } return false; } - + + // Mutable methods: + + SectionInfo* getParent() { + return m_parent; + } + + SectionInfo* findOrAddSubSection( const std::string& name, bool& changed ) { + std::map::const_iterator it = m_subSections.find( name ); + if( it != m_subSections.end() ) + return it->second; + SectionInfo* subSection = new SectionInfo( this, name ); + m_subSections.insert( std::make_pair( name, subSection ) ); + m_state = Branch; + changed = true; + return subSection; + } + + bool ran() { + if( m_state < Branch ) { + m_state = TestedLeaf; + return true; + } + return false; + } + + void ranToCompletion() { + if( m_state == Branch && !hasUntestedSections() ) + m_state = TestedBranch; + } + private: - Status m_status; - std::map m_subSections; + State m_state; SectionInfo* m_parent; + std::string m_name; + std::map m_subSections; }; } From 6f2343bf644175228df02f411cbbd271fbf866e4 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 29 Nov 2012 09:17:08 +0000 Subject: [PATCH 067/296] Sections use vector instead of a map Uses brute-force search, but only ever for small vectors --- include/internal/catch_common.h | 4 ---- include/internal/catch_section_info.hpp | 26 +++++++++++++------------ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 58fbe0ff..ec8cd2e9 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -51,18 +51,14 @@ namespace Catch { typename ContainerT::const_iterator it = container.begin(); typename ContainerT::const_iterator itEnd = container.end(); for(; it != itEnd; ++it ) - { delete *it; - } } template inline void deleteAllValues( AssociativeContainerT& container ) { typename AssociativeContainerT::const_iterator it = container.begin(); typename AssociativeContainerT::const_iterator itEnd = container.end(); for(; it != itEnd; ++it ) - { delete it->second; - } } template diff --git a/include/internal/catch_section_info.hpp b/include/internal/catch_section_info.hpp index 9cdcd679..e28f3147 100644 --- a/include/internal/catch_section_info.hpp +++ b/include/internal/catch_section_info.hpp @@ -24,6 +24,8 @@ namespace Catch { class SectionInfo : ISectionInfo { public: + + typedef std::vector SubSections; enum State { Root, @@ -46,7 +48,7 @@ namespace Catch { {} ~SectionInfo() { - deleteAllValues( m_subSections ); + deleteAll( m_subSections ); } virtual std::string getName() const { @@ -68,13 +70,11 @@ namespace Catch { bool hasUntestedSections() const { if( m_state == Unknown ) return true; - - std::map::const_iterator it = m_subSections.begin(); - std::map::const_iterator itEnd = m_subSections.end(); - for(; it != itEnd; ++it ) { - if( it->second->hasUntestedSections() ) + for( SubSections::const_iterator it = m_subSections.begin(); + it != m_subSections.end(); + ++it) + if( (*it)->hasUntestedSections() ) return true; - } return false; } @@ -85,11 +85,13 @@ namespace Catch { } SectionInfo* findOrAddSubSection( const std::string& name, bool& changed ) { - std::map::const_iterator it = m_subSections.find( name ); - if( it != m_subSections.end() ) - return it->second; + for( SubSections::const_iterator it = m_subSections.begin(); + it != m_subSections.end(); + ++it) + if( (*it)->getName() == name ) + return *it; SectionInfo* subSection = new SectionInfo( this, name ); - m_subSections.insert( std::make_pair( name, subSection ) ); + m_subSections.push_back( subSection ); m_state = Branch; changed = true; return subSection; @@ -112,7 +114,7 @@ namespace Catch { State m_state; SectionInfo* m_parent; std::string m_name; - std::map m_subSections; + SubSections m_subSections; }; } From 3d6be037e92fc1f7ac7cb65b7717bc5da2be274a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 29 Nov 2012 20:11:46 +0000 Subject: [PATCH 068/296] Small logic tweaks --- include/internal/catch_running_test.hpp | 14 +++++--------- include/internal/catch_section_info.hpp | 11 +++++------ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/include/internal/catch_running_test.hpp b/include/internal/catch_running_test.hpp index 6f0ec7bf..7f89ab70 100644 --- a/include/internal/catch_running_test.hpp +++ b/include/internal/catch_running_test.hpp @@ -55,16 +55,12 @@ namespace Catch { } void ranToCompletion() { - if( m_runStatus == RanAtLeastOneSection || - m_runStatus == EncounteredASection ) { - m_runStatus = RanToCompletionWithSections; - if( m_lastSectionToRun ) { - m_lastSectionToRun->ranToCompletion(); - m_changed = true; - } - } - else { + if( m_runStatus != RanAtLeastOneSection && m_runStatus != EncounteredASection ) m_runStatus = RanToCompletionWithNoSections; + m_runStatus = RanToCompletionWithSections; + if( m_lastSectionToRun ) { + m_lastSectionToRun->ranToCompletion(); + m_changed = true; } } diff --git a/include/internal/catch_section_info.hpp b/include/internal/catch_section_info.hpp index e28f3147..7f09a943 100644 --- a/include/internal/catch_section_info.hpp +++ b/include/internal/catch_section_info.hpp @@ -22,7 +22,7 @@ namespace Catch { virtual const ISectionInfo* getParent() const = 0; }; - class SectionInfo : ISectionInfo { + class SectionInfo : public ISectionInfo { public: typedef std::vector SubSections; @@ -98,11 +98,10 @@ namespace Catch { } bool ran() { - if( m_state < Branch ) { - m_state = TestedLeaf; - return true; - } - return false; + if( m_state >= Branch ) + return false; + m_state = TestedLeaf; + return true; } void ranToCompletion() { From 95df676a27ac0a5a1cb258dc95c0229bde540998 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 29 Nov 2012 20:31:17 +0000 Subject: [PATCH 069/296] Renamed SectionInfo -> RunningSection. Added SectionInfo (that now corresponds to TestCaseInfo) and SectionStats Switched some const T&'s to T const&'s --- include/internal/catch_interfaces_reporter.h | 105 +++++++++++-------- include/internal/catch_running_test.hpp | 8 +- include/internal/catch_section_info.hpp | 29 ++--- 3 files changed, 76 insertions(+), 66 deletions(-) diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index a0b274ab..b5fdabef 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -21,9 +21,8 @@ namespace Catch { - struct ReporterConfig - { - ReporterConfig( std::ostream& _stream, const ConfigData& _fullConfig ) + struct ReporterConfig { + ReporterConfig( std::ostream& _stream, ConfigData const& _fullConfig ) : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} std::ostream& stream() { return *m_stream; } @@ -36,8 +35,7 @@ namespace Catch ConfigData m_fullConfig; }; - struct ReporterPreferences - { + struct ReporterPreferences { ReporterPreferences() : shouldRedirectStdOut( false ) {} @@ -45,9 +43,23 @@ namespace Catch bool shouldRedirectStdOut; }; + struct SectionInfo { + SectionInfo( std::string const& _name, + std::string const& _description, + SourceLineInfo const& _lineInfo ) + : name( _name ), + description( _description ), + sourceLineInfo( _lineInfo ) + {} + + std::string name; + std::string description; + SourceLineInfo sourceLineInfo; + }; + struct AssertionStats { - AssertionStats( const AssertionResult& _assertionResult, - const Totals& _totals ) + AssertionStats( AssertionResult const& _assertionResult, + Totals const& _totals ) : assertionResult( _assertionResult ), totals( _totals ) {} @@ -57,11 +69,16 @@ namespace Catch Totals totals; }; + struct SectionStats { + SectionInfo sectionInfo; + Totals totals; + }; + struct TestCaseStats { - TestCaseStats( const TestCaseInfo& _testInfo, - const Totals& _totals, - const std::string& _stdOut, - const std::string& _stdErr, + TestCaseStats( TestCaseInfo const& _testInfo, + Totals const& _totals, + std::string const& _stdOut, + std::string const& _stdErr, bool _missingAssertions, bool _aborting ) : testInfo( _testInfo ), @@ -81,8 +98,8 @@ namespace Catch }; struct TestGroupStats { - TestGroupStats( const std::string& _groupName, - const Totals& _totals, + TestGroupStats( std::string const& _groupName, + Totals const& _totals, bool _aborting ) : groupName( _groupName ), totals( _totals ), @@ -95,8 +112,8 @@ namespace Catch }; struct TestRunStats { - TestRunStats( const std::string& _runName, - const Totals& _totals, + TestRunStats( std::string const& _runName, + Totals const& _totals, bool _aborting ) : runName( _runName ), totals( _totals ), @@ -113,17 +130,17 @@ namespace Catch virtual ~IStreamingReporter(); virtual ReporterPreferences getPreferences() const = 0; - virtual void testRunStarting( const std::string& runName ) = 0; - virtual void testGroupStarting( const std::string& groupName ) = 0; + virtual void testRunStarting( std::string const& runName ) = 0; + virtual void testGroupStarting( std::string const& groupName ) = 0; // !TBD: include section info (perhaps TestCase has an isSection flag and/ or a parent pointer - virtual void testCaseStarting( const TestCaseInfo& testInfo ) = 0; - virtual void assertionStarting( const AssertionInfo& assertionInfo ) = 0; + virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; + virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; - virtual void assertionEnding( const AssertionStats& assertionStats ) = 0; - virtual void testCaseEnding( const TestCaseStats& testCaseStats ) = 0; - virtual void testGroupEnding( const TestGroupStats& testGroupStats ) = 0; - virtual void testRunEnding( const TestRunStats& testRunStats ) = 0; + virtual void assertionEnding( AssertionStats const& assertionStats ) = 0; + virtual void testCaseEnding( TestCaseStats const& testCaseStats ) = 0; + virtual void testGroupEnding( TestGroupStats const& testGroupStats ) = 0; + virtual void testRunEnding( TestRunStats const& testRunStats ) = 0; }; // !TBD: Derived helper that implements the streaming interface but holds the stats // - declares a new interface where methods are called at the end of each event @@ -138,23 +155,23 @@ namespace Catch virtual bool shouldRedirectStdout() const = 0; virtual void StartTesting() = 0; - virtual void EndTesting( const Totals& totals ) = 0; + virtual void EndTesting( Totals const& totals ) = 0; - virtual void StartGroup( const std::string& groupName ) = 0; - virtual void EndGroup( const std::string& groupName, const Totals& totals ) = 0; + virtual void StartGroup( std::string const& groupName ) = 0; + virtual void EndGroup( std::string const& groupName, Totals const& totals ) = 0; - virtual void StartTestCase( const TestCaseInfo& testInfo ) = 0; + virtual void StartTestCase( TestCaseInfo const& testInfo ) = 0; // TestCaseResult - virtual void EndTestCase( const TestCaseInfo& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0; + virtual void EndTestCase( TestCaseInfo const& testInfo, Totals const& totals, std::string const& stdOut, std::string const& stdErr ) = 0; // SectionInfo - virtual void StartSection( const std::string& sectionName, const std::string& description ) = 0; + virtual void StartSection( std::string const& sectionName, std::string const& description ) = 0; // Section Result - virtual void EndSection( const std::string& sectionName, const Counts& assertions ) = 0; + virtual void EndSection( std::string const& 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 NoAssertionsInSection( std::string const& sectionName ) = 0; + virtual void NoAssertionsInTestCase( std::string const& testName ) = 0; // - merge into SectionResult, TestCaseResult, GroupResult & TestRunResult virtual void Aborted() = 0; @@ -166,7 +183,7 @@ namespace Catch class LegacyReporterAdapter : public SharedImpl { public: - LegacyReporterAdapter( const Ptr& legacyReporter, const ReporterConfig& config ) + LegacyReporterAdapter( Ptr const& legacyReporter, ReporterConfig const& config ) : m_legacyReporter( legacyReporter ), m_config( config ) {} @@ -178,33 +195,33 @@ namespace Catch return prefs; } - virtual void testRunStarting( const std::string& ) { + virtual void testRunStarting( std::string const& ) { m_legacyReporter->StartTesting(); } - virtual void testGroupStarting( const std::string& groupName ) { + virtual void testGroupStarting( std::string const& groupName ) { m_legacyReporter->StartGroup( groupName ); } - virtual void testCaseStarting( const TestCaseInfo& testInfo ) { + virtual void testCaseStarting( TestCaseInfo const& testInfo ) { m_legacyReporter->StartTestCase( testInfo ); } - virtual void assertionStarting( const AssertionInfo& ) { + virtual void assertionStarting( AssertionInfo const& ) { // Not on legacy interface } - virtual void assertionEnding( const AssertionStats& assertionStats ) { + virtual void assertionEnding( AssertionStats const& assertionStats ) { m_legacyReporter->Result( assertionStats.assertionResult ); } - virtual void testCaseEnding( const TestCaseStats& testCaseStats ) { + virtual void testCaseEnding( TestCaseStats const& testCaseStats ) { if( testCaseStats.missingAssertions ) m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name ); m_legacyReporter->EndTestCase( testCaseStats.testInfo, testCaseStats.totals, testCaseStats.stdOut, testCaseStats.stdErr ); } - virtual void testGroupEnding( const TestGroupStats& testGroupStats ) { + virtual void testGroupEnding( TestGroupStats const& testGroupStats ) { if( testGroupStats.aborting ) m_legacyReporter->Aborted(); m_legacyReporter->EndGroup( testGroupStats.groupName, testGroupStats.totals ); } - virtual void testRunEnding( const TestRunStats& testRunStats ) { + virtual void testRunEnding( TestRunStats const& testRunStats ) { m_legacyReporter->EndTesting( testRunStats.totals ); } @@ -216,7 +233,7 @@ namespace Catch struct IReporterFactory { virtual ~IReporterFactory(); - virtual IReporter* create( const ReporterConfig& config ) const = 0; + virtual IReporter* create( ReporterConfig const& config ) const = 0; virtual std::string getDescription() const = 0; }; @@ -224,11 +241,11 @@ namespace Catch typedef std::map FactoryMap; virtual ~IReporterRegistry(); - virtual IReporter* create( const std::string& name, const ReporterConfig& config ) const = 0; + virtual IReporter* create( std::string const& name, ReporterConfig const& config ) const = 0; virtual const FactoryMap& getFactories() const = 0; }; - inline std::string trim( const std::string& str ) { + inline std::string trim( std::string const& str ) { std::string::size_type start = str.find_first_not_of( "\n\r\t " ); std::string::size_type end = str.find_last_not_of( "\n\r\t " ); diff --git a/include/internal/catch_running_test.hpp b/include/internal/catch_running_test.hpp index 7f89ab70..0b234c09 100644 --- a/include/internal/catch_running_test.hpp +++ b/include/internal/catch_running_test.hpp @@ -68,7 +68,7 @@ namespace Catch { if( m_runStatus == NothingRun ) m_runStatus = EncounteredASection; - SectionInfo* thisSection = m_currentSection->findOrAddSubSection( name, m_changed ); + RunningSection* thisSection = m_currentSection->findOrAddSubSection( name, m_changed ); if( !wasSectionSeen() && thisSection->shouldRun() ) { m_currentSection = thisSection; @@ -102,9 +102,9 @@ namespace Catch { private: const TestCase& m_info; RunStatus m_runStatus; - SectionInfo m_rootSection; - SectionInfo* m_currentSection; - SectionInfo* m_lastSectionToRun; + RunningSection m_rootSection; + RunningSection* m_currentSection; + RunningSection* m_lastSectionToRun; bool m_changed; }; } diff --git a/include/internal/catch_section_info.hpp b/include/internal/catch_section_info.hpp index 7f09a943..7a326dfd 100644 --- a/include/internal/catch_section_info.hpp +++ b/include/internal/catch_section_info.hpp @@ -15,17 +15,10 @@ namespace Catch { - struct ISectionInfo { - virtual ~ISectionInfo() {} - - virtual std::string getName() const = 0; - virtual const ISectionInfo* getParent() const = 0; - }; - - class SectionInfo : public ISectionInfo { + class RunningSection { public: - typedef std::vector SubSections; + typedef std::vector SubSections; enum State { Root, @@ -35,23 +28,23 @@ namespace Catch { TestedLeaf }; - SectionInfo( SectionInfo* parent, const std::string& name ) + RunningSection( RunningSection* parent, const std::string& name ) : m_state( Unknown ), m_parent( parent ), m_name( name ) {} - SectionInfo( const std::string& name ) + RunningSection( const std::string& name ) : m_state( Root ), m_parent( NULL ), m_name( name ) {} - ~SectionInfo() { + ~RunningSection() { deleteAll( m_subSections ); } - virtual std::string getName() const { + std::string getName() const { return m_name; } @@ -63,7 +56,7 @@ namespace Catch { return m_state == Branch; } - const SectionInfo* getParent() const { + const RunningSection* getParent() const { return m_parent; } @@ -80,17 +73,17 @@ namespace Catch { // Mutable methods: - SectionInfo* getParent() { + RunningSection* getParent() { return m_parent; } - SectionInfo* findOrAddSubSection( const std::string& name, bool& changed ) { + RunningSection* findOrAddSubSection( const std::string& name, bool& changed ) { for( SubSections::const_iterator it = m_subSections.begin(); it != m_subSections.end(); ++it) if( (*it)->getName() == name ) return *it; - SectionInfo* subSection = new SectionInfo( this, name ); + RunningSection* subSection = new RunningSection( this, name ); m_subSections.push_back( subSection ); m_state = Branch; changed = true; @@ -111,7 +104,7 @@ namespace Catch { private: State m_state; - SectionInfo* m_parent; + RunningSection* m_parent; std::string m_name; SubSections m_subSections; }; From ad6701d222764aeb751e4dab78d37d521eb82702 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 30 Nov 2012 08:58:46 +0000 Subject: [PATCH 070/296] SectionInfo now goes via new streaming reporter interface --- include/catch_runner.hpp | 2 +- include/internal/catch_interfaces_capture.h | 11 +++-- include/internal/catch_interfaces_reporter.h | 43 ++++++++++++++------ include/internal/catch_runner_impl.hpp | 37 ++++++++--------- include/internal/catch_section.hpp | 7 ++-- 5 files changed, 59 insertions(+), 41 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 13d085b5..c836f155 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -50,7 +50,7 @@ namespace Catch { for(; it != itEnd && !context.aborting(); ++it ) { reporter.testGroupStarting( it->getName() ); totals += runTestsForGroup( context, *it ); - reporter.testGroupEnding( TestGroupStats( it->getName(), totals, context.aborting() ) ); + reporter.testGroupEnded( TestGroupStats( it->getName(), totals, context.aborting() ) ); } return totals; } diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index 3f01bd0b..08147055 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -20,22 +20,21 @@ namespace Catch { class ExpressionResultBuilder; class AssertionResult; struct AssertionInfo; + struct SectionInfo; struct IResultCapture { virtual ~IResultCapture(); - virtual void testEnded( const AssertionResult& result ) = 0; - virtual bool sectionStarted( const std::string& name, - const std::string& description, - const SourceLineInfo& lineInfo, + virtual void testEnded( AssertionResult const& result ) = 0; + virtual bool sectionStarted( SectionInfo const& sectionInfo, Counts& assertions ) = 0; - virtual void sectionEnded( const std::string& name, const Counts& assertions ) = 0; + virtual void sectionEnded( SectionInfo const& name, Counts const& assertions ) = 0; virtual void pushScopedInfo( ScopedInfo* scopedInfo ) = 0; virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; virtual bool shouldDebugBreak() const = 0; - virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) = 0; + virtual ResultAction::Value acceptExpression( ExpressionResultBuilder const& assertionResult, AssertionInfo const& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; virtual const AssertionResult* getLastResult() const = 0; diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index b5fdabef..da7b67ce 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -49,12 +49,12 @@ namespace Catch SourceLineInfo const& _lineInfo ) : name( _name ), description( _description ), - sourceLineInfo( _lineInfo ) + lineInfo( _lineInfo ) {} std::string name; std::string description; - SourceLineInfo sourceLineInfo; + SourceLineInfo lineInfo; }; struct AssertionStats { @@ -70,8 +70,17 @@ namespace Catch }; struct SectionStats { + SectionStats( SectionInfo const& _sectionInfo, + Counts const& _assertions, + bool _missingAssertions ) + : sectionInfo( _sectionInfo ), + assertions( _assertions ), + missingAssertions( _missingAssertions ) + {} + SectionInfo sectionInfo; - Totals totals; + Counts assertions; + bool missingAssertions; }; struct TestCaseStats { @@ -133,14 +142,16 @@ namespace Catch virtual void testRunStarting( std::string const& runName ) = 0; virtual void testGroupStarting( std::string const& groupName ) = 0; - // !TBD: include section info (perhaps TestCase has an isSection flag and/ or a parent pointer virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; + virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; + virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; - virtual void assertionEnding( AssertionStats const& assertionStats ) = 0; - virtual void testCaseEnding( TestCaseStats const& testCaseStats ) = 0; - virtual void testGroupEnding( TestGroupStats const& testGroupStats ) = 0; - virtual void testRunEnding( TestRunStats const& testRunStats ) = 0; + virtual void assertionEnded( AssertionStats const& assertionStats ) = 0; + virtual void sectionEnded( SectionStats const& sectionStats ) = 0; + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; + virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; }; // !TBD: Derived helper that implements the streaming interface but holds the stats // - declares a new interface where methods are called at the end of each event @@ -204,24 +215,32 @@ namespace Catch virtual void testCaseStarting( TestCaseInfo const& testInfo ) { m_legacyReporter->StartTestCase( testInfo ); } + virtual void sectionStarting( SectionInfo const& sectionInfo ) { + m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description ); + } virtual void assertionStarting( AssertionInfo const& ) { // Not on legacy interface } - virtual void assertionEnding( AssertionStats const& assertionStats ) { + virtual void assertionEnded( AssertionStats const& assertionStats ) { m_legacyReporter->Result( assertionStats.assertionResult ); } - virtual void testCaseEnding( TestCaseStats const& testCaseStats ) { + virtual void sectionEnded( SectionStats const& sectionStats ) { + if( sectionStats.missingAssertions ) + m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); + m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); + } + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { if( testCaseStats.missingAssertions ) m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name ); m_legacyReporter->EndTestCase( testCaseStats.testInfo, testCaseStats.totals, testCaseStats.stdOut, testCaseStats.stdErr ); } - virtual void testGroupEnding( TestGroupStats const& testGroupStats ) { + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { if( testGroupStats.aborting ) m_legacyReporter->Aborted(); m_legacyReporter->EndGroup( testGroupStats.groupName, testGroupStats.totals ); } - virtual void testRunEnding( TestRunStats const& testRunStats ) { + virtual void testRunEnded( TestRunStats const& testRunStats ) { m_legacyReporter->EndTesting( testRunStats.totals ); } diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index e307a164..d4abaf7d 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -72,7 +72,7 @@ namespace Catch { } virtual ~Runner() { - LegacyReporterAdapter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ).testRunEnding( TestRunStats( "", m_totals, aborting() ) ); // !TBD - name + LegacyReporterAdapter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ).testRunEnded( TestRunStats( "", m_totals, aborting() ) ); // !TBD - name m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); @@ -94,7 +94,7 @@ namespace Catch { for(; it != itEnd; ++it ) totals += runTest( *it ); - reporter.testGroupEnding( TestGroupStats( testSpec, totals, aborting() ) ); + reporter.testGroupEnded( TestGroupStats( testSpec, totals, aborting() ) ); return totals; } @@ -131,7 +131,7 @@ namespace Catch { m_totals.testCases += deltaTotals.testCases; TestCaseStats stats( testInfo, deltaTotals, redirectedCout, redirectedCerr, missingAssertions, aborting() ); - reporter.testCaseEnding( stats ); + reporter.testCaseEnded( stats ); delete m_runningTest; @@ -163,13 +163,13 @@ namespace Catch { std::vector::const_iterator it = m_scopedInfos.begin(); std::vector::const_iterator itEnd = m_scopedInfos.end(); for(; it != itEnd; ++it ) - reporter.assertionEnding( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); + reporter.assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); std::vector::const_iterator itEnd = m_assertionResults.end(); for(; it != itEnd; ++it ) - reporter.assertionEnding( AssertionStats( *it, m_totals ) ); + reporter.assertionEnded( AssertionStats( *it, m_totals ) ); } m_assertionResults.clear(); } @@ -180,49 +180,48 @@ namespace Catch { m_totals.assertions.info++; } else - reporter.assertionEnding( AssertionStats( result, m_totals ) ); + reporter.assertionEnded( AssertionStats( result, m_totals ) ); // Reset AssertionInfo m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); } virtual bool sectionStarted ( - const std::string& name, - const std::string& description, - const SourceLineInfo& lineInfo, + SectionInfo const& sectionInfo, Counts& assertions ) { std::ostringstream oss; - oss << name << "@" << lineInfo; + oss << sectionInfo.name << "@" << sectionInfo.lineInfo; if( !m_runningTest->addSection( oss.str() ) ) return false; - m_lastAssertionInfo.lineInfo = lineInfo; + m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; - // !TBD: ------------ - std::string className = m_runningTest->getTestCase().getTestCaseInfo().className; - TestCaseInfo sectionInfo( name, className, description, std::set(), false, lineInfo ); + LegacyReporterAdapter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ).sectionStarting( sectionInfo ); - m_reporter->StartSection( name, description ); assertions = m_totals.assertions; return true; } - virtual void sectionEnded( const std::string& name, const Counts& prevAssertions ) { + virtual void sectionEnded( SectionInfo const& info, Counts const& prevAssertions ) { Counts assertions = m_totals.assertions - prevAssertions; + bool missingAssertions = false; if( assertions.total() == 0 && ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) && !m_runningTest->isBranchSection() ) { - m_reporter->NoAssertionsInSection( name ); m_totals.assertions.failed++; assertions.failed++; + missingAssertions = true; + } - m_runningTest->endSection( name ); - m_reporter->EndSection( name, assertions ); + m_runningTest->endSection( info.name ); + + SectionStats stats( info, assertions, missingAssertions ); + LegacyReporterAdapter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ).sectionEnded( stats ); } virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { diff --git a/include/internal/catch_section.hpp b/include/internal/catch_section.hpp index 38bea0d2..e6a6d254 100644 --- a/include/internal/catch_section.hpp +++ b/include/internal/catch_section.hpp @@ -20,13 +20,13 @@ namespace Catch { 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 ) ) + : m_info( name, description, lineInfo ), + m_sectionIncluded( getCurrentContext().getResultCapture().sectionStarted( m_info, m_assertions ) ) {} ~Section() { if( m_sectionIncluded ) - getCurrentContext().getResultCapture().sectionEnded( m_name, m_assertions ); + getCurrentContext().getResultCapture().sectionEnded( m_info, m_assertions ); } // This indicates whether the section should be executed or not @@ -35,6 +35,7 @@ namespace Catch { } private: + SectionInfo m_info; std::string m_name; Counts m_assertions; From f4774d96425baa6c2cc52f93724f33c62d48df98 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 30 Nov 2012 09:13:27 +0000 Subject: [PATCH 071/296] Reference to legacy reporter adapter localised to one place --- include/catch_runner.hpp | 6 ++-- include/internal/catch_runner_impl.hpp | 40 ++++++++++++++------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index c836f155..74f28aa1 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -45,12 +45,10 @@ namespace Catch { std::vector::const_iterator it = filterGroups.begin(); std::vector::const_iterator itEnd = filterGroups.end(); - LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_configWrapper.stream(), m_config ) ); - for(; it != itEnd && !context.aborting(); ++it ) { - reporter.testGroupStarting( it->getName() ); + context.testGroupStarting( it->getName() ); totals += runTestsForGroup( context, *it ); - reporter.testGroupEnded( TestGroupStats( it->getName(), totals, context.aborting() ) ); + context.testGroupEnded( it->getName(), totals ); } return totals; } diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index d4abaf7d..66fb52d6 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -60,7 +60,7 @@ namespace Catch { : m_context( getCurrentMutableContext() ), m_runningTest( NULL ), m_config( config ), - m_reporter( reporter ), + m_reporter( reporter, ReporterConfig( m_config.stream(), m_config.data() ) ), m_prevRunner( &m_context.getRunner() ), m_prevResultCapture( &m_context.getResultCapture() ), m_prevConfig( m_context.getConfig() ) @@ -68,33 +68,38 @@ namespace Catch { m_context.setRunner( this ); m_context.setConfig( &m_config ); m_context.setResultCapture( this ); - LegacyReporterAdapter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ).testRunStarting( "" ); // !TBD - name + m_reporter.testRunStarting( "" ); // !TBD - name } virtual ~Runner() { - LegacyReporterAdapter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ).testRunEnded( TestRunStats( "", m_totals, aborting() ) ); // !TBD - name + m_reporter.testRunEnded( TestRunStats( "", m_totals, aborting() ) ); // !TBD - name m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); m_context.setConfig( m_prevConfig ); } + void testGroupStarting( std::string const& testSpec ) { + m_reporter.testGroupStarting( testSpec ); + } + void testGroupEnded( std::string const& testSpec, Totals const& totals ) { + m_reporter.testGroupEnded( TestGroupStats( testSpec, totals, aborting() ) ); + } + Totals runMatching( const std::string& testSpec ) { std::vector matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ); Totals totals; - - LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ); - reporter.testGroupStarting( testSpec ); + testGroupStarting( testSpec ); std::vector::const_iterator it = matchingTests.begin(); std::vector::const_iterator itEnd = matchingTests.end(); for(; it != itEnd; ++it ) totals += runTest( *it ); - reporter.testGroupEnded( TestGroupStats( testSpec, totals, aborting() ) ); + testGroupEnded( testSpec, totals ); return totals; } @@ -106,8 +111,7 @@ namespace Catch { TestCaseInfo testInfo = testCase.getTestCaseInfo(); - LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ); - reporter.testCaseStarting( testInfo ); + m_reporter.testCaseStarting( testInfo ); m_runningTest = new RunningTest( testCase ); @@ -131,7 +135,7 @@ namespace Catch { m_totals.testCases += deltaTotals.testCases; TestCaseStats stats( testInfo, deltaTotals, redirectedCout, redirectedCerr, missingAssertions, aborting() ); - reporter.testCaseEnded( stats ); + m_reporter.testCaseEnded( stats ); delete m_runningTest; @@ -152,7 +156,6 @@ namespace Catch { } virtual void testEnded( const AssertionResult& result ) { - LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ); if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } @@ -163,13 +166,13 @@ namespace Catch { std::vector::const_iterator it = m_scopedInfos.begin(); std::vector::const_iterator itEnd = m_scopedInfos.end(); for(; it != itEnd; ++it ) - reporter.assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); + m_reporter.assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); std::vector::const_iterator itEnd = m_assertionResults.end(); for(; it != itEnd; ++it ) - reporter.assertionEnded( AssertionStats( *it, m_totals ) ); + m_reporter.assertionEnded( AssertionStats( *it, m_totals ) ); } m_assertionResults.clear(); } @@ -180,7 +183,7 @@ namespace Catch { m_totals.assertions.info++; } else - reporter.assertionEnded( AssertionStats( result, m_totals ) ); + m_reporter.assertionEnded( AssertionStats( result, m_totals ) ); // Reset AssertionInfo m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); @@ -200,7 +203,7 @@ namespace Catch { m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; - LegacyReporterAdapter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ).sectionStarting( sectionInfo ); + m_reporter.sectionStarting( sectionInfo ); assertions = m_totals.assertions; @@ -221,7 +224,7 @@ namespace Catch { m_runningTest->endSection( info.name ); SectionStats stats( info, assertions, missingAssertions ); - LegacyReporterAdapter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ).sectionEnded( stats ); + m_reporter.sectionEnded( stats ); } virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { @@ -275,8 +278,7 @@ namespace Catch { try { m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getTestCaseInfo().lineInfo, "", ResultDisposition::Normal ); m_runningTest->reset(); - LegacyReporterAdapter reporter( m_reporter, ReporterConfig( m_config.stream(), m_config.data() ) ); - if( reporter.getPreferences().shouldRedirectStdOut ) { + if( m_reporter.getPreferences().shouldRedirectStdOut ) { StreamRedirect coutRedir( std::cout, redirectedCout ); StreamRedirect cerrRedir( std::cerr, redirectedCerr ); m_runningTest->getTestCase().invoke(); @@ -304,7 +306,7 @@ namespace Catch { const Config& m_config; Totals m_totals; - Ptr m_reporter; + LegacyReporterAdapter m_reporter; std::vector m_scopedInfos; std::vector m_assertionResults; IRunner* m_prevRunner; From 7f04b56738ba74bebb675572abc1aaec4bffbb69 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 30 Nov 2012 18:54:06 +0000 Subject: [PATCH 072/296] Reporter "stats" objects passed in by Ptr --- include/internal/catch_impl.hpp | 7 +- include/internal/catch_interfaces_reporter.h | 79 ++++++++++---------- include/internal/catch_ptr.hpp | 44 ++++------- include/internal/catch_runner_impl.hpp | 21 +++--- 4 files changed, 70 insertions(+), 81 deletions(-) diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 15bdd3b6..295bf773 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -49,7 +49,12 @@ namespace Catch { IReporterRegistry::~IReporterRegistry() {} IStreamingReporter::~IStreamingReporter() {} LegacyReporterAdapter::~LegacyReporterAdapter() {} - + AssertionStats::~AssertionStats() {} + SectionStats::~SectionStats() {} + TestCaseStats::~TestCaseStats() {} + TestGroupStats::~TestGroupStats() {} + TestRunStats::~TestRunStats() {} + BasicReporter::~BasicReporter() {} IRunner::~IRunner() {} IMutableContext::~IMutableContext() {} diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index da7b67ce..fec09e77 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -57,19 +57,19 @@ namespace Catch SourceLineInfo lineInfo; }; - struct AssertionStats { + struct AssertionStats : SharedImpl<> { AssertionStats( AssertionResult const& _assertionResult, Totals const& _totals ) : assertionResult( _assertionResult ), totals( _totals ) {} + virtual ~AssertionStats(); -// AssertionInfo assertionInfo; // !TBD: needed? It's in the result AssertionResult assertionResult; Totals totals; }; - struct SectionStats { + struct SectionStats : SharedImpl<> { SectionStats( SectionInfo const& _sectionInfo, Counts const& _assertions, bool _missingAssertions ) @@ -77,13 +77,14 @@ namespace Catch assertions( _assertions ), missingAssertions( _missingAssertions ) {} - + virtual ~SectionStats(); + SectionInfo sectionInfo; Counts assertions; bool missingAssertions; }; - struct TestCaseStats { + struct TestCaseStats : SharedImpl<> { TestCaseStats( TestCaseInfo const& _testInfo, Totals const& _totals, std::string const& _stdOut, @@ -97,6 +98,7 @@ namespace Catch missingAssertions( _missingAssertions ), aborting( _aborting ) {} + virtual ~TestCaseStats(); TestCaseInfo testInfo; Totals totals; @@ -106,7 +108,7 @@ namespace Catch bool aborting; }; - struct TestGroupStats { + struct TestGroupStats : SharedImpl<> { TestGroupStats( std::string const& _groupName, Totals const& _totals, bool _aborting ) @@ -114,13 +116,14 @@ namespace Catch totals( _totals ), aborting( _aborting ) {} + virtual ~TestGroupStats(); std::string groupName; Totals totals; bool aborting; }; - struct TestRunStats { + struct TestRunStats : SharedImpl<> { TestRunStats( std::string const& _runName, Totals const& _totals, bool _aborting ) @@ -128,6 +131,7 @@ namespace Catch totals( _totals ), aborting( _aborting ) {} + virtual ~TestRunStats(); std::string runName; Totals totals; @@ -147,11 +151,11 @@ namespace Catch virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; - virtual void assertionEnded( AssertionStats const& assertionStats ) = 0; - virtual void sectionEnded( SectionStats const& sectionStats ) = 0; - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; - virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; + virtual void assertionEnded( Ptr const& assertionStats ) = 0; + virtual void sectionEnded( Ptr const& sectionStats ) = 0; + virtual void testCaseEnded( Ptr const& testCaseStats ) = 0; + virtual void testGroupEnded( Ptr const& testGroupStats ) = 0; + virtual void testRunEnded( Ptr const& testRunStats ) = 0; }; // !TBD: Derived helper that implements the streaming interface but holds the stats // - declares a new interface where methods are called at the end of each event @@ -160,34 +164,23 @@ namespace Catch // as it goes + // Deprecated struct IReporter : IShared { virtual ~IReporter(); virtual bool shouldRedirectStdout() const = 0; virtual void StartTesting() = 0; - virtual void EndTesting( Totals const& totals ) = 0; - + virtual void EndTesting( Totals const& totals ) = 0; virtual void StartGroup( std::string const& groupName ) = 0; - virtual void EndGroup( std::string const& groupName, Totals const& totals ) = 0; - + virtual void EndGroup( std::string const& groupName, Totals const& totals ) = 0; virtual void StartTestCase( TestCaseInfo const& testInfo ) = 0; - // TestCaseResult virtual void EndTestCase( TestCaseInfo const& testInfo, Totals const& totals, std::string const& stdOut, std::string const& stdErr ) = 0; - - // SectionInfo virtual void StartSection( std::string const& sectionName, std::string const& description ) = 0; - // Section Result virtual void EndSection( std::string const& sectionName, const Counts& assertions ) = 0; - - // - merge into SectionResult ? virtual void NoAssertionsInSection( std::string const& sectionName ) = 0; virtual void NoAssertionsInTestCase( std::string const& testName ) = 0; - - // - merge into SectionResult, TestCaseResult, GroupResult & TestRunResult virtual void Aborted() = 0; - - // AssertionReslt virtual void Result( const AssertionResult& result ) = 0; }; @@ -222,26 +215,30 @@ namespace Catch // Not on legacy interface } - virtual void assertionEnded( AssertionStats const& assertionStats ) { - m_legacyReporter->Result( assertionStats.assertionResult ); + virtual void assertionEnded( Ptr const& assertionStats ) { + m_legacyReporter->Result( assertionStats->assertionResult ); } - virtual void sectionEnded( SectionStats const& sectionStats ) { - if( sectionStats.missingAssertions ) - m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); - m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); + virtual void sectionEnded( Ptr const& sectionStats ) { + if( sectionStats->missingAssertions ) + m_legacyReporter->NoAssertionsInSection( sectionStats->sectionInfo.name ); + m_legacyReporter->EndSection( sectionStats->sectionInfo.name, sectionStats->assertions ); } - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { - if( testCaseStats.missingAssertions ) - m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name ); - m_legacyReporter->EndTestCase( testCaseStats.testInfo, testCaseStats.totals, testCaseStats.stdOut, testCaseStats.stdErr ); + virtual void testCaseEnded( Ptr const& testCaseStats ) { + if( testCaseStats->missingAssertions ) + m_legacyReporter->NoAssertionsInTestCase( testCaseStats->testInfo.name ); + m_legacyReporter->EndTestCase + ( testCaseStats->testInfo, + testCaseStats->totals, + testCaseStats->stdOut, + testCaseStats->stdErr ); } - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { - if( testGroupStats.aborting ) + virtual void testGroupEnded( Ptr const& testGroupStats ) { + if( testGroupStats->aborting ) m_legacyReporter->Aborted(); - m_legacyReporter->EndGroup( testGroupStats.groupName, testGroupStats.totals ); + m_legacyReporter->EndGroup( testGroupStats->groupName, testGroupStats->totals ); } - virtual void testRunEnded( TestRunStats const& testRunStats ) { - m_legacyReporter->EndTesting( testRunStats.totals ); + virtual void testRunEnded( Ptr const& testRunStats ) { + m_legacyReporter->EndTesting( testRunStats->totals ); } private: diff --git a/include/internal/catch_ptr.hpp b/include/internal/catch_ptr.hpp index 19e92a8d..60000aaa 100644 --- a/include/internal/catch_ptr.hpp +++ b/include/internal/catch_ptr.hpp @@ -23,7 +23,7 @@ namespace Catch { if( m_p ) m_p->addRef(); } - Ptr( const Ptr& other ) : m_p( other.m_p ){ + Ptr( Ptr const& other ) : m_p( other.m_p ){ if( m_p ) m_p->addRef(); } @@ -36,33 +36,17 @@ namespace Catch { swap( temp ); return *this; } - Ptr& operator = ( const Ptr& other ){ + Ptr& operator = ( Ptr const& other ){ Ptr temp( other ); swap( temp ); return *this; } - void swap( Ptr& other ){ - std::swap( m_p, other.m_p ); - } - - T* get(){ - return m_p; - } - const T* get() const{ - return m_p; - } - - T& operator*() const { - return *m_p; - } - - T* operator->() const { - return m_p; - } - - bool operator !() const { - return m_p == NULL; - } + void swap( Ptr& other ) { std::swap( m_p, other.m_p ); } + T* get() { return m_p; } + const T* get() const{ return m_p; } + T& operator*() const { return *m_p; } + T* operator->() const { return m_p; } + bool operator !() const { return m_p == NULL; } private: T* m_p; @@ -70,24 +54,24 @@ namespace Catch { struct IShared : NonCopyable { virtual ~IShared(); - virtual void addRef() = 0; - virtual void release() = 0; + virtual void addRef() const = 0; + virtual void release() const = 0; }; - template + template struct SharedImpl : T { SharedImpl() : m_rc( 0 ){} - virtual void addRef(){ + virtual void addRef() const { ++m_rc; } - virtual void release(){ + virtual void release() const { if( --m_rc == 0 ) delete this; } - int m_rc; + mutable unsigned int m_rc; }; } // end namespace Catch diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 66fb52d6..69d2158e 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -72,7 +72,7 @@ namespace Catch { } virtual ~Runner() { - m_reporter.testRunEnded( TestRunStats( "", m_totals, aborting() ) ); // !TBD - name + m_reporter.testRunEnded( new TestRunStats( "", m_totals, aborting() ) ); // !TBD - name m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); @@ -83,7 +83,7 @@ namespace Catch { m_reporter.testGroupStarting( testSpec ); } void testGroupEnded( std::string const& testSpec, Totals const& totals ) { - m_reporter.testGroupEnded( TestGroupStats( testSpec, totals, aborting() ) ); + m_reporter.testGroupEnded( new TestGroupStats( testSpec, totals, aborting() ) ); } Totals runMatching( const std::string& testSpec ) { @@ -134,8 +134,12 @@ namespace Catch { m_totals.testCases += deltaTotals.testCases; - TestCaseStats stats( testInfo, deltaTotals, redirectedCout, redirectedCerr, missingAssertions, aborting() ); - m_reporter.testCaseEnded( stats ); + m_reporter.testCaseEnded( new TestCaseStats( testInfo, + deltaTotals, + redirectedCout, + redirectedCerr, + missingAssertions, + aborting() ) ); delete m_runningTest; @@ -166,13 +170,13 @@ namespace Catch { std::vector::const_iterator it = m_scopedInfos.begin(); std::vector::const_iterator itEnd = m_scopedInfos.end(); for(; it != itEnd; ++it ) - m_reporter.assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); + m_reporter.assertionEnded( new AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); std::vector::const_iterator itEnd = m_assertionResults.end(); for(; it != itEnd; ++it ) - m_reporter.assertionEnded( AssertionStats( *it, m_totals ) ); + m_reporter.assertionEnded( new AssertionStats( *it, m_totals ) ); } m_assertionResults.clear(); } @@ -183,7 +187,7 @@ namespace Catch { m_totals.assertions.info++; } else - m_reporter.assertionEnded( AssertionStats( result, m_totals ) ); + m_reporter.assertionEnded( new AssertionStats( result, m_totals ) ); // Reset AssertionInfo m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); @@ -223,8 +227,7 @@ namespace Catch { } m_runningTest->endSection( info.name ); - SectionStats stats( info, assertions, missingAssertions ); - m_reporter.sectionEnded( stats ); + m_reporter.sectionEnded( new SectionStats( info, assertions, missingAssertions ) ); } virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { From 4e12e12c1f60f20d5231229aba5c617348903547 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 30 Nov 2012 19:15:23 +0000 Subject: [PATCH 073/296] Streaming reporter interface is now used natively. Legacy reporters are adapted by their factories. --- include/catch_runner.hpp | 2 +- include/internal/catch_interfaces_reporter.h | 4 +-- .../internal/catch_reporter_registrars.hpp | 29 ++++++++++++++++-- include/internal/catch_reporter_registry.hpp | 2 +- include/internal/catch_runner_impl.hpp | 30 +++++++++---------- projects/SelfTest/catch_self_test.cpp | 2 +- 6 files changed, 46 insertions(+), 23 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 74f28aa1..cac00af0 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -112,7 +112,7 @@ namespace Catch { Config& m_configWrapper; const ConfigData& m_config; std::ofstream m_ofs; - Ptr m_reporter; + Ptr m_reporter; std::set m_testsAlreadyRun; }; diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index fec09e77..7c30d96c 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -249,7 +249,7 @@ namespace Catch struct IReporterFactory { virtual ~IReporterFactory(); - virtual IReporter* create( ReporterConfig const& config ) const = 0; + virtual IStreamingReporter* create( ReporterConfig const& config ) const = 0; virtual std::string getDescription() const = 0; }; @@ -257,7 +257,7 @@ namespace Catch typedef std::map FactoryMap; virtual ~IReporterRegistry(); - virtual IReporter* create( std::string const& name, ReporterConfig const& config ) const = 0; + virtual IStreamingReporter* create( std::string const& name, ReporterConfig const& config ) const = 0; virtual const FactoryMap& getFactories() const = 0; }; diff --git a/include/internal/catch_reporter_registrars.hpp b/include/internal/catch_reporter_registrars.hpp index 33af47da..77ed5374 100644 --- a/include/internal/catch_reporter_registrars.hpp +++ b/include/internal/catch_reporter_registrars.hpp @@ -13,12 +13,12 @@ namespace Catch { template - class ReporterRegistrar { + class LegacyReporterRegistrar { class ReporterFactory : public IReporterFactory { - virtual IReporter* create( const ReporterConfig& config ) const { - return new T( config ); + virtual IStreamingReporter* create( const ReporterConfig& config ) const { + return new LegacyReporterAdapter( new T( config ), config ); } virtual std::string getDescription() const { @@ -26,6 +26,27 @@ namespace Catch { } }; + public: + + LegacyReporterRegistrar( const std::string& name ) { + getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); + } + }; + + template + class ReporterRegistrar { + + class ReporterFactory : public IReporterFactory { + + virtual IStreamingReporter* create( const ReporterConfig& config ) const { + return new T( config ); + } + + virtual std::string getDescription() const { + return T::getDescription(); + } + }; + public: ReporterRegistrar( const std::string& name ) { @@ -35,6 +56,8 @@ namespace Catch { } #define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \ + Catch::LegacyReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); +#define INTERNAL_CATCH_REGISTER_REPORTER2( name, reporterType ) \ Catch::ReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); #endif // TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED diff --git a/include/internal/catch_reporter_registry.hpp b/include/internal/catch_reporter_registry.hpp index 21a48962..78219805 100644 --- a/include/internal/catch_reporter_registry.hpp +++ b/include/internal/catch_reporter_registry.hpp @@ -22,7 +22,7 @@ namespace Catch { deleteAllValues( m_factories ); } - virtual IReporter* create( const std::string& name, const ReporterConfig& config ) const { + virtual IStreamingReporter* create( const std::string& name, const ReporterConfig& config ) const { FactoryMap::const_iterator it = m_factories.find( name ); if( it == m_factories.end() ) return NULL; diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 69d2158e..850fa56f 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -56,11 +56,11 @@ namespace Catch { public: - explicit Runner( const Config& config, const Ptr& reporter ) + explicit Runner( const Config& config, const Ptr& reporter ) : m_context( getCurrentMutableContext() ), m_runningTest( NULL ), m_config( config ), - m_reporter( reporter, ReporterConfig( m_config.stream(), m_config.data() ) ), + m_reporter( reporter ), m_prevRunner( &m_context.getRunner() ), m_prevResultCapture( &m_context.getResultCapture() ), m_prevConfig( m_context.getConfig() ) @@ -68,11 +68,11 @@ namespace Catch { m_context.setRunner( this ); m_context.setConfig( &m_config ); m_context.setResultCapture( this ); - m_reporter.testRunStarting( "" ); // !TBD - name + m_reporter->testRunStarting( "" ); // !TBD - name } virtual ~Runner() { - m_reporter.testRunEnded( new TestRunStats( "", m_totals, aborting() ) ); // !TBD - name + m_reporter->testRunEnded( new TestRunStats( "", m_totals, aborting() ) ); // !TBD - name m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); @@ -80,10 +80,10 @@ namespace Catch { } void testGroupStarting( std::string const& testSpec ) { - m_reporter.testGroupStarting( testSpec ); + m_reporter->testGroupStarting( testSpec ); } void testGroupEnded( std::string const& testSpec, Totals const& totals ) { - m_reporter.testGroupEnded( new TestGroupStats( testSpec, totals, aborting() ) ); + m_reporter->testGroupEnded( new TestGroupStats( testSpec, totals, aborting() ) ); } Totals runMatching( const std::string& testSpec ) { @@ -111,7 +111,7 @@ namespace Catch { TestCaseInfo testInfo = testCase.getTestCaseInfo(); - m_reporter.testCaseStarting( testInfo ); + m_reporter->testCaseStarting( testInfo ); m_runningTest = new RunningTest( testCase ); @@ -134,7 +134,7 @@ namespace Catch { m_totals.testCases += deltaTotals.testCases; - m_reporter.testCaseEnded( new TestCaseStats( testInfo, + m_reporter->testCaseEnded( new TestCaseStats( testInfo, deltaTotals, redirectedCout, redirectedCerr, @@ -170,13 +170,13 @@ namespace Catch { std::vector::const_iterator it = m_scopedInfos.begin(); std::vector::const_iterator itEnd = m_scopedInfos.end(); for(; it != itEnd; ++it ) - m_reporter.assertionEnded( new AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); + m_reporter->assertionEnded( new AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); std::vector::const_iterator itEnd = m_assertionResults.end(); for(; it != itEnd; ++it ) - m_reporter.assertionEnded( new AssertionStats( *it, m_totals ) ); + m_reporter->assertionEnded( new AssertionStats( *it, m_totals ) ); } m_assertionResults.clear(); } @@ -187,7 +187,7 @@ namespace Catch { m_totals.assertions.info++; } else - m_reporter.assertionEnded( new AssertionStats( result, m_totals ) ); + m_reporter->assertionEnded( new AssertionStats( result, m_totals ) ); // Reset AssertionInfo m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); @@ -207,7 +207,7 @@ namespace Catch { m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; - m_reporter.sectionStarting( sectionInfo ); + m_reporter->sectionStarting( sectionInfo ); assertions = m_totals.assertions; @@ -227,7 +227,7 @@ namespace Catch { } m_runningTest->endSection( info.name ); - m_reporter.sectionEnded( new SectionStats( info, assertions, missingAssertions ) ); + m_reporter->sectionEnded( new SectionStats( info, assertions, missingAssertions ) ); } virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { @@ -281,7 +281,7 @@ namespace Catch { try { m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getTestCaseInfo().lineInfo, "", ResultDisposition::Normal ); m_runningTest->reset(); - if( m_reporter.getPreferences().shouldRedirectStdOut ) { + if( m_reporter->getPreferences().shouldRedirectStdOut ) { StreamRedirect coutRedir( std::cout, redirectedCout ); StreamRedirect cerrRedir( std::cerr, redirectedCerr ); m_runningTest->getTestCase().invoke(); @@ -309,7 +309,7 @@ namespace Catch { const Config& m_config; Totals m_totals; - LegacyReporterAdapter m_reporter; + Ptr m_reporter; std::vector m_scopedInfos; std::vector m_assertionResults; IRunner* m_prevRunner; diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index 244cd822..3182b884 100644 --- a/projects/SelfTest/catch_self_test.cpp +++ b/projects/SelfTest/catch_self_test.cpp @@ -24,7 +24,7 @@ namespace Catch{ // Scoped because Runner doesn't report EndTesting until its destructor { - Runner runner( config, m_reporter.get() ); + Runner runner( config, new LegacyReporterAdapter( m_reporter.get(), ReporterConfig( config.stream(), config.data() ) ) ); totals = runner.runMatching( rawTestSpec ); } m_output = oss.str(); From 8255acf88fa86e1e7d80ab48d7ee1d1c8b05b57a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 30 Nov 2012 19:29:03 +0000 Subject: [PATCH 074/296] =?UTF-8?q?IStreamingReporter=20is=20now=20the=20d?= =?UTF-8?q?efault.=20Use=20REGISTER=5FLEGACY=5FREPORTER=20to=20register?= =?UTF-8?q?=E2=80=A6=20you=20guessed=20it:=20legacy=20reporters=20The=20bu?= =?UTF-8?q?ilt-in=20reporters=20are=20still=20legacy=20at=20the=20moment.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/catch.hpp | 2 ++ include/internal/catch_impl.hpp | 6 +++--- include/internal/catch_reporter_registrars.hpp | 15 +++++++++++++-- projects/SelfTest/catch_self_test.cpp | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index 54acd738..6fb0fd10 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -84,6 +84,7 @@ #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) +#define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) #define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) @@ -126,6 +127,7 @@ #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) +#define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) #define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 295bf773..014a6345 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -76,9 +76,9 @@ namespace Catch { void Config::dummy() {} - INTERNAL_CATCH_REGISTER_REPORTER( "basic", BasicReporter ) - INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter ) - INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter ) + INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "basic", BasicReporter ) + INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "xml", XmlReporter ) + INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "junit", JunitReporter ) } diff --git a/include/internal/catch_reporter_registrars.hpp b/include/internal/catch_reporter_registrars.hpp index 77ed5374..3496999f 100644 --- a/include/internal/catch_reporter_registrars.hpp +++ b/include/internal/catch_reporter_registrars.hpp @@ -38,6 +38,17 @@ namespace Catch { class ReporterFactory : public IReporterFactory { + // *** Please Note ***: + // - If you end up here looking at a compiler error because it's trying to register + // your custom reporter class be aware that the native reporter interface has changed + // to IStreamingReporter. The "legacy" interface, IReporter, is still supported via + // an adapter. Just use REGISTER_LEGACY_REPORTER to take advantage of the adapter. + // However please consider updating to the new interface as the old one is now + // deprecated and will probably be removed quite soon! + // Please contact me via github if you have any questions at all about this. + // In fact, ideally, please contact me anyway to let me know you've hit this - as I have + // no idea who is actually using custom reporters at all (possibly no-one!). + // The new interface is designed to minimise exposure to interface changes in the future. virtual IStreamingReporter* create( const ReporterConfig& config ) const { return new T( config ); } @@ -55,9 +66,9 @@ namespace Catch { }; } -#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \ +#define INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) \ Catch::LegacyReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); -#define INTERNAL_CATCH_REGISTER_REPORTER2( name, reporterType ) \ +#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \ Catch::ReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); #endif // TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index 3182b884..f2bfb8db 100644 --- a/projects/SelfTest/catch_self_test.cpp +++ b/projects/SelfTest/catch_self_test.cpp @@ -106,6 +106,6 @@ namespace Catch{ const std::string MockReporter::recordTestCases = "[tc]"; const std::string MockReporter::recordSections =" [s]"; - INTERNAL_CATCH_REGISTER_REPORTER( "mock", MockReporter ) + INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "mock", MockReporter ) } From 37ce023a300af6ec1de825929c8e0c7afc853c1e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 1 Dec 2012 09:13:36 +0000 Subject: [PATCH 075/296] Removed mocked output logging tests in favour of approval tests --- projects/SelfTest/Baselines/results.txt | 596 ++++++++---------------- projects/SelfTest/ExceptionTests.cpp | 23 - projects/SelfTest/MiscTests.cpp | 30 -- projects/SelfTest/TestMain.cpp | 2 +- projects/SelfTest/catch_self_test.cpp | 82 +--- projects/SelfTest/catch_self_test.hpp | 136 ++---- 6 files changed, 237 insertions(+), 632 deletions(-) diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index 8b19b879..e778487a 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -283,47 +283,8 @@ No assertions in section, 'the section2' ExceptionTests.cpp:132: Unexpected exception with message: 'Exception from section' [Finished: './failing/exceptions/in-section' 1 test case failed (All 2 assertions failed)] -[Running: ./succeeding/exceptions/error messages] -[Started section: 'custom, unexpected'] -ExceptionTests.cpp:152: runner.getLog() Contains( "custom exception" ) succeeded for: -"\[g] ./failing/exceptions/custom - \[tc] ./failing/exceptions/custom -ExceptionTests.cpp:102: 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'] -ExceptionTests.cpp:160: 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 -ExceptionTests.cpp:132: ThrewException'Exception from section' \ [s] the section - / [s] the section - /[tc] ./failing/exceptions/in-section -/[g] ./failing/exceptions/in-section -" contains: "Exception from section" -ExceptionTests.cpp:161: 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 -ExceptionTests.cpp:132: ThrewException'Exception from section' \ [s] the section - / [s] the section - /[tc] ./failing/exceptions/in-section -/[g] ./failing/exceptions/in-section -ExceptionTests.cpp:132: " -[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] -ExceptionTests.cpp:172: thisFunctionNotImplemented( 7 ) succeeded +ExceptionTests.cpp:149: thisFunctionNotImplemented( 7 ) succeeded [Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/generators/1] @@ -631,72 +592,30 @@ No assertions in section, 'f (leaf)' [Finished: './Sections/nested/a/b' 1 test case failed (All 3 assertions failed)] -[Running: Sections/nested3] -MiscTests.cpp:119: runner.getLog() == "\\[g] ./Sections/nested/a/b\n" " \\[tc] ./Sections/nested/a/b\n" " \\ [s] c\n" " \\ [s] d (leaf)\n" " / [s] d (leaf)\n" " / [s] c\n" " \\ [s] c\n" " \\ [s] e (leaf)\n" " / [s] e (leaf)\n" " / [s] c\n" " \\ [s] c\n" " / [s] c\n" " \\ [s] f (leaf)\n" " / [s] f (leaf)\n" " /[tc] ./Sections/nested/a/b\n" "/[g] ./Sections/nested/a/b\n" succeeded for: - -"\[g] ./Sections/nested/a/b - \[tc] ./Sections/nested/a/b - \ [s] c - \ [s] d (leaf) - / [s] d (leaf) - / [s] c - \ [s] c - \ [s] e (leaf) - / [s] e (leaf) - / [s] c - \ [s] c - / [s] c - \ [s] f (leaf) - / [s] f (leaf) - /[tc] ./Sections/nested/a/b -/[g] ./Sections/nested/a/b -" -== -"\[g] ./Sections/nested/a/b - \[tc] ./Sections/nested/a/b - \ [s] c - \ [s] d (leaf) - / [s] d (leaf) - / [s] c - \ [s] c - \ [s] e (leaf) - / [s] e (leaf) - / [s] c - \ [s] c - / [s] c - \ [s] f (leaf) - / [s] f (leaf) - /[tc] ./Sections/nested/a/b -/[g] ./Sections/nested/a/b -" - - -[Finished: 'Sections/nested3' All tests passed (1 assertion in 1 test case)] - [Running: ./mixed/Misc/Sections/loops] [Started section: 's1'] -MiscTests.cpp:133: b > a failed for: 0 > 1 +MiscTests.cpp:103: b > a failed for: 0 > 1 [End of section: 's1' 1 assertion failed] [Finished: './mixed/Misc/Sections/loops' 1 test case failed (1 assertion failed)] [Running: ./mixed/Misc/loops] -MiscTests.cpp:144: [info: Testing if fib[0] (1) is even] -MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:144: [info: Testing if fib[1] (1) is even] -MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:145: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -MiscTests.cpp:144: [info: Testing if fib[2] (2) is even] -MiscTests.cpp:144: [info: Testing if fib[3] (3) is even] -MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:144: [info: Testing if fib[4] (5) is even] -MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:145: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -MiscTests.cpp:144: [info: Testing if fib[5] (8) is even] -MiscTests.cpp:144: [info: Testing if fib[6] (13) is even] -MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:144: [info: Testing if fib[7] (21) is even] -MiscTests.cpp:145: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:114: [info: Testing if fib[0] (1) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:114: [info: Testing if fib[1] (1) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +MiscTests.cpp:114: [info: Testing if fib[2] (2) is even] +MiscTests.cpp:114: [info: Testing if fib[3] (3) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:114: [info: Testing if fib[4] (5) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +MiscTests.cpp:114: [info: Testing if fib[5] (8) is even] +MiscTests.cpp:114: [info: Testing if fib[6] (13) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:114: [info: Testing if fib[7] (21) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 [Finished: './mixed/Misc/loops' 1 test case failed (6 of 8 assertions failed)] Some information An error @@ -708,34 +627,34 @@ No assertions in test case, './succeeding/Misc/stdout,stderr' [Finished: './succeeding/Misc/stdout,stderr' 1 test case failed (1 assertion failed)] [Running: ./succeeding/Misc/null strings] -MiscTests.cpp:163: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} -MiscTests.cpp:164: makeString( true ) == static_cast(__null) succeeded for: {null string} == {null string} +MiscTests.cpp:133: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} +MiscTests.cpp:134: 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] -MiscTests.cpp:169: [info: hi] -MiscTests.cpp:171: [info: i := 7] -MiscTests.cpp:172: false failed +MiscTests.cpp:139: [info: hi] +MiscTests.cpp:141: [info: i := 7] +MiscTests.cpp:142: false failed [Finished: './failing/info' 1 test case failed (1 assertion failed)] [Running: ./succeeding/checkedif] -MiscTests.cpp:177: flag succeeded for: true -MiscTests.cpp:185: testCheckedIf( true ) succeeded for: true +MiscTests.cpp:147: flag succeeded for: true +MiscTests.cpp:155: testCheckedIf( true ) succeeded for: true [Finished: './succeeding/checkedif' All tests passed (2 assertions in 1 test case)] [Running: ./failing/checkedif] -MiscTests.cpp:177: flag failed for: false -MiscTests.cpp:190: testCheckedIf( false ) failed for: false +MiscTests.cpp:147: flag failed for: false +MiscTests.cpp:160: testCheckedIf( false ) failed for: false [Finished: './failing/checkedif' 1 test case failed (All 2 assertions failed)] [Running: ./succeeding/checkedelse] -MiscTests.cpp:195: flag succeeded for: true -MiscTests.cpp:203: testCheckedElse( true ) succeeded for: true +MiscTests.cpp:165: flag succeeded for: true +MiscTests.cpp:173: testCheckedElse( true ) succeeded for: true [Finished: './succeeding/checkedelse' All tests passed (2 assertions in 1 test case)] [Running: ./failing/checkedelse] -MiscTests.cpp:195: flag failed for: false -MiscTests.cpp:208: testCheckedElse( false ) failed for: false +MiscTests.cpp:165: flag failed for: false +MiscTests.cpp:178: testCheckedElse( false ) failed for: false [Finished: './failing/checkedelse' 1 test case failed (All 2 assertions failed)] [Running: ./misc/xmlentitycheck] @@ -754,68 +673,68 @@ No assertions in section, 'encoded chars' [Finished: './misc/xmlentitycheck' 1 test case failed (All 2 assertions failed)] [Running: ./manual/onechar] -MiscTests.cpp:225: [info: 3] -MiscTests.cpp:226: false failed +MiscTests.cpp:195: [info: 3] +MiscTests.cpp:196: false failed [Finished: './manual/onechar' 1 test case failed (1 assertion failed)] [Running: ./succeeding/atomic if] -MiscTests.cpp:236: x == 0 succeeded for: 0 == 0 +MiscTests.cpp:206: x == 0 succeeded for: 0 == 0 [Finished: './succeeding/atomic if' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/matchers] -MiscTests.cpp:246: testStringForMatching() Contains( "string" ) succeeded for: +MiscTests.cpp:216: testStringForMatching() Contains( "string" ) succeeded for: "this string contains 'abc' as a substring" contains: "string" -MiscTests.cpp:247: testStringForMatching() Contains( "abc" ) succeeded for: +MiscTests.cpp:217: testStringForMatching() Contains( "abc" ) succeeded for: "this string contains 'abc' as a substring" contains: "abc" -MiscTests.cpp:249: testStringForMatching() StartsWith( "this" ) succeeded for: +MiscTests.cpp:219: testStringForMatching() StartsWith( "this" ) succeeded for: "this string contains 'abc' as a substring" starts with: "this" -MiscTests.cpp:250: testStringForMatching() EndsWith( "substring" ) succeeded for: +MiscTests.cpp:220: 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] -MiscTests.cpp:255: testStringForMatching() Contains( "not there" ) failed for: +MiscTests.cpp:225: 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] -MiscTests.cpp:260: testStringForMatching() StartsWith( "string" ) failed for: +MiscTests.cpp:230: 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] -MiscTests.cpp:265: testStringForMatching() EndsWith( "this" ) failed for: +MiscTests.cpp:235: 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] -MiscTests.cpp:270: testStringForMatching() Equals( "something else" ) failed for: +MiscTests.cpp:240: 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/AllOf] -MiscTests.cpp:275: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: +MiscTests.cpp:245: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) [Finished: '/succeeding/matchers/AllOf' All tests passed (1 assertion in 1 test case)] [Running: /succeeding/matchers/AnyOf] -MiscTests.cpp:279: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: +MiscTests.cpp:249: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -MiscTests.cpp:280: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: +MiscTests.cpp:250: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) [Finished: '/succeeding/matchers/AnyOf' All tests passed (2 assertions in 1 test case)] [Running: ./succeeding/matchers/Equals] -MiscTests.cpp:285: testStringForMatching() Equals( "this string contains 'abc' as a substring" ) succeeded for: +MiscTests.cpp:255: 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: example/factorial] -MiscTests.cpp:296: Factorial(0) == 1 succeeded for: 1 == 1 -MiscTests.cpp:297: Factorial(1) == 1 succeeded for: 1 == 1 -MiscTests.cpp:298: Factorial(2) == 2 succeeded for: 2 == 2 -MiscTests.cpp:299: Factorial(3) == 6 succeeded for: 6 == 6 -MiscTests.cpp:300: Factorial(10) == 3628800 succeeded for: 0x == 3628800 +MiscTests.cpp:266: Factorial(0) == 1 succeeded for: 1 == 1 +MiscTests.cpp:267: Factorial(1) == 1 succeeded for: 1 == 1 +MiscTests.cpp:268: Factorial(2) == 2 succeeded for: 2 == 2 +MiscTests.cpp:269: Factorial(3) == 6 succeeded for: 6 == 6 +MiscTests.cpp:270: Factorial(10) == 3628800 succeeded for: 0x == 3628800 [Finished: 'example/factorial' All tests passed (5 assertions in 1 test case)] [Running: empty] @@ -825,7 +744,7 @@ No assertions in test case, 'empty' [Finished: 'empty' 1 test case failed (1 assertion failed)] [Running: Nice descriptive name] -MiscTests.cpp:309: [warning: This one ran] +MiscTests.cpp:279: [warning: This one ran] No assertions in test case, 'Nice descriptive name' @@ -846,57 +765,57 @@ No assertions in test case, 'second tag' [Running: selftest/main] [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/failing tests'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:182: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] [End of section: 'selftest/expected result/failing tests' All 26 assertions passed] @@ -904,101 +823,99 @@ No assertions in test case, 'second tag' [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/succeeding tests'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded -[with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] Message from section one Message from section two -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] Some information An error -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:170: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -[End of section: 'selftest/expected result/succeeding tests' All 44 assertions passed] +[End of section: 'selftest/expected result/succeeding tests' All 43 assertions passed] -[End of section: 'selftest/expected result' All 44 assertions passed] +[End of section: 'selftest/expected result' All 43 assertions passed] Message from section one Message from section two @@ -1006,7 +923,7 @@ Some information An error [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/succeeding tests'] -TestMain.cpp:40: totals.assertions.passed == 294 succeeded for: 294 == 294 +TestMain.cpp:40: totals.assertions.passed == 291 succeeded for: 291 == 291 TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 [End of section: 'selftest/test counts/succeeding tests' All 2 assertions passed] @@ -1020,7 +937,7 @@ TestMain.cpp:48: totals.assertions.failed == 73 succeeded for: 73 == 73 [End of section: 'selftest/test counts' All 2 assertions passed] -[Finished: 'selftest/main' All tests passed (74 assertions in 1 test case)] +[Finished: 'selftest/main' All tests passed (73 assertions in 1 test case)] [Running: meta/Misc/Sections] TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 @@ -1433,13 +1350,13 @@ BDDTests.cpp:37: itDoesThis() succeeded for: true [End of section: 'This stuff exists' 1 assertion passed] [Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 45 of 98 test cases failed (103 of 615 assertions failed)] +[End of group: '~dummy'. 45 of 96 test cases failed (103 of 610 assertions failed)] -[Testing completed. 45 of 98 test cases failed (103 of 615 assertions failed)] +[Testing completed. 45 of 96 test cases failed (103 of 610 assertions failed)] - + @@ -1659,7 +1576,6 @@ ExceptionTests.cpp:118: ExceptionTests.cpp:132: - @@ -1739,54 +1655,53 @@ MiscTests.cpp:61: - -MiscTests.cpp:133: +MiscTests.cpp:103: -MiscTests.cpp:144: +MiscTests.cpp:114: -MiscTests.cpp:145: +MiscTests.cpp:115: -MiscTests.cpp:144: +MiscTests.cpp:114: -MiscTests.cpp:145: +MiscTests.cpp:115: -MiscTests.cpp:144: +MiscTests.cpp:114: -MiscTests.cpp:144: +MiscTests.cpp:114: -MiscTests.cpp:145: +MiscTests.cpp:115: -MiscTests.cpp:144: +MiscTests.cpp:114: -MiscTests.cpp:145: +MiscTests.cpp:115: -MiscTests.cpp:144: +MiscTests.cpp:114: -MiscTests.cpp:144: +MiscTests.cpp:114: -MiscTests.cpp:145: +MiscTests.cpp:115: -MiscTests.cpp:144: +MiscTests.cpp:114: -MiscTests.cpp:145: +MiscTests.cpp:115: @@ -1800,62 +1715,62 @@ An error -MiscTests.cpp:169: +MiscTests.cpp:139: -MiscTests.cpp:171: +MiscTests.cpp:141: -MiscTests.cpp:172: +MiscTests.cpp:142: -MiscTests.cpp:177: +MiscTests.cpp:147: -MiscTests.cpp:190: +MiscTests.cpp:160: -MiscTests.cpp:195: +MiscTests.cpp:165: -MiscTests.cpp:208: +MiscTests.cpp:178: -MiscTests.cpp:225: +MiscTests.cpp:195: -MiscTests.cpp:226: +MiscTests.cpp:196: -MiscTests.cpp:255: +MiscTests.cpp:225: -MiscTests.cpp:260: +MiscTests.cpp:230: -MiscTests.cpp:265: +MiscTests.cpp:235: -MiscTests.cpp:270: +MiscTests.cpp:240: @@ -1865,7 +1780,7 @@ MiscTests.cpp:270: -MiscTests.cpp:309: +MiscTests.cpp:279: @@ -3389,65 +3304,8 @@ ExceptionTests.cpp" line="132"> - -
-ExceptionTests.cpp" line="152"> - - runner.getLog() Contains( "custom exception" ) - - - "\[g] ./failing/exceptions/custom - \[tc] ./failing/exceptions/custom -ExceptionTests.cpp:102: ThrewException'custom exception' /[tc] ./failing/exceptions/custom -/[g] ./failing/exceptions/custom -" contains: "custom exception" - - - -
-
-ExceptionTests.cpp" line="160"> - - runner.getLog() Contains( "Exception from section" ) - - - "\[g] ./failing/exceptions/in-section - \[tc] ./failing/exceptions/in-section - \ [s] the section - \ [s] the section2 - / [s] the section2 - / [s] the section -ExceptionTests.cpp:132: ThrewException'Exception from section' \ [s] the section - / [s] the section - /[tc] ./failing/exceptions/in-section -/[g] ./failing/exceptions/in-section -" contains: "Exception from section" - - -ExceptionTests.cpp" line="161"> - - runner.getLog() Contains( ::Catch::LineInfoRegistry::get().infoForName( "the section2" ) ) - - - "\[g] ./failing/exceptions/in-section - \[tc] ./failing/exceptions/in-section - \ [s] the section - \ [s] the section2 - / [s] the section2 - / [s] the section -ExceptionTests.cpp:132: ThrewException'Exception from section' \ [s] the section - / [s] the section - /[tc] ./failing/exceptions/in-section -/[g] ./failing/exceptions/in-section -ExceptionTests.cpp:132: " - - - -
- -
-ExceptionTests.cpp" line="172"> +ExceptionTests.cpp" line="149"> thisFunctionNotImplemented( 7 ) @@ -4968,57 +4826,9 @@ MiscTests.cpp" line="70"> - -MiscTests.cpp" line="119"> - - runner.getLog() == "\\[g] ./Sections/nested/a/b\n" " \\[tc] ./Sections/nested/a/b\n" " \\ [s] c\n" " \\ [s] d (leaf)\n" " / [s] d (leaf)\n" " / [s] c\n" " \\ [s] c\n" " \\ [s] e (leaf)\n" " / [s] e (leaf)\n" " / [s] c\n" " \\ [s] c\n" " / [s] c\n" " \\ [s] f (leaf)\n" " / [s] f (leaf)\n" " /[tc] ./Sections/nested/a/b\n" "/[g] ./Sections/nested/a/b\n" - - - -"\[g] ./Sections/nested/a/b - \[tc] ./Sections/nested/a/b - \ [s] c - \ [s] d (leaf) - / [s] d (leaf) - / [s] c - \ [s] c - \ [s] e (leaf) - / [s] e (leaf) - / [s] c - \ [s] c - / [s] c - \ [s] f (leaf) - / [s] f (leaf) - /[tc] ./Sections/nested/a/b -/[g] ./Sections/nested/a/b -" -== -"\[g] ./Sections/nested/a/b - \[tc] ./Sections/nested/a/b - \ [s] c - \ [s] d (leaf) - / [s] d (leaf) - / [s] c - \ [s] c - \ [s] e (leaf) - / [s] e (leaf) - / [s] c - \ [s] c - / [s] c - \ [s] f (leaf) - / [s] f (leaf) - /[tc] ./Sections/nested/a/b -/[g] ./Sections/nested/a/b -" - - - - - -
-MiscTests.cpp" line="133"> +MiscTests.cpp" line="103"> b > a @@ -5034,7 +4844,7 @@ MiscTests.cpp" line="133"> Testing if fib[0] (1) is even -MiscTests.cpp" line="145"> +MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -5045,7 +4855,7 @@ MiscTests.cpp" line="145"> Testing if fib[1] (1) is even -MiscTests.cpp" line="145"> +MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -5053,7 +4863,7 @@ MiscTests.cpp" line="145"> 1 == 0 -MiscTests.cpp" line="145"> +MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -5067,7 +4877,7 @@ MiscTests.cpp" line="145"> Testing if fib[3] (3) is even -MiscTests.cpp" line="145"> +MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -5078,7 +4888,7 @@ MiscTests.cpp" line="145"> Testing if fib[4] (5) is even -MiscTests.cpp" line="145"> +MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -5086,7 +4896,7 @@ MiscTests.cpp" line="145"> 1 == 0 -MiscTests.cpp" line="145"> +MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -5100,7 +4910,7 @@ MiscTests.cpp" line="145"> Testing if fib[6] (13) is even -MiscTests.cpp" line="145"> +MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -5111,7 +4921,7 @@ MiscTests.cpp" line="145"> Testing if fib[7] (21) is even -MiscTests.cpp" line="145"> +MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -5125,7 +4935,7 @@ MiscTests.cpp" line="145"> -MiscTests.cpp" line="163"> +MiscTests.cpp" line="133"> makeString( false ) != static_cast<char*>(__null) @@ -5133,7 +4943,7 @@ MiscTests.cpp" line="163"> "valid string" != {null string} -MiscTests.cpp" line="164"> +MiscTests.cpp" line="134"> makeString( true ) == static_cast<char*>(__null) @@ -5150,7 +4960,7 @@ MiscTests.cpp" line="164"> i := 7 -MiscTests.cpp" line="172"> +MiscTests.cpp" line="142"> false @@ -5161,7 +4971,7 @@ MiscTests.cpp" line="172"> -MiscTests.cpp" line="177"> +MiscTests.cpp" line="147"> flag @@ -5169,7 +4979,7 @@ MiscTests.cpp" line="177"> true -MiscTests.cpp" line="185"> +MiscTests.cpp" line="155"> testCheckedIf( true ) @@ -5180,7 +4990,7 @@ MiscTests.cpp" line="185"> -MiscTests.cpp" line="177"> +MiscTests.cpp" line="147"> flag @@ -5188,7 +4998,7 @@ MiscTests.cpp" line="177"> false -MiscTests.cpp" line="190"> +MiscTests.cpp" line="160"> testCheckedIf( false ) @@ -5199,7 +5009,7 @@ MiscTests.cpp" line="190"> -MiscTests.cpp" line="195"> +MiscTests.cpp" line="165"> flag @@ -5207,7 +5017,7 @@ MiscTests.cpp" line="195"> true -MiscTests.cpp" line="203"> +MiscTests.cpp" line="173"> testCheckedElse( true ) @@ -5218,7 +5028,7 @@ MiscTests.cpp" line="203"> -MiscTests.cpp" line="195"> +MiscTests.cpp" line="165"> flag @@ -5226,7 +5036,7 @@ MiscTests.cpp" line="195"> false -MiscTests.cpp" line="208"> +MiscTests.cpp" line="178"> testCheckedElse( false ) @@ -5249,7 +5059,7 @@ MiscTests.cpp" line="208"> 3 -MiscTests.cpp" line="226"> +MiscTests.cpp" line="196"> false @@ -5260,7 +5070,7 @@ MiscTests.cpp" line="226"> -MiscTests.cpp" line="236"> +MiscTests.cpp" line="206"> x == 0 @@ -5271,7 +5081,7 @@ MiscTests.cpp" line="236"> -MiscTests.cpp" line="246"> +MiscTests.cpp" line="216"> testStringForMatching() Contains( "string" ) @@ -5279,7 +5089,7 @@ MiscTests.cpp" line="246"> "this string contains 'abc' as a substring" contains: "string" -MiscTests.cpp" line="247"> +MiscTests.cpp" line="217"> testStringForMatching() Contains( "abc" ) @@ -5287,7 +5097,7 @@ MiscTests.cpp" line="247"> "this string contains 'abc' as a substring" contains: "abc" -MiscTests.cpp" line="249"> +MiscTests.cpp" line="219"> testStringForMatching() StartsWith( "this" ) @@ -5295,7 +5105,7 @@ MiscTests.cpp" line="249"> "this string contains 'abc' as a substring" starts with: "this" -MiscTests.cpp" line="250"> +MiscTests.cpp" line="220"> testStringForMatching() EndsWith( "substring" ) @@ -5306,7 +5116,7 @@ MiscTests.cpp" line="250"> -MiscTests.cpp" line="255"> +MiscTests.cpp" line="225"> testStringForMatching() Contains( "not there" ) @@ -5317,7 +5127,7 @@ MiscTests.cpp" line="255"> -MiscTests.cpp" line="260"> +MiscTests.cpp" line="230"> testStringForMatching() StartsWith( "string" ) @@ -5328,7 +5138,7 @@ MiscTests.cpp" line="260"> -MiscTests.cpp" line="265"> +MiscTests.cpp" line="235"> testStringForMatching() EndsWith( "this" ) @@ -5339,7 +5149,7 @@ MiscTests.cpp" line="265"> -MiscTests.cpp" line="270"> +MiscTests.cpp" line="240"> testStringForMatching() Equals( "something else" ) @@ -5350,7 +5160,7 @@ MiscTests.cpp" line="270"> -MiscTests.cpp" line="275"> +MiscTests.cpp" line="245"> testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) @@ -5361,7 +5171,7 @@ MiscTests.cpp" line="275"> -MiscTests.cpp" line="279"> +MiscTests.cpp" line="249"> testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) @@ -5369,7 +5179,7 @@ MiscTests.cpp" line="279"> "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -MiscTests.cpp" line="280"> +MiscTests.cpp" line="250"> testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) @@ -5380,7 +5190,7 @@ MiscTests.cpp" line="280"> -MiscTests.cpp" line="285"> +MiscTests.cpp" line="255"> testStringForMatching() Equals( "this string contains 'abc' as a substring" ) @@ -5391,7 +5201,7 @@ MiscTests.cpp" line="285"> -MiscTests.cpp" line="296"> +MiscTests.cpp" line="266"> Factorial(0) == 1 @@ -5399,7 +5209,7 @@ MiscTests.cpp" line="296"> 1 == 1 -MiscTests.cpp" line="297"> +MiscTests.cpp" line="267"> Factorial(1) == 1 @@ -5407,7 +5217,7 @@ MiscTests.cpp" line="297"> 1 == 1 -MiscTests.cpp" line="298"> +MiscTests.cpp" line="268"> Factorial(2) == 2 @@ -5415,7 +5225,7 @@ MiscTests.cpp" line="298"> 2 == 2 -MiscTests.cpp" line="299"> +MiscTests.cpp" line="269"> Factorial(3) == 6 @@ -5423,7 +5233,7 @@ MiscTests.cpp" line="299"> 6 == 6 -MiscTests.cpp" line="300"> +MiscTests.cpp" line="270"> Factorial(10) == 3628800 @@ -5457,9 +5267,9 @@ MiscTests.cpp" line="300">
- +
- +
@@ -5468,10 +5278,10 @@ MiscTests.cpp" line="300">
TestMain.cpp" line="40"> - totals.assertions.passed == 294 + totals.assertions.passed == 291 - 294 == 294 + 291 == 291 TestMain.cpp" line="41"> @@ -6904,7 +6714,7 @@ BDDTests.cpp" line="37">
- + - + diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp index 7747eb73..eeab679b 100644 --- a/projects/SelfTest/ExceptionTests.cpp +++ b/projects/SelfTest/ExceptionTests.cpp @@ -140,29 +140,6 @@ TEST_CASE( "./failing/exceptions/in-section", "Exceptions thrown from sections r #pragma GCC diagnostic pop #endif -TEST_CASE( "./succeeding/exceptions/error messages", "The error messages produced by exceptions caught by Catch matched the expected form" ) -{ - Catch::EmbeddedRunner runner; - using namespace Catch::Matchers; - - SECTION( "custom, unexpected", "" ) - { - runner.runMatching( "./failing/exceptions/custom" ); -// CHECK_THAT( runner.getLog(), Contains( "Unexpected exception" ) ); // Mock reporter doesn't say this - CHECK_THAT( runner.getLog(), Contains( "custom exception" ) ); - } - - SECTION( "in section", "" ) - { - runner.runMatching( "./failing/exceptions/in-section" ); - 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_THAT( runner.getLog(), Contains( CATCH_GET_LINE_INFO( "the section2" ) ) ); - } - -} - inline int thisFunctionNotImplemented( int ) { CATCH_NOT_IMPLEMENTED; } diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index 34915069..b1cf90ff 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -90,36 +90,6 @@ TEST_CASE( "./Sections/nested/a/b", "nested SECTION tests" ) } } -TEST_CASE( "Sections/nested3", "nested SECTION tests" ) -{ - Catch::EmbeddedRunner runner; - - runner.runMatching( "./Sections/nested/a/b", "mock" ); - CHECK( runner.getLog() == - "\\[g] ./Sections/nested/a/b\n" - " \\[tc] ./Sections/nested/a/b\n" - - " \\ [s] c\n" - " \\ [s] d (leaf)\n" - " / [s] d (leaf)\n" - " / [s] c\n" - - " \\ [s] c\n" - " \\ [s] e (leaf)\n" - " / [s] e (leaf)\n" - " / [s] c\n" - - " \\ [s] c\n" - " / [s] c\n" - - " \\ [s] f (leaf)\n" - " / [s] f (leaf)\n" - - " /[tc] ./Sections/nested/a/b\n" - "/[g] ./Sections/nested/a/b\n" ); - -} - TEST_CASE( "./mixed/Misc/Sections/loops", "looped SECTION tests" ) { int a = 1; diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 19fcbd48..e2eeebce 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 == 294 ); + CHECK( totals.assertions.passed == 291 ); CHECK( totals.assertions.failed == 0 ); } diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index f2bfb8db..81bc7e23 100644 --- a/projects/SelfTest/catch_self_test.cpp +++ b/projects/SelfTest/catch_self_test.cpp @@ -15,6 +15,8 @@ namespace Catch{ + NullStreamingReporter::~NullStreamingReporter() {} + Totals EmbeddedRunner::runMatching( const std::string& rawTestSpec, const std::string& ) { std::ostringstream oss; Config config; @@ -24,88 +26,10 @@ namespace Catch{ // Scoped because Runner doesn't report EndTesting until its destructor { - Runner runner( config, new LegacyReporterAdapter( m_reporter.get(), ReporterConfig( config.stream(), config.data() ) ) ); + Runner runner( config, m_reporter.get() ); totals = runner.runMatching( rawTestSpec ); } - m_output = oss.str(); return totals; } - - void MockReporter::Result( const AssertionResult& assertionResult ) { - if( assertionResult.getResultType() == ResultWas::Ok ) - return; - m_log << assertionResult.getSourceInfo() << " "; - - switch( assertionResult.getResultType() ) { - case ResultWas::Info: - m_log << "Info"; - break; - case ResultWas::Warning: - m_log << "Warning"; - break; - case ResultWas::ExplicitFailure: - m_log << "ExplicitFailure"; - break; - case ResultWas::ExpressionFailed: - m_log << "ExpressionFailed"; - break; - case ResultWas::Unknown: - m_log << "Unknown"; - break; - case ResultWas::ThrewException: - m_log << "ThrewException"; - break; - case ResultWas::DidntThrowException: - m_log << "DidntThrowException"; - break; - - // We shouldn't ever see these - case ResultWas::Ok: - m_log << "Ok"; - break; - case ResultWas::FailureBit: - m_log << "FailureBit"; - break; - case ResultWas::Exception: - m_log << "Exception"; - break; - } - - if( assertionResult.hasExpression() ) - m_log << assertionResult.getExpression(); - - if( assertionResult.hasMessage() ) - m_log << "'" << assertionResult.getMessage() << "'"; - - if( assertionResult.hasExpandedExpression() ) - m_log << assertionResult.getExpandedExpression(); - } - - void MockReporter::openLabel( const std::string& label, const std::string& arg ) { - if( shouldRecord( label ) ) { - m_log << m_indent << "\\" << label; - if( !arg.empty() ) - m_log << " " << arg; - m_log << "\n"; - m_indent += " "; - } - } - - void MockReporter::closeLabel( const std::string& label, const std::string& arg ) { - if( shouldRecord( label ) ) { - m_indent = m_indent.substr( 0, m_indent.size()-1 ); - m_log << m_indent << "/" << label; - if( !arg.empty() ) - m_log << " " << arg; - m_log << "\n"; - } - } - - const std::string MockReporter::recordGroups = "[g]"; - const std::string MockReporter::recordTestCases = "[tc]"; - const std::string MockReporter::recordSections =" [s]"; - - INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "mock", MockReporter ) - } diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index 6f926814..8c7dc67f 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -20,121 +20,43 @@ namespace Catch { - class MockReporter : public SharedImpl { + class NullStreamingReporter : public SharedImpl { public: - - static const std::string recordGroups; - static const std::string recordTestCases; - static const std::string recordSections; - - void recordAll() { - addRecorder( recordGroups ); - addRecorder( recordTestCases ); - addRecorder( recordSections ); - } - - MockReporter( const ReporterConfig& ) { - recordAll(); - } - - MockReporter() { - recordAll(); - } - - void addRecorder( const std::string& recorder ) { - m_recorders.insert( recorder ); - } - + + virtual ~NullStreamingReporter(); + static std::string getDescription() { - return "mock reporter"; + return "null reporter"; } - std::string getLog() const { - return m_log.str(); - } + private: // IStreamingReporter - private: // IReporter - - virtual bool shouldRedirectStdout() const { - return false; - } - - virtual void StartTesting() {} - - virtual void EndTesting( const Totals& ) {} - - virtual void StartGroup( const std::string& groupName ) { - openLabel( recordGroups, groupName ); - } - - virtual void EndGroup( const std::string& groupName, const Totals& ) { - closeLabel( recordGroups, groupName ); - } - - virtual void StartSection( const std::string& sectionName, const std::string& ) { - openLabel( recordSections, sectionName ); + virtual ReporterPreferences getPreferences() const { + return ReporterPreferences(); } - virtual void NoAssertionsInSection( const std::string& ) {} - virtual void NoAssertionsInTestCase( const std::string& ) {} - - virtual void EndSection( const std::string& sectionName, const Counts& ) { - closeLabel( recordSections, sectionName ); - } - - virtual void StartTestCase( const TestCaseInfo& testInfo ) { - openLabel( recordTestCases, testInfo.name ); - } - - virtual void Aborted(){} - - virtual void EndTestCase( const TestCaseInfo& testInfo, - const Totals&, - const std::string&, - const std::string& ) { - closeLabel( recordTestCases, testInfo.name ); - } - - virtual void Result( const AssertionResult& assertionResult ); - - - private: - - bool shouldRecord( const std::string& recorder ) const { - return m_recorders.find( recorder ) != m_recorders.end(); - } - - void openLabel( const std::string& label, const std::string& arg = "" ); - void closeLabel( const std::string& label, const std::string& arg = "" ); - - std::string m_indent; - std::ostringstream m_log; - std::set m_recorders; + virtual void testRunStarting( std::string const& ) {} + virtual void testGroupStarting( std::string const& ) {} + virtual void testCaseStarting( TestCaseInfo const& ) {} + virtual void sectionStarting( SectionInfo const& ) {} + virtual void assertionStarting( AssertionInfo const& ) {} + virtual void assertionEnded( Ptr const& ) {} + virtual void sectionEnded( Ptr const& ) {} + virtual void testCaseEnded( Ptr const& ) {} + virtual void testGroupEnded( Ptr const& ) {} + virtual void testRunEnded( Ptr const& ) {} }; - + class EmbeddedRunner { public: - EmbeddedRunner() : m_reporter( new MockReporter() ) {} + EmbeddedRunner() : m_reporter( new NullStreamingReporter() ) {} Totals runMatching( const std::string& rawTestSpec, const std::string& reporter = "basic" ); - std::string getOutput() { - return m_output; - } - - void addRecorder( const std::string& recorder ) { - m_reporter->addRecorder( recorder ); - } - - std::string getLog() const { - return m_reporter->getLog(); - } - private: - std::string m_output; - Ptr m_reporter; + Ptr m_reporter; }; class MetaTestRunner { @@ -154,14 +76,17 @@ namespace Catch { } void operator()( const TestCase& testCase ) { - EmbeddedRunner runner; - std::string name = testCase.getTestCaseInfo().name; - Totals totals = runner.runMatching( name ); + std::string name; + Totals totals; + { + EmbeddedRunner runner; + name = testCase.getTestCaseInfo().name; + totals = runner.runMatching( name ); + } switch( m_expectedResult ) { case Expected::ToSucceed: if( totals.assertions.failed > 0 ) { - INFO( runner.getOutput() ); - FAIL( "Expected test case '" + FAIL( "Expected test case '" << name << "' to succeed but there was/ were " << totals.assertions.failed << " failure(s)" ); @@ -172,8 +97,7 @@ namespace Catch { break; case Expected::ToFail: if( totals.assertions.failed == 0 ) { - INFO( runner.getOutput() ); - FAIL( "Expected test case '" + FAIL( "Expected test case '" << name << "' to fail but there was/ were " << totals.assertions.passed << " success(es)" ); From 209e89bcb98ca38d8beab97860d12cf872bf6629 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 1 Dec 2012 19:09:01 +0000 Subject: [PATCH 076/296] Removed some more test cruft --- projects/SelfTest/Baselines/results.txt | 67 ++++++------------------- projects/SelfTest/ExceptionTests.cpp | 20 -------- projects/SelfTest/TestMain.cpp | 2 +- projects/SelfTest/catch_self_test.hpp | 2 +- 4 files changed, 18 insertions(+), 73 deletions(-) diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/results.txt index e778487a..195d532f 100644 --- a/projects/SelfTest/Baselines/results.txt +++ b/projects/SelfTest/Baselines/results.txt @@ -269,22 +269,8 @@ ExceptionTests.cpp:114: throw CustomException( "custom exception - not std" ) fa ExceptionTests.cpp:118: Unexpected exception with message: '3.14' [Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] -[Running: ./failing/exceptions/in-section] - -[Started section: 'the section'] -[Started section: 'the section2'] - -No assertions in section, 'the section2' - -[End of section: 'the section2' 1 assertion failed] - -[End of section: 'the section' 1 assertion failed] - -ExceptionTests.cpp:132: Unexpected exception with message: 'Exception from section' -[Finished: './failing/exceptions/in-section' 1 test case failed (All 2 assertions failed)] - [Running: ./succeeding/exceptions/notimplemented] -ExceptionTests.cpp:149: thisFunctionNotImplemented( 7 ) succeeded +ExceptionTests.cpp:129: thisFunctionNotImplemented( 7 ) succeeded [Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/generators/1] @@ -467,6 +453,7 @@ MessageTests.cpp:51: 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'] MessageTests.cpp:58: failed with message: 'Message from section one' [End of section: 'one' 1 assertion failed] @@ -815,11 +802,9 @@ No assertions in test case, 'second tag' [with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded -[with message: Tests failed, as expected] -[End of section: 'selftest/expected result/failing tests' All 26 assertions passed] +[End of section: 'selftest/expected result/failing tests' All 25 assertions passed] -[End of section: 'selftest/expected result' All 26 assertions passed] +[End of section: 'selftest/expected result' All 25 assertions passed] [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/succeeding tests'] @@ -932,12 +917,12 @@ TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/failing tests'] TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 -TestMain.cpp:48: totals.assertions.failed == 73 succeeded for: 73 == 73 +TestMain.cpp:48: totals.assertions.failed == 72 succeeded for: 72 == 72 [End of section: 'selftest/test counts/failing tests' All 2 assertions passed] [End of section: 'selftest/test counts' All 2 assertions passed] -[Finished: 'selftest/main' All tests passed (73 assertions in 1 test case)] +[Finished: 'selftest/main' All tests passed (72 assertions in 1 test case)] [Running: meta/Misc/Sections] TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 @@ -1350,13 +1335,13 @@ BDDTests.cpp:37: itDoesThis() succeeded for: true [End of section: 'This stuff exists' 1 assertion passed] [Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 45 of 96 test cases failed (103 of 610 assertions failed)] +[End of group: '~dummy'. 44 of 95 test cases failed (101 of 607 assertions failed)] -[Testing completed. 45 of 96 test cases failed (103 of 610 assertions failed)] +[Testing completed. 44 of 95 test cases failed (101 of 607 assertions failed)] - + @@ -1571,11 +1556,6 @@ ExceptionTests.cpp:114: ExceptionTests.cpp:118: - - -ExceptionTests.cpp:132: - - @@ -3289,23 +3269,8 @@ ExceptionTests.cpp" line="118"> - -
-
- -
- -
-ExceptionTests.cpp" line="132"> - Exception from section - -
- -
- -
-ExceptionTests.cpp" line="149"> +ExceptionTests.cpp" line="129"> thisFunctionNotImplemented( 7 ) @@ -5261,9 +5226,9 @@ MiscTests.cpp" line="270">
- +
- +
@@ -5308,10 +5273,10 @@ TestMain.cpp" line="47"> TestMain.cpp" line="48"> - totals.assertions.failed == 73 + totals.assertions.failed == 72 - 73 == 73 + 72 == 72 @@ -6714,7 +6679,7 @@ BDDTests.cpp" line="37">
- + - + diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp index eeab679b..fc20bde9 100644 --- a/projects/SelfTest/ExceptionTests.cpp +++ b/projects/SelfTest/ExceptionTests.cpp @@ -120,26 +120,6 @@ TEST_CASE_NORETURN( "./failing/exceptions/custom/double", "Unexpected custom exc throw double( 3.14 ); } -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-variable" -#endif - -TEST_CASE( "./failing/exceptions/in-section", "Exceptions thrown from sections report file/ line or section" ) -{ - SECTION( "the section", "" ) - { - CATCH_REGISTER_LINE_INFO( "the section2" ) SECTION( "the section2", "" ) - { - throw std::domain_error( "Exception from section" ); - } - } -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - inline int thisFunctionNotImplemented( int ) { CATCH_NOT_IMPLEMENTED; } diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index e2eeebce..2111ac22 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -45,7 +45,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" "Number of 'failing' tests is fixed" ) { Totals totals = runner.runMatching( "./failing/*" ); CHECK( totals.assertions.passed == 1 ); - CHECK( totals.assertions.failed == 73 ); + CHECK( totals.assertions.failed == 72 ); } } } diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index 8c7dc67f..f31d7eca 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -108,7 +108,7 @@ namespace Catch { break; } }; - + private: Expected::Result m_expectedResult; }; From 602880f5abc675ef1a82d43f49cd416539e2440d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 1 Dec 2012 19:11:06 +0000 Subject: [PATCH 077/296] Approval filenames are now approvedResults.txt and unapprovedResults.txt (only the former is checked in) --- approvalTests.py | 4 ++-- approve.py | 4 ++-- .../SelfTest/Baselines/{results.txt => approvedResults.txt} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename projects/SelfTest/Baselines/{results.txt => approvedResults.txt} (100%) diff --git a/approvalTests.py b/approvalTests.py index 09a104d9..ef9ddbf3 100644 --- a/approvalTests.py +++ b/approvalTests.py @@ -7,9 +7,9 @@ filenameParser = re.compile( r'\s*.*/(.*\.cpp)(.*)' ) hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' ) catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) -baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/results.txt' ) +baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedResults.txt' ) rawResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/_rawResults.tmp' ) -filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/newResults.txt' ) +filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) cmdPath = sys.argv[1] diff --git a/approve.py b/approve.py index 0d46ddae..83b25594 100644 --- a/approve.py +++ b/approve.py @@ -3,8 +3,8 @@ import sys import shutil catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) -baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/results.txt' ) -filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/newResults.txt' ) +baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedResults.txt' ) +filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) if os.path.isfile( filteredResultsPath ): os.remove( baselinesPath ) diff --git a/projects/SelfTest/Baselines/results.txt b/projects/SelfTest/Baselines/approvedResults.txt similarity index 100% rename from projects/SelfTest/Baselines/results.txt rename to projects/SelfTest/Baselines/approvedResults.txt From b56aaf4c36c4593e1b768deb9d396a3fdef867ac Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 1 Dec 2012 23:42:47 +0000 Subject: [PATCH 078/296] Version uses constructor instead of initialiser to avoid warnings --- generateSingleHeader.py | 4 ++-- include/catch_runner.hpp | 10 +++++----- include/internal/catch_version.h | 18 ++++++++++++++---- include/internal/catch_version.hpp | 2 +- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/generateSingleHeader.py b/generateSingleHeader.py index 835d7dad..caec29bd 100644 --- a/generateSingleHeader.py +++ b/generateSingleHeader.py @@ -3,7 +3,7 @@ import sys import re import datetime -versionParser = re.compile( r'(\s*Version\slibraryVersion\s*=)\s*{\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*}.*' ) +versionParser = re.compile( r'(\s*Version\slibraryVersion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*\).*' ) includesParser = re.compile( r'\s*#include\s*"(.*)"' ) guardParser = re.compile( r'\s*#.*_INCLUDED') defineParser = re.compile( r'\s*#define') @@ -65,7 +65,7 @@ class Version: for line in f: m = versionParser.match( line ) if m: - lines.append( '{0} {{ {1}, {2}, {3}, "{4}" }};'.format( self.variableDecl, self.majorVersion, self.minorVersion, self.buildNumber, self.branchName ) ) + lines.append( '{0}( {1}, {2}, {3}, "{4}" );'.format( self.variableDecl, self.majorVersion, self.minorVersion, self.buildNumber, self.branchName ) ) else: lines.append( line.rstrip() ) f.close() diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index cac00af0..55f3d30a 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -213,11 +213,11 @@ namespace Catch { } if( !displayedSpecificOption ) { - std::cout << "\nCATCH v" << libraryVersion.MajorVersion << "." - << libraryVersion.MinorVersion << " build " - << libraryVersion.BuildNumber; - if( libraryVersion.BranchName != "master" ) - std::cout << " (" << libraryVersion.BranchName << " branch)"; + std::cout << "\nCATCH v" << libraryVersion.majorVersion << "." + << libraryVersion.minorVersion << " build " + << libraryVersion.buildNumber; + if( libraryVersion.branchName != "master" ) + std::cout << " (" << libraryVersion.branchName << " branch)"; std::cout << "\n\n" << parser.exeName() << " is a CATCH host application. Options are as follows:\n\n"; showUsage( std::cout ); diff --git a/include/internal/catch_version.h b/include/internal/catch_version.h index ec767996..75b6c8f0 100644 --- a/include/internal/catch_version.h +++ b/include/internal/catch_version.h @@ -12,10 +12,20 @@ namespace Catch { // Versioning information struct Version { - const unsigned int MajorVersion; - const unsigned int MinorVersion; - const unsigned int BuildNumber; - const std::string BranchName; + Version( unsigned int _majorVersion, + unsigned int _minorVersion, + unsigned int _buildNumber, + std::string const& _branchName ) + : majorVersion( _majorVersion ), + minorVersion( _minorVersion ), + buildNumber( _buildNumber ), + branchName( _branchName ) + {} + + const unsigned int majorVersion; + const unsigned int minorVersion; + const unsigned int buildNumber; + const std::string branchName; }; extern Version libraryVersion; diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 081d578f..ae94087d 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion = { 0, 9, 6, "integration" }; + Version libraryVersion( 0, 9, 6, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED From 2632dca81d84b30f014a5a7efca785fe345f322a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 1 Dec 2012 23:49:57 +0000 Subject: [PATCH 079/296] Completed IStreamingInterface abstraction with TestRunInfo and GroupInfo --- include/internal/catch_interfaces_reporter.h | 33 +++++++++++++------- include/internal/catch_runner_impl.hpp | 8 ++--- projects/SelfTest/catch_self_test.hpp | 4 +-- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 7c30d96c..fc272755 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -43,6 +43,15 @@ namespace Catch bool shouldRedirectStdOut; }; + struct TestRunInfo { + TestRunInfo( std::string const& _name ) : name( _name ) {} + std::string name; + }; + struct GroupInfo { + GroupInfo( std::string const& _name ) : name( _name ) {} + std::string name; + }; + struct SectionInfo { SectionInfo( std::string const& _name, std::string const& _description, @@ -109,31 +118,31 @@ namespace Catch }; struct TestGroupStats : SharedImpl<> { - TestGroupStats( std::string const& _groupName, + TestGroupStats( GroupInfo const& _groupInfo, Totals const& _totals, bool _aborting ) - : groupName( _groupName ), + : groupInfo( _groupInfo ), totals( _totals ), aborting( _aborting ) {} virtual ~TestGroupStats(); - std::string groupName; + GroupInfo groupInfo; Totals totals; bool aborting; }; struct TestRunStats : SharedImpl<> { - TestRunStats( std::string const& _runName, + TestRunStats( TestRunInfo const& _runInfo, Totals const& _totals, bool _aborting ) - : runName( _runName ), + : runInfo( _runInfo ), totals( _totals ), aborting( _aborting ) {} virtual ~TestRunStats(); - std::string runName; + TestRunInfo runInfo; Totals totals; bool aborting; }; @@ -143,8 +152,8 @@ namespace Catch virtual ~IStreamingReporter(); virtual ReporterPreferences getPreferences() const = 0; - virtual void testRunStarting( std::string const& runName ) = 0; - virtual void testGroupStarting( std::string const& groupName ) = 0; + virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; + virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0; virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; @@ -199,11 +208,11 @@ namespace Catch return prefs; } - virtual void testRunStarting( std::string const& ) { + virtual void testRunStarting( TestRunInfo const& ) { m_legacyReporter->StartTesting(); } - virtual void testGroupStarting( std::string const& groupName ) { - m_legacyReporter->StartGroup( groupName ); + virtual void testGroupStarting( GroupInfo const& groupInfo ) { + m_legacyReporter->StartGroup( groupInfo.name ); } virtual void testCaseStarting( TestCaseInfo const& testInfo ) { m_legacyReporter->StartTestCase( testInfo ); @@ -235,7 +244,7 @@ namespace Catch virtual void testGroupEnded( Ptr const& testGroupStats ) { if( testGroupStats->aborting ) m_legacyReporter->Aborted(); - m_legacyReporter->EndGroup( testGroupStats->groupName, testGroupStats->totals ); + m_legacyReporter->EndGroup( testGroupStats->groupInfo.name, testGroupStats->totals ); } virtual void testRunEnded( Ptr const& testRunStats ) { m_legacyReporter->EndTesting( testRunStats->totals ); diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 850fa56f..8deb4f7d 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -68,11 +68,11 @@ namespace Catch { m_context.setRunner( this ); m_context.setConfig( &m_config ); m_context.setResultCapture( this ); - m_reporter->testRunStarting( "" ); // !TBD - name + m_reporter->testRunStarting( TestRunInfo( "" ) ); // !TBD - name } virtual ~Runner() { - m_reporter->testRunEnded( new TestRunStats( "", m_totals, aborting() ) ); // !TBD - name + m_reporter->testRunEnded( new TestRunStats( TestRunInfo( "" ), m_totals, aborting() ) ); // !TBD - name m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); @@ -80,10 +80,10 @@ namespace Catch { } void testGroupStarting( std::string const& testSpec ) { - m_reporter->testGroupStarting( testSpec ); + m_reporter->testGroupStarting( GroupInfo( testSpec ) ); } void testGroupEnded( std::string const& testSpec, Totals const& totals ) { - m_reporter->testGroupEnded( new TestGroupStats( testSpec, totals, aborting() ) ); + m_reporter->testGroupEnded( new TestGroupStats( GroupInfo( testSpec ), totals, aborting() ) ); } Totals runMatching( const std::string& testSpec ) { diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index f31d7eca..eeaff6e4 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -35,8 +35,8 @@ namespace Catch { return ReporterPreferences(); } - virtual void testRunStarting( std::string const& ) {} - virtual void testGroupStarting( std::string const& ) {} + virtual void testRunStarting( TestRunInfo const& ) {} + virtual void testGroupStarting( GroupInfo const& ) {} virtual void testCaseStarting( TestCaseInfo const& ) {} virtual void sectionStarting( SectionInfo const& ) {} virtual void assertionStarting( AssertionInfo const& ) {} From e3e9e075b94a01b5422c1cec28584c8b9b3543d8 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 1 Dec 2012 23:54:17 +0000 Subject: [PATCH 080/296] Capture RunInfo --- include/internal/catch_runner_impl.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 8deb4f7d..72c54467 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -57,7 +57,8 @@ namespace Catch { public: explicit Runner( const Config& config, const Ptr& reporter ) - : m_context( getCurrentMutableContext() ), + : m_runInfo( config.data().name ), + m_context( getCurrentMutableContext() ), m_runningTest( NULL ), m_config( config ), m_reporter( reporter ), @@ -68,11 +69,11 @@ namespace Catch { m_context.setRunner( this ); m_context.setConfig( &m_config ); m_context.setResultCapture( this ); - m_reporter->testRunStarting( TestRunInfo( "" ) ); // !TBD - name + m_reporter->testRunStarting( m_runInfo ); } virtual ~Runner() { - m_reporter->testRunEnded( new TestRunStats( TestRunInfo( "" ), m_totals, aborting() ) ); // !TBD - name + m_reporter->testRunEnded( new TestRunStats( m_runInfo, m_totals, aborting() ) ); m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); @@ -303,6 +304,7 @@ namespace Catch { } private: + TestRunInfo m_runInfo; IMutableContext& m_context; RunningTest* m_runningTest; AssertionResult m_lastResult; From a1fbfea6591c4215cdb1f7f6e8d89efbda269d25 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 1 Dec 2012 23:57:18 +0000 Subject: [PATCH 081/296] Generated build 7 --- README | 2 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 1137 +++++++++++++++++----------- 3 files changed, 691 insertions(+), 450 deletions(-) diff --git a/README b/README index 150f5135..526c1eff 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 6 (integration branch) +CATCH v0.9 build 7 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index ae94087d..4600a14a 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 6, "integration" ); + Version libraryVersion( 0, 9, 7, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 1d9f11e2..92546d11 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 6 (integration branch) - * Generated: 2012-11-21 18:04:49.655014 + * CATCH v0.9 build 7 (integration branch) + * Generated: 2012-12-01 23:56:31.861593 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -69,18 +69,14 @@ namespace Catch { typename ContainerT::const_iterator it = container.begin(); typename ContainerT::const_iterator itEnd = container.end(); for(; it != itEnd; ++it ) - { delete *it; - } } template inline void deleteAllValues( AssociativeContainerT& container ) { typename AssociativeContainerT::const_iterator it = container.begin(); typename AssociativeContainerT::const_iterator itEnd = container.end(); for(; it != itEnd; ++it ) - { delete it->second; - } } template @@ -215,7 +211,7 @@ namespace Catch { namespace Catch { - class TestCaseInfo; + class TestCase; class Stream; struct IResultCapture; struct IRunner; @@ -270,7 +266,7 @@ namespace Catch { if( m_p ) m_p->addRef(); } - Ptr( const Ptr& other ) : m_p( other.m_p ){ + Ptr( Ptr const& other ) : m_p( other.m_p ){ if( m_p ) m_p->addRef(); } @@ -283,33 +279,17 @@ namespace Catch { swap( temp ); return *this; } - Ptr& operator = ( const Ptr& other ){ + Ptr& operator = ( Ptr const& other ){ Ptr temp( other ); swap( temp ); return *this; } - void swap( Ptr& other ){ - std::swap( m_p, other.m_p ); - } - - T* get(){ - return m_p; - } - const T* get() const{ - return m_p; - } - - T& operator*() const { - return *m_p; - } - - T* operator->() const { - return m_p; - } - - bool operator !() const { - return m_p == NULL; - } + void swap( Ptr& other ) { std::swap( m_p, other.m_p ); } + T* get() { return m_p; } + const T* get() const{ return m_p; } + T& operator*() const { return *m_p; } + T* operator->() const { return m_p; } + bool operator !() const { return m_p == NULL; } private: T* m_p; @@ -317,24 +297,24 @@ namespace Catch { struct IShared : NonCopyable { virtual ~IShared(); - virtual void addRef() = 0; - virtual void release() = 0; + virtual void addRef() const = 0; + virtual void release() const = 0; }; - template + template struct SharedImpl : T { SharedImpl() : m_rc( 0 ){} - virtual void addRef(){ + virtual void addRef() const { ++m_rc; } - virtual void release(){ + virtual void release() const { if( --m_rc == 0 ) delete this; } - int m_rc; + mutable unsigned int m_rc; }; } // end namespace Catch @@ -351,12 +331,12 @@ namespace Catch { virtual ~ITestCase(); }; - class TestCaseInfo; + class TestCase; struct ITestCaseRegistry { virtual ~ITestCaseRegistry(); - virtual const std::vector& getAllTests() const = 0; - virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const = 0; + virtual const std::vector& getAllTests() const = 0; + virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const = 0; }; } @@ -1098,27 +1078,26 @@ namespace Catch { namespace Catch { - class TestCaseInfo; + class TestCase; class ScopedInfo; class ExpressionResultBuilder; class AssertionResult; struct AssertionInfo; + struct SectionInfo; struct IResultCapture { virtual ~IResultCapture(); - virtual void testEnded( const AssertionResult& result ) = 0; - virtual bool sectionStarted( const std::string& name, - const std::string& description, - const SourceLineInfo& lineInfo, + virtual void testEnded( AssertionResult const& result ) = 0; + virtual bool sectionStarted( SectionInfo const& sectionInfo, Counts& assertions ) = 0; - virtual void sectionEnded( const std::string& name, const Counts& assertions ) = 0; + virtual void sectionEnded( SectionInfo const& name, Counts const& assertions ) = 0; virtual void pushScopedInfo( ScopedInfo* scopedInfo ) = 0; virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; virtual bool shouldDebugBreak() const = 0; - virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) = 0; + virtual ResultAction::Value acceptExpression( ExpressionResultBuilder const& assertionResult, AssertionInfo const& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; virtual const AssertionResult* getLastResult() const = 0; @@ -1253,44 +1232,55 @@ namespace Catch { struct ITestCase; - class TestCaseInfo { - public: - TestCaseInfo(); + struct TestCaseInfo { + TestCaseInfo( const std::string& _name, + const std::string& _className, + const std::string& _description, + const std::set& _tags, + bool _isHidden, + const SourceLineInfo& _lineInfo ); - TestCaseInfo( ITestCase* testCase, - 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 ); + std::string name; + std::string className; + std::string description; + std::set tags; + bool isHidden; + SourceLineInfo lineInfo; + }; + + class TestCase : protected TestCaseInfo { + public: + + TestCase( ITestCase* testCase, const TestCaseInfo& info ); + TestCase( const TestCase& other ); + + TestCase withName( const std::string& _newName ) const; + void invoke() const; - const std::string& getClassName() const; - const std::string& getName() const; - const std::string& getDescription() const; - const SourceLineInfo& getLineInfo() const; + const TestCaseInfo& getTestCaseInfo() const; + bool isHidden() const; bool hasTag( const std::string& tag ) const; bool matchesTags( const std::string& tagPattern ) const; const std::set& getTags() const; - void swap( TestCaseInfo& other ); - bool operator == ( const TestCaseInfo& other ) const; - bool operator < ( const TestCaseInfo& other ) const; - TestCaseInfo& operator = ( const TestCaseInfo& other ); + void swap( TestCase& other ); + bool operator == ( const TestCase& other ) const; + bool operator < ( const TestCase& other ) const; + TestCase& operator = ( const TestCase& other ); private: - Ptr m_test; - std::string m_className; - std::string m_name; - std::string m_description; - std::set m_tags; - SourceLineInfo m_lineInfo; - bool m_isHidden; + Ptr test; }; + + TestCase makeTestCase( ITestCase* testCase, + const std::string& className, + const std::string& name, + const std::string& description, + const SourceLineInfo& lineInfo ); } // #included from: catch_tags.hpp @@ -1529,7 +1519,7 @@ namespace Catch { return m_filterType; } - bool shouldInclude( const TestCaseInfo& testCase ) const { + bool shouldInclude( const TestCase& testCase ) const { return isMatch( testCase ) == (m_filterType == IfFilterMatches::IncludeTests); } private: @@ -1539,8 +1529,8 @@ namespace Catch { #pragma clang diagnostic ignored "-Wunreachable-code" #endif - bool isMatch( const TestCaseInfo& testCase ) const { - const std::string& name = testCase.getName(); + bool isMatch( const TestCase& testCase ) const { + const std::string& name = testCase.getTestCaseInfo().name; switch( m_wildcardPosition ) { case NoWildcard: @@ -1586,7 +1576,7 @@ namespace Catch { m_tagExpressions.push_back( exp ); } - bool shouldInclude( const TestCaseInfo& testCase ) const { + bool shouldInclude( const TestCase& testCase ) const { if( !m_tagExpressions.empty() ) { std::vector::const_iterator it = m_tagExpressions.begin(); std::vector::const_iterator itEnd = m_tagExpressions.end(); @@ -1893,71 +1883,242 @@ namespace Catch { namespace Catch { - struct ReporterConfig - { - ReporterConfig( const std::string& _name, - std::ostream& _stream, - bool _includeSuccessfulResults, - const ConfigData& _fullConfig ) - : name( _name ), - stream( _stream ), - includeSuccessfulResults( _includeSuccessfulResults ), - fullConfig( _fullConfig ) + struct ReporterConfig { + ReporterConfig( std::ostream& _stream, ConfigData const& _fullConfig ) + : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} + + std::ostream& stream() { return *m_stream; } + std::string name() const { return m_fullConfig.name; } + bool includeSuccessfulResults() const { return m_fullConfig.includeWhichResults == Include::SuccessfulResults; } + bool warnAboutMissingAssertions() const { return m_fullConfig.warnings & ConfigData::WarnAbout::NoAssertions; } + + private: + std::ostream* m_stream; + ConfigData m_fullConfig; + }; + + struct ReporterPreferences { + ReporterPreferences() + : shouldRedirectStdOut( false ) {} - ReporterConfig( const ReporterConfig& other ) - : name( other.name ), - stream( other.stream ), - includeSuccessfulResults( other.includeSuccessfulResults ), - fullConfig( other.fullConfig ) + bool shouldRedirectStdOut; + }; + + struct TestRunInfo { + TestRunInfo( std::string const& _name ) : name( _name ) {} + std::string name; + }; + struct GroupInfo { + GroupInfo( std::string const& _name ) : name( _name ) {} + std::string name; + }; + + struct SectionInfo { + SectionInfo( std::string const& _name, + std::string const& _description, + SourceLineInfo const& _lineInfo ) + : name( _name ), + description( _description ), + lineInfo( _lineInfo ) {} std::string name; - std::ostream& stream; - bool includeSuccessfulResults; - ConfigData fullConfig; - - private: - void operator=(const ReporterConfig&); + std::string description; + SourceLineInfo lineInfo; }; - class TestCaseInfo; - class AssertionResult; + struct AssertionStats : SharedImpl<> { + AssertionStats( AssertionResult const& _assertionResult, + Totals const& _totals ) + : assertionResult( _assertionResult ), + totals( _totals ) + {} + virtual ~AssertionStats(); + AssertionResult assertionResult; + Totals totals; + }; + + struct SectionStats : SharedImpl<> { + SectionStats( SectionInfo const& _sectionInfo, + Counts const& _assertions, + bool _missingAssertions ) + : sectionInfo( _sectionInfo ), + assertions( _assertions ), + missingAssertions( _missingAssertions ) + {} + virtual ~SectionStats(); + + SectionInfo sectionInfo; + Counts assertions; + bool missingAssertions; + }; + + struct TestCaseStats : SharedImpl<> { + TestCaseStats( TestCaseInfo const& _testInfo, + Totals const& _totals, + std::string const& _stdOut, + std::string const& _stdErr, + bool _missingAssertions, + bool _aborting ) + : testInfo( _testInfo ), + totals( _totals ), + stdOut( _stdOut ), + stdErr( _stdErr ), + missingAssertions( _missingAssertions ), + aborting( _aborting ) + {} + virtual ~TestCaseStats(); + + TestCaseInfo testInfo; + Totals totals; + std::string stdOut; + std::string stdErr; + bool missingAssertions; + bool aborting; + }; + + struct TestGroupStats : SharedImpl<> { + TestGroupStats( GroupInfo const& _groupInfo, + Totals const& _totals, + bool _aborting ) + : groupInfo( _groupInfo ), + totals( _totals ), + aborting( _aborting ) + {} + virtual ~TestGroupStats(); + + GroupInfo groupInfo; + Totals totals; + bool aborting; + }; + + struct TestRunStats : SharedImpl<> { + TestRunStats( TestRunInfo const& _runInfo, + Totals const& _totals, + bool _aborting ) + : runInfo( _runInfo ), + totals( _totals ), + aborting( _aborting ) + {} + virtual ~TestRunStats(); + + TestRunInfo runInfo; + Totals totals; + bool aborting; + }; + + // !Work In progress + struct IStreamingReporter : IShared { + virtual ~IStreamingReporter(); + virtual ReporterPreferences getPreferences() const = 0; + + virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; + virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0; + + virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; + virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; + + virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; + + virtual void assertionEnded( Ptr const& assertionStats ) = 0; + virtual void sectionEnded( Ptr const& sectionStats ) = 0; + virtual void testCaseEnded( Ptr const& testCaseStats ) = 0; + virtual void testGroupEnded( Ptr const& testGroupStats ) = 0; + virtual void testRunEnded( Ptr const& testRunStats ) = 0; + }; + // !TBD: Derived helper that implements the streaming interface but holds the stats + // - declares a new interface where methods are called at the end of each event + // - this would be used by the JUnit reporter, for example. + // - it may be used by the basic reporter, too, but that would clear down the stack + // as it goes + + // Deprecated 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; - - // - merge into SectionResult, TestCaseResult, GroupResult & TestRunResult + virtual void EndTesting( Totals const& totals ) = 0; + virtual void StartGroup( std::string const& groupName ) = 0; + virtual void EndGroup( std::string const& groupName, Totals const& totals ) = 0; + virtual void StartTestCase( TestCaseInfo const& testInfo ) = 0; + virtual void EndTestCase( TestCaseInfo const& testInfo, Totals const& totals, std::string const& stdOut, std::string const& stdErr ) = 0; + virtual void StartSection( std::string const& sectionName, std::string const& description ) = 0; + virtual void EndSection( std::string const& sectionName, const Counts& assertions ) = 0; + virtual void NoAssertionsInSection( std::string const& sectionName ) = 0; + virtual void NoAssertionsInTestCase( std::string const& testName ) = 0; virtual void Aborted() = 0; - - // AssertionReslt virtual void Result( const AssertionResult& result ) = 0; }; + class LegacyReporterAdapter : public SharedImpl + { + public: + LegacyReporterAdapter( Ptr const& legacyReporter, ReporterConfig const& config ) + : m_legacyReporter( legacyReporter ), + m_config( config ) + {} + virtual ~LegacyReporterAdapter(); + + virtual ReporterPreferences getPreferences() const { + ReporterPreferences prefs; + prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout(); + return prefs; + } + + virtual void testRunStarting( TestRunInfo const& ) { + m_legacyReporter->StartTesting(); + } + virtual void testGroupStarting( GroupInfo const& groupInfo ) { + m_legacyReporter->StartGroup( groupInfo.name ); + } + virtual void testCaseStarting( TestCaseInfo const& testInfo ) { + m_legacyReporter->StartTestCase( testInfo ); + } + virtual void sectionStarting( SectionInfo const& sectionInfo ) { + m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description ); + } + virtual void assertionStarting( AssertionInfo const& ) { + // Not on legacy interface + } + + virtual void assertionEnded( Ptr const& assertionStats ) { + m_legacyReporter->Result( assertionStats->assertionResult ); + } + virtual void sectionEnded( Ptr const& sectionStats ) { + if( sectionStats->missingAssertions ) + m_legacyReporter->NoAssertionsInSection( sectionStats->sectionInfo.name ); + m_legacyReporter->EndSection( sectionStats->sectionInfo.name, sectionStats->assertions ); + } + virtual void testCaseEnded( Ptr const& testCaseStats ) { + if( testCaseStats->missingAssertions ) + m_legacyReporter->NoAssertionsInTestCase( testCaseStats->testInfo.name ); + m_legacyReporter->EndTestCase + ( testCaseStats->testInfo, + testCaseStats->totals, + testCaseStats->stdOut, + testCaseStats->stdErr ); + } + virtual void testGroupEnded( Ptr const& testGroupStats ) { + if( testGroupStats->aborting ) + m_legacyReporter->Aborted(); + m_legacyReporter->EndGroup( testGroupStats->groupInfo.name, testGroupStats->totals ); + } + virtual void testRunEnded( Ptr const& testRunStats ) { + m_legacyReporter->EndTesting( testRunStats->totals ); + } + + private: + Ptr m_legacyReporter; + ReporterConfig m_config; + }; + struct IReporterFactory { virtual ~IReporterFactory(); - virtual IReporter* create( const ReporterConfig& config ) const = 0; + virtual IStreamingReporter* create( ReporterConfig const& config ) const = 0; virtual std::string getDescription() const = 0; }; @@ -1965,11 +2126,11 @@ namespace Catch typedef std::map FactoryMap; virtual ~IReporterRegistry(); - virtual IReporter* create( const std::string& name, const ReporterConfig& config ) const = 0; + virtual IStreamingReporter* create( std::string const& name, ReporterConfig const& config ) const = 0; virtual const FactoryMap& getFactories() const = 0; }; - inline std::string trim( const std::string& str ) { + inline std::string trim( std::string const& str ) { std::string::size_type start = str.find_first_not_of( "\n\r\t " ); std::string::size_type end = str.find_last_not_of( "\n\r\t " ); @@ -1981,7 +2142,7 @@ namespace Catch namespace Catch { - class TestCaseInfo; + class TestCase; struct ITestCaseRegistry; struct IExceptionTranslatorRegistry; struct IExceptionTranslator; @@ -1997,7 +2158,7 @@ namespace Catch { struct IMutableRegistryHub { virtual ~IMutableRegistryHub(); virtual void registerReporter( const std::string& name, IReporterFactory* factory ) = 0; - virtual void registerTest( const TestCaseInfo& testInfo ) = 0; + virtual void registerTest( const TestCase& testInfo ) = 0; virtual void registerTranslator( const IExceptionTranslator* translator ) = 0; }; @@ -2200,13 +2361,13 @@ namespace Catch { 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 ) ) + : m_info( name, description, lineInfo ), + m_sectionIncluded( getCurrentContext().getResultCapture().sectionStarted( m_info, m_assertions ) ) {} ~Section() { if( m_sectionIncluded ) - getCurrentContext().getResultCapture().sectionEnded( m_name, m_assertions ); + getCurrentContext().getResultCapture().sectionEnded( m_info, m_assertions ); } // This indicates whether the section should be executed or not @@ -2215,6 +2376,7 @@ namespace Catch { } private: + SectionInfo m_info; std::string m_name; Counts m_assertions; @@ -2752,7 +2914,7 @@ using namespace Matchers; #include namespace Catch { - class TestCaseInfo; + class TestCase; struct IRunner { virtual ~IRunner(); @@ -2846,7 +3008,7 @@ namespace Catch { std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); - getMutableRegistryHub().registerTest( TestCaseInfo( new OcMethod( cls, selector ), name.c_str(), desc.c_str(), SourceLineInfo() ) ); + getMutableRegistryHub().registerTest( TestCase( new OcMethod( cls, selector ), name.c_str(), desc.c_str(), SourceLineInfo() ) ); noTestMethods++; } } @@ -3639,7 +3801,7 @@ namespace Catch { #include namespace Catch { - inline bool matchesFilters( const std::vector& filters, const TestCaseInfo& testCase ) { + inline bool matchesFilters( const std::vector& filters, const TestCase& testCase ) { std::vector::const_iterator it = filters.begin(); std::vector::const_iterator itEnd = filters.end(); for(; it != itEnd; ++it ) @@ -3665,16 +3827,16 @@ namespace Catch { std::cout << "All available test cases:\n"; else std::cout << "Matching test cases:\n"; - std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); - std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); + std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); + std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); std::size_t matchedTests = 0; for(; it != itEnd; ++it ) { if( matchesFilters( config.filters, *it ) ) { matchedTests++; // !TBD: consider listAs() - std::cout << "\t" << it->getName() << "\n"; + std::cout << "\t" << it->getTestCaseInfo().name << "\n"; if( ( config.listSpec & List::TestNames ) != List::TestNames ) - std::cout << "\t\t '" << it->getDescription() << "'\n"; + std::cout << "\t\t '" << it->getTestCaseInfo().description << "'\n"; } } if( config.filters.empty() ) @@ -3706,10 +3868,12 @@ namespace Catch { namespace Catch { - class SectionInfo { + class RunningSection { public: - enum Status { + typedef std::vector SubSections; + + enum State { Root, Unknown, Branch, @@ -3717,76 +3881,85 @@ namespace Catch { TestedLeaf }; - SectionInfo( SectionInfo* parent ) - : m_status( Unknown ), - m_parent( parent ) + RunningSection( RunningSection* parent, const std::string& name ) + : m_state( Unknown ), + m_parent( parent ), + m_name( name ) {} - SectionInfo() - : m_status( Root ), - m_parent( NULL ) + RunningSection( const std::string& name ) + : m_state( Root ), + m_parent( NULL ), + m_name( name ) {} - ~SectionInfo() { - deleteAllValues( m_subSections ); + ~RunningSection() { + deleteAll( m_subSections ); + } + + std::string getName() const { + return m_name; } bool shouldRun() const { - return m_status < TestedBranch; - } - - bool ran() { - if( m_status < Branch ) { - m_status = TestedLeaf; - return true; - } - return false; + return m_state < TestedBranch; } bool isBranch() const { - return m_status == Branch; + return m_state == Branch; } - void ranToCompletion() { - if( m_status == Branch && !hasUntestedSections() ) - m_status = TestedBranch; - } - - SectionInfo* findSubSection( const std::string& name ) { - std::map::const_iterator it = m_subSections.find( name ); - return it != m_subSections.end() - ? it->second - : NULL; - } - - SectionInfo* addSubSection( const std::string& name ) { - SectionInfo* subSection = new SectionInfo( this ); - m_subSections.insert( std::make_pair( name, subSection ) ); - m_status = Branch; - return subSection; - } - - SectionInfo* getParent() { + const RunningSection* getParent() const { return m_parent; } bool hasUntestedSections() const { - if( m_status == Unknown ) + if( m_state == Unknown ) return true; - - std::map::const_iterator it = m_subSections.begin(); - std::map::const_iterator itEnd = m_subSections.end(); - for(; it != itEnd; ++it ) { - if( it->second->hasUntestedSections() ) + for( SubSections::const_iterator it = m_subSections.begin(); + it != m_subSections.end(); + ++it) + if( (*it)->hasUntestedSections() ) return true; - } return false; } + // Mutable methods: + + RunningSection* getParent() { + return m_parent; + } + + RunningSection* findOrAddSubSection( const std::string& name, bool& changed ) { + for( SubSections::const_iterator it = m_subSections.begin(); + it != m_subSections.end(); + ++it) + if( (*it)->getName() == name ) + return *it; + RunningSection* subSection = new RunningSection( this, name ); + m_subSections.push_back( subSection ); + m_state = Branch; + changed = true; + return subSection; + } + + bool ran() { + if( m_state >= Branch ) + return false; + m_state = TestedLeaf; + return true; + } + + void ranToCompletion() { + if( m_state == Branch && !hasUntestedSections() ) + m_state = TestedBranch; + } + private: - Status m_status; - std::map m_subSections; - SectionInfo* m_parent; + State m_state; + RunningSection* m_parent; + std::string m_name; + SubSections m_subSections; }; } @@ -3803,9 +3976,10 @@ namespace Catch { }; public: - explicit RunningTest( const TestCaseInfo* info = NULL ) + explicit RunningTest( const TestCase& info ) : m_info( info ), m_runStatus( RanAtLeastOneSection ), + m_rootSection( info.getTestCaseInfo().name ), m_currentSection( &m_rootSection ), m_changed( false ) {} @@ -3833,16 +4007,12 @@ namespace Catch { } void ranToCompletion() { - if( m_runStatus == RanAtLeastOneSection || - m_runStatus == EncounteredASection ) { - m_runStatus = RanToCompletionWithSections; - if( m_lastSectionToRun ) { - m_lastSectionToRun->ranToCompletion(); - m_changed = true; - } - } - else { + if( m_runStatus != RanAtLeastOneSection && m_runStatus != EncounteredASection ) m_runStatus = RanToCompletionWithNoSections; + m_runStatus = RanToCompletionWithSections; + if( m_lastSectionToRun ) { + m_lastSectionToRun->ranToCompletion(); + m_changed = true; } } @@ -3850,11 +4020,7 @@ namespace Catch { if( m_runStatus == NothingRun ) m_runStatus = EncounteredASection; - SectionInfo* thisSection = m_currentSection->findSubSection( name ); - if( !thisSection ) { - thisSection = m_currentSection->addSubSection( name ); - m_changed = true; - } + RunningSection* thisSection = m_currentSection->findOrAddSubSection( name, m_changed ); if( !wasSectionSeen() && thisSection->shouldRun() ) { m_currentSection = thisSection; @@ -3876,8 +4042,8 @@ namespace Catch { m_currentSection = m_currentSection->getParent(); } - const TestCaseInfo& getTestCaseInfo() const { - return *m_info; + const TestCase& getTestCase() const { + return m_info; } bool hasUntestedSections() const { @@ -3886,11 +4052,11 @@ namespace Catch { } private: - const TestCaseInfo* m_info; + const TestCase& m_info; RunStatus m_runStatus; - SectionInfo m_rootSection; - SectionInfo* m_currentSection; - SectionInfo* m_lastSectionToRun; + RunningSection m_rootSection; + RunningSection* m_currentSection; + RunningSection* m_lastSectionToRun; bool m_changed; }; } @@ -3932,8 +4098,9 @@ namespace Catch { public: - explicit Runner( const Config& config, const Ptr& reporter ) - : m_context( getCurrentMutableContext() ), + explicit Runner( const Config& config, const Ptr& reporter ) + : m_runInfo( config.data().name ), + m_context( getCurrentMutableContext() ), m_runningTest( NULL ), m_config( config ), m_reporter( reporter ), @@ -3944,44 +4111,52 @@ namespace Catch { m_context.setRunner( this ); m_context.setConfig( &m_config ); m_context.setResultCapture( this ); - m_reporter->StartTesting(); + m_reporter->testRunStarting( m_runInfo ); } virtual ~Runner() { - m_reporter->EndTesting( m_totals ); + m_reporter->testRunEnded( new TestRunStats( m_runInfo, m_totals, aborting() ) ); m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); m_context.setConfig( m_prevConfig ); } + void testGroupStarting( std::string const& testSpec ) { + m_reporter->testGroupStarting( GroupInfo( testSpec ) ); + } + void testGroupEnded( std::string const& testSpec, Totals const& totals ) { + m_reporter->testGroupEnded( new TestGroupStats( GroupInfo( testSpec ), totals, aborting() ) ); + } + Totals runMatching( const std::string& testSpec ) { - std::vector matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ); + std::vector matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ); Totals totals; - m_reporter->StartGroup( testSpec ); + testGroupStarting( testSpec ); - std::vector::const_iterator it = matchingTests.begin(); - std::vector::const_iterator itEnd = matchingTests.end(); + std::vector::const_iterator it = matchingTests.begin(); + std::vector::const_iterator itEnd = matchingTests.end(); for(; it != itEnd; ++it ) totals += runTest( *it ); - // !TBD use std::accumulate? - m_reporter->EndGroup( testSpec, totals ); + testGroupEnded( testSpec, totals ); return totals; } - Totals runTest( const TestCaseInfo& testInfo ) { + Totals runTest( const TestCase& testCase ) { Totals prevTotals = m_totals; std::string redirectedCout; std::string redirectedCerr; - m_reporter->StartTestCase( testInfo ); + TestCaseInfo testInfo = testCase.getTestCaseInfo(); - m_runningTest = new RunningTest( &testInfo ); + m_reporter->testCaseStarting( testInfo ); + + m_runningTest = new RunningTest( testCase ); do { do { @@ -3992,15 +4167,22 @@ namespace Catch { while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() ); Totals deltaTotals = m_totals.delta( prevTotals ); + bool missingAssertions = false; if( deltaTotals.assertions.total() == 0 && ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) ) { m_totals.assertions.failed++; deltaTotals = m_totals.delta( prevTotals ); - m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCaseInfo().getName() ); + missingAssertions = true; } + m_totals.testCases += deltaTotals.testCases; - m_reporter->EndTestCase( testInfo, deltaTotals, redirectedCout, redirectedCerr ); + m_reporter->testCaseEnded( new TestCaseStats( testInfo, + deltaTotals, + redirectedCout, + redirectedCerr, + missingAssertions, + aborting() ) ); delete m_runningTest; m_runningTest = NULL; @@ -4030,13 +4212,13 @@ 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)->buildResult( m_lastAssertionInfo ) ); + m_reporter->assertionEnded( new AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); } { 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_reporter->assertionEnded( new AssertionStats( *it, m_totals ) ); } m_assertionResults.clear(); } @@ -4047,44 +4229,46 @@ namespace Catch { m_totals.assertions.info++; } else - m_reporter->Result( result ); + m_reporter->assertionEnded( new AssertionStats( result, m_totals ) ); // Reset AssertionInfo m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); } virtual bool sectionStarted ( - const std::string& name, - const std::string& description, - const SourceLineInfo& lineInfo, + SectionInfo const& sectionInfo, Counts& assertions ) { std::ostringstream oss; - oss << name << "@" << lineInfo; + oss << sectionInfo.name << "@" << sectionInfo.lineInfo; if( !m_runningTest->addSection( oss.str() ) ) return false; - m_lastAssertionInfo.lineInfo = lineInfo; + m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; + + m_reporter->sectionStarting( sectionInfo ); - m_reporter->StartSection( name, description ); assertions = m_totals.assertions; return true; } - virtual void sectionEnded( const std::string& name, const Counts& prevAssertions ) { + virtual void sectionEnded( SectionInfo const& info, Counts const& prevAssertions ) { Counts assertions = m_totals.assertions - prevAssertions; + bool missingAssertions = false; if( assertions.total() == 0 && ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) && !m_runningTest->isBranchSection() ) { - m_reporter->NoAssertionsInSection( name ); m_totals.assertions.failed++; assertions.failed++; + missingAssertions = true; + } - m_runningTest->endSection( name ); - m_reporter->EndSection( name, assertions ); + m_runningTest->endSection( info.name ); + + m_reporter->sectionEnded( new SectionStats( info, assertions, missingAssertions ) ); } virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { @@ -4102,7 +4286,7 @@ namespace Catch { virtual std::string getCurrentTestName() const { return m_runningTest - ? m_runningTest->getTestCaseInfo().getName() + ? m_runningTest->getTestCase().getTestCaseInfo().name : ""; } @@ -4136,15 +4320,15 @@ namespace Catch { void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { try { - m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo(), "", ResultDisposition::Normal ); + m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getTestCaseInfo().lineInfo, "", ResultDisposition::Normal ); m_runningTest->reset(); - if( m_reporter->shouldRedirectStdout() ) { + if( m_reporter->getPreferences().shouldRedirectStdOut ) { StreamRedirect coutRedir( std::cout, redirectedCout ); StreamRedirect cerrRedir( std::cerr, redirectedCerr ); - m_runningTest->getTestCaseInfo().invoke(); + m_runningTest->getTestCase().invoke(); } else { - m_runningTest->getTestCaseInfo().invoke(); + m_runningTest->getTestCase().invoke(); } m_runningTest->ranToCompletion(); } @@ -4160,13 +4344,14 @@ namespace Catch { } private: + TestRunInfo m_runInfo; IMutableContext& m_context; RunningTest* m_runningTest; AssertionResult m_lastResult; const Config& m_config; Totals m_totals; - Ptr m_reporter; + Ptr m_reporter; std::vector m_scopedInfos; std::vector m_assertionResults; IRunner* m_prevRunner; @@ -4184,10 +4369,20 @@ namespace Catch { // Versioning information struct Version { - const unsigned int MajorVersion; - const unsigned int MinorVersion; - const unsigned int BuildNumber; - const std::string BranchName; + Version( unsigned int _majorVersion, + unsigned int _minorVersion, + unsigned int _buildNumber, + std::string const& _branchName ) + : majorVersion( _majorVersion ), + minorVersion( _minorVersion ), + buildNumber( _buildNumber ), + branchName( _branchName ) + {} + + const unsigned int majorVersion; + const unsigned int minorVersion; + const unsigned int buildNumber; + const std::string branchName; }; extern Version libraryVersion; @@ -4223,20 +4418,19 @@ namespace Catch { std::vector::const_iterator it = filterGroups.begin(); std::vector::const_iterator itEnd = filterGroups.end(); + for(; it != itEnd && !context.aborting(); ++it ) { - m_reporter->StartGroup( it->getName() ); + context.testGroupStarting( it->getName() ); totals += runTestsForGroup( context, *it ); - if( context.aborting() ) - m_reporter->Aborted(); - m_reporter->EndGroup( it->getName(), totals ); + context.testGroupEnded( it->getName(), totals ); } return totals; } Totals runTestsForGroup( Runner& context, const TestCaseFilters& filterGroup ) { Totals totals; - std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); - std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); + std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); + std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); int testsRunForGroup = 0; for(; it != itEnd; ++it ) { if( filterGroup.shouldInclude( *it ) ) { @@ -4278,7 +4472,7 @@ namespace Catch { ? "basic" : m_config.reporter; - ReporterConfig reporterConfig( m_config.name, m_configWrapper.stream(), m_config.includeWhichResults == Include::SuccessfulResults, m_config ); + ReporterConfig reporterConfig( m_configWrapper.stream(), m_config ); m_reporter = getRegistryHub().getReporterRegistry().create( reporterName, reporterConfig ); if( !m_reporter ) { @@ -4292,8 +4486,8 @@ namespace Catch { Config& m_configWrapper; const ConfigData& m_config; std::ofstream m_ofs; - Ptr m_reporter; - std::set m_testsAlreadyRun; + Ptr m_reporter; + std::set m_testsAlreadyRun; }; inline int Main( Config& configWrapper ) { @@ -4393,11 +4587,11 @@ namespace Catch { } if( !displayedSpecificOption ) { - std::cout << "\nCATCH v" << libraryVersion.MajorVersion << "." - << libraryVersion.MinorVersion << " build " - << libraryVersion.BuildNumber; - if( libraryVersion.BranchName != "master" ) - std::cout << " (" << libraryVersion.BranchName << " branch)"; + std::cout << "\nCATCH v" << libraryVersion.majorVersion << "." + << libraryVersion.minorVersion << " build " + << libraryVersion.buildNumber; + if( libraryVersion.branchName != "master" ) + std::cout << " (" << libraryVersion.branchName << " branch)"; std::cout << "\n\n" << parser.exeName() << " is a CATCH host application. Options are as follows:\n\n"; showUsage( std::cout ); @@ -4460,58 +4654,59 @@ namespace Catch { TestRegistry() : m_unnamedCount( 0 ) {} virtual ~TestRegistry(); - virtual void registerTest( const TestCaseInfo& testInfo ) { - if( testInfo.getName() == "" ) { + virtual void registerTest( const TestCase& testCase ) { + std::string name = testCase.getTestCaseInfo().name; + if( name == "" ) { std::ostringstream oss; - oss << testInfo.getName() << "unnamed/" << ++m_unnamedCount; - return registerTest( TestCaseInfo( testInfo, oss.str() ) ); + oss << name << "unnamed/" << ++m_unnamedCount; + return registerTest( testCase.withName( oss.str() ) ); } - if( m_functions.find( testInfo ) == m_functions.end() ) { - m_functions.insert( testInfo ); - m_functionsInOrder.push_back( testInfo ); - if( !testInfo.isHidden() ) - m_nonHiddenFunctions.push_back( testInfo ); + if( m_functions.find( testCase ) == m_functions.end() ) { + m_functions.insert( testCase ); + m_functionsInOrder.push_back( testCase ); + if( !testCase.isHidden() ) + m_nonHiddenFunctions.push_back( testCase ); } else { - const TestCaseInfo& prev = *m_functions.find( testInfo ); - std::cerr << "error: TEST_CASE( \"" << testInfo.getName() << "\" ) already defined.\n" - << "\tFirst seen at " << SourceLineInfo( prev.getLineInfo() ) << "\n" - << "\tRedefined at " << SourceLineInfo( testInfo.getLineInfo() ) << std::endl; + const TestCase& prev = *m_functions.find( testCase ); + std::cerr << "error: TEST_CASE( \"" << name << "\" ) already defined.\n" + << "\tFirst seen at " << SourceLineInfo( prev.getTestCaseInfo().lineInfo ) << "\n" + << "\tRedefined at " << SourceLineInfo( testCase.getTestCaseInfo().lineInfo ) << std::endl; exit(1); } } - virtual const std::vector& getAllTests() const { + virtual const std::vector& getAllTests() const { return m_functionsInOrder; } - virtual const std::vector& getAllNonHiddenTests() const { + virtual const std::vector& getAllNonHiddenTests() const { return m_nonHiddenFunctions; } // !TBD deprecated - virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const { - std::vector matchingTests; + virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const { + std::vector matchingTests; getMatchingTestCases( rawTestSpec, matchingTests ); return matchingTests; } // !TBD deprecated - virtual void getMatchingTestCases( const std::string& rawTestSpec, std::vector& matchingTestsOut ) const { + virtual void getMatchingTestCases( const std::string& rawTestSpec, std::vector& matchingTestsOut ) const { TestCaseFilter filter( rawTestSpec ); - std::vector::const_iterator it = m_functionsInOrder.begin(); - std::vector::const_iterator itEnd = m_functionsInOrder.end(); + std::vector::const_iterator it = m_functionsInOrder.begin(); + std::vector::const_iterator itEnd = m_functionsInOrder.end(); for(; it != itEnd; ++it ) { if( filter.shouldInclude( *it ) ) { matchingTestsOut.push_back( *it ); } } } - virtual void getMatchingTestCases( const TestCaseFilters& filters, std::vector& matchingTestsOut ) const { - std::vector::const_iterator it = m_functionsInOrder.begin(); - std::vector::const_iterator itEnd = m_functionsInOrder.end(); + virtual void getMatchingTestCases( const TestCaseFilters& filters, std::vector& matchingTestsOut ) const { + std::vector::const_iterator it = m_functionsInOrder.begin(); + std::vector::const_iterator itEnd = m_functionsInOrder.end(); // !TBD: replace with algorithm for(; it != itEnd; ++it ) if( filters.shouldInclude( *it ) ) @@ -4520,9 +4715,9 @@ namespace Catch { private: - std::set m_functions; - std::vector m_functionsInOrder; - std::vector m_nonHiddenFunctions; + std::set m_functions; + std::vector m_functionsInOrder; + std::vector m_nonHiddenFunctions; size_t m_unnamedCount; }; @@ -4573,7 +4768,7 @@ namespace Catch { const char* description, const SourceLineInfo& lineInfo ) { - getMutableRegistryHub().registerTest( TestCaseInfo( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); + getMutableRegistryHub().registerTest( makeTestCase( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); } } // end namespace Catch @@ -4593,7 +4788,7 @@ namespace Catch { deleteAllValues( m_factories ); } - virtual IReporter* create( const std::string& name, const ReporterConfig& config ) const { + virtual IStreamingReporter* create( const std::string& name, const ReporterConfig& config ) const { FactoryMap::const_iterator it = m_factories.find( name ); if( it == m_factories.end() ) return NULL; @@ -4703,7 +4898,7 @@ namespace Catch { virtual void registerReporter( const std::string& name, IReporterFactory* factory ) { m_reporterRegistry.registerReporter( name, factory ); } - virtual void registerTest( const TestCaseInfo& testInfo ) { + virtual void registerTest( const TestCase& testInfo ) { m_testCaseRegistry.registerTest( testInfo ); } virtual void registerTranslator( const IExceptionTranslator* translator ) { @@ -5276,107 +5471,107 @@ namespace Catch { namespace Catch { - TestCaseInfo::TestCaseInfo( ITestCase* testCase, - 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 ), - m_isHidden( startsWith( name, "./" ) ) + TestCase makeTestCase( ITestCase* _testCase, + const std::string& _className, + const std::string& _name, + const std::string& _descOrTags, + const SourceLineInfo& _lineInfo ) { - TagExtracter( m_tags ).parse( m_description ); - if( hasTag( "hide" ) ) - m_isHidden = true; + std::string desc = _descOrTags; + bool isHidden( startsWith( _name, "./" ) ); + std::set tags; + TagExtracter( tags ).parse( desc ); + if( tags.find( "hide" ) != tags.end() ) + isHidden = true; + + TestCaseInfo info( _name, _className, desc, tags, isHidden, _lineInfo ); + return TestCase( _testCase, info ); } - TestCaseInfo::TestCaseInfo() - : m_test( NULL ), - m_className(), - m_name(), - m_description(), - m_isHidden( false ) - {} - - 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 ), - m_lineInfo( other.m_lineInfo ), - m_isHidden( other.m_isHidden ) + TestCaseInfo::TestCaseInfo( const std::string& _name, + const std::string& _className, + const std::string& _description, + const std::set& _tags, + bool _isHidden, + const SourceLineInfo& _lineInfo ) + : name( _name ), + className( _className ), + description( _description ), + tags( _tags ), + isHidden( _isHidden ), + lineInfo( _lineInfo ) {} 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 ), - m_lineInfo( other.m_lineInfo ), - m_isHidden( other.m_isHidden ) + : name( other.name ), + className( other.className ), + description( other.description ), + tags( other.tags ), + isHidden( other.isHidden ), + lineInfo( other.lineInfo ) {} - void TestCaseInfo::invoke() const { - m_test->invoke(); + TestCase::TestCase( ITestCase* testCase, const TestCaseInfo& info ) : TestCaseInfo( info ), test( testCase ) {} + + TestCase::TestCase( const TestCase& other ) + : TestCaseInfo( other ), + test( other.test ) + {} + + TestCase TestCase::withName( const std::string& _newName ) const { + TestCase other( *this ); + other.name = _newName; + return other; } - 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; + void TestCase::invoke() const { + test->invoke(); } - bool TestCaseInfo::isHidden() const { - return m_isHidden; + bool TestCase::isHidden() const { + return TestCaseInfo::isHidden; } - bool TestCaseInfo::hasTag( const std::string& tag ) const { - return m_tags.find( tag ) != m_tags.end(); + bool TestCase::hasTag( const std::string& tag ) const { + return tags.find( tag ) != tags.end(); } - bool TestCaseInfo::matchesTags( const std::string& tagPattern ) const { + bool TestCase::matchesTags( const std::string& tagPattern ) const { TagExpression exp; TagExpressionParser( exp ).parse( tagPattern ); - return exp.matches( m_tags ); + return exp.matches( tags ); } - const std::set& TestCaseInfo::getTags() const { - return m_tags; + const std::set& TestCase::getTags() const { + return tags; } - 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 ); - std::swap( m_lineInfo, other.m_lineInfo ); + void TestCase::swap( TestCase& other ) { + test.swap( other.test ); + className.swap( other.className ); + name.swap( other.name ); + description.swap( other.description ); + std::swap( lineInfo, other.lineInfo ); } - bool TestCaseInfo::operator == ( const TestCaseInfo& other ) const { - return m_test.get() == other.m_test.get() && - m_name == other.m_name && - m_className == other.m_className; + bool TestCase::operator == ( const TestCase& other ) const { + return test.get() == other.test.get() && + name == other.name && + className == other.className; } - bool TestCaseInfo::operator < ( const TestCaseInfo& other ) const { - return m_name < other.m_name; + bool TestCase::operator < ( const TestCase& other ) const { + return name < other.name; } - TestCaseInfo& TestCaseInfo::operator = ( const TestCaseInfo& other ) { - TestCaseInfo temp( other ); + TestCase& TestCase::operator = ( const TestCase& other ) { + TestCase temp( other ); swap( temp ); return *this; } + const TestCaseInfo& TestCase::getTestCaseInfo() const + { + return *this; + } + } // end namespace Catch // #included from: catch_version.hpp @@ -5385,7 +5580,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion = { 0, 9, 6, "integration" }; + Version libraryVersion( 0, 9, 7, "integration" ); } // #included from: ../reporters/catch_reporter_basic.hpp @@ -5396,12 +5591,44 @@ namespace Catch { namespace Catch { + template + class LegacyReporterRegistrar { + + class ReporterFactory : public IReporterFactory { + + virtual IStreamingReporter* create( const ReporterConfig& config ) const { + return new LegacyReporterAdapter( new T( config ), config ); + } + + virtual std::string getDescription() const { + return T::getDescription(); + } + }; + + public: + + LegacyReporterRegistrar( const std::string& name ) { + getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); + } + }; + template class ReporterRegistrar { class ReporterFactory : public IReporterFactory { - virtual IReporter* create( const ReporterConfig& config ) const { + // *** Please Note ***: + // - If you end up here looking at a compiler error because it's trying to register + // your custom reporter class be aware that the native reporter interface has changed + // to IStreamingReporter. The "legacy" interface, IReporter, is still supported via + // an adapter. Just use REGISTER_LEGACY_REPORTER to take advantage of the adapter. + // However please consider updating to the new interface as the old one is now + // deprecated and will probably be removed quite soon! + // Please contact me via github if you have any questions at all about this. + // In fact, ideally, please contact me anyway to let me know you've hit this - as I have + // no idea who is actually using custom reporters at all (possibly no-one!). + // The new interface is designed to minimise exposure to interface changes in the future. + virtual IStreamingReporter* create( const ReporterConfig& config ) const { return new T( config ); } @@ -5418,6 +5645,8 @@ namespace Catch { }; } +#define INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) \ + Catch::LegacyReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); #define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \ Catch::ReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); @@ -5462,27 +5691,27 @@ namespace Catch { void ReportCounts( const std::string& label, const Counts& counts, const std::string& allPrefix = "All " ) { if( counts.passed ) - m_config.stream << counts.failed << " of " << counts.total() << " " << label << "s failed"; + m_config.stream() << counts.failed << " of " << counts.total() << " " << label << "s failed"; else - m_config.stream << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed"; + m_config.stream() << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed"; } void ReportCounts( const Totals& totals, const std::string& allPrefix = "All " ) { if( totals.assertions.total() == 0 ) { - m_config.stream << "No tests ran"; + m_config.stream() << "No tests ran"; } else if( totals.assertions.failed ) { TextColour colour( TextColour::ResultError ); ReportCounts( "test case", totals.testCases, allPrefix ); if( totals.testCases.failed > 0 ) { - m_config.stream << " ("; + m_config.stream() << " ("; ReportCounts( "assertion", totals.assertions, allPrefix ); - m_config.stream << ")"; + m_config.stream() << ")"; } } else { TextColour colour( TextColour::ResultSuccess ); - m_config.stream << allPrefix << "tests passed (" + m_config.stream() << allPrefix << "tests passed (" << pluralise( totals.assertions.passed, "assertion" ) << " in " << pluralise( totals.testCases.passed, "test case" ) << ")"; } @@ -5505,14 +5734,14 @@ namespace Catch { virtual void EndTesting( const Totals& totals ) { // Output the overall test results even if "Started Testing" was not emitted if( m_aborted ) { - m_config.stream << "\n[Testing aborted. "; + m_config.stream() << "\n[Testing aborted. "; ReportCounts( totals, "The first " ); } else { - m_config.stream << "\n[Testing completed. "; + m_config.stream() << "\n[Testing completed. "; ReportCounts( totals ); } - m_config.stream << "]\n" << std::endl; + m_config.stream() << "]\n" << std::endl; } virtual void StartGroup( const std::string& groupName ) { @@ -5521,15 +5750,15 @@ namespace Catch { virtual void EndGroup( const std::string& groupName, const Totals& totals ) { if( m_groupSpan.emitted && !groupName.empty() ) { - m_config.stream << "[End of group: '" << groupName << "'. "; + m_config.stream() << "[End of group: '" << groupName << "'. "; ReportCounts( totals ); - m_config.stream << "]\n" << std::endl; + m_config.stream() << "]\n" << std::endl; m_groupSpan = SpanInfo(); } } virtual void StartTestCase( const TestCaseInfo& testInfo ) { - m_testSpan = testInfo.getName(); + m_testSpan = testInfo.name; } virtual void StartSection( const std::string& sectionName, const std::string& ) { @@ -5539,19 +5768,19 @@ namespace Catch { virtual void NoAssertionsInSection( const std::string& sectionName ) { startSpansLazily(); TextColour colour( TextColour::ResultError ); - m_config.stream << "\nNo assertions in section, '" << sectionName << "'\n" << std::endl; + m_config.stream() << "\nNo assertions in section, '" << sectionName << "'\n" << std::endl; } virtual void NoAssertionsInTestCase( const std::string& testName ) { startSpansLazily(); TextColour colour( TextColour::ResultError ); - m_config.stream << "\nNo assertions in test case, '" << testName << "'\n" << std::endl; + m_config.stream() << "\nNo assertions in test case, '" << testName << "'\n" << std::endl; } virtual void EndSection( const std::string& sectionName, const Counts& assertions ) { SpanInfo& sectionSpan = m_sectionSpans.back(); if( sectionSpan.emitted && !sectionSpan.name.empty() ) { - m_config.stream << "[End of section: '" << sectionName << "' "; + m_config.stream() << "[End of section: '" << sectionName << "' "; if( assertions.failed ) { TextColour colour( TextColour::ResultError ); @@ -5559,38 +5788,38 @@ namespace Catch { } else { TextColour colour( TextColour::ResultSuccess ); - m_config.stream << ( assertions.passed > 1 ? "All " : "" ) + m_config.stream() << ( assertions.passed > 1 ? "All " : "" ) << pluralise( assertions.passed, "assertion" ) << " passed" ; } - m_config.stream << "]\n" << std::endl; + m_config.stream() << "]\n" << std::endl; } m_sectionSpans.pop_back(); } virtual void Result( const AssertionResult& assertionResult ) { - if( !m_config.includeSuccessfulResults && assertionResult.getResultType() == ResultWas::Ok ) + if( !m_config.includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok ) return; startSpansLazily(); if( !assertionResult.getSourceInfo().empty() ) { TextColour colour( TextColour::FileName ); - m_config.stream << assertionResult.getSourceInfo(); + m_config.stream() << assertionResult.getSourceInfo(); } if( assertionResult.hasExpression() ) { TextColour colour( TextColour::OriginalExpression ); - m_config.stream << assertionResult.getExpression(); + m_config.stream() << assertionResult.getExpression(); if( assertionResult.succeeded() ) { TextColour successColour( TextColour::Success ); - m_config.stream << " succeeded"; + m_config.stream() << " succeeded"; } else { TextColour errorColour( TextColour::Error ); - m_config.stream << " failed"; + m_config.stream() << " failed"; if( assertionResult.isOk() ) { TextColour okAnywayColour( TextColour::Success ); - m_config.stream << " - but was ok"; + m_config.stream() << " - but was ok"; } } } @@ -5599,19 +5828,19 @@ namespace Catch { { TextColour colour( TextColour::Error ); if( assertionResult.hasExpression() ) - m_config.stream << " with unexpected"; + m_config.stream() << " with unexpected"; else - m_config.stream << "Unexpected"; - m_config.stream << " exception with message: '" << assertionResult.getMessage() << "'"; + m_config.stream() << "Unexpected"; + m_config.stream() << " exception with message: '" << assertionResult.getMessage() << "'"; } break; case ResultWas::DidntThrowException: { TextColour colour( TextColour::Error ); if( assertionResult.hasExpression() ) - m_config.stream << " because no exception was thrown where one was expected"; + m_config.stream() << " because no exception was thrown where one was expected"; else - m_config.stream << "No exception thrown where one was expected"; + m_config.stream() << "No exception thrown where one was expected"; } break; case ResultWas::Info: @@ -5629,7 +5858,7 @@ namespace Catch { case ResultWas::ExplicitFailure: { TextColour colour( TextColour::Error ); - m_config.stream << "failed with message: '" << assertionResult.getMessage() << "'"; + m_config.stream() << "failed with message: '" << assertionResult.getMessage() << "'"; } break; case ResultWas::Unknown: // These cases are here to prevent compiler warnings @@ -5640,19 +5869,19 @@ namespace Catch { if( !assertionResult.hasExpression() ) { if( assertionResult.succeeded() ) { TextColour colour( TextColour::Success ); - m_config.stream << " succeeded"; + m_config.stream() << " succeeded"; } else { TextColour colour( TextColour::Error ); - m_config.stream << " failed"; + m_config.stream() << " failed"; if( assertionResult.isOk() ) { TextColour okAnywayColour( TextColour::Success ); - m_config.stream << " - but was ok"; + m_config.stream() << " - but was ok"; } } } if( assertionResult.hasMessage() ) { - m_config.stream << "\n"; + m_config.stream() << "\n"; TextColour colour( TextColour::ReconstructedExpression ); streamVariableLengthText( "with message", assertionResult.getMessage() ); } @@ -5660,16 +5889,16 @@ namespace Catch { } if( assertionResult.hasExpandedExpression() ) { - m_config.stream << " for: "; + m_config.stream() << " for: "; if( assertionResult.getExpandedExpression().size() > 40 ) { - m_config.stream << "\n"; + m_config.stream() << "\n"; if( assertionResult.getExpandedExpression().size() < 70 ) - m_config.stream << "\t"; + m_config.stream() << "\t"; } TextColour colour( TextColour::ReconstructedExpression ); - m_config.stream << assertionResult.getExpandedExpression(); + m_config.stream() << assertionResult.getExpandedExpression(); } - m_config.stream << std::endl; + m_config.stream() << std::endl; } virtual void EndTestCase( const TestCaseInfo& testInfo, @@ -5687,9 +5916,9 @@ namespace Catch { } if( m_testSpan.emitted ) { - m_config.stream << "[Finished: '" << testInfo.getName() << "' "; + m_config.stream() << "[Finished: '" << testInfo.name << "' "; ReportCounts( totals ); - m_config.stream << "]" << std::endl; + m_config.stream() << "]" << std::endl; } } @@ -5697,20 +5926,20 @@ namespace Catch { void startSpansLazily() { if( !m_testingSpan.emitted ) { - if( m_config.name.empty() ) - m_config.stream << "[Started testing]" << std::endl; + if( m_config.name().empty() ) + m_config.stream() << "[Started testing]" << std::endl; else - m_config.stream << "[Started testing: " << m_config.name << "]" << std::endl; + m_config.stream() << "[Started testing: " << m_config.name() << "]" << std::endl; m_testingSpan.emitted = true; } if( !m_groupSpan.emitted && !m_groupSpan.name.empty() ) { - m_config.stream << "[Started group: '" << m_groupSpan.name << "']" << std::endl; + m_config.stream() << "[Started group: '" << m_groupSpan.name << "']" << std::endl; m_groupSpan.emitted = true; } if( !m_testSpan.emitted ) { - m_config.stream << std::endl << "[Running: " << m_testSpan.name << "]" << std::endl; + m_config.stream() << std::endl << "[Running: " << m_testSpan.name << "]" << std::endl; m_testSpan.emitted = true; } @@ -5718,7 +5947,7 @@ namespace Catch { SpanInfo& sectionSpan = m_sectionSpans.back(); if( !sectionSpan.emitted && !sectionSpan.name.empty() ) { if( m_firstSectionInTestCase ) { - m_config.stream << "\n"; + m_config.stream() << "\n"; m_firstSectionInTestCase = false; } std::vector::iterator it = m_sectionSpans.begin(); @@ -5726,7 +5955,7 @@ namespace Catch { for(; it != itEnd; ++it ) { SpanInfo& prevSpan = *it; if( !prevSpan.emitted && !prevSpan.name.empty() ) { - m_config.stream << "[Started section: '" << prevSpan.name << "']" << std::endl; + m_config.stream() << "[Started section: '" << prevSpan.name << "']" << std::endl; prevSpan.emitted = true; } } @@ -5737,10 +5966,10 @@ 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 << "]"; + m_config.stream() << "[" << prefix << ": " << trimmed << "]"; } else { - m_config.stream << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed + m_config.stream() << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed << "\n[end of " << prefix << "] <<<<<<<<<<<<<<<<<<<<<<<<\n"; } } @@ -5790,8 +6019,8 @@ namespace Catch { m_writer->endElement(); } - ScopedElement& writeText( const std::string& text ) { - m_writer->writeText( text ); + ScopedElement& writeText( const std::string& text, bool indent = true ) { + m_writer->writeText( text, indent ); return *this; } @@ -5887,11 +6116,11 @@ namespace Catch { return *this; } - XmlWriter& writeText( const std::string& text ) { + XmlWriter& writeText( const std::string& text, bool indent = true ) { if( !text.empty() ){ bool tagWasOpen = m_tagIsOpen; ensureTagClosed(); - if( tagWasOpen ) + if( tagWasOpen && indent ) stream() << m_indent; writeEncodedText( text ); m_needsNewline = true; @@ -5981,10 +6210,10 @@ namespace Catch { } virtual void StartTesting() { - m_xml = XmlWriter( m_config.stream ); + m_xml = XmlWriter( m_config.stream() ); m_xml.startElement( "Catch" ); - if( !m_config.name.empty() ) - m_xml.writeAttribute( "name", m_config.name ); + if( !m_config.name().empty() ) + m_xml.writeAttribute( "name", m_config.name() ); } virtual void EndTesting( const Totals& totals ) { @@ -6022,12 +6251,12 @@ namespace Catch { } virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) { - m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.getName() ); + m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.name ); m_currentTestSuccess = true; } virtual void Result( const Catch::AssertionResult& assertionResult ) { - if( !m_config.includeSuccessfulResults && assertionResult.getResultType() == ResultWas::Ok ) + if( !m_config.includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok ) return; if( assertionResult.hasExpression() ) { @@ -6121,6 +6350,7 @@ namespace Catch { std::string m_stdOut; std::string m_stdErr; std::vector m_testStats; + std::vector m_sections; }; struct Stats { @@ -6166,7 +6396,7 @@ namespace Catch { virtual void StartGroup( const std::string& groupName ) { if( groupName.empty() ) - m_statsForSuites.push_back( Stats( m_config.name ) ); + m_statsForSuites.push_back( Stats( m_config.name() ) ); else m_statsForSuites.push_back( Stats( groupName ) ); m_currentStats = &m_statsForSuites.back(); @@ -6185,11 +6415,12 @@ 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.getClassName(), testInfo.getName() ) ); + m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.className, testInfo.name ) ); + m_currentTestCaseStats.push_back( &m_currentStats->m_testCaseStats.back() ); } virtual void Result( const Catch::AssertionResult& assertionResult ) { - if( assertionResult.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults ) { + if( assertionResult.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults() ) { TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); TestStats stats; std::ostringstream oss; @@ -6233,6 +6464,8 @@ namespace Catch { } virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string& stdOut, const std::string& stdErr ) { + m_currentTestCaseStats.pop_back(); + assert( m_currentTestCaseStats.empty() ); TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); testCaseStats.m_stdOut = stdOut; testCaseStats.m_stdErr = stdErr; @@ -6247,32 +6480,29 @@ namespace Catch { } virtual void EndTesting( const Totals& ) { - std::ostream& str = m_config.stream; - { - XmlWriter xml( str ); + XmlWriter xml( m_config.stream() ); - if( m_statsForSuites.size() > 0 ) - xml.startElement( "testsuites" ); + if( m_statsForSuites.size() > 0 ) + xml.startElement( "testsuites" ); - std::vector::const_iterator it = m_statsForSuites.begin(); - std::vector::const_iterator itEnd = m_statsForSuites.end(); + std::vector::const_iterator it = m_statsForSuites.begin(); + std::vector::const_iterator itEnd = m_statsForSuites.end(); - for(; it != itEnd; ++it ) { - XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); - xml.writeAttribute( "name", it->m_name ); - xml.writeAttribute( "errors", it->m_errorsCount ); - xml.writeAttribute( "failures", it->m_failuresCount ); - xml.writeAttribute( "tests", it->m_testsCount ); - xml.writeAttribute( "hostname", "tbd" ); - xml.writeAttribute( "time", "tbd" ); - xml.writeAttribute( "timestamp", "tbd" ); + for(; it != itEnd; ++it ) { + XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); + xml.writeAttribute( "name", it->m_name ); + xml.writeAttribute( "errors", it->m_errorsCount ); + xml.writeAttribute( "failures", it->m_failuresCount ); + xml.writeAttribute( "tests", it->m_testsCount ); + xml.writeAttribute( "hostname", "tbd" ); + xml.writeAttribute( "time", "tbd" ); + xml.writeAttribute( "timestamp", "tbd" ); - OutputTestCases( xml, *it ); - } - - xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ) ); - xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ) ); + OutputTestCases( xml, *it ); } + + xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ), false ); + xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ), false ); } void OutputTestCases( XmlWriter& xml, const Stats& stats ) { @@ -6289,10 +6519,10 @@ namespace Catch { std::string stdOut = trim( it->m_stdOut ); if( !stdOut.empty() ) - xml.scopedElement( "system-out" ).writeText( stdOut ); + xml.scopedElement( "system-out" ).writeText( stdOut, false ); std::string stdErr = trim( it->m_stdErr ); if( !stdErr.empty() ) - xml.scopedElement( "system-err" ).writeText( stdErr ); + xml.scopedElement( "system-err" ).writeText( stdErr, false ); } } @@ -6318,6 +6548,7 @@ namespace Catch { Stats m_testSuiteStats; Stats* m_currentStats; std::vector m_statsForSuites; + std::vector m_currentTestCaseStats; std::ostringstream m_stdOut; std::ostringstream m_stdErr; }; @@ -6339,6 +6570,14 @@ namespace Catch { IReporter::~IReporter() {} IReporterFactory::~IReporterFactory() {} IReporterRegistry::~IReporterRegistry() {} + IStreamingReporter::~IStreamingReporter() {} + LegacyReporterAdapter::~LegacyReporterAdapter() {} + AssertionStats::~AssertionStats() {} + SectionStats::~SectionStats() {} + TestCaseStats::~TestCaseStats() {} + TestGroupStats::~TestGroupStats() {} + TestRunStats::~TestRunStats() {} + BasicReporter::~BasicReporter() {} IRunner::~IRunner() {} IMutableContext::~IMutableContext() {} @@ -6360,9 +6599,9 @@ namespace Catch { void Config::dummy() {} - INTERNAL_CATCH_REGISTER_REPORTER( "basic", BasicReporter ) - INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter ) - INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter ) + INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "basic", BasicReporter ) + INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "xml", XmlReporter ) + INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "junit", JunitReporter ) } @@ -6446,6 +6685,7 @@ int main (int argc, char * const argv[]) { #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) +#define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) #define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) @@ -6488,6 +6728,7 @@ int main (int argc, char * const argv[]) { #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) +#define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) #define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) From f276a0588c8c057b642266a94f893133fe0d99ef Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 2 Dec 2012 00:05:51 +0000 Subject: [PATCH 082/296] Added missing #include for assert to fix build failure --- README | 2 +- include/internal/catch_version.hpp | 2 +- include/reporters/catch_reporter_junit.hpp | 2 ++ single_include/catch.hpp | 8 +++++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README b/README index 526c1eff..a34bb854 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 7 (integration branch) +CATCH v0.9 build 8 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 4600a14a..6a8c26f9 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 7, "integration" ); + Version libraryVersion( 0, 9, 8, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 9d4b6388..21c4ccfb 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -13,6 +13,8 @@ #include "../internal/catch_reporter_registrars.hpp" #include "../internal/catch_xmlwriter.hpp" +#include + namespace Catch { class JunitReporter : public SharedImpl { diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 92546d11..5b231ebd 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 7 (integration branch) - * Generated: 2012-12-01 23:56:31.861593 + * CATCH v0.9 build 8 (integration branch) + * Generated: 2012-12-02 00:05:11.160560 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -5580,7 +5580,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 7, "integration" ); + Version libraryVersion( 0, 9, 8, "integration" ); } // #included from: ../reporters/catch_reporter_basic.hpp @@ -6325,6 +6325,8 @@ namespace Catch { // #included from: ../reporters/catch_reporter_junit.hpp #define TWOBLUECUBES_CATCH_REPORTER_JUNIT_HPP_INCLUDED +#include + namespace Catch { class JunitReporter : public SharedImpl { From fe98123d0bcfac7c47f398b9ca6bd2dca5b41c6e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 5 Dec 2012 08:40:53 +0000 Subject: [PATCH 083/296] Started new reporter, "console", which will replace "basic" when done. Introduced Option template as part of this. --- include/internal/catch_impl.hpp | 4 + include/internal/catch_interfaces_reporter.h | 71 ++++++++++++- include/internal/catch_option.hpp | 64 ++++++++++++ include/internal/catch_ptr.hpp | 6 ++ include/internal/catch_test_case_info.h | 2 +- include/internal/catch_test_case_info.hpp | 8 +- include/reporters/catch_reporter_console.hpp | 99 +++++++++++++++++++ .../SelfTest/SurrogateCpps/catch_option.cpp | 2 + .../CatchSelfTest.xcodeproj/project.pbxproj | 8 ++ 9 files changed, 258 insertions(+), 6 deletions(-) create mode 100644 include/internal/catch_option.hpp create mode 100644 include/reporters/catch_reporter_console.hpp create mode 100644 projects/SelfTest/SurrogateCpps/catch_option.cpp diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 014a6345..8b4c226c 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -31,6 +31,7 @@ #include "../reporters/catch_reporter_basic.hpp" #include "../reporters/catch_reporter_xml.hpp" #include "../reporters/catch_reporter_junit.hpp" +#include "../reporters/catch_reporter_console.hpp" namespace Catch { NonCopyable::~NonCopyable() {} @@ -54,8 +55,11 @@ namespace Catch { TestCaseStats::~TestCaseStats() {} TestGroupStats::~TestGroupStats() {} TestRunStats::~TestRunStats() {} + ThreadedSectionInfo::~ThreadedSectionInfo() {} BasicReporter::~BasicReporter() {} + AccumulatingReporter::~AccumulatingReporter() {} + ConsoleReporter::~ConsoleReporter() {} IRunner::~IRunner() {} IMutableContext::~IMutableContext() {} IConfig::~IConfig() {} diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index fc272755..2743e969 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -14,6 +14,7 @@ #include "catch_config.hpp" #include "catch_test_case_info.h" #include "catch_assertionresult.h" +#include "catch_option.hpp" #include #include @@ -25,7 +26,7 @@ namespace Catch ReporterConfig( std::ostream& _stream, ConfigData const& _fullConfig ) : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} - std::ostream& stream() { return *m_stream; } + std::ostream& stream() const { return *m_stream; } std::string name() const { return m_fullConfig.name; } bool includeSuccessfulResults() const { return m_fullConfig.includeWhichResults == Include::SuccessfulResults; } bool warnAboutMissingAssertions() const { return m_fullConfig.warnings & ConfigData::WarnAbout::NoAssertions; } @@ -66,6 +67,17 @@ namespace Catch SourceLineInfo lineInfo; }; + struct ThreadedSectionInfo : SectionInfo, SharedImpl<> { + ThreadedSectionInfo( SectionInfo const& _sectionInfo, Ptr const& _parent = Ptr() ) + : SectionInfo( _sectionInfo ), + parent( _parent ) + {} + virtual ~ThreadedSectionInfo(); + + std::vector > children; + Ptr parent; + }; + struct AssertionStats : SharedImpl<> { AssertionStats( AssertionResult const& _assertionResult, Totals const& _totals ) @@ -150,6 +162,10 @@ namespace Catch // !Work In progress struct IStreamingReporter : IShared { virtual ~IStreamingReporter(); + + // Implementing class must also provide the following static methid: + // static std::string getDescription(); + virtual ReporterPreferences getPreferences() const = 0; virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; @@ -171,6 +187,59 @@ namespace Catch // - this would be used by the JUnit reporter, for example. // - it may be used by the basic reporter, too, but that would clear down the stack // as it goes + struct AccumulatingReporter : SharedImpl { + + AccumulatingReporter( ReporterConfig const& _config ) + : stream( _config.stream() ) + {} + + virtual ~AccumulatingReporter(); + + virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { + testRunInfo = _testRunInfo; + } + virtual void testGroupStarting( GroupInfo const& _groupInfo ) { + unusedGroupInfo = _groupInfo; + } + + virtual void testCaseStarting( TestCaseInfo const& _testInfo ) { + unusedTestCaseInfo = _testInfo; + } + virtual void sectionStarting( SectionInfo const& _sectionInfo ) { + Ptr sectionInfo = new ThreadedSectionInfo( _sectionInfo ); + unusedSectionInfo = sectionInfo; + if( !currentSectionInfo ) { + currentSectionInfo = sectionInfo; + } + else { + currentSectionInfo->children.push_back( sectionInfo ); + sectionInfo->parent = currentSectionInfo; + currentSectionInfo = sectionInfo; + } + } + + virtual void sectionEnded( Ptr const& /* _sectionStats */ ) { + currentSectionInfo = currentSectionInfo->parent; + unusedSectionInfo = currentSectionInfo; + } + virtual void testCaseEnded( Ptr const& /* _testCaseStats */ ) { + unusedTestCaseInfo.reset(); + } + virtual void testGroupEnded( Ptr const& /* _testGroupStats */ ) { + unusedGroupInfo.reset(); + } + virtual void testRunEnded( Ptr const& /* _testRunStats */ ) { + } + + Option testRunInfo; + Option unusedGroupInfo; + Option unusedTestCaseInfo; + Ptr unusedSectionInfo; + Ptr currentSectionInfo; + bool currentSectionOpen; + std::ostream& stream; + }; + // Deprecated diff --git a/include/internal/catch_option.hpp b/include/internal/catch_option.hpp new file mode 100644 index 00000000..0b01a4dc --- /dev/null +++ b/include/internal/catch_option.hpp @@ -0,0 +1,64 @@ +/* + * Created by Phil on 02/12/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_OPTION_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED + +#include "catch_common.h" + +namespace Catch { + + // An optional type + template + class Option { + public: + Option() : nullableValue( NULL ) {} + Option( T const& _value ) + : nullableValue( new( storage ) T( _value ) ) + {} + Option( Option const& _other ) + : nullableValue( _other ? new( storage ) T( *_other ) : NULL ) + {} + + ~Option() { + reset(); + } + + Option& operator= ( Option const& _other ) { + reset(); + if( _other ) + nullableValue = new( storage ) T( *_other ); + return *this; + } + + void reset() { + if( nullableValue ) + nullableValue->~T(); + nullableValue = NULL; + } + T& operator*() { return *nullableValue; } + const T& operator*() const { return *nullableValue; } + T* operator->() { return nullableValue; } + const T* operator->() const { return nullableValue; } + + bool some() const { return nullableValue != NULL; } + bool none() const { return nullableValue == NULL; } + + bool operator !() const { return nullableValue == NULL; } + operator SafeBool::type() const { + return SafeBool::makeSafe( some() ); + } + + private: + T* nullableValue; + char storage[sizeof(T)]; + }; + + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED diff --git a/include/internal/catch_ptr.hpp b/include/internal/catch_ptr.hpp index 60000aaa..2817ddd1 100644 --- a/include/internal/catch_ptr.hpp +++ b/include/internal/catch_ptr.hpp @@ -31,6 +31,11 @@ namespace Catch { if( m_p ) m_p->release(); } + void reset() { + if( m_p ) + m_p->release(); + m_p = NULL; + } Ptr& operator = ( T* p ){ Ptr temp( p ); swap( temp ); @@ -47,6 +52,7 @@ namespace Catch { T& operator*() const { return *m_p; } T* operator->() const { return m_p; } bool operator !() const { return m_p == NULL; } + operator SafeBool::type() const { return SafeBool::makeSafe( m_p != NULL ); } private: T* m_p; diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h index b3f133b4..fd4e44ad 100644 --- a/include/internal/catch_test_case_info.h +++ b/include/internal/catch_test_case_info.h @@ -31,8 +31,8 @@ namespace Catch { std::string className; std::string description; std::set tags; - bool isHidden; SourceLineInfo lineInfo; + bool isHidden; }; class TestCase : protected TestCaseInfo { diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index e7e12166..6795047d 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -41,8 +41,8 @@ namespace Catch { className( _className ), description( _description ), tags( _tags ), - isHidden( _isHidden ), - lineInfo( _lineInfo ) + lineInfo( _lineInfo ), + isHidden( _isHidden ) {} TestCaseInfo::TestCaseInfo( const TestCaseInfo& other ) @@ -50,8 +50,8 @@ namespace Catch { className( other.className ), description( other.description ), tags( other.tags ), - isHidden( other.isHidden ), - lineInfo( other.lineInfo ) + lineInfo( other.lineInfo ), + isHidden( other.isHidden ) {} TestCase::TestCase( ITestCase* testCase, const TestCaseInfo& info ) : TestCaseInfo( info ), test( testCase ) {} diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp new file mode 100644 index 00000000..4eeb8c79 --- /dev/null +++ b/include/reporters/catch_reporter_console.hpp @@ -0,0 +1,99 @@ +/* + * Created by Phil on 5/12/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_REPORTER_CONSOLE_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_REPORTER_CONSOLE_HPP_INCLUDED + +#include "../internal/catch_interfaces_reporter.h" +#include "../internal/catch_reporter_registrars.hpp" +#include "../internal/catch_console_colour.hpp" + +namespace Catch { + + struct ConsoleReporter : AccumulatingReporter { + ConsoleReporter( ReporterConfig const& _config ) + : AccumulatingReporter( _config ) + {} + + virtual ~ConsoleReporter(); + static std::string getDescription() { + return "Reports test results as plain lines of text"; + } + virtual ReporterPreferences getPreferences() const { + ReporterPreferences prefs; + prefs.shouldRedirectStdOut = false; + return prefs; + + } + void lazyPrintRunInfo() { + stream << "[Started testing: " << testRunInfo->name << "]" << std::endl; + testRunInfo.reset(); + } + void lazyPrintGroupInfo() { + if( !unusedGroupInfo->name.empty() ) + stream << "[Group: " << unusedGroupInfo->name << "]" << std::endl; + unusedGroupInfo.reset(); + } + void lazyPrintTestCaseInfo() { + stream << "[TestCase: " << unusedTestCaseInfo->name << "]" << std::endl; + unusedTestCaseInfo.reset(); + } + void lazyPrintSectionInfo() { + ThreadedSectionInfo* section = unusedSectionInfo.get(); + bool firstSection = true; + stream << "[Section: "; + do { + if( firstSection ) + firstSection = false; + else + stream << ",\n "; + stream << section->name; + section = section->parent.get(); + } + while( section ); + + stream << "]" << std::endl; + unusedSectionInfo.reset(); + } + void lazyPrint() { + if( testRunInfo ) + lazyPrintRunInfo(); + if( unusedGroupInfo ) + lazyPrintGroupInfo(); + if( unusedTestCaseInfo ) + lazyPrintTestCaseInfo(); + if( unusedSectionInfo ) + lazyPrintSectionInfo(); + } + + virtual void assertionStarting( AssertionInfo const& _assertionInfo ) { + } + virtual void assertionEnded( Ptr const& _assertionStats ) { + if( !_assertionStats->assertionResult.isOk() ) + lazyPrint(); + } + + virtual void sectionEnded( Ptr const& _sectionStats ) { + if( !unusedSectionInfo ) { + stream << "[Section totals: ]" << std::endl; + } + AccumulatingReporter::sectionEnded( _sectionStats ); + } + virtual void testCaseEnded( Ptr const& _testCaseStats ) { + if( !unusedTestCaseInfo ) { + stream << "[TestCase totals: ]\n" << std::endl; + } + AccumulatingReporter::testCaseEnded( _testCaseStats ); + } + + }; + + INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_REPORTER_CONSOLE_HPP_INCLUDED diff --git a/projects/SelfTest/SurrogateCpps/catch_option.cpp b/projects/SelfTest/SurrogateCpps/catch_option.cpp new file mode 100644 index 00000000..9461fdef --- /dev/null +++ b/projects/SelfTest/SurrogateCpps/catch_option.cpp @@ -0,0 +1,2 @@ +// This file is only here to verify (to the extent possible) the self sufficiency of the header +#include "catch_option.hpp" diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 0376b843..7346eb15 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ 4AB3D99D1616216500C9A0F8 /* catch_interfaces_testcase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AB3D99C1616216500C9A0F8 /* catch_interfaces_testcase.cpp */; }; 4AB3D9A01616219100C9A0F8 /* catch_interfaces_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AB3D99F1616219100C9A0F8 /* catch_interfaces_config.cpp */; }; 4AB3D9A2161621B500C9A0F8 /* catch_interfaces_generators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AB3D9A1161621B500C9A0F8 /* catch_interfaces_generators.cpp */; }; + 4ACE21CC166CA1B300FB5509 /* catch_option.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACE21CA166CA1B300FB5509 /* catch_option.cpp */; }; 4AE1840B14EE4F230066340D /* catch_self_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AE1840A14EE4F230066340D /* catch_self_test.cpp */; }; 4AEE032016142F910071E950 /* catch_common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AEE031F16142F910071E950 /* catch_common.cpp */; }; 4AEE032316142FC70071E950 /* catch_debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AEE032216142FC70071E950 /* catch_debugger.cpp */; }; @@ -132,12 +133,15 @@ 4AB3D99C1616216500C9A0F8 /* catch_interfaces_testcase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_interfaces_testcase.cpp; path = ../../../SelfTest/SurrogateCpps/catch_interfaces_testcase.cpp; sourceTree = ""; }; 4AB3D99F1616219100C9A0F8 /* catch_interfaces_config.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_interfaces_config.cpp; path = ../../../SelfTest/SurrogateCpps/catch_interfaces_config.cpp; sourceTree = ""; }; 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 = ""; }; + 4AB42F84166F3E1A0099F2C8 /* catch_reporter_console.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_console.hpp; 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; 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_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; }; + 4ACE21C8166CA19700FB5509 /* catch_option.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_option.hpp; sourceTree = ""; }; + 4ACE21CA166CA1B300FB5509 /* catch_option.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_option.cpp; path = ../../../SelfTest/SurrogateCpps/catch_option.cpp; sourceTree = ""; }; 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 = ""; }; @@ -240,6 +244,7 @@ 4A6D0C66149B3E3D00DB3EAA /* catch_reporter_basic.hpp */, 4A6D0C67149B3E3D00DB3EAA /* catch_reporter_junit.hpp */, 4A6D0C68149B3E3D00DB3EAA /* catch_reporter_xml.hpp */, + 4AB42F84166F3E1A0099F2C8 /* catch_reporter_console.hpp */, ); name = reporters; path = ../../../../include/reporters; @@ -264,6 +269,7 @@ 4AB3D99C1616216500C9A0F8 /* catch_interfaces_testcase.cpp */, 4AB3D99F1616219100C9A0F8 /* catch_interfaces_config.cpp */, 4AB3D9A1161621B500C9A0F8 /* catch_interfaces_generators.cpp */, + 4ACE21CA166CA1B300FB5509 /* catch_option.cpp */, ); name = SurrogateCpps; sourceTree = ""; @@ -367,6 +373,7 @@ 4AB1C73714F97C1300F31DF7 /* catch_console_colour.hpp */, 4AB77CB51551AEA200857BF0 /* catch_ptr.hpp */, 4AEE0326161431070071E950 /* catch_streambuf.h */, + 4ACE21C8166CA19700FB5509 /* catch_option.hpp */, ); name = Infrastructure; sourceTree = ""; @@ -457,6 +464,7 @@ 4AB3D99D1616216500C9A0F8 /* catch_interfaces_testcase.cpp in Sources */, 4AB3D9A01616219100C9A0F8 /* catch_interfaces_config.cpp in Sources */, 4AB3D9A2161621B500C9A0F8 /* catch_interfaces_generators.cpp in Sources */, + 4ACE21CC166CA1B300FB5509 /* catch_option.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 442463473d5dbf30274943244d35e108850c6c8a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 6 Dec 2012 08:41:38 +0000 Subject: [PATCH 084/296] Updated obj-c bindings for new Matchers and TestCaseInfo changes --- include/internal/catch_matchers.hpp | 4 +- include/internal/catch_objc.hpp | 42 +++++++++---------- .../OCTest/OCTest.xcodeproj/project.pbxproj | 4 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/internal/catch_matchers.hpp b/include/internal/catch_matchers.hpp index b0a697e5..8fd88ad1 100644 --- a/include/internal/catch_matchers.hpp +++ b/include/internal/catch_matchers.hpp @@ -15,9 +15,11 @@ namespace Matchers { template struct Matcher : SharedImpl { + typedef ExpressionT ExpressionType; + virtual ~Matcher() {} virtual Ptr clone() const = 0; - virtual bool match( const ExpressionT& expr ) const = 0; + virtual bool match( ExpressionT const& expr ) const = 0; virtual std::string toString() const = 0; }; diff --git a/include/internal/catch_objc.hpp b/include/internal/catch_objc.hpp index dbc5a97f..eb8c5264 100644 --- a/include/internal/catch_objc.hpp +++ b/include/internal/catch_objc.hpp @@ -93,7 +93,7 @@ namespace Catch { std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); - getMutableRegistryHub().registerTest( TestCase( new OcMethod( cls, selector ), name.c_str(), desc.c_str(), SourceLineInfo() ) ); + getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), "", name.c_str(), desc.c_str(), SourceLineInfo() ) ); noTestMethods++; } } @@ -107,8 +107,10 @@ namespace Catch { namespace Impl { namespace NSStringMatchers { - struct StringHolder { + template + struct StringHolder : MatcherImpl{ StringHolder( NSString* substr ) : m_substr( [substr copy] ){} + StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){} StringHolder() { arcSafeRelease( m_substr ); } @@ -116,54 +118,50 @@ namespace Catch { NSString* m_substr; }; - struct Equals : StringHolder { + struct Equals : StringHolder { Equals( NSString* substr ) : StringHolder( substr ){} - bool operator()( NSString* str ) const { + virtual bool match( ExpressionType const& str ) const { return [str isEqualToString:m_substr]; } - friend std::ostream& operator<<( std::ostream& os, const Equals& matcher ) { - os << "equals string: " << Catch::toString( matcher.m_substr ); - return os; + virtual std::string toString() const { + return "equals string: \"" + Catch::toString( m_substr ) + "\""; } }; - struct Contains : StringHolder { + struct Contains : StringHolder { Contains( NSString* substr ) : StringHolder( substr ){} - bool operator()( NSString* str ) const { + virtual bool match( ExpressionType const& str ) const { return [str rangeOfString:m_substr].location != NSNotFound; } - friend std::ostream& operator<<( std::ostream& os, const Contains& matcher ) { - os << "contains: " << Catch::toString( matcher.m_substr ); - return os; + virtual std::string toString() const { + return "contains string: \"" + Catch::toString( m_substr ) + "\""; } }; - struct StartsWith : StringHolder { + struct StartsWith : StringHolder { StartsWith( NSString* substr ) : StringHolder( substr ){} - bool operator()( NSString* str ) const { + virtual bool match( ExpressionType const& str ) const { return [str rangeOfString:m_substr].location == 0; } - friend std::ostream& operator<<( std::ostream& os, const StartsWith& matcher ) { - os << "starts with: " << Catch::toString( matcher.m_substr ); - return os; + virtual std::string toString() const { + return "starts with: \"" + Catch::toString( m_substr ) + "\""; } }; - struct EndsWith : StringHolder { + struct EndsWith : StringHolder { EndsWith( NSString* substr ) : StringHolder( substr ){} - bool operator()( NSString* str ) const { + virtual bool match( ExpressionType const& str ) const { return [str rangeOfString:m_substr].location == [str length] - [m_substr length]; } - friend std::ostream& operator<<( std::ostream& os, const EndsWith& matcher ) { - os << "ends with: " << Catch::toString( matcher.m_substr ); - return os; + virtual std::string toString() const { + return "ends with: \"" + Catch::toString( m_substr ) + "\""; } }; diff --git a/projects/XCode4/OCTest/OCTest.xcodeproj/project.pbxproj b/projects/XCode4/OCTest/OCTest.xcodeproj/project.pbxproj index d6db4ae8..93f668c3 100644 --- a/projects/XCode4/OCTest/OCTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/OCTest/OCTest.xcodeproj/project.pbxproj @@ -208,7 +208,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; - HEADER_SEARCH_PATHS = ../../../single_include; + HEADER_SEARCH_PATHS = ../../../include; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -217,7 +217,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; - HEADER_SEARCH_PATHS = ../../../single_include; + HEADER_SEARCH_PATHS = ../../../include; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; From ff03cdf2b25b7129227e27321b72fe886d8e50ea Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 6 Dec 2012 08:44:51 +0000 Subject: [PATCH 085/296] Work in progress on Console reporter. Includes regenerated single include for Obj-C fixes --- README | 2 +- include/internal/catch_version.hpp | 2 +- include/reporters/catch_reporter_console.hpp | 73 ++++- single_include/catch.hpp | 319 +++++++++++++++++-- 4 files changed, 345 insertions(+), 51 deletions(-) diff --git a/README b/README index a34bb854..b5f5bb33 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 8 (integration branch) +CATCH v0.9 build 9 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 6a8c26f9..d0c7736f 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 8, "integration" ); + Version libraryVersion( 0, 9, 9, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 4eeb8c79..3d8abfa7 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -35,28 +35,27 @@ namespace Catch { } void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() ) - stream << "[Group: " << unusedGroupInfo->name << "]" << std::endl; + stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; unusedGroupInfo.reset(); } void lazyPrintTestCaseInfo() { - stream << "[TestCase: " << unusedTestCaseInfo->name << "]" << std::endl; + stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; unusedTestCaseInfo.reset(); } + std::string makeSectionPath( ThreadedSectionInfo const * section, std::string const& delimiter ) { + std::string sectionPath = "'" + section->name + "'"; + while( ( section = section->parent.get() ) ) + sectionPath = "'" + section->name + "'" + delimiter + sectionPath; + return sectionPath; + } void lazyPrintSectionInfo() { ThreadedSectionInfo* section = unusedSectionInfo.get(); - bool firstSection = true; - stream << "[Section: "; - do { - if( firstSection ) - firstSection = false; - else - stream << ",\n "; - stream << section->name; - section = section->parent.get(); - } - while( section ); - stream << "]" << std::endl; + std::string sectionPath = makeSectionPath( section, ", " ); + if( sectionPath.size() > 60 ) + sectionPath = makeSectionPath( section, ",\n " ); + + stream << "[Section: " << sectionPath << "]" << std::endl; unusedSectionInfo.reset(); } void lazyPrint() { @@ -77,19 +76,59 @@ namespace Catch { lazyPrint(); } + void printAssertionCounts( std::string const& label, Counts const& counts, std::string const& allPrefix = "All " ) { + if( counts.passed ) + stream << counts.failed << " of " << counts.total() << " " << label << "s failed"; + else + stream << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed"; + } + + void printTotals( const Totals& totals, const std::string& allPrefix = "All " ) { + if( totals.assertions.total() == 0 ) { + stream << "No tests ran"; + } + else if( totals.assertions.failed ) { + TextColour colour( TextColour::ResultError ); + printAssertionCounts( "test case", totals.testCases, allPrefix ); + if( totals.testCases.failed > 0 ) { + stream << " ("; + printAssertionCounts( "assertion", totals.assertions, allPrefix ); + stream << ")"; + } + } + else { + TextColour colour( TextColour::ResultSuccess ); + stream << allPrefix << "tests passed (" + << pluralise( totals.assertions.passed, "assertion" ) << " in " + << pluralise( totals.testCases.passed, "test case" ) << ")"; + } + } + virtual void sectionEnded( Ptr const& _sectionStats ) { if( !unusedSectionInfo ) { - stream << "[Section totals: ]" << std::endl; + stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; + printAssertionCounts( "assertion", _sectionStats->assertions ); + stream << "]\n" << std::endl; } AccumulatingReporter::sectionEnded( _sectionStats ); } virtual void testCaseEnded( Ptr const& _testCaseStats ) { if( !unusedTestCaseInfo ) { - stream << "[TestCase totals: ]\n" << std::endl; + stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; + printTotals( _testCaseStats->totals ); + stream << "]\n" << std::endl; } AccumulatingReporter::testCaseEnded( _testCaseStats ); } - + virtual void testGroupEnded( Ptr const& _testGroupStats ) { + // !TBD + AccumulatingReporter::testGroupEnded( _testGroupStats ); + } + virtual void testRunEnded( Ptr const& _testRunStats ) { + // !TBD + AccumulatingReporter::testRunEnded( _testRunStats ); + } + }; INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 5b231ebd..9e04ac30 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 8 (integration branch) - * Generated: 2012-12-02 00:05:11.160560 + * CATCH v0.9 build 9 (integration branch) + * Generated: 2012-12-06 08:42:33.813351 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -274,6 +274,11 @@ namespace Catch { if( m_p ) m_p->release(); } + void reset() { + if( m_p ) + m_p->release(); + m_p = NULL; + } Ptr& operator = ( T* p ){ Ptr temp( p ); swap( temp ); @@ -290,6 +295,7 @@ namespace Catch { T& operator*() const { return *m_p; } T* operator->() const { return m_p; } bool operator !() const { return m_p == NULL; } + operator SafeBool::type() const { return SafeBool::makeSafe( m_p != NULL ); } private: T* m_p; @@ -1246,8 +1252,8 @@ namespace Catch { std::string className; std::string description; std::set tags; - bool isHidden; SourceLineInfo lineInfo; + bool isHidden; }; class TestCase : protected TestCaseInfo { @@ -1877,6 +1883,59 @@ namespace Catch { } // end namespace Catch +// #included from: catch_option.hpp +#define TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED + +namespace Catch { + + // An optional type + template + class Option { + public: + Option() : nullableValue( NULL ) {} + Option( T const& _value ) + : nullableValue( new( storage ) T( _value ) ) + {} + Option( Option const& _other ) + : nullableValue( _other ? new( storage ) T( *_other ) : NULL ) + {} + + ~Option() { + reset(); + } + + Option& operator= ( Option const& _other ) { + reset(); + if( _other ) + nullableValue = new( storage ) T( *_other ); + return *this; + } + + void reset() { + if( nullableValue ) + nullableValue->~T(); + nullableValue = NULL; + } + T& operator*() { return *nullableValue; } + const T& operator*() const { return *nullableValue; } + T* operator->() { return nullableValue; } + const T* operator->() const { return nullableValue; } + + bool some() const { return nullableValue != NULL; } + bool none() const { return nullableValue == NULL; } + + bool operator !() const { return nullableValue == NULL; } + operator SafeBool::type() const { + return SafeBool::makeSafe( some() ); + } + + private: + T* nullableValue; + char storage[sizeof(T)]; + }; + +} // end namespace Catch + #include #include #include @@ -1887,7 +1946,7 @@ namespace Catch ReporterConfig( std::ostream& _stream, ConfigData const& _fullConfig ) : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} - std::ostream& stream() { return *m_stream; } + std::ostream& stream() const { return *m_stream; } std::string name() const { return m_fullConfig.name; } bool includeSuccessfulResults() const { return m_fullConfig.includeWhichResults == Include::SuccessfulResults; } bool warnAboutMissingAssertions() const { return m_fullConfig.warnings & ConfigData::WarnAbout::NoAssertions; } @@ -1928,6 +1987,17 @@ namespace Catch SourceLineInfo lineInfo; }; + struct ThreadedSectionInfo : SectionInfo, SharedImpl<> { + ThreadedSectionInfo( SectionInfo const& _sectionInfo, Ptr const& _parent = Ptr() ) + : SectionInfo( _sectionInfo ), + parent( _parent ) + {} + virtual ~ThreadedSectionInfo(); + + std::vector > children; + Ptr parent; + }; + struct AssertionStats : SharedImpl<> { AssertionStats( AssertionResult const& _assertionResult, Totals const& _totals ) @@ -2012,6 +2082,10 @@ namespace Catch // !Work In progress struct IStreamingReporter : IShared { virtual ~IStreamingReporter(); + + // Implementing class must also provide the following static methid: + // static std::string getDescription(); + virtual ReporterPreferences getPreferences() const = 0; virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; @@ -2033,6 +2107,58 @@ namespace Catch // - this would be used by the JUnit reporter, for example. // - it may be used by the basic reporter, too, but that would clear down the stack // as it goes + struct AccumulatingReporter : SharedImpl { + + AccumulatingReporter( ReporterConfig const& _config ) + : stream( _config.stream() ) + {} + + virtual ~AccumulatingReporter(); + + virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { + testRunInfo = _testRunInfo; + } + virtual void testGroupStarting( GroupInfo const& _groupInfo ) { + unusedGroupInfo = _groupInfo; + } + + virtual void testCaseStarting( TestCaseInfo const& _testInfo ) { + unusedTestCaseInfo = _testInfo; + } + virtual void sectionStarting( SectionInfo const& _sectionInfo ) { + Ptr sectionInfo = new ThreadedSectionInfo( _sectionInfo ); + unusedSectionInfo = sectionInfo; + if( !currentSectionInfo ) { + currentSectionInfo = sectionInfo; + } + else { + currentSectionInfo->children.push_back( sectionInfo ); + sectionInfo->parent = currentSectionInfo; + currentSectionInfo = sectionInfo; + } + } + + virtual void sectionEnded( Ptr const& /* _sectionStats */ ) { + currentSectionInfo = currentSectionInfo->parent; + unusedSectionInfo = currentSectionInfo; + } + virtual void testCaseEnded( Ptr const& /* _testCaseStats */ ) { + unusedTestCaseInfo.reset(); + } + virtual void testGroupEnded( Ptr const& /* _testGroupStats */ ) { + unusedGroupInfo.reset(); + } + virtual void testRunEnded( Ptr const& /* _testRunStats */ ) { + } + + Option testRunInfo; + Option unusedGroupInfo; + Option unusedTestCaseInfo; + Ptr unusedSectionInfo; + Ptr currentSectionInfo; + bool currentSectionOpen; + std::ostream& stream; + }; // Deprecated struct IReporter : IShared { @@ -2716,9 +2842,11 @@ namespace Matchers { template struct Matcher : SharedImpl { + typedef ExpressionT ExpressionType; + virtual ~Matcher() {} virtual Ptr clone() const = 0; - virtual bool match( const ExpressionT& expr ) const = 0; + virtual bool match( ExpressionT const& expr ) const = 0; virtual std::string toString() const = 0; }; @@ -3008,7 +3136,7 @@ namespace Catch { std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); - getMutableRegistryHub().registerTest( TestCase( new OcMethod( cls, selector ), name.c_str(), desc.c_str(), SourceLineInfo() ) ); + getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), "", name.c_str(), desc.c_str(), SourceLineInfo() ) ); noTestMethods++; } } @@ -3022,8 +3150,10 @@ namespace Catch { namespace Impl { namespace NSStringMatchers { - struct StringHolder { + template + struct StringHolder : MatcherImpl{ StringHolder( NSString* substr ) : m_substr( [substr copy] ){} + StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){} StringHolder() { arcSafeRelease( m_substr ); } @@ -3031,54 +3161,50 @@ namespace Catch { NSString* m_substr; }; - struct Equals : StringHolder { + struct Equals : StringHolder { Equals( NSString* substr ) : StringHolder( substr ){} - bool operator()( NSString* str ) const { + virtual bool match( ExpressionType const& str ) const { return [str isEqualToString:m_substr]; } - friend std::ostream& operator<<( std::ostream& os, const Equals& matcher ) { - os << "equals string: " << Catch::toString( matcher.m_substr ); - return os; + virtual std::string toString() const { + return "equals string: \"" + Catch::toString( m_substr ) + "\""; } }; - struct Contains : StringHolder { + struct Contains : StringHolder { Contains( NSString* substr ) : StringHolder( substr ){} - bool operator()( NSString* str ) const { + virtual bool match( ExpressionType const& str ) const { return [str rangeOfString:m_substr].location != NSNotFound; } - friend std::ostream& operator<<( std::ostream& os, const Contains& matcher ) { - os << "contains: " << Catch::toString( matcher.m_substr ); - return os; + virtual std::string toString() const { + return "contains string: \"" + Catch::toString( m_substr ) + "\""; } }; - struct StartsWith : StringHolder { + struct StartsWith : StringHolder { StartsWith( NSString* substr ) : StringHolder( substr ){} - bool operator()( NSString* str ) const { + virtual bool match( ExpressionType const& str ) const { return [str rangeOfString:m_substr].location == 0; } - friend std::ostream& operator<<( std::ostream& os, const StartsWith& matcher ) { - os << "starts with: " << Catch::toString( matcher.m_substr ); - return os; + virtual std::string toString() const { + return "starts with: \"" + Catch::toString( m_substr ) + "\""; } }; - struct EndsWith : StringHolder { + struct EndsWith : StringHolder { EndsWith( NSString* substr ) : StringHolder( substr ){} - bool operator()( NSString* str ) const { + virtual bool match( ExpressionType const& str ) const { return [str rangeOfString:m_substr].location == [str length] - [m_substr length]; } - friend std::ostream& operator<<( std::ostream& os, const EndsWith& matcher ) { - os << "ends with: " << Catch::toString( matcher.m_substr ); - return os; + virtual std::string toString() const { + return "ends with: \"" + Catch::toString( m_substr ) + "\""; } }; @@ -5498,8 +5624,8 @@ namespace Catch { className( _className ), description( _description ), tags( _tags ), - isHidden( _isHidden ), - lineInfo( _lineInfo ) + lineInfo( _lineInfo ), + isHidden( _isHidden ) {} TestCaseInfo::TestCaseInfo( const TestCaseInfo& other ) @@ -5507,8 +5633,8 @@ namespace Catch { className( other.className ), description( other.description ), tags( other.tags ), - isHidden( other.isHidden ), - lineInfo( other.lineInfo ) + lineInfo( other.lineInfo ), + isHidden( other.isHidden ) {} TestCase::TestCase( ITestCase* testCase, const TestCaseInfo& info ) : TestCaseInfo( info ), test( testCase ) {} @@ -5580,7 +5706,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 8, "integration" ); + Version libraryVersion( 0, 9, 9, "integration" ); } // #included from: ../reporters/catch_reporter_basic.hpp @@ -6557,6 +6683,132 @@ namespace Catch { } // end namespace Catch +// #included from: ../reporters/catch_reporter_console.hpp +#define TWOBLUECUBES_CATCH_REPORTER_CONSOLE_HPP_INCLUDED + +namespace Catch { + + struct ConsoleReporter : AccumulatingReporter { + ConsoleReporter( ReporterConfig const& _config ) + : AccumulatingReporter( _config ) + {} + + virtual ~ConsoleReporter(); + static std::string getDescription() { + return "Reports test results as plain lines of text"; + } + virtual ReporterPreferences getPreferences() const { + ReporterPreferences prefs; + prefs.shouldRedirectStdOut = false; + return prefs; + + } + void lazyPrintRunInfo() { + stream << "[Started testing: " << testRunInfo->name << "]" << std::endl; + testRunInfo.reset(); + } + void lazyPrintGroupInfo() { + if( !unusedGroupInfo->name.empty() ) + stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; + unusedGroupInfo.reset(); + } + void lazyPrintTestCaseInfo() { + stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; + unusedTestCaseInfo.reset(); + } + std::string makeSectionPath( ThreadedSectionInfo const * section, std::string const& delimiter ) { + std::string sectionPath = "'" + section->name + "'"; + while( ( section = section->parent.get() ) ) + sectionPath = "'" + section->name + "'" + delimiter + sectionPath; + return sectionPath; + } + void lazyPrintSectionInfo() { + ThreadedSectionInfo* section = unusedSectionInfo.get(); + + std::string sectionPath = makeSectionPath( section, ", " ); + if( sectionPath.size() > 60 ) + sectionPath = makeSectionPath( section, ",\n " ); + + stream << "[Section: " << sectionPath << "]" << std::endl; + unusedSectionInfo.reset(); + } + void lazyPrint() { + if( testRunInfo ) + lazyPrintRunInfo(); + if( unusedGroupInfo ) + lazyPrintGroupInfo(); + if( unusedTestCaseInfo ) + lazyPrintTestCaseInfo(); + if( unusedSectionInfo ) + lazyPrintSectionInfo(); + } + + virtual void assertionStarting( AssertionInfo const& _assertionInfo ) { + } + virtual void assertionEnded( Ptr const& _assertionStats ) { + if( !_assertionStats->assertionResult.isOk() ) + lazyPrint(); + } + + void printAssertionCounts( std::string const& label, Counts const& counts, std::string const& allPrefix = "All " ) { + if( counts.passed ) + stream << counts.failed << " of " << counts.total() << " " << label << "s failed"; + else + stream << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed"; + } + + void printTotals( const Totals& totals, const std::string& allPrefix = "All " ) { + if( totals.assertions.total() == 0 ) { + stream << "No tests ran"; + } + else if( totals.assertions.failed ) { + TextColour colour( TextColour::ResultError ); + printAssertionCounts( "test case", totals.testCases, allPrefix ); + if( totals.testCases.failed > 0 ) { + stream << " ("; + printAssertionCounts( "assertion", totals.assertions, allPrefix ); + stream << ")"; + } + } + else { + TextColour colour( TextColour::ResultSuccess ); + stream << allPrefix << "tests passed (" + << pluralise( totals.assertions.passed, "assertion" ) << " in " + << pluralise( totals.testCases.passed, "test case" ) << ")"; + } + } + + virtual void sectionEnded( Ptr const& _sectionStats ) { + if( !unusedSectionInfo ) { + stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; + printAssertionCounts( "assertion", _sectionStats->assertions ); + stream << "]\n" << std::endl; + } + AccumulatingReporter::sectionEnded( _sectionStats ); + } + virtual void testCaseEnded( Ptr const& _testCaseStats ) { + if( !unusedTestCaseInfo ) { + stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; + printTotals( _testCaseStats->totals ); + stream << "]\n" << std::endl; + } + AccumulatingReporter::testCaseEnded( _testCaseStats ); + } + virtual void testGroupEnded( Ptr const& _testGroupStats ) { + // !TBD + AccumulatingReporter::testGroupEnded( _testGroupStats ); + } + virtual void testRunEnded( Ptr const& _testRunStats ) { + // !TBD + AccumulatingReporter::testRunEnded( _testRunStats ); + } + + }; + + INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) + +} // end namespace Catch + namespace Catch { NonCopyable::~NonCopyable() {} IShared::~IShared() {} @@ -6579,8 +6831,11 @@ namespace Catch { TestCaseStats::~TestCaseStats() {} TestGroupStats::~TestGroupStats() {} TestRunStats::~TestRunStats() {} + ThreadedSectionInfo::~ThreadedSectionInfo() {} BasicReporter::~BasicReporter() {} + AccumulatingReporter::~AccumulatingReporter() {} + ConsoleReporter::~ConsoleReporter() {} IRunner::~IRunner() {} IMutableContext::~IMutableContext() {} IConfig::~IConfig() {} From daedf8ff5ff927c4a7b4033a3c2379ea136529c7 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 6 Dec 2012 18:39:08 +0000 Subject: [PATCH 086/296] Minimal changes to get iTchRunner to work again --- .gitignore | 3 +- .../iTchRunner/internal/iTchRunnerMainView.h | 62 +++++++++++++++---- .../iTchRunner/internal/iTchRunnerReporter.h | 8 ++- projects/runners/iTchRunner/itChRunnerMain.mm | 1 + 4 files changed, 58 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index ccd16f6c..b3bb2b8c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ Breakpoints.xcbkptlist projects/VS2010/TestCatch/_UpgradeReport_Files/ projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj.filters projects/VisualStudio/TestCatch/UpgradeLog.XML -UpgradeLog.XML \ No newline at end of file +UpgradeLog.XML +projects/XCode4/iOSTest/Build/Intermediates/PrecompiledHeaders diff --git a/projects/runners/iTchRunner/internal/iTchRunnerMainView.h b/projects/runners/iTchRunner/internal/iTchRunnerMainView.h index 12f9c5db..5cc8802b 100644 --- a/projects/runners/iTchRunner/internal/iTchRunnerMainView.h +++ b/projects/runners/iTchRunner/internal/iTchRunnerMainView.h @@ -75,40 +75,78 @@ } +// This is a copy & paste from Catch::Runner2 to get us bootstrapped (this is due to all be +// replaced anyway) +inline Catch::Totals runTestsForGroup( Catch::Runner& context, const Catch::TestCaseFilters& filterGroup ) { + using namespace Catch; + Totals totals; + std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); + std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); + int testsRunForGroup = 0; + for(; it != itEnd; ++it ) { + if( filterGroup.shouldInclude( *it ) ) { + testsRunForGroup++; + + if( context.aborting() ) + break; + + totals += context.runTest( *it ); + } + } + if( testsRunForGroup == 0 ) + std::cerr << "\n[No test cases matched with: " << filterGroup.getName() << "]" << std::endl; + return totals; + +} + /////////////////////////////////////////////////////////////////////////////// -(void) actionSheet: (UIActionSheet*) sheet clickedButtonAtIndex: (NSInteger) index { Catch::Config config; - config.setReporter( new Catch::iTchRunnerReporter( self ) ); - Catch::Runner runner( config ); - - config.getReporter()->StartGroup( "" ); - runner.runAll( true ); - config.getReporter()->EndGroup( "", runner.getTotals() ); + Catch::IReporter* reporter = new Catch::iTchRunnerReporter( self ); + Catch::LegacyReporterAdapter* reporterAdapter = new Catch::LegacyReporterAdapter( reporter, Catch::ReporterConfig( config.stream(), config.data() ) ); + Catch::Runner runner( config, reporterAdapter ); - if( runner.getTotals().assertions.failed == 0 ) + + std::vector filterGroups; + Catch::TestCaseFilters filterGroup( "" ); + filterGroups.push_back( filterGroup ); + + Catch::Totals totals; + + std::vector::const_iterator it = filterGroups.begin(); + std::vector::const_iterator itEnd = filterGroups.end(); + + for(; it != itEnd && !runner.aborting(); ++it ) { + runner.testGroupStarting( it->getName() ); + totals += runTestsForGroup( runner, *it ); + runner.testGroupEnded( it->getName(), totals ); + } + + + if( totals.assertions.failed == 0 ) { NSLog( @"no failures" ); - if( runner.getTotals().assertions.passed > 0 ) + if( totals.assertions.passed > 0 ) appName.textColor = [[UIColor alloc] initWithRed:0.35 green:1 blue:0.35 alpha:1]; } else { - NSLog( @"%lu failures", runner.getTotals().assertions.failed ); + NSLog( @"%lu failures", totals.assertions.failed ); appName.textColor = [[UIColor alloc] initWithRed:1 green:0.35 blue:0.35 alpha:1]; } } /////////////////////////////////////////////////////////////////////////////// --(void) testWasRun: (const Catch::ResultInfo*) pResultInfo +-(void) testWasRun: (const Catch::AssertionResult*) pResultInfo { - const Catch::ResultInfo& resultInfo = *pResultInfo; + const Catch::AssertionResult& resultInfo = *pResultInfo; std::ostringstream oss; if( resultInfo.hasExpression() ) { oss << resultInfo.getExpression(); - if( resultInfo.ok() ) + if( resultInfo.isOk() ) oss << " succeeded"; else oss << " failed"; diff --git a/projects/runners/iTchRunner/internal/iTchRunnerReporter.h b/projects/runners/iTchRunner/internal/iTchRunnerReporter.h index 08bd1aac..a7adf866 100644 --- a/projects/runners/iTchRunner/internal/iTchRunnerReporter.h +++ b/projects/runners/iTchRunner/internal/iTchRunnerReporter.h @@ -13,7 +13,7 @@ @protocol iTchRunnerDelegate --(void) testWasRun: (const Catch::ResultInfo*) result; +-(void) testWasRun: (const Catch::AssertionResult*) result; @end @@ -87,7 +87,7 @@ namespace Catch /////////////////////////////////////////////////////////////////////////// virtual void Result ( - const ResultInfo& result + const AssertionResult& result ) { [m_delegate testWasRun: &result]; @@ -102,7 +102,9 @@ namespace Catch virtual void EndSection( const std::string&, const Counts& ){} virtual void EndTestCase( const TestCaseInfo&, const Totals&, const std::string&, const std::string& ){} virtual void Aborted() {} - + virtual void NoAssertionsInSection( std::string const& sectionName ) {} + virtual void NoAssertionsInTestCase( std::string const& testName ) {} + private: Totals m_totals; diff --git a/projects/runners/iTchRunner/itChRunnerMain.mm b/projects/runners/iTchRunner/itChRunnerMain.mm index a28bc756..cac5faec 100644 --- a/projects/runners/iTchRunner/itChRunnerMain.mm +++ b/projects/runners/iTchRunner/itChRunnerMain.mm @@ -6,6 +6,7 @@ // Copyright Two Blue Cubes Ltd 2011. All rights reserved. // +#define CATCH_CONFIG_RUNNER #include "catch.hpp" #import "internal/iTchRunnerAppDelegate.h" From e6d1c9897a61871f6542c973909251a19a2f693a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 9 Dec 2012 11:20:46 +0000 Subject: [PATCH 087/296] Fleshed out console reporter --- approvalTests.py | 4 +- include/internal/catch_interfaces_reporter.h | 8 +- include/reporters/catch_reporter_console.hpp | 194 +++++++++++++++++-- 3 files changed, 189 insertions(+), 17 deletions(-) diff --git a/approvalTests.py b/approvalTests.py index ef9ddbf3..af52f60c 100644 --- a/approvalTests.py +++ b/approvalTests.py @@ -14,7 +14,9 @@ filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unap cmdPath = sys.argv[1] f = open( rawResultsPath, 'w' ) -subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions" ], stdout=f, stderr=f ) +subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic" ], stdout=f, stderr=f ) +#subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console" ], stdout=f, stderr=f ) +#subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic", "-a", "4" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "junit" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "xml" ], stdout=f, stderr=f ) f.close() diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 2743e969..efde354b 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -70,12 +70,14 @@ namespace Catch struct ThreadedSectionInfo : SectionInfo, SharedImpl<> { ThreadedSectionInfo( SectionInfo const& _sectionInfo, Ptr const& _parent = Ptr() ) : SectionInfo( _sectionInfo ), - parent( _parent ) + parent( _parent ), + printed( false ) {} virtual ~ThreadedSectionInfo(); std::vector > children; Ptr parent; + bool printed; }; struct AssertionStats : SharedImpl<> { @@ -190,7 +192,8 @@ namespace Catch struct AccumulatingReporter : SharedImpl { AccumulatingReporter( ReporterConfig const& _config ) - : stream( _config.stream() ) + : m_config( _config ), + stream( _config.stream() ) {} virtual ~AccumulatingReporter(); @@ -231,6 +234,7 @@ namespace Catch virtual void testRunEnded( Ptr const& /* _testRunStats */ ) { } + ReporterConfig m_config; Option testRunInfo; Option unusedGroupInfo; Option unusedTestCaseInfo; diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 3d8abfa7..2b9b75fb 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -35,11 +35,13 @@ namespace Catch { } void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() ) - stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; +// stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; + stream << "[Started group: '" << unusedGroupInfo->name << "']" << std::endl; unusedGroupInfo.reset(); } void lazyPrintTestCaseInfo() { - stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; +// stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; + stream << "[Running: " << unusedTestCaseInfo->name << "]" << std::endl; unusedTestCaseInfo.reset(); } std::string makeSectionPath( ThreadedSectionInfo const * section, std::string const& delimiter ) { @@ -49,6 +51,7 @@ namespace Catch { return sectionPath; } void lazyPrintSectionInfo() { + // !TBD use printed flag ThreadedSectionInfo* section = unusedSectionInfo.get(); std::string sectionPath = makeSectionPath( section, ", " ); @@ -58,6 +61,21 @@ namespace Catch { stream << "[Section: " << sectionPath << "]" << std::endl; unusedSectionInfo.reset(); } + + void lazyPrintSectionInfoLegacy() { + std::vector sections; + for( ThreadedSectionInfo* section = unusedSectionInfo.get(); + section && !section->printed; + section = section->parent.get() ) + sections.push_back( section ); + + typedef std::vector::const_reverse_iterator It; + for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { + stream << "[Started section: " << "'" + (*it)->name + "'" << "]" << std::endl; + (*it)->printed = true; + } + unusedSectionInfo.reset(); + } void lazyPrint() { if( testRunInfo ) lazyPrintRunInfo(); @@ -65,17 +83,134 @@ namespace Catch { lazyPrintGroupInfo(); if( unusedTestCaseInfo ) lazyPrintTestCaseInfo(); - if( unusedSectionInfo ) - lazyPrintSectionInfo(); + if( currentSectionInfo && !currentSectionInfo->printed ) + lazyPrintSectionInfoLegacy(); // !TBD } - virtual void assertionStarting( AssertionInfo const& _assertionInfo ) { + virtual void assertionStarting( AssertionInfo const& ) { } virtual void assertionEnded( Ptr const& _assertionStats ) { - if( !_assertionStats->assertionResult.isOk() ) - lazyPrint(); - } + AssertionResult const& result = _assertionStats->assertionResult; + + // Drop out if result was successful and we're not printing those + if( !m_config.includeSuccessfulResults() && result.isOk() ) + return; + + lazyPrint(); + + if( !result.getSourceInfo().empty() ) { + TextColour colour( TextColour::FileName ); + stream << result.getSourceInfo(); + } + + if( result.hasExpression() ) { + TextColour colour( TextColour::OriginalExpression ); + stream << result.getExpression(); + if( result.succeeded() ) { + TextColour successColour( TextColour::Success ); + stream << " succeeded"; + } + else { + TextColour errorColour( TextColour::Error ); + stream << " failed"; + if( result.isOk() ) { + TextColour okAnywayColour( TextColour::Success ); + stream << " - but was ok"; + } + } + } + + switch( result.getResultType() ) { + case ResultWas::ThrewException: + { + TextColour colour( TextColour::Error ); + if( result.hasExpression() ) + stream << " with unexpected"; + else + stream << "Unexpected"; + stream << " exception with message: '" << result.getMessage() << "'"; + } + break; + case ResultWas::DidntThrowException: + { + TextColour colour( TextColour::Error ); + if( result.hasExpression() ) + stream << " because no exception was thrown where one was expected"; + else + stream << "No exception thrown where one was expected"; + } + break; + case ResultWas::Info: + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "info", result.getMessage() ); + } + break; + case ResultWas::Warning: + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "warning", result.getMessage() ); + } + break; + case ResultWas::ExplicitFailure: + { + TextColour colour( TextColour::Error ); + stream << "failed with message: '" << result.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( !result.hasExpression() ) { + if( result.succeeded() ) { + TextColour colour( TextColour::Success ); + stream << " succeeded"; + } + else { + TextColour colour( TextColour::Error ); + stream << " failed"; + if( result.isOk() ) { + TextColour okAnywayColour( TextColour::Success ); + stream << " - but was ok"; + } + } + } + if( result.hasMessage() ) { + stream << "\n"; + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "with message", result.getMessage() ); + } + break; + } + + if( result.hasExpandedExpression() ) { + stream << " for: "; + if( result.getExpandedExpression().size() > 40 ) { + stream << "\n"; + if( result.getExpandedExpression().size() < 70 ) + stream << "\t"; + } + TextColour colour( TextColour::ReconstructedExpression ); + stream << result.getExpandedExpression(); + } + + stream << std::endl; + } + + void streamVariableLengthText( std::string const& prefix, std::string const& text ) { + std::string trimmed = trim( text ); + if( trimmed.find_first_of( "\r\n" ) == std::string::npos ) { + stream << "[" << prefix << ": " << trimmed << "]"; + } + else { + stream << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed + << "\n[end of " << prefix << "] <<<<<<<<<<<<<<<<<<<<<<<<\n"; + } + } + void printAssertionCounts( std::string const& label, Counts const& counts, std::string const& allPrefix = "All " ) { if( counts.passed ) stream << counts.failed << " of " << counts.total() << " " << label << "s failed"; @@ -105,27 +240,58 @@ namespace Catch { } virtual void sectionEnded( Ptr const& _sectionStats ) { - if( !unusedSectionInfo ) { - stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; - printAssertionCounts( "assertion", _sectionStats->assertions ); + if( _sectionStats->missingAssertions ) { + lazyPrint(); + TextColour colour( TextColour::ResultError ); + stream << "\nNo assertions in section, '" << _sectionStats->sectionInfo.name << "'\n" << std::endl; + } + if( currentSectionInfo && currentSectionInfo->printed ) { +// stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; + stream << "[End of section: '" << _sectionStats->sectionInfo.name << "' "; + Counts const& assertions = _sectionStats->assertions; + if( assertions.failed ) { + TextColour colour( TextColour::ResultError ); + printAssertionCounts( "assertion", assertions ); + } + else { + TextColour colour( TextColour::ResultSuccess ); + stream << ( assertions.passed > 1 ? "All " : "" ) + << pluralise( assertions.passed, "assertion" ) << " passed" ; + } stream << "]\n" << std::endl; } AccumulatingReporter::sectionEnded( _sectionStats ); } virtual void testCaseEnded( Ptr const& _testCaseStats ) { + if( _testCaseStats->missingAssertions ) { + lazyPrint(); + TextColour colour( TextColour::ResultError ); + stream << "\nNo assertions in test case, '" << _testCaseStats->testInfo.name << "'\n" << std::endl; + } if( !unusedTestCaseInfo ) { - stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; +// stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; + stream << "[Finished: '" << _testCaseStats->testInfo.name << "' "; printTotals( _testCaseStats->totals ); stream << "]\n" << std::endl; } AccumulatingReporter::testCaseEnded( _testCaseStats ); } virtual void testGroupEnded( Ptr const& _testGroupStats ) { - // !TBD + if( !unusedGroupInfo ) { +// stream << "[Summary for group '" << _testGroupStats->groupInfo.name << "': "; + stream << "[End of group '" << _testGroupStats->groupInfo.name << "'. "; + printTotals( _testGroupStats->totals ); + stream << "]\n" << std::endl; + } AccumulatingReporter::testGroupEnded( _testGroupStats ); } virtual void testRunEnded( Ptr const& _testRunStats ) { - // !TBD + if( !unusedTestCaseInfo ) { +// stream << "[Summary for '" << _testRunStats->runInfo.name << "': "; + stream << "[Testing completed. "; + printTotals( _testRunStats->totals ); + stream << "]\n" << std::endl; + } AccumulatingReporter::testRunEnded( _testRunStats ); } From 8a2bfc3ab644540b8882897f9a43d62cb845d21f Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 9 Dec 2012 11:21:50 +0000 Subject: [PATCH 088/296] Updated .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b3bb2b8c..14f42f52 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj.filters projects/VisualStudio/TestCatch/UpgradeLog.XML UpgradeLog.XML projects/XCode4/iOSTest/Build/Intermediates/PrecompiledHeaders +projects/XCode4/iOSTest/Build/Products/Debug-iphonesimulator/iOSTest.app.dSYM/Contents/Resources/DWARF +projects/XCode4/iOSTest/Build From 51f05722094d450cdddf0d550d334ddb523856a4 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 9 Dec 2012 11:33:54 +0000 Subject: [PATCH 089/296] Added approval test for aborted test results (-a) --- approvalTests.py | 2 +- .../SelfTest/Baselines/approvedResults.txt | 81 +++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/approvalTests.py b/approvalTests.py index af52f60c..6910cba2 100644 --- a/approvalTests.py +++ b/approvalTests.py @@ -15,8 +15,8 @@ cmdPath = sys.argv[1] f = open( rawResultsPath, 'w' ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic" ], stdout=f, stderr=f ) +subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic", "-a", "4" ], stdout=f, stderr=f ) #subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console" ], stdout=f, stderr=f ) -#subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic", "-a", "4" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "junit" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "xml" ], stdout=f, stderr=f ) f.close() diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 195d532f..295ab9be 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1340,6 +1340,87 @@ BDDTests.cpp:37: itDoesThis() succeeded for: true [Testing completed. 44 of 95 test cases failed (101 of 607 assertions failed)] +[Started testing: CatchSelfTest] +[Started group: '~dummy'] + +[Running: ./succeeding/Approx/simple] +ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) +ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) +ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 +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] +ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) +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] +ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) +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] +ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded +ApproxTests.cpp:61: 0 == Approx( 0 ) succeeded +[Finished: './succeeding/Approx/int' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/Approx/mixed] +ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) +ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) +ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) +ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) +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] +ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) +ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) +ApproxTests.cpp:96: d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) +ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 +ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 +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] +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] +ClassTests.cpp:28: s == "world" failed for: "hello" == "world" +[Finished: './failing/TestClass/failingCase' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/Fixture/succeedingCase] +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] +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] +ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 +ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) +ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) +ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" +ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" +ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 +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] +ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 +ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 +[Finished: './failing/conditions/equality' 1 test case failed (All 2 assertions failed)] +[End of group: '~dummy'. 3 of 12 test cases failed (4 of 38 assertions failed)] + + +[Testing aborted. 3 of 12 test cases failed (4 of 38 assertions failed)] + From f4c0a1848db323a673e4c816fd75a82e61754fb4 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 9 Dec 2012 21:46:15 +0000 Subject: [PATCH 090/296] console reporter is now a full replacement for the basic reporter, using the new streaming interface directly --- approvalTests.py | 7 ++++--- include/reporters/catch_reporter_console.hpp | 2 ++ projects/SelfTest/Baselines/approvedResults.txt | 13 +++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/approvalTests.py b/approvalTests.py index 6910cba2..29543425 100644 --- a/approvalTests.py +++ b/approvalTests.py @@ -14,9 +14,10 @@ filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unap cmdPath = sys.argv[1] f = open( rawResultsPath, 'w' ) -subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic" ], stdout=f, stderr=f ) -subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic", "-a", "4" ], stdout=f, stderr=f ) -#subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console" ], stdout=f, stderr=f ) +#subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic" ], stdout=f, stderr=f ) +#subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic", "-a", "4" ], stdout=f, stderr=f ) +subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console" ], stdout=f, stderr=f ) +subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console", "-a", "4" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "junit" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "xml" ], stdout=f, stderr=f ) f.close() diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 2b9b75fb..fabcc4f7 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -46,6 +46,8 @@ namespace Catch { } std::string makeSectionPath( ThreadedSectionInfo const * section, std::string const& delimiter ) { std::string sectionPath = "'" + section->name + "'"; + + // !TBD: Do this without the assignment in the while as it causes warnings: while( ( section = section->parent.get() ) ) sectionPath = "'" + section->name + "'" + delimiter + sectionPath; return sectionPath; diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 295ab9be..f2f31a07 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,5 @@ [Started testing: CatchSelfTest] [Started group: '~dummy'] - [Running: ./succeeding/Approx/simple] ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) @@ -453,7 +452,6 @@ MessageTests.cpp:51: 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'] MessageTests.cpp:58: failed with message: 'Message from section one' [End of section: 'one' 1 assertion failed] @@ -463,8 +461,8 @@ MessageTests.cpp:63: 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)] -Message from section one +Message from section one [Running: ./succeeding/message/sections/stdout] [Started section: 'one'] @@ -604,9 +602,9 @@ MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 MiscTests.cpp:114: [info: Testing if fib[7] (21) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 [Finished: './mixed/Misc/loops' 1 test case failed (6 of 8 assertions failed)] + Some information An error - [Running: ./succeeding/Misc/stdout,stderr] No assertions in test case, './succeeding/Misc/stdout,stderr' @@ -1335,14 +1333,13 @@ BDDTests.cpp:37: itDoesThis() succeeded for: true [End of section: 'This stuff exists' 1 assertion passed] [Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 44 of 95 test cases failed (101 of 607 assertions failed)] +[End of group '~dummy'. 44 of 95 test cases failed (101 of 607 assertions failed)] [Testing completed. 44 of 95 test cases failed (101 of 607 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] - [Running: ./succeeding/Approx/simple] ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) @@ -1416,10 +1413,10 @@ ConditionTests.cpp:63: x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 [Finished: './failing/conditions/equality' 1 test case failed (All 2 assertions failed)] -[End of group: '~dummy'. 3 of 12 test cases failed (4 of 38 assertions failed)] +[End of group '~dummy'. 3 of 12 test cases failed (4 of 38 assertions failed)] -[Testing aborted. 3 of 12 test cases failed (4 of 38 assertions failed)] +[Testing completed. 3 of 12 test cases failed (4 of 38 assertions failed)] From bcad093af74659761eb8fbce0a8c6ad42a933681 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 10 Dec 2012 08:54:57 +0000 Subject: [PATCH 091/296] Console reporter is now the default --- README | 2 +- include/catch_runner.hpp | 2 +- include/internal/catch_version.hpp | 2 +- include/reporters/catch_reporter_console.hpp | 50 +- .../SelfTest/Baselines/approvedResults.txt | 822 +++++++++--------- projects/SelfTest/TestMain.cpp | 4 +- projects/SelfTest/catch_self_test.hpp | 2 +- single_include/catch.hpp | 206 ++++- 8 files changed, 613 insertions(+), 477 deletions(-) diff --git a/README b/README index b5f5bb33..41f6f7c7 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 9 (integration branch) +CATCH v0.9 build 10 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 55f3d30a..71f91981 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -95,7 +95,7 @@ namespace Catch { } void makeReporter() { std::string reporterName = m_config.reporter.empty() - ? "basic" + ? "console" : m_config.reporter; ReporterConfig reporterConfig( m_configWrapper.stream(), m_config ); diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index d0c7736f..78c4d938 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 9, "integration" ); + Version libraryVersion( 0, 9, 10, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index fabcc4f7..5c1d99ab 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -35,36 +35,17 @@ namespace Catch { } void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() ) -// stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; - stream << "[Started group: '" << unusedGroupInfo->name << "']" << std::endl; + stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; +// stream << "[Started group: '" << unusedGroupInfo->name << "']" << std::endl; unusedGroupInfo.reset(); } void lazyPrintTestCaseInfo() { -// stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; - stream << "[Running: " << unusedTestCaseInfo->name << "]" << std::endl; + stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; +// stream << "[Running: " << unusedTestCaseInfo->name << "]" << std::endl; unusedTestCaseInfo.reset(); } - std::string makeSectionPath( ThreadedSectionInfo const * section, std::string const& delimiter ) { - std::string sectionPath = "'" + section->name + "'"; - - // !TBD: Do this without the assignment in the while as it causes warnings: - while( ( section = section->parent.get() ) ) - sectionPath = "'" + section->name + "'" + delimiter + sectionPath; - return sectionPath; - } - void lazyPrintSectionInfo() { - // !TBD use printed flag - ThreadedSectionInfo* section = unusedSectionInfo.get(); - - std::string sectionPath = makeSectionPath( section, ", " ); - if( sectionPath.size() > 60 ) - sectionPath = makeSectionPath( section, ",\n " ); - - stream << "[Section: " << sectionPath << "]" << std::endl; - unusedSectionInfo.reset(); - } - void lazyPrintSectionInfoLegacy() { + void lazyPrintSectionInfo() { std::vector sections; for( ThreadedSectionInfo* section = unusedSectionInfo.get(); section && !section->printed; @@ -73,7 +54,8 @@ namespace Catch { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { - stream << "[Started section: " << "'" + (*it)->name + "'" << "]" << std::endl; +// stream << "[Started section: " << "'" + (*it)->name + "'" << "]" << std::endl; + stream << "[Section: " << "'" + (*it)->name + "'" << "]" << std::endl; (*it)->printed = true; } unusedSectionInfo.reset(); @@ -86,7 +68,7 @@ namespace Catch { if( unusedTestCaseInfo ) lazyPrintTestCaseInfo(); if( currentSectionInfo && !currentSectionInfo->printed ) - lazyPrintSectionInfoLegacy(); // !TBD + lazyPrintSectionInfo(); } virtual void assertionStarting( AssertionInfo const& ) { @@ -248,8 +230,8 @@ namespace Catch { stream << "\nNo assertions in section, '" << _sectionStats->sectionInfo.name << "'\n" << std::endl; } if( currentSectionInfo && currentSectionInfo->printed ) { -// stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; - stream << "[End of section: '" << _sectionStats->sectionInfo.name << "' "; + stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; +// stream << "[End of section: '" << _sectionStats->sectionInfo.name << "' "; Counts const& assertions = _sectionStats->assertions; if( assertions.failed ) { TextColour colour( TextColour::ResultError ); @@ -271,8 +253,8 @@ namespace Catch { stream << "\nNo assertions in test case, '" << _testCaseStats->testInfo.name << "'\n" << std::endl; } if( !unusedTestCaseInfo ) { -// stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; - stream << "[Finished: '" << _testCaseStats->testInfo.name << "' "; + stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; +// stream << "[Finished: '" << _testCaseStats->testInfo.name << "' "; printTotals( _testCaseStats->totals ); stream << "]\n" << std::endl; } @@ -280,8 +262,8 @@ namespace Catch { } virtual void testGroupEnded( Ptr const& _testGroupStats ) { if( !unusedGroupInfo ) { -// stream << "[Summary for group '" << _testGroupStats->groupInfo.name << "': "; - stream << "[End of group '" << _testGroupStats->groupInfo.name << "'. "; + stream << "[Summary for group '" << _testGroupStats->groupInfo.name << "': "; +// stream << "[End of group '" << _testGroupStats->groupInfo.name << "'. "; printTotals( _testGroupStats->totals ); stream << "]\n" << std::endl; } @@ -289,8 +271,8 @@ namespace Catch { } virtual void testRunEnded( Ptr const& _testRunStats ) { if( !unusedTestCaseInfo ) { -// stream << "[Summary for '" << _testRunStats->runInfo.name << "': "; - stream << "[Testing completed. "; + stream << "[Summary for '" << _testRunStats->runInfo.name << "': "; +// stream << "[Testing completed. "; printTotals( _testRunStats->totals ); stream << "]\n" << std::endl; } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index f2f31a07..cfdb4648 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,38 +1,38 @@ [Started testing: CatchSelfTest] -[Started group: '~dummy'] -[Running: ./succeeding/Approx/simple] +[Group: '~dummy'] +[Test case: './succeeding/Approx/simple'] ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 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)] +[Summary for test case './succeeding/Approx/simple': All tests passed (6 assertions in 1 test case)] -[Running: ./succeeding/Approx/epsilon] +[Test case: './succeeding/Approx/epsilon'] ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) 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)] +[Summary for test case './succeeding/Approx/epsilon': All tests passed (2 assertions in 1 test case)] -[Running: ./succeeding/Approx/float] +[Test case: './succeeding/Approx/float'] ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) 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)] +[Summary for test case './succeeding/Approx/float': All tests passed (2 assertions in 1 test case)] -[Running: ./succeeding/Approx/int] +[Test case: './succeeding/Approx/int'] ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded ApproxTests.cpp:61: 0 == Approx( 0 ) succeeded -[Finished: './succeeding/Approx/int' All tests passed (2 assertions in 1 test case)] +[Summary for test case './succeeding/Approx/int': All tests passed (2 assertions in 1 test case)] -[Running: ./succeeding/Approx/mixed] +[Test case: './succeeding/Approx/mixed'] ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) 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)] +[Summary for test case './succeeding/Approx/mixed': All tests passed (5 assertions in 1 test case)] -[Running: ./succeeding/Approx/custom] +[Test case: './succeeding/Approx/custom'] ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) @@ -41,25 +41,25 @@ ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 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)] +[Summary for test case './succeeding/Approx/custom': All tests passed (8 assertions in 1 test case)] -[Running: ./succeeding/TestClass/succeedingCase] +[Test case: './succeeding/TestClass/succeedingCase'] ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" -[Finished: './succeeding/TestClass/succeedingCase' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/TestClass/succeedingCase': All tests passed (1 assertion in 1 test case)] -[Running: ./failing/TestClass/failingCase] +[Test case: './failing/TestClass/failingCase'] ClassTests.cpp:28: s == "world" failed for: "hello" == "world" -[Finished: './failing/TestClass/failingCase' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/TestClass/failingCase': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/Fixture/succeedingCase] +[Test case: './succeeding/Fixture/succeedingCase'] ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 -[Finished: './succeeding/Fixture/succeedingCase' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/Fixture/succeedingCase': All tests passed (1 assertion in 1 test case)] -[Running: ./failing/Fixture/failingCase] +[Test case: './failing/Fixture/failingCase'] ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 -[Finished: './failing/Fixture/failingCase' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/Fixture/failingCase': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/conditions/equality] +[Test case: './succeeding/conditions/equality'] ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) @@ -67,9 +67,9 @@ ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hell ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 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)] +[Summary for test case './succeeding/conditions/equality': All tests passed (7 assertions in 1 test case)] -[Running: ./failing/conditions/equality] +[Test case: './failing/conditions/equality'] ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 ConditionTests.cpp:73: data.int_seven == 0 failed for: 7 == 0 @@ -83,9 +83,9 @@ ConditionTests.cpp:80: data.str_hello == "hell" failed for: "hello" == "hell" ConditionTests.cpp:81: data.str_hello == "hello1" failed for: "hello" == "hello1" ConditionTests.cpp:82: data.str_hello.size() == 6 failed for: 5 == 6 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)] +[Summary for test case './failing/conditions/equality': 1 test case failed (All 13 assertions failed)] -[Running: ./succeeding/conditions/inequality] +[Test case: './succeeding/conditions/inequality'] ConditionTests.cpp:93: data.int_seven != 6 succeeded for: 7 != 6 ConditionTests.cpp:94: data.int_seven != 8 succeeded for: 7 != 8 ConditionTests.cpp:95: data.float_nine_point_one != Approx( 9.11f ) succeeded for: 9.1 != Approx( 9.11 ) @@ -97,17 +97,17 @@ ConditionTests.cpp:100: data.str_hello != "goodbye" succeeded for: "hello" != "g ConditionTests.cpp:101: data.str_hello != "hell" succeeded for: "hello" != "hell" ConditionTests.cpp:102: data.str_hello != "hello1" succeeded for: "hello" != "hello1" 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)] +[Summary for test case './succeeding/conditions/inequality': All tests passed (11 assertions in 1 test case)] -[Running: ./failing/conditions/inequality] +[Test case: './failing/conditions/inequality'] ConditionTests.cpp:111: data.int_seven != 7 failed for: 7 != 7 ConditionTests.cpp:112: data.float_nine_point_one != Approx( 9.1f ) failed for: 9.1 != Approx( 9.1 ) ConditionTests.cpp:113: data.double_pi != Approx( 3.1415926535 ) failed for: 3.14159 != Approx( 3.14159 ) ConditionTests.cpp:114: data.str_hello != "hello" failed for: "hello" != "hello" ConditionTests.cpp:115: data.str_hello.size() != 5 failed for: 5 != 5 -[Finished: './failing/conditions/inequality' 1 test case failed (All 5 assertions failed)] +[Summary for test case './failing/conditions/inequality': 1 test case failed (All 5 assertions failed)] -[Running: ./succeeding/conditions/ordered] +[Test case: './succeeding/conditions/ordered'] ConditionTests.cpp:124: data.int_seven < 8 succeeded for: 7 < 8 ConditionTests.cpp:125: data.int_seven > 6 succeeded for: 7 > 6 ConditionTests.cpp:126: data.int_seven > 0 succeeded for: 7 > 0 @@ -125,9 +125,9 @@ ConditionTests.cpp:141: data.str_hello < "hellp" succeeded for: "hello" < "hellp ConditionTests.cpp:142: data.str_hello < "zebra" succeeded for: "hello" < "zebra" ConditionTests.cpp:143: data.str_hello > "hellm" succeeded for: "hello" > "hellm" ConditionTests.cpp:144: data.str_hello > "a" succeeded for: "hello" > "a" -[Finished: './succeeding/conditions/ordered' All tests passed (17 assertions in 1 test case)] +[Summary for test case './succeeding/conditions/ordered': All tests passed (17 assertions in 1 test case)] -[Running: ./failing/conditions/ordered] +[Test case: './failing/conditions/ordered'] ConditionTests.cpp:152: data.int_seven > 7 failed for: 7 > 7 ConditionTests.cpp:153: data.int_seven < 7 failed for: 7 < 7 ConditionTests.cpp:154: data.int_seven > 8 failed for: 7 > 8 @@ -147,9 +147,9 @@ ConditionTests.cpp:170: data.str_hello < "hellm" failed for: "hello" < "hellm" ConditionTests.cpp:171: data.str_hello < "a" failed for: "hello" < "a" ConditionTests.cpp:173: data.str_hello >= "z" failed for: "hello" >= "z" ConditionTests.cpp:174: data.str_hello <= "a" failed for: "hello" <= "a" -[Finished: './failing/conditions/ordered' 1 test case failed (All 19 assertions failed)] +[Summary for test case './failing/conditions/ordered': 1 test case failed (All 19 assertions failed)] -[Running: ./succeeding/conditions/int literals] +[Test case: './succeeding/conditions/int literals'] ConditionTests.cpp:188: i == 1 succeeded for: 1 == 1 ConditionTests.cpp:189: ui == 2 succeeded for: 2 == 2 ConditionTests.cpp:190: l == 3 succeeded for: 3 == 3 @@ -163,36 +163,36 @@ ConditionTests.cpp:198: 4 == ul succeeded for: 4 == 4 ConditionTests.cpp:199: 5 == c succeeded for: 5 == 5 ConditionTests.cpp:200: 6 == uc succeeded for: 6 ==  ConditionTests.cpp:202: (std::numeric_limits::max)() > ul succeeded for: 0x > 4 -[Finished: './succeeding/conditions/int literals' All tests passed (13 assertions in 1 test case)] +[Summary for test case './succeeding/conditions/int literals': All tests passed (13 assertions in 1 test case)] -[Running: ./succeeding/conditions//long_to_unsigned_x] +[Test case: './succeeding/conditions//long_to_unsigned_x'] ConditionTests.cpp:223: long_var == unsigned_char_var succeeded for: 1 ==  ConditionTests.cpp:224: long_var == unsigned_short_var succeeded for: 1 == 1 ConditionTests.cpp:225: long_var == unsigned_int_var succeeded for: 1 == 1 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)] +[Summary for test case './succeeding/conditions//long_to_unsigned_x': All tests passed (4 assertions in 1 test case)] -[Running: ./succeeding/conditions/const ints to int literal] +[Test case: './succeeding/conditions/const ints to int literal'] ConditionTests.cpp:237: unsigned_char_var == 1 succeeded for:  == 1 ConditionTests.cpp:238: unsigned_short_var == 1 succeeded for: 1 == 1 ConditionTests.cpp:239: unsigned_int_var == 1 succeeded for: 1 == 1 ConditionTests.cpp:240: unsigned_long_var == 1 succeeded for: 1 == 1 -[Finished: './succeeding/conditions/const ints to int literal' All tests passed (4 assertions in 1 test case)] +[Summary for test case './succeeding/conditions/const ints to int literal': All tests passed (4 assertions in 1 test case)] -[Running: ./succeeding/conditions/negative ints] +[Test case: './succeeding/conditions/negative ints'] ConditionTests.cpp:246: ( -1 > 2u ) succeeded for: true ConditionTests.cpp:247: -1 > 2u succeeded for: -1 > 2 ConditionTests.cpp:249: ( 2u < -1 ) succeeded for: true ConditionTests.cpp:250: 2u < -1 succeeded for: 2 < -1 ConditionTests.cpp:253: ( minInt > 2u ) succeeded for: true ConditionTests.cpp:254: minInt > 2u succeeded for: -2147483648 > 2 -[Finished: './succeeding/conditions/negative ints' All tests passed (6 assertions in 1 test case)] +[Summary for test case './succeeding/conditions/negative ints': All tests passed (6 assertions in 1 test case)] -[Running: ./succeeding/conditions/computed ints] +[Test case: './succeeding/conditions/computed ints'] ConditionTests.cpp:269: 54 == 6*9 succeeded for: 54 == 54 -[Finished: './succeeding/conditions/computed ints' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/conditions/computed ints': All tests passed (1 assertion in 1 test case)] -[Running: ./succeeding/conditions/ptr] +[Test case: './succeeding/conditions/ptr'] ConditionTests.cpp:285: p == __null succeeded for: __null == 0 ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null ConditionTests.cpp:291: p != __null succeeded for: 0x != 0 @@ -201,9 +201,9 @@ ConditionTests.cpp:297: cpc != __null succeeded for: 0x != 0 ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x -[Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] +[Summary for test case './succeeding/conditions/ptr': All tests passed (8 assertions in 1 test case)] -[Running: ./succeeding/conditions/not] +[Test case: './succeeding/conditions/not'] ConditionTests.cpp:317: false == false succeeded ConditionTests.cpp:318: true == true succeeded ConditionTests.cpp:319: !false succeeded for: true @@ -212,9 +212,9 @@ ConditionTests.cpp:322: !falseValue succeeded for: true ConditionTests.cpp:323: !falseValue succeeded for: !false ConditionTests.cpp:325: !(1 == 2) succeeded for: true ConditionTests.cpp:326: !1 == 2 succeeded for: !(1 == 2) -[Finished: './succeeding/conditions/not' All tests passed (8 assertions in 1 test case)] +[Summary for test case './succeeding/conditions/not': All tests passed (8 assertions in 1 test case)] -[Running: ./failing/conditions/not] +[Test case: './failing/conditions/not'] ConditionTests.cpp:334: false != false failed ConditionTests.cpp:335: true != true failed ConditionTests.cpp:336: !true failed for: false @@ -223,56 +223,56 @@ ConditionTests.cpp:339: !trueValue failed for: false ConditionTests.cpp:340: !trueValue failed for: !true ConditionTests.cpp:342: !(1 == 1) failed for: false ConditionTests.cpp:343: !1 == 1 failed for: !(1 == 1) -[Finished: './failing/conditions/not' 1 test case failed (All 8 assertions failed)] +[Summary for test case './failing/conditions/not': 1 test case failed (All 8 assertions failed)] -[Running: ./succeeding/exceptions/explicit] +[Test case: './succeeding/exceptions/explicit'] ExceptionTests.cpp:39: thisThrows() succeeded ExceptionTests.cpp:40: thisDoesntThrow() succeeded ExceptionTests.cpp:41: thisThrows() succeeded -[Finished: './succeeding/exceptions/explicit' All tests passed (3 assertions in 1 test case)] +[Summary for test case './succeeding/exceptions/explicit': All tests passed (3 assertions in 1 test case)] -[Running: ./failing/exceptions/explicit] +[Test case: './failing/exceptions/explicit'] ExceptionTests.cpp:47: thisThrows() failed with unexpected exception with message: 'expected exception' ExceptionTests.cpp:48: thisDoesntThrow() failed because no exception was thrown where one was expected ExceptionTests.cpp:49: thisThrows() failed with unexpected exception with message: 'expected exception' -[Finished: './failing/exceptions/explicit' 1 test case failed (All 3 assertions failed)] +[Summary for test case './failing/exceptions/explicit': 1 test case failed (All 3 assertions failed)] -[Running: ./failing/exceptions/implicit] +[Test case: './failing/exceptions/implicit'] ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' -[Finished: './failing/exceptions/implicit' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/exceptions/implicit': 1 test case failed (1 assertion failed)] -[Running: ./failing/exceptions/implicit/2] +[Test case: './failing/exceptions/implicit/2'] ExceptionTests.cpp:60: 1 == 1 succeeded ExceptionTests.cpp:60: {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' -[Finished: './failing/exceptions/implicit/2' 1 test case failed (1 of 2 assertions failed)] +[Summary for test case './failing/exceptions/implicit/2': 1 test case failed (1 of 2 assertions failed)] -[Running: ./succeeding/exceptions/implicit] +[Test case: './succeeding/exceptions/implicit'] No assertions in test case, './succeeding/exceptions/implicit' -[Finished: './succeeding/exceptions/implicit' 1 test case failed (1 assertion failed)] +[Summary for test case './succeeding/exceptions/implicit': 1 test case failed (1 assertion failed)] -[Running: ./failing/exceptions/custom] +[Test case: './failing/exceptions/custom'] ExceptionTests.cpp:102: Unexpected exception with message: 'custom exception' -[Finished: './failing/exceptions/custom' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/exceptions/custom': 1 test case failed (1 assertion failed)] -[Running: ./failing/exceptions/custom/nothrow] +[Test case: './failing/exceptions/custom/nothrow'] ExceptionTests.cpp:109: 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)] +[Summary for test case './failing/exceptions/custom/nothrow': 1 test case failed (1 assertion failed)] -[Running: ./failing/exceptions/custom/throw] +[Test case: './failing/exceptions/custom/throw'] ExceptionTests.cpp:114: 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)] +[Summary for test case './failing/exceptions/custom/throw': 1 test case failed (1 assertion failed)] -[Running: ./failing/exceptions/custom/double] +[Test case: './failing/exceptions/custom/double'] ExceptionTests.cpp:118: Unexpected exception with message: '3.14' -[Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/exceptions/custom/double': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/exceptions/notimplemented] +[Test case: './succeeding/exceptions/notimplemented'] ExceptionTests.cpp:129: thisFunctionNotImplemented( 7 ) succeeded -[Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/exceptions/notimplemented': All tests passed (1 assertion in 1 test case)] -[Running: ./succeeding/generators/1] +[Test case: './succeeding/generators/1'] GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 @@ -417,27 +417,27 @@ GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 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)] +[Summary for test case './succeeding/generators/1': All tests passed (144 assertions in 1 test case)] -[Running: ./succeeding/message] +[Test case: './succeeding/message'] MessageTests.cpp:14: [warning: this is a warning] No assertions in test case, './succeeding/message' -[Finished: './succeeding/message' 1 test case failed (1 assertion failed)] +[Summary for test case './succeeding/message': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/succeed] +[Test case: './succeeding/succeed'] MessageTests.cpp:18: succeeded [with message: this is a success] -[Finished: './succeeding/succeed' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/succeed': All tests passed (1 assertion in 1 test case)] -[Running: ./failing/message/info/1] +[Test case: './failing/message/info/1'] MessageTests.cpp:23: [info: this message should be logged] MessageTests.cpp:24: [info: so should this] MessageTests.cpp:26: a == 1 failed for: 2 == 1 -[Finished: './failing/message/info/1' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/message/info/1': 1 test case failed (1 assertion failed)] -[Running: ./mixed/message/info/2] +[Test case: './mixed/message/info/2'] MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 MessageTests.cpp:31: [info: this message should be logged] MessageTests.cpp:35: [info: this message should be logged, too] @@ -445,41 +445,41 @@ MessageTests.cpp:37: a == 1 failed for: 2 == 1 MessageTests.cpp:39: [info: and this, but later] MessageTests.cpp:41: a == 0 failed for: 2 == 0 MessageTests.cpp:45: a == 2 succeeded for: 2 == 2 -[Finished: './mixed/message/info/2' 1 test case failed (2 of 4 assertions failed)] +[Summary for test case './mixed/message/info/2': 1 test case failed (2 of 4 assertions failed)] -[Running: ./failing/message/fail] +[Test case: './failing/message/fail'] MessageTests.cpp:51: failed with message: 'This is a failure' -[Finished: './failing/message/fail' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/message/fail': 1 test case failed (1 assertion failed)] -[Running: ./failing/message/sections] -[Started section: 'one'] +[Test case: './failing/message/sections'] +[Section: 'one'] MessageTests.cpp:58: failed with message: 'Message from section one' -[End of section: 'one' 1 assertion failed] +[Summary for section 'one': 1 assertion failed] -[Started section: 'two'] +[Section: 'two'] MessageTests.cpp:63: failed with message: 'Message from section two' -[End of section: 'two' 1 assertion failed] +[Summary for section 'two': 1 assertion failed] -[Finished: './failing/message/sections' 1 test case failed (All 2 assertions failed)] +[Summary for test case './failing/message/sections': 1 test case failed (All 2 assertions failed)] Message from section one -[Running: ./succeeding/message/sections/stdout] -[Started section: 'one'] +[Test case: './succeeding/message/sections/stdout'] +[Section: 'one'] No assertions in section, 'one' -[End of section: 'one' 1 assertion failed] +[Summary for section 'one': 1 assertion failed] Message from section two -[Started section: 'two'] +[Section: 'two'] No assertions in section, 'two' -[End of section: 'two' 1 assertion failed] +[Summary for section 'two': 1 assertion failed] -[Finished: './succeeding/message/sections/stdout' 1 test case failed (All 2 assertions failed)] +[Summary for test case './succeeding/message/sections/stdout': 1 test case failed (All 2 assertions failed)] -[Running: ./mixed/message/scoped] +[Test case: './mixed/message/scoped'] MessageTests.cpp:86: i < 10 succeeded for: 0 < 10 MessageTests.cpp:86: i < 10 succeeded for: 1 < 10 MessageTests.cpp:86: i < 10 succeeded for: 2 < 10 @@ -493,98 +493,98 @@ MessageTests.cpp:86: i < 10 succeeded for: 9 < 10 MessageTests.cpp:86: i < 10 succeeded[info: current counter 10] MessageTests.cpp:86: i < 10 succeeded[info: i := 10] MessageTests.cpp:86: i < 10 failed for: 10 < 10 -[Finished: './mixed/message/scoped' 1 test case failed (1 of 11 assertions failed)] +[Summary for test case './mixed/message/scoped': 1 test case failed (1 of 11 assertions failed)] -[Running: ./succeeding/nofail] +[Test case: './succeeding/nofail'] MessageTests.cpp:92: 1 == 2 failed - but was ok No assertions in test case, './succeeding/nofail' -[Finished: './succeeding/nofail' 1 test case failed (1 assertion failed)] +[Summary for test case './succeeding/nofail': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/Misc/Sections] -[Started section: 's1'] +[Test case: './succeeding/Misc/Sections'] +[Section: 's1'] MiscTests.cpp:25: a != b succeeded for: 1 != 2 MiscTests.cpp:26: b != a succeeded for: 2 != 1 -[End of section: 's1' All 2 assertions passed] +[Summary for section 's1': All 2 assertions passed] -[Started section: 's2'] +[Section: 's2'] MiscTests.cpp:31: a != b succeeded for: 1 != 2 -[End of section: 's2' 1 assertion passed] +[Summary for section 's2': 1 assertion passed] -[Finished: './succeeding/Misc/Sections' All tests passed (3 assertions in 1 test case)] +[Summary for test case './succeeding/Misc/Sections': All tests passed (3 assertions in 1 test case)] -[Running: ./succeeding/Misc/Sections/nested] -[Started section: 's1'] +[Test case: './succeeding/Misc/Sections/nested'] +[Section: 's1'] MiscTests.cpp:42: a != b succeeded for: 1 != 2 MiscTests.cpp:43: b != a succeeded for: 2 != 1 -[Started section: 's2'] +[Section: 's2'] MiscTests.cpp:47: a != b succeeded for: 1 != 2 -[End of section: 's2' 1 assertion passed] +[Summary for section 's2': 1 assertion passed] -[End of section: 's1' All 3 assertions passed] +[Summary for section 's1': All 3 assertions passed] -[Finished: './succeeding/Misc/Sections/nested' All tests passed (3 assertions in 1 test case)] +[Summary for test case './succeeding/Misc/Sections/nested': All tests passed (3 assertions in 1 test case)] -[Running: ./mixed/Misc/Sections/nested2] -[Started section: 's1'] -[Started section: 's2'] +[Test case: './mixed/Misc/Sections/nested2'] +[Section: 's1'] +[Section: 's2'] MiscTests.cpp:61: a == b failed for: 1 == 2 -[End of section: 's2' 1 assertion failed] +[Summary for section 's2': 1 assertion failed] -[End of section: 's1' 1 assertion failed] +[Summary for section 's1': 1 assertion failed] -[Started section: 's1'] -[Started section: 's3'] +[Section: 's1'] +[Section: 's3'] MiscTests.cpp:66: a != b succeeded for: 1 != 2 -[End of section: 's3' 1 assertion passed] +[Summary for section 's3': 1 assertion passed] -[End of section: 's1' 1 assertion passed] +[Summary for section 's1': 1 assertion passed] -[Started section: 's1'] -[Started section: 's4'] +[Section: 's1'] +[Section: 's4'] MiscTests.cpp:70: a < b succeeded for: 1 < 2 -[End of section: 's4' 1 assertion passed] +[Summary for section 's4': 1 assertion passed] -[End of section: 's1' 1 assertion passed] +[Summary for section 's1': 1 assertion passed] -[Finished: './mixed/Misc/Sections/nested2' 1 test case failed (1 of 3 assertions failed)] +[Summary for test case './mixed/Misc/Sections/nested2': 1 test case failed (1 of 3 assertions failed)] -[Running: ./Sections/nested/a/b] -[Started section: 'c'] -[Started section: 'd (leaf)'] +[Test case: './Sections/nested/a/b'] +[Section: 'c'] +[Section: 'd (leaf)'] No assertions in section, 'd (leaf)' -[End of section: 'd (leaf)' 1 assertion failed] +[Summary for section 'd (leaf)': 1 assertion failed] -[End of section: 'c' 1 assertion failed] +[Summary for section 'c': 1 assertion failed] -[Started section: 'c'] -[Started section: 'e (leaf)'] +[Section: 'c'] +[Section: 'e (leaf)'] No assertions in section, 'e (leaf)' -[End of section: 'e (leaf)' 1 assertion failed] +[Summary for section 'e (leaf)': 1 assertion failed] -[End of section: 'c' 1 assertion failed] +[Summary for section 'c': 1 assertion failed] -[Started section: 'f (leaf)'] +[Section: 'f (leaf)'] No assertions in section, 'f (leaf)' -[End of section: 'f (leaf)' 1 assertion failed] +[Summary for section 'f (leaf)': 1 assertion failed] -[Finished: './Sections/nested/a/b' 1 test case failed (All 3 assertions failed)] +[Summary for test case './Sections/nested/a/b': 1 test case failed (All 3 assertions failed)] -[Running: ./mixed/Misc/Sections/loops] -[Started section: 's1'] +[Test case: './mixed/Misc/Sections/loops'] +[Section: 's1'] MiscTests.cpp:103: b > a failed for: 0 > 1 -[End of section: 's1' 1 assertion failed] +[Summary for section 's1': 1 assertion failed] -[Finished: './mixed/Misc/Sections/loops' 1 test case failed (1 assertion failed)] +[Summary for test case './mixed/Misc/Sections/loops': 1 test case failed (1 assertion failed)] -[Running: ./mixed/Misc/loops] +[Test case: './mixed/Misc/loops'] MiscTests.cpp:114: [info: Testing if fib[0] (1) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 MiscTests.cpp:114: [info: Testing if fib[1] (1) is even] @@ -601,72 +601,72 @@ MiscTests.cpp:114: [info: Testing if fib[6] (13) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 MiscTests.cpp:114: [info: Testing if fib[7] (21) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -[Finished: './mixed/Misc/loops' 1 test case failed (6 of 8 assertions failed)] +[Summary for test case './mixed/Misc/loops': 1 test case failed (6 of 8 assertions failed)] Some information An error -[Running: ./succeeding/Misc/stdout,stderr] +[Test case: './succeeding/Misc/stdout,stderr'] No assertions in test case, './succeeding/Misc/stdout,stderr' -[Finished: './succeeding/Misc/stdout,stderr' 1 test case failed (1 assertion failed)] +[Summary for test case './succeeding/Misc/stdout,stderr': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/Misc/null strings] +[Test case: './succeeding/Misc/null strings'] MiscTests.cpp:133: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} MiscTests.cpp:134: 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)] +[Summary for test case './succeeding/Misc/null strings': All tests passed (2 assertions in 1 test case)] -[Running: ./failing/info] +[Test case: './failing/info'] MiscTests.cpp:139: [info: hi] MiscTests.cpp:141: [info: i := 7] MiscTests.cpp:142: false failed -[Finished: './failing/info' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/info': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/checkedif] +[Test case: './succeeding/checkedif'] MiscTests.cpp:147: flag succeeded for: true MiscTests.cpp:155: testCheckedIf( true ) succeeded for: true -[Finished: './succeeding/checkedif' All tests passed (2 assertions in 1 test case)] +[Summary for test case './succeeding/checkedif': All tests passed (2 assertions in 1 test case)] -[Running: ./failing/checkedif] +[Test case: './failing/checkedif'] MiscTests.cpp:147: flag failed for: false MiscTests.cpp:160: testCheckedIf( false ) failed for: false -[Finished: './failing/checkedif' 1 test case failed (All 2 assertions failed)] +[Summary for test case './failing/checkedif': 1 test case failed (All 2 assertions failed)] -[Running: ./succeeding/checkedelse] +[Test case: './succeeding/checkedelse'] MiscTests.cpp:165: flag succeeded for: true MiscTests.cpp:173: testCheckedElse( true ) succeeded for: true -[Finished: './succeeding/checkedelse' All tests passed (2 assertions in 1 test case)] +[Summary for test case './succeeding/checkedelse': All tests passed (2 assertions in 1 test case)] -[Running: ./failing/checkedelse] +[Test case: './failing/checkedelse'] MiscTests.cpp:165: flag failed for: false MiscTests.cpp:178: testCheckedElse( false ) failed for: false -[Finished: './failing/checkedelse' 1 test case failed (All 2 assertions failed)] +[Summary for test case './failing/checkedelse': 1 test case failed (All 2 assertions failed)] -[Running: ./misc/xmlentitycheck] -[Started section: 'embedded xml'] +[Test case: './misc/xmlentitycheck'] +[Section: 'embedded xml'] No assertions in section, 'embedded xml' -[End of section: 'embedded xml' 1 assertion failed] +[Summary for section 'embedded xml': 1 assertion failed] -[Started section: 'encoded chars'] +[Section: 'encoded chars'] No assertions in section, 'encoded chars' -[End of section: 'encoded chars' 1 assertion failed] +[Summary for section 'encoded chars': 1 assertion failed] -[Finished: './misc/xmlentitycheck' 1 test case failed (All 2 assertions failed)] +[Summary for test case './misc/xmlentitycheck': 1 test case failed (All 2 assertions failed)] -[Running: ./manual/onechar] +[Test case: './manual/onechar'] MiscTests.cpp:195: [info: 3] MiscTests.cpp:196: false failed -[Finished: './manual/onechar' 1 test case failed (1 assertion failed)] +[Summary for test case './manual/onechar': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/atomic if] +[Test case: './succeeding/atomic if'] MiscTests.cpp:206: x == 0 succeeded for: 0 == 0 -[Finished: './succeeding/atomic if' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/atomic if': All tests passed (1 assertion in 1 test case)] -[Running: ./succeeding/matchers] +[Test case: './succeeding/matchers'] MiscTests.cpp:216: testStringForMatching() Contains( "string" ) succeeded for: "this string contains 'abc' as a substring" contains: "string" MiscTests.cpp:217: testStringForMatching() Contains( "abc" ) succeeded for: @@ -675,81 +675,81 @@ MiscTests.cpp:219: testStringForMatching() StartsWith( "this" ) succeeded for: "this string contains 'abc' as a substring" starts with: "this" MiscTests.cpp:220: 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)] +[Summary for test case './succeeding/matchers': All tests passed (4 assertions in 1 test case)] -[Running: ./failing/matchers/Contains] +[Test case: './failing/matchers/Contains'] MiscTests.cpp:225: 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)] +[Summary for test case './failing/matchers/Contains': 1 test case failed (1 assertion failed)] -[Running: ./failing/matchers/StartsWith] +[Test case: './failing/matchers/StartsWith'] MiscTests.cpp:230: 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)] +[Summary for test case './failing/matchers/StartsWith': 1 test case failed (1 assertion failed)] -[Running: ./failing/matchers/EndsWith] +[Test case: './failing/matchers/EndsWith'] MiscTests.cpp:235: 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)] +[Summary for test case './failing/matchers/EndsWith': 1 test case failed (1 assertion failed)] -[Running: ./failing/matchers/Equals] +[Test case: './failing/matchers/Equals'] MiscTests.cpp:240: 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)] +[Summary for test case './failing/matchers/Equals': 1 test case failed (1 assertion failed)] -[Running: /succeeding/matchers/AllOf] +[Test case: '/succeeding/matchers/AllOf'] MiscTests.cpp:245: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) -[Finished: '/succeeding/matchers/AllOf' All tests passed (1 assertion in 1 test case)] +[Summary for test case '/succeeding/matchers/AllOf': All tests passed (1 assertion in 1 test case)] -[Running: /succeeding/matchers/AnyOf] +[Test case: '/succeeding/matchers/AnyOf'] MiscTests.cpp:249: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) MiscTests.cpp:250: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) -[Finished: '/succeeding/matchers/AnyOf' All tests passed (2 assertions in 1 test case)] +[Summary for test case '/succeeding/matchers/AnyOf': All tests passed (2 assertions in 1 test case)] -[Running: ./succeeding/matchers/Equals] +[Test case: './succeeding/matchers/Equals'] MiscTests.cpp:255: 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)] +[Summary for test case './succeeding/matchers/Equals': All tests passed (1 assertion in 1 test case)] -[Running: example/factorial] +[Test case: 'example/factorial'] MiscTests.cpp:266: Factorial(0) == 1 succeeded for: 1 == 1 MiscTests.cpp:267: Factorial(1) == 1 succeeded for: 1 == 1 MiscTests.cpp:268: Factorial(2) == 2 succeeded for: 2 == 2 MiscTests.cpp:269: Factorial(3) == 6 succeeded for: 6 == 6 MiscTests.cpp:270: Factorial(10) == 3628800 succeeded for: 0x == 3628800 -[Finished: 'example/factorial' All tests passed (5 assertions in 1 test case)] +[Summary for test case 'example/factorial': All tests passed (5 assertions in 1 test case)] -[Running: empty] +[Test case: 'empty'] No assertions in test case, 'empty' -[Finished: 'empty' 1 test case failed (1 assertion failed)] +[Summary for test case 'empty': 1 test case failed (1 assertion failed)] -[Running: Nice descriptive name] +[Test case: 'Nice descriptive name'] MiscTests.cpp:279: [warning: This one ran] No assertions in test case, 'Nice descriptive name' -[Finished: 'Nice descriptive name' 1 test case failed (1 assertion failed)] +[Summary for test case 'Nice descriptive name': 1 test case failed (1 assertion failed)] -[Running: first tag] +[Test case: 'first tag'] No assertions in test case, 'first tag' -[Finished: 'first tag' 1 test case failed (1 assertion failed)] +[Summary for test case 'first tag': 1 test case failed (1 assertion failed)] -[Running: second tag] +[Test case: 'second tag'] No assertions in test case, 'second tag' -[Finished: 'second tag' 1 test case failed (1 assertion failed)] +[Summary for test case 'second tag': 1 test case failed (1 assertion failed)] -[Running: selftest/main] -[Started section: 'selftest/expected result'] -[Started section: 'selftest/expected result/failing tests'] +[Test case: 'selftest/main'] +[Section: 'selftest/expected result'] +[Section: 'selftest/expected result/failing tests'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded @@ -800,12 +800,12 @@ No assertions in test case, 'second tag' [with message: Tests failed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] -[End of section: 'selftest/expected result/failing tests' All 25 assertions passed] +[Summary for section 'selftest/expected result/failing tests': All 25 assertions passed] -[End of section: 'selftest/expected result' All 25 assertions passed] +[Summary for section 'selftest/expected result': All 25 assertions passed] -[Started section: 'selftest/expected result'] -[Started section: 'selftest/expected result/succeeding tests'] +[Section: 'selftest/expected result'] +[Section: 'selftest/expected result/succeeding tests'] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded @@ -896,302 +896,302 @@ An error [with message: Tests passed, as expected] /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] -[End of section: 'selftest/expected result/succeeding tests' All 43 assertions passed] +[Summary for section 'selftest/expected result/succeeding tests': All 43 assertions passed] -[End of section: 'selftest/expected result' All 43 assertions passed] +[Summary for section 'selftest/expected result': All 43 assertions passed] Message from section one Message from section two Some information An error -[Started section: 'selftest/test counts'] -[Started section: 'selftest/test counts/succeeding tests'] +[Section: 'selftest/test counts'] +[Section: 'selftest/test counts/succeeding tests'] TestMain.cpp:40: totals.assertions.passed == 291 succeeded for: 291 == 291 TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 -[End of section: 'selftest/test counts/succeeding tests' All 2 assertions passed] +[Summary for section 'selftest/test counts/succeeding tests': All 2 assertions passed] -[End of section: 'selftest/test counts' All 2 assertions passed] +[Summary for section 'selftest/test counts': All 2 assertions passed] -[Started section: 'selftest/test counts'] -[Started section: 'selftest/test counts/failing tests'] +[Section: 'selftest/test counts'] +[Section: 'selftest/test counts/failing tests'] TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 TestMain.cpp:48: totals.assertions.failed == 72 succeeded for: 72 == 72 -[End of section: 'selftest/test counts/failing tests' All 2 assertions passed] +[Summary for section 'selftest/test counts/failing tests': All 2 assertions passed] -[End of section: 'selftest/test counts' All 2 assertions passed] +[Summary for section 'selftest/test counts': All 2 assertions passed] -[Finished: 'selftest/main' All tests passed (72 assertions in 1 test case)] +[Summary for test case 'selftest/main': All tests passed (72 assertions in 1 test case)] -[Running: meta/Misc/Sections] +[Test case: 'meta/Misc/Sections'] TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 TestMain.cpp:58: totals.assertions.failed == 1 succeeded for: 1 == 1 -[Finished: 'meta/Misc/Sections' All tests passed (2 assertions in 1 test case)] +[Summary for test case 'meta/Misc/Sections': All tests passed (2 assertions in 1 test case)] -[Running: selftest/parser/2] -[Started section: 'default'] +[Test case: 'selftest/parser/2'] +[Section: 'default'] TestMain.cpp:97: parseIntoConfig( argv, config ) succeeded TestMain.cpp:99: config.shouldDebugBreak == false succeeded for: false == false TestMain.cpp:100: config.cutoff == -1 succeeded for: -1 == -1 TestMain.cpp:101: config.allowThrows == true succeeded for: true == true TestMain.cpp:102: config.reporter.empty() succeeded for: true -[End of section: 'default' All 5 assertions passed] +[Summary for section 'default': All 5 assertions passed] -[Started section: 'test lists'] -[Started section: '-t/1'] +[Section: 'test lists'] +[Section: '-t/1'] TestMain.cpp:108: parseIntoConfig( argv, config ) succeeded TestMain.cpp:110: config.filters.size() == 1 succeeded for: 1 == 1 TestMain.cpp:111: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false TestMain.cpp:112: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -[End of section: '-t/1' All 4 assertions passed] +[Summary for section '-t/1': All 4 assertions passed] -[End of section: 'test lists' All 4 assertions passed] +[Summary for section 'test lists': All 4 assertions passed] -[Started section: 'test lists'] -[Started section: '-t/exclude:1'] +[Section: 'test lists'] +[Section: '-t/exclude:1'] TestMain.cpp:116: parseIntoConfig( argv, config ) succeeded TestMain.cpp:118: config.filters.size() == 1 succeeded for: 1 == 1 TestMain.cpp:119: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false TestMain.cpp:120: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true -[End of section: '-t/exclude:1' All 4 assertions passed] +[Summary for section '-t/exclude:1': All 4 assertions passed] -[End of section: 'test lists' All 4 assertions passed] +[Summary for section 'test lists': All 4 assertions passed] -[Started section: 'test lists'] -[Started section: '--test/1'] +[Section: 'test lists'] +[Section: '--test/1'] TestMain.cpp:125: parseIntoConfig( argv, config ) succeeded TestMain.cpp:127: config.filters.size() == 1 succeeded for: 1 == 1 TestMain.cpp:128: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false TestMain.cpp:129: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -[End of section: '--test/1' All 4 assertions passed] +[Summary for section '--test/1': All 4 assertions passed] -[End of section: 'test lists' All 4 assertions passed] +[Summary for section 'test lists': All 4 assertions passed] -[Started section: 'test lists'] -[Started section: '--test/exclude:1'] +[Section: 'test lists'] +[Section: '--test/exclude:1'] TestMain.cpp:134: parseIntoConfig( argv, config ) succeeded TestMain.cpp:136: config.filters.size() == 1 succeeded for: 1 == 1 TestMain.cpp:137: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false TestMain.cpp:138: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true -[End of section: '--test/exclude:1' All 4 assertions passed] +[Summary for section '--test/exclude:1': All 4 assertions passed] -[End of section: 'test lists' All 4 assertions passed] +[Summary for section 'test lists': All 4 assertions passed] -[Started section: 'test lists'] -[Started section: '--test/exclude:2'] +[Section: 'test lists'] +[Section: '--test/exclude:2'] TestMain.cpp:143: parseIntoConfig( argv, config ) succeeded TestMain.cpp:145: config.filters.size() == 1 succeeded for: 1 == 1 TestMain.cpp:146: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false TestMain.cpp:147: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true -[End of section: '--test/exclude:2' All 4 assertions passed] +[Summary for section '--test/exclude:2': All 4 assertions passed] -[End of section: 'test lists' All 4 assertions passed] +[Summary for section 'test lists': All 4 assertions passed] -[Started section: 'test lists'] -[Started section: '-t/2'] +[Section: 'test lists'] +[Section: '-t/2'] TestMain.cpp:152: parseIntoConfig( argv, config ) succeeded TestMain.cpp:154: config.filters.size() == 1 succeeded for: 1 == 1 TestMain.cpp:155: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false TestMain.cpp:156: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true TestMain.cpp:157: config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true -[End of section: '-t/2' All 5 assertions passed] +[Summary for section '-t/2': All 5 assertions passed] -[End of section: 'test lists' All 5 assertions passed] +[Summary for section 'test lists': All 5 assertions passed] -[Started section: 'test lists'] -[Started section: '-t/0'] +[Section: 'test lists'] +[Section: '-t/0'] TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" -[End of section: '-t/0' 1 assertion passed] +[Summary for section '-t/0': 1 assertion passed] -[End of section: 'test lists' 1 assertion passed] +[Summary for section 'test lists': 1 assertion passed] -[Started section: 'reporter'] -[Started section: '-r/basic'] +[Section: 'reporter'] +[Section: '-r/basic'] TestMain.cpp:169: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:171: config.reporter == "basic" succeeded for: "basic" == "basic" -[End of section: '-r/basic' All 2 assertions passed] +TestMain.cpp:171: config.reporter == "console" succeeded for: "console" == "console" +[Summary for section '-r/basic': All 2 assertions passed] -[End of section: 'reporter' All 2 assertions passed] +[Summary for section 'reporter': All 2 assertions passed] -[Started section: 'reporter'] -[Started section: '-r/xml'] +[Section: 'reporter'] +[Section: '-r/xml'] TestMain.cpp:175: parseIntoConfig( argv, config ) succeeded TestMain.cpp:177: config.reporter == "xml" succeeded for: "xml" == "xml" -[End of section: '-r/xml' All 2 assertions passed] +[Summary for section '-r/xml': All 2 assertions passed] -[End of section: 'reporter' All 2 assertions passed] +[Summary for section 'reporter': All 2 assertions passed] -[Started section: 'reporter'] -[Started section: '--reporter/junit'] +[Section: 'reporter'] +[Section: '--reporter/junit'] TestMain.cpp:181: parseIntoConfig( argv, config ) succeeded TestMain.cpp:183: config.reporter == "junit" succeeded for: "junit" == "junit" -[End of section: '--reporter/junit' All 2 assertions passed] +[Summary for section '--reporter/junit': All 2 assertions passed] -[End of section: 'reporter' All 2 assertions passed] +[Summary for section 'reporter': All 2 assertions passed] -[Started section: 'reporter'] -[Started section: '-r/error'] +[Section: 'reporter'] +[Section: '-r/error'] TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" -[End of section: '-r/error' 1 assertion passed] +[Summary for section '-r/error': 1 assertion passed] -[End of section: 'reporter' 1 assertion passed] +[Summary for section 'reporter': 1 assertion passed] -[Started section: 'debugger'] -[Started section: '-b'] +[Section: 'debugger'] +[Section: '-b'] TestMain.cpp:194: parseIntoConfig( argv, config ) succeeded TestMain.cpp:196: config.shouldDebugBreak == true succeeded for: true == true -[End of section: '-b' All 2 assertions passed] +[Summary for section '-b': All 2 assertions passed] -[End of section: 'debugger' All 2 assertions passed] +[Summary for section 'debugger': All 2 assertions passed] -[Started section: 'debugger'] -[Started section: '--break'] +[Section: 'debugger'] +[Section: '--break'] TestMain.cpp:200: parseIntoConfig( argv, config ) succeeded TestMain.cpp:202: config.shouldDebugBreak succeeded for: true -[End of section: '--break' All 2 assertions passed] +[Summary for section '--break': All 2 assertions passed] -[End of section: 'debugger' All 2 assertions passed] +[Summary for section 'debugger': All 2 assertions passed] -[Started section: 'debugger'] -[Started section: '-b'] +[Section: 'debugger'] +[Section: '-b'] TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" -[End of section: '-b' 1 assertion passed] +[Summary for section '-b': 1 assertion passed] -[End of section: 'debugger' 1 assertion passed] +[Summary for section 'debugger': 1 assertion passed] -[Started section: 'abort'] -[Started section: '-a'] +[Section: 'abort'] +[Section: '-a'] TestMain.cpp:213: parseIntoConfig( argv, config ) succeeded TestMain.cpp:215: config.cutoff == 1 succeeded for: 1 == 1 -[End of section: '-a' All 2 assertions passed] +[Summary for section '-a': All 2 assertions passed] -[End of section: 'abort' All 2 assertions passed] +[Summary for section 'abort': All 2 assertions passed] -[Started section: 'abort'] -[Started section: '-a/2'] +[Section: 'abort'] +[Section: '-a/2'] TestMain.cpp:219: parseIntoConfig( argv, config ) succeeded TestMain.cpp:221: config.cutoff == 2 succeeded for: 2 == 2 -[End of section: '-a/2' All 2 assertions passed] +[Summary for section '-a/2': All 2 assertions passed] -[End of section: 'abort' All 2 assertions passed] +[Summary for section 'abort': All 2 assertions passed] -[Started section: 'abort'] -[Started section: '-a/error/0'] +[Section: 'abort'] +[Section: '-a/error/0'] TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" -[End of section: '-a/error/0' 1 assertion passed] +[Summary for section '-a/error/0': 1 assertion passed] -[End of section: 'abort' 1 assertion passed] +[Summary for section 'abort': 1 assertion passed] -[Started section: 'abort'] -[Started section: '-a/error/non numeric'] +[Section: 'abort'] +[Section: '-a/error/non numeric'] TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" -[End of section: '-a/error/non numeric' 1 assertion passed] +[Summary for section '-a/error/non numeric': 1 assertion passed] -[End of section: 'abort' 1 assertion passed] +[Summary for section 'abort': 1 assertion passed] -[Started section: 'abort'] -[Started section: '-a/error/two args'] +[Section: 'abort'] +[Section: '-a/error/two args'] TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" -[End of section: '-a/error/two args' 1 assertion passed] +[Summary for section '-a/error/two args': 1 assertion passed] -[End of section: 'abort' 1 assertion passed] +[Summary for section 'abort': 1 assertion passed] -[Started section: 'nothrow'] -[Started section: '-nt'] +[Section: 'nothrow'] +[Section: '-nt'] TestMain.cpp:240: parseIntoConfig( argv, config ) succeeded TestMain.cpp:242: config.allowThrows == false succeeded for: false == false -[End of section: '-nt' All 2 assertions passed] +[Summary for section '-nt': All 2 assertions passed] -[End of section: 'nothrow' All 2 assertions passed] +[Summary for section 'nothrow': All 2 assertions passed] -[Started section: 'nothrow'] -[Started section: '--nothrow'] +[Section: 'nothrow'] +[Section: '--nothrow'] TestMain.cpp:246: parseIntoConfig( argv, config ) succeeded TestMain.cpp:248: config.allowThrows == false succeeded for: false == false -[End of section: '--nothrow' All 2 assertions passed] +[Summary for section '--nothrow': All 2 assertions passed] -[End of section: 'nothrow' All 2 assertions passed] +[Summary for section 'nothrow': All 2 assertions passed] -[Started section: 'streams'] -[Started section: '-o filename'] +[Section: 'streams'] +[Section: '-o filename'] TestMain.cpp:255: parseIntoConfig( argv, config ) succeeded TestMain.cpp:257: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" TestMain.cpp:258: config.stream.empty() succeeded for: true -[End of section: '-o filename' All 3 assertions passed] +[Summary for section '-o filename': All 3 assertions passed] -[End of section: 'streams' All 3 assertions passed] +[Summary for section 'streams': All 3 assertions passed] -[Started section: 'streams'] -[Started section: '-o %stdout'] +[Section: 'streams'] +[Section: '-o %stdout'] TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded TestMain.cpp:264: config.stream == "stdout" succeeded for: "stdout" == "stdout" TestMain.cpp:265: config.outputFilename.empty() succeeded for: true -[End of section: '-o %stdout' All 3 assertions passed] +[Summary for section '-o %stdout': All 3 assertions passed] -[End of section: 'streams' All 3 assertions passed] +[Summary for section 'streams': All 3 assertions passed] -[Started section: 'streams'] -[Started section: '--out'] +[Section: 'streams'] +[Section: '--out'] TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded TestMain.cpp:271: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -[End of section: '--out' All 2 assertions passed] +[Summary for section '--out': All 2 assertions passed] -[End of section: 'streams' All 2 assertions passed] +[Summary for section 'streams': All 2 assertions passed] -[Started section: 'combinations'] -[Started section: '-a -b'] +[Section: 'combinations'] +[Section: '-a -b'] TestMain.cpp:278: parseIntoConfig( argv, config ) succeeded TestMain.cpp:280: config.cutoff == 1 succeeded for: 1 == 1 TestMain.cpp:281: config.shouldDebugBreak succeeded for: true TestMain.cpp:282: config.allowThrows == false succeeded for: false == false -[End of section: '-a -b' All 4 assertions passed] +[Summary for section '-a -b': All 4 assertions passed] -[End of section: 'combinations' All 4 assertions passed] +[Summary for section 'combinations': All 4 assertions passed] -[Finished: 'selftest/parser/2' All tests passed (66 assertions in 1 test case)] +[Summary for test case 'selftest/parser/2': All tests passed (66 assertions in 1 test case)] -[Running: selftest/test filter] +[Test case: 'selftest/test filter'] TestMain.cpp:291: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true TestMain.cpp:292: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false TestMain.cpp:297: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false TestMain.cpp:298: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true TestMain.cpp:300: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true TestMain.cpp:301: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false -[Finished: 'selftest/test filter' All tests passed (6 assertions in 1 test case)] +[Summary for test case 'selftest/test filter': All tests passed (6 assertions in 1 test case)] -[Running: selftest/test filters] +[Test case: 'selftest/test filters'] TestMain.cpp:312: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true TestMain.cpp:314: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true TestMain.cpp:316: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false -[Finished: 'selftest/test filters' All tests passed (4 assertions in 1 test case)] +[Summary for test case 'selftest/test filters': All tests passed (4 assertions in 1 test case)] -[Running: selftest/filter/prefix wildcard] +[Test case: 'selftest/filter/prefix wildcard'] TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true TestMain.cpp:323: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false -[Finished: 'selftest/filter/prefix wildcard' All tests passed (2 assertions in 1 test case)] +[Summary for test case 'selftest/filter/prefix wildcard': All tests passed (2 assertions in 1 test case)] -[Running: selftest/filter/wildcard at both ends] +[Test case: 'selftest/filter/wildcard at both ends'] TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true TestMain.cpp:331: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false -[Finished: 'selftest/filter/wildcard at both ends' All tests passed (4 assertions in 1 test case)] +[Summary for test case 'selftest/filter/wildcard at both ends': All tests passed (4 assertions in 1 test case)] -[Running: selftest/option parsers] +[Test case: 'selftest/option parsers'] TestMain.cpp:351: opt.parseIntoConfig( parser, config ) succeeded TestMain.cpp:353: config.filters.size() == 1 succeeded for: 1 == 1 TestMain.cpp:354: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false TestMain.cpp:355: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -[Finished: 'selftest/option parsers' All tests passed (4 assertions in 1 test case)] +[Summary for test case 'selftest/option parsers': All tests passed (4 assertions in 1 test case)] -[Running: selftest/tags] -[Started section: 'one tag'] +[Test case: 'selftest/tags'] +[Section: 'one tag'] TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" TestMain.cpp:370: oneTag.hasTag( "one" ) succeeded for: true TestMain.cpp:371: oneTag.getTags().size() == 1 succeeded for: 1 == 1 @@ -1200,9 +1200,9 @@ TestMain.cpp:374: oneTag.matchesTags( p2 ) == true succeeded for: true == true TestMain.cpp:375: oneTag.matchesTags( p3 ) == false succeeded for: false == false TestMain.cpp:376: oneTag.matchesTags( p4 ) == false succeeded for: false == false TestMain.cpp:377: oneTag.matchesTags( p5 ) == false succeeded for: false == false -[End of section: 'one tag' All 8 assertions passed] +[Summary for section 'one tag': All 8 assertions passed] -[Started section: 'two tags'] +[Section: 'two tags'] TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" TestMain.cpp:384: twoTags.hasTag( "one" ) succeeded for: true TestMain.cpp:385: twoTags.hasTag( "two" ) succeeded for: true @@ -1213,166 +1213,166 @@ TestMain.cpp:390: twoTags.matchesTags( p2 ) == true succeeded for: true == true TestMain.cpp:391: twoTags.matchesTags( p3 ) == true succeeded for: true == true TestMain.cpp:392: twoTags.matchesTags( p4 ) == true succeeded for: true == true TestMain.cpp:393: twoTags.matchesTags( p5 ) == true succeeded for: true == true -[End of section: 'two tags' All 10 assertions passed] +[Summary for section 'two tags': All 10 assertions passed] -[Started section: 'one tag with characters either side'] +[Section: 'one tag with characters either side'] TestMain.cpp:399: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" TestMain.cpp:400: oneTagWithExtras.hasTag( "one" ) succeeded for: true TestMain.cpp:401: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false TestMain.cpp:402: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 -[End of section: 'one tag with characters either side' All 4 assertions passed] +[Summary for section 'one tag with characters either side': All 4 assertions passed] -[Started section: 'start of a tag, but not closed'] +[Section: 'start of a tag, but not closed'] TestMain.cpp:409: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" TestMain.cpp:410: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false TestMain.cpp:411: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 -[End of section: 'start of a tag, but not closed' All 3 assertions passed] +[Summary for section 'start of a tag, but not closed': All 3 assertions passed] -[Started section: 'hidden'] +[Section: 'hidden'] TestMain.cpp:417: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" TestMain.cpp:418: oneTag.hasTag( "hide" ) succeeded for: true TestMain.cpp:419: oneTag.isHidden() succeeded for: true TestMain.cpp:421: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false -[End of section: 'hidden' All 4 assertions passed] +[Summary for section 'hidden': All 4 assertions passed] -[Finished: 'selftest/tags' All tests passed (29 assertions in 1 test case)] +[Summary for test case 'selftest/tags': All tests passed (29 assertions in 1 test case)] -[Running: ./succeeding/Tricky/std::pair] +[Test case: './succeeding/Tricky/std::pair'] 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)] +[Summary for test case './succeeding/Tricky/std::pair': All tests passed (1 assertion in 1 test case)] -[Running: ./inprogress/failing/Tricky/trailing expression] +[Test case: './inprogress/failing/Tricky/trailing expression'] TrickyTests.cpp:55: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] No assertions in test case, './inprogress/failing/Tricky/trailing expression' -[Finished: './inprogress/failing/Tricky/trailing expression' 1 test case failed (1 assertion failed)] +[Summary for test case './inprogress/failing/Tricky/trailing expression': 1 test case failed (1 assertion failed)] -[Running: ./inprogress/failing/Tricky/compound lhs] +[Test case: './inprogress/failing/Tricky/compound lhs'] TrickyTests.cpp:71: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] No assertions in test case, './inprogress/failing/Tricky/compound lhs' -[Finished: './inprogress/failing/Tricky/compound lhs' 1 test case failed (1 assertion failed)] +[Summary for test case './inprogress/failing/Tricky/compound lhs': 1 test case failed (1 assertion failed)] -[Running: ./failing/Tricky/non streamable type] +[Test case: './failing/Tricky/non streamable type'] TrickyTests.cpp:95: &o1 == &o2 failed for: 0x == 0x TrickyTests.cpp:96: o1 == o2 failed for: {?} == {?} -[Finished: './failing/Tricky/non streamable type' 1 test case failed (All 2 assertions failed)] +[Summary for test case './failing/Tricky/non streamable type': 1 test case failed (All 2 assertions failed)] -[Running: ./failing/string literals] +[Test case: './failing/string literals'] TrickyTests.cpp:106: std::string( "first" ) == "second" failed for: "first" == "second" -[Finished: './failing/string literals' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/string literals': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/side-effects] +[Test case: './succeeding/side-effects'] TrickyTests.cpp:119: i++ == 7 succeeded for: 7 == 7 TrickyTests.cpp:120: i++ == 8 succeeded for: 8 == 8 -[Finished: './succeeding/side-effects' All tests passed (2 assertions in 1 test case)] +[Summary for test case './succeeding/side-effects': All tests passed (2 assertions in 1 test case)] -[Running: ./succeeding/koenig] +[Test case: './succeeding/koenig'] TrickyTests.cpp:186: 0x == o succeeded for: 0x == {?} -[Finished: './succeeding/koenig' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/koenig': All tests passed (1 assertion in 1 test case)] -[Running: ./succeeding/non-const==] +[Test case: './succeeding/non-const=='] TrickyTests.cpp:212: t == 1u succeeded for: {?} == 1 -[Finished: './succeeding/non-const==' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/non-const==': All tests passed (1 assertion in 1 test case)] -[Running: ./succeeding/enum/bits] +[Test case: './succeeding/enum/bits'] TrickyTests.cpp:224: 0x == bit30and31 succeeded for: 0x == 3221225472 -[Finished: './succeeding/enum/bits' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/enum/bits': All tests passed (1 assertion in 1 test case)] -[Running: ./succeeding/boolean member] +[Test case: './succeeding/boolean member'] TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x != 0 -[Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/boolean member': All tests passed (1 assertion in 1 test case)] -[Running: ./succeeding/unimplemented static bool] -[Started section: 'compare to true'] +[Test case: './succeeding/unimplemented static bool'] +[Section: 'compare to true'] TrickyTests.cpp:259: is_true::value == true succeeded for: true == true TrickyTests.cpp:260: true == is_true::value succeeded for: true == true -[End of section: 'compare to true' All 2 assertions passed] +[Summary for section 'compare to true': All 2 assertions passed] -[Started section: 'compare to false'] +[Section: 'compare to false'] TrickyTests.cpp:264: is_true::value == false succeeded for: false == false TrickyTests.cpp:265: false == is_true::value succeeded for: false == false -[End of section: 'compare to false' All 2 assertions passed] +[Summary for section 'compare to false': All 2 assertions passed] -[Started section: 'negation'] +[Section: 'negation'] TrickyTests.cpp:270: !is_true::value succeeded for: true -[End of section: 'negation' 1 assertion passed] +[Summary for section 'negation': 1 assertion passed] -[Started section: 'double negation'] +[Section: 'double negation'] TrickyTests.cpp:275: !!is_true::value succeeded for: true -[End of section: 'double negation' 1 assertion passed] +[Summary for section 'double negation': 1 assertion passed] -[Started section: 'direct'] +[Section: 'direct'] TrickyTests.cpp:280: is_true::value succeeded for: true TrickyTests.cpp:281: !is_true::value succeeded for: !false -[End of section: 'direct' All 2 assertions passed] +[Summary for section 'direct': All 2 assertions passed] -[Finished: './succeeding/unimplemented static bool' All tests passed (8 assertions in 1 test case)] +[Summary for test case './succeeding/unimplemented static bool': All tests passed (8 assertions in 1 test case)] -[Running: ./succeeding/SafeBool] +[Test case: './succeeding/SafeBool'] TrickyTests.cpp:313: True succeeded for: true TrickyTests.cpp:314: !False succeeded for: true TrickyTests.cpp:315: !False succeeded for: !false -[Finished: './succeeding/SafeBool' All tests passed (3 assertions in 1 test case)] +[Summary for test case './succeeding/SafeBool': All tests passed (3 assertions in 1 test case)] -[Running: scenario name] -[Started section: 'This stuff exists'] -[Started section: 'I do this'] -[Started section: 'it should do this'] +[Test case: 'scenario name'] +[Section: 'This stuff exists'] +[Section: 'I do this'] +[Section: 'it should do this'] BDDTests.cpp:37: itDoesThis() succeeded for: true -[End of section: 'it should do this' 1 assertion passed] +[Summary for section 'it should do this': 1 assertion passed] -[End of section: 'I do this' 1 assertion passed] +[Summary for section 'I do this': 1 assertion passed] -[End of section: 'This stuff exists' 1 assertion passed] +[Summary for section 'This stuff exists': 1 assertion passed] -[Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] +[Summary for test case 'scenario name': All tests passed (1 assertion in 1 test case)] -[End of group '~dummy'. 44 of 95 test cases failed (101 of 607 assertions failed)] +[Summary for group '~dummy': 44 of 95 test cases failed (101 of 607 assertions failed)] -[Testing completed. 44 of 95 test cases failed (101 of 607 assertions failed)] +[Summary for 'CatchSelfTest': 44 of 95 test cases failed (101 of 607 assertions failed)] [Started testing: CatchSelfTest] -[Started group: '~dummy'] -[Running: ./succeeding/Approx/simple] +[Group: '~dummy'] +[Test case: './succeeding/Approx/simple'] ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 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)] +[Summary for test case './succeeding/Approx/simple': All tests passed (6 assertions in 1 test case)] -[Running: ./succeeding/Approx/epsilon] +[Test case: './succeeding/Approx/epsilon'] ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) 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)] +[Summary for test case './succeeding/Approx/epsilon': All tests passed (2 assertions in 1 test case)] -[Running: ./succeeding/Approx/float] +[Test case: './succeeding/Approx/float'] ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) 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)] +[Summary for test case './succeeding/Approx/float': All tests passed (2 assertions in 1 test case)] -[Running: ./succeeding/Approx/int] +[Test case: './succeeding/Approx/int'] ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded ApproxTests.cpp:61: 0 == Approx( 0 ) succeeded -[Finished: './succeeding/Approx/int' All tests passed (2 assertions in 1 test case)] +[Summary for test case './succeeding/Approx/int': All tests passed (2 assertions in 1 test case)] -[Running: ./succeeding/Approx/mixed] +[Test case: './succeeding/Approx/mixed'] ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) 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)] +[Summary for test case './succeeding/Approx/mixed': All tests passed (5 assertions in 1 test case)] -[Running: ./succeeding/Approx/custom] +[Test case: './succeeding/Approx/custom'] ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) @@ -1381,25 +1381,25 @@ ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 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)] +[Summary for test case './succeeding/Approx/custom': All tests passed (8 assertions in 1 test case)] -[Running: ./succeeding/TestClass/succeedingCase] +[Test case: './succeeding/TestClass/succeedingCase'] ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" -[Finished: './succeeding/TestClass/succeedingCase' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/TestClass/succeedingCase': All tests passed (1 assertion in 1 test case)] -[Running: ./failing/TestClass/failingCase] +[Test case: './failing/TestClass/failingCase'] ClassTests.cpp:28: s == "world" failed for: "hello" == "world" -[Finished: './failing/TestClass/failingCase' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/TestClass/failingCase': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/Fixture/succeedingCase] +[Test case: './succeeding/Fixture/succeedingCase'] ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 -[Finished: './succeeding/Fixture/succeedingCase' All tests passed (1 assertion in 1 test case)] +[Summary for test case './succeeding/Fixture/succeedingCase': All tests passed (1 assertion in 1 test case)] -[Running: ./failing/Fixture/failingCase] +[Test case: './failing/Fixture/failingCase'] ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 -[Finished: './failing/Fixture/failingCase' 1 test case failed (1 assertion failed)] +[Summary for test case './failing/Fixture/failingCase': 1 test case failed (1 assertion failed)] -[Running: ./succeeding/conditions/equality] +[Test case: './succeeding/conditions/equality'] ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) @@ -1407,16 +1407,16 @@ ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hell ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 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)] +[Summary for test case './succeeding/conditions/equality': All tests passed (7 assertions in 1 test case)] -[Running: ./failing/conditions/equality] +[Test case: './failing/conditions/equality'] ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 -[Finished: './failing/conditions/equality' 1 test case failed (All 2 assertions failed)] +[Summary for test case './failing/conditions/equality': 1 test case failed (All 2 assertions failed)] -[End of group '~dummy'. 3 of 12 test cases failed (4 of 38 assertions failed)] +[Summary for group '~dummy': 3 of 12 test cases failed (4 of 38 assertions failed)] -[Testing completed. 3 of 12 test cases failed (4 of 38 assertions failed)] +[Summary for 'CatchSelfTest': 3 of 12 test cases failed (4 of 38 assertions failed)] @@ -5691,10 +5691,10 @@ TestMain.cpp" line="169"> TestMain.cpp" line="171"> - config.reporter == "basic" + config.reporter == "console" - "basic" == "basic" + "console" == "console" diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 2111ac22..064027b0 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -165,10 +165,10 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { SECTION( "reporter", "" ) { SECTION( "-r/basic", "" ) { - const char* argv[] = { "test", "-r", "basic" }; + const char* argv[] = { "test", "-r", "console" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.reporter == "basic" ); + REQUIRE( config.reporter == "console" ); } SECTION( "-r/xml", "" ) { const char* argv[] = { "test", "-r", "xml" }; diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index eeaff6e4..9454e221 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -53,7 +53,7 @@ namespace Catch { EmbeddedRunner() : m_reporter( new NullStreamingReporter() ) {} Totals runMatching( const std::string& rawTestSpec, - const std::string& reporter = "basic" ); + const std::string& reporter = "console" ); private: Ptr m_reporter; diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 9e04ac30..aa49a4c6 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 9 (integration branch) - * Generated: 2012-12-06 08:42:33.813351 + * CATCH v0.9 build 10 (integration branch) + * Generated: 2012-12-10 08:54:04.228540 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -1990,12 +1990,14 @@ namespace Catch struct ThreadedSectionInfo : SectionInfo, SharedImpl<> { ThreadedSectionInfo( SectionInfo const& _sectionInfo, Ptr const& _parent = Ptr() ) : SectionInfo( _sectionInfo ), - parent( _parent ) + parent( _parent ), + printed( false ) {} virtual ~ThreadedSectionInfo(); std::vector > children; Ptr parent; + bool printed; }; struct AssertionStats : SharedImpl<> { @@ -2110,7 +2112,8 @@ namespace Catch struct AccumulatingReporter : SharedImpl { AccumulatingReporter( ReporterConfig const& _config ) - : stream( _config.stream() ) + : m_config( _config ), + stream( _config.stream() ) {} virtual ~AccumulatingReporter(); @@ -2151,6 +2154,7 @@ namespace Catch virtual void testRunEnded( Ptr const& /* _testRunStats */ ) { } + ReporterConfig m_config; Option testRunInfo; Option unusedGroupInfo; Option unusedTestCaseInfo; @@ -4595,7 +4599,7 @@ namespace Catch { } void makeReporter() { std::string reporterName = m_config.reporter.empty() - ? "basic" + ? "console" : m_config.reporter; ReporterConfig reporterConfig( m_configWrapper.stream(), m_config ); @@ -5706,7 +5710,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 9, "integration" ); + Version libraryVersion( 0, 9, 10, "integration" ); } // #included from: ../reporters/catch_reporter_basic.hpp @@ -6710,26 +6714,28 @@ namespace Catch { void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() ) stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; +// stream << "[Started group: '" << unusedGroupInfo->name << "']" << std::endl; unusedGroupInfo.reset(); } void lazyPrintTestCaseInfo() { stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; +// stream << "[Running: " << unusedTestCaseInfo->name << "]" << std::endl; unusedTestCaseInfo.reset(); } - std::string makeSectionPath( ThreadedSectionInfo const * section, std::string const& delimiter ) { - std::string sectionPath = "'" + section->name + "'"; - while( ( section = section->parent.get() ) ) - sectionPath = "'" + section->name + "'" + delimiter + sectionPath; - return sectionPath; - } + void lazyPrintSectionInfo() { - ThreadedSectionInfo* section = unusedSectionInfo.get(); + std::vector sections; + for( ThreadedSectionInfo* section = unusedSectionInfo.get(); + section && !section->printed; + section = section->parent.get() ) + sections.push_back( section ); - std::string sectionPath = makeSectionPath( section, ", " ); - if( sectionPath.size() > 60 ) - sectionPath = makeSectionPath( section, ",\n " ); - - stream << "[Section: " << sectionPath << "]" << std::endl; + typedef std::vector::const_reverse_iterator It; + for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { +// stream << "[Started section: " << "'" + (*it)->name + "'" << "]" << std::endl; + stream << "[Section: " << "'" + (*it)->name + "'" << "]" << std::endl; + (*it)->printed = true; + } unusedSectionInfo.reset(); } void lazyPrint() { @@ -6739,15 +6745,132 @@ namespace Catch { lazyPrintGroupInfo(); if( unusedTestCaseInfo ) lazyPrintTestCaseInfo(); - if( unusedSectionInfo ) + if( currentSectionInfo && !currentSectionInfo->printed ) lazyPrintSectionInfo(); } - virtual void assertionStarting( AssertionInfo const& _assertionInfo ) { + virtual void assertionStarting( AssertionInfo const& ) { } virtual void assertionEnded( Ptr const& _assertionStats ) { - if( !_assertionStats->assertionResult.isOk() ) - lazyPrint(); + + AssertionResult const& result = _assertionStats->assertionResult; + + // Drop out if result was successful and we're not printing those + if( !m_config.includeSuccessfulResults() && result.isOk() ) + return; + + lazyPrint(); + + if( !result.getSourceInfo().empty() ) { + TextColour colour( TextColour::FileName ); + stream << result.getSourceInfo(); + } + + if( result.hasExpression() ) { + TextColour colour( TextColour::OriginalExpression ); + stream << result.getExpression(); + if( result.succeeded() ) { + TextColour successColour( TextColour::Success ); + stream << " succeeded"; + } + else { + TextColour errorColour( TextColour::Error ); + stream << " failed"; + if( result.isOk() ) { + TextColour okAnywayColour( TextColour::Success ); + stream << " - but was ok"; + } + } + } + + switch( result.getResultType() ) { + case ResultWas::ThrewException: + { + TextColour colour( TextColour::Error ); + if( result.hasExpression() ) + stream << " with unexpected"; + else + stream << "Unexpected"; + stream << " exception with message: '" << result.getMessage() << "'"; + } + break; + case ResultWas::DidntThrowException: + { + TextColour colour( TextColour::Error ); + if( result.hasExpression() ) + stream << " because no exception was thrown where one was expected"; + else + stream << "No exception thrown where one was expected"; + } + break; + case ResultWas::Info: + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "info", result.getMessage() ); + } + break; + case ResultWas::Warning: + { + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "warning", result.getMessage() ); + } + break; + case ResultWas::ExplicitFailure: + { + TextColour colour( TextColour::Error ); + stream << "failed with message: '" << result.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( !result.hasExpression() ) { + if( result.succeeded() ) { + TextColour colour( TextColour::Success ); + stream << " succeeded"; + } + else { + TextColour colour( TextColour::Error ); + stream << " failed"; + if( result.isOk() ) { + TextColour okAnywayColour( TextColour::Success ); + stream << " - but was ok"; + } + } + } + if( result.hasMessage() ) { + stream << "\n"; + TextColour colour( TextColour::ReconstructedExpression ); + streamVariableLengthText( "with message", result.getMessage() ); + } + break; + } + + if( result.hasExpandedExpression() ) { + stream << " for: "; + if( result.getExpandedExpression().size() > 40 ) { + stream << "\n"; + if( result.getExpandedExpression().size() < 70 ) + stream << "\t"; + } + TextColour colour( TextColour::ReconstructedExpression ); + stream << result.getExpandedExpression(); + } + + stream << std::endl; + } + + void streamVariableLengthText( std::string const& prefix, std::string const& text ) { + std::string trimmed = trim( text ); + if( trimmed.find_first_of( "\r\n" ) == std::string::npos ) { + stream << "[" << prefix << ": " << trimmed << "]"; + } + else { + stream << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed + << "\n[end of " << prefix << "] <<<<<<<<<<<<<<<<<<<<<<<<\n"; + } } void printAssertionCounts( std::string const& label, Counts const& counts, std::string const& allPrefix = "All " ) { @@ -6779,27 +6902,58 @@ namespace Catch { } virtual void sectionEnded( Ptr const& _sectionStats ) { - if( !unusedSectionInfo ) { + if( _sectionStats->missingAssertions ) { + lazyPrint(); + TextColour colour( TextColour::ResultError ); + stream << "\nNo assertions in section, '" << _sectionStats->sectionInfo.name << "'\n" << std::endl; + } + if( currentSectionInfo && currentSectionInfo->printed ) { stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; - printAssertionCounts( "assertion", _sectionStats->assertions ); +// stream << "[End of section: '" << _sectionStats->sectionInfo.name << "' "; + Counts const& assertions = _sectionStats->assertions; + if( assertions.failed ) { + TextColour colour( TextColour::ResultError ); + printAssertionCounts( "assertion", assertions ); + } + else { + TextColour colour( TextColour::ResultSuccess ); + stream << ( assertions.passed > 1 ? "All " : "" ) + << pluralise( assertions.passed, "assertion" ) << " passed" ; + } stream << "]\n" << std::endl; } AccumulatingReporter::sectionEnded( _sectionStats ); } virtual void testCaseEnded( Ptr const& _testCaseStats ) { + if( _testCaseStats->missingAssertions ) { + lazyPrint(); + TextColour colour( TextColour::ResultError ); + stream << "\nNo assertions in test case, '" << _testCaseStats->testInfo.name << "'\n" << std::endl; + } if( !unusedTestCaseInfo ) { stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; +// stream << "[Finished: '" << _testCaseStats->testInfo.name << "' "; printTotals( _testCaseStats->totals ); stream << "]\n" << std::endl; } AccumulatingReporter::testCaseEnded( _testCaseStats ); } virtual void testGroupEnded( Ptr const& _testGroupStats ) { - // !TBD + if( !unusedGroupInfo ) { + stream << "[Summary for group '" << _testGroupStats->groupInfo.name << "': "; +// stream << "[End of group '" << _testGroupStats->groupInfo.name << "'. "; + printTotals( _testGroupStats->totals ); + stream << "]\n" << std::endl; + } AccumulatingReporter::testGroupEnded( _testGroupStats ); } virtual void testRunEnded( Ptr const& _testRunStats ) { - // !TBD + if( !unusedTestCaseInfo ) { + stream << "[Summary for '" << _testRunStats->runInfo.name << "': "; +// stream << "[Testing completed. "; + printTotals( _testRunStats->totals ); + stream << "]\n" << std::endl; + } AccumulatingReporter::testRunEnded( _testRunStats ); } From 6fb8260addcadf443fb41846f57d5e858a2dac62 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 11 Dec 2012 08:27:21 +0000 Subject: [PATCH 092/296] Tweaks to summary counts in console reporter --- include/reporters/catch_reporter_console.hpp | 45 +++--- .../SelfTest/Baselines/approvedResults.txt | 130 +++++++++--------- 2 files changed, 94 insertions(+), 81 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 5c1d99ab..682ba18a 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -36,12 +36,10 @@ namespace Catch { void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() ) stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; -// stream << "[Started group: '" << unusedGroupInfo->name << "']" << std::endl; unusedGroupInfo.reset(); } void lazyPrintTestCaseInfo() { stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; -// stream << "[Running: " << unusedTestCaseInfo->name << "]" << std::endl; unusedTestCaseInfo.reset(); } @@ -54,7 +52,6 @@ namespace Catch { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { -// stream << "[Started section: " << "'" + (*it)->name + "'" << "]" << std::endl; stream << "[Section: " << "'" + (*it)->name + "'" << "]" << std::endl; (*it)->printed = true; } @@ -195,29 +192,49 @@ namespace Catch { } } - void printAssertionCounts( std::string const& label, Counts const& counts, std::string const& allPrefix = "All " ) { - if( counts.passed ) - stream << counts.failed << " of " << counts.total() << " " << label << "s failed"; - else - stream << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed"; + void printAssertionCounts( std::string const& label, Counts const& counts ) { + if( counts.total() == 1 ) { + stream << "1 " << label << " - "; + if( counts.failed ) + stream << "failed"; + else + stream << "passed"; + } + else { + stream << counts.total() << " " << label << "s "; + if( counts.passed ) { + if( counts.failed ) + stream << "- " << counts.failed << " failed"; + else if( counts.passed == 2 ) + stream << "- both passed"; + else + stream << "- all passed"; + } + else { + if( counts.failed == 2 ) + stream << "- both failed"; + else + stream << "- all failed"; + } + } } - void printTotals( const Totals& totals, const std::string& allPrefix = "All " ) { + void printTotals( const Totals& totals ) { if( totals.assertions.total() == 0 ) { stream << "No tests ran"; } else if( totals.assertions.failed ) { TextColour colour( TextColour::ResultError ); - printAssertionCounts( "test case", totals.testCases, allPrefix ); + printAssertionCounts( "test case", totals.testCases ); if( totals.testCases.failed > 0 ) { stream << " ("; - printAssertionCounts( "assertion", totals.assertions, allPrefix ); + printAssertionCounts( "assertion", totals.assertions ); stream << ")"; } } else { TextColour colour( TextColour::ResultSuccess ); - stream << allPrefix << "tests passed (" + stream << "All tests passed (" << pluralise( totals.assertions.passed, "assertion" ) << " in " << pluralise( totals.testCases.passed, "test case" ) << ")"; } @@ -231,7 +248,6 @@ namespace Catch { } if( currentSectionInfo && currentSectionInfo->printed ) { stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; -// stream << "[End of section: '" << _sectionStats->sectionInfo.name << "' "; Counts const& assertions = _sectionStats->assertions; if( assertions.failed ) { TextColour colour( TextColour::ResultError ); @@ -254,7 +270,6 @@ namespace Catch { } if( !unusedTestCaseInfo ) { stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; -// stream << "[Finished: '" << _testCaseStats->testInfo.name << "' "; printTotals( _testCaseStats->totals ); stream << "]\n" << std::endl; } @@ -263,7 +278,6 @@ namespace Catch { virtual void testGroupEnded( Ptr const& _testGroupStats ) { if( !unusedGroupInfo ) { stream << "[Summary for group '" << _testGroupStats->groupInfo.name << "': "; -// stream << "[End of group '" << _testGroupStats->groupInfo.name << "'. "; printTotals( _testGroupStats->totals ); stream << "]\n" << std::endl; } @@ -272,7 +286,6 @@ namespace Catch { virtual void testRunEnded( Ptr const& _testRunStats ) { if( !unusedTestCaseInfo ) { stream << "[Summary for '" << _testRunStats->runInfo.name << "': "; -// stream << "[Testing completed. "; printTotals( _testRunStats->totals ); stream << "]\n" << std::endl; } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index cfdb4648..0a6dda24 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -49,7 +49,7 @@ ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" [Test case: './failing/TestClass/failingCase'] ClassTests.cpp:28: s == "world" failed for: "hello" == "world" -[Summary for test case './failing/TestClass/failingCase': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/TestClass/failingCase': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/Fixture/succeedingCase'] ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 @@ -57,7 +57,7 @@ ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 [Test case: './failing/Fixture/failingCase'] ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 -[Summary for test case './failing/Fixture/failingCase': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/Fixture/failingCase': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/conditions/equality'] ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 @@ -83,7 +83,7 @@ ConditionTests.cpp:80: data.str_hello == "hell" failed for: "hello" == "hell" ConditionTests.cpp:81: data.str_hello == "hello1" failed for: "hello" == "hello1" ConditionTests.cpp:82: data.str_hello.size() == 6 failed for: 5 == 6 ConditionTests.cpp:85: x == Approx( 1.301 ) failed for: 1.3 == Approx( 1.301 ) -[Summary for test case './failing/conditions/equality': 1 test case failed (All 13 assertions failed)] +[Summary for test case './failing/conditions/equality': 1 test case - failed (13 assertions - all failed)] [Test case: './succeeding/conditions/inequality'] ConditionTests.cpp:93: data.int_seven != 6 succeeded for: 7 != 6 @@ -105,7 +105,7 @@ ConditionTests.cpp:112: data.float_nine_point_one != Approx( 9.1f ) failed for: ConditionTests.cpp:113: data.double_pi != Approx( 3.1415926535 ) failed for: 3.14159 != Approx( 3.14159 ) ConditionTests.cpp:114: data.str_hello != "hello" failed for: "hello" != "hello" ConditionTests.cpp:115: data.str_hello.size() != 5 failed for: 5 != 5 -[Summary for test case './failing/conditions/inequality': 1 test case failed (All 5 assertions failed)] +[Summary for test case './failing/conditions/inequality': 1 test case - failed (5 assertions - all failed)] [Test case: './succeeding/conditions/ordered'] ConditionTests.cpp:124: data.int_seven < 8 succeeded for: 7 < 8 @@ -147,7 +147,7 @@ ConditionTests.cpp:170: data.str_hello < "hellm" failed for: "hello" < "hellm" ConditionTests.cpp:171: data.str_hello < "a" failed for: "hello" < "a" ConditionTests.cpp:173: data.str_hello >= "z" failed for: "hello" >= "z" ConditionTests.cpp:174: data.str_hello <= "a" failed for: "hello" <= "a" -[Summary for test case './failing/conditions/ordered': 1 test case failed (All 19 assertions failed)] +[Summary for test case './failing/conditions/ordered': 1 test case - failed (19 assertions - all failed)] [Test case: './succeeding/conditions/int literals'] ConditionTests.cpp:188: i == 1 succeeded for: 1 == 1 @@ -223,7 +223,7 @@ ConditionTests.cpp:339: !trueValue failed for: false ConditionTests.cpp:340: !trueValue failed for: !true ConditionTests.cpp:342: !(1 == 1) failed for: false ConditionTests.cpp:343: !1 == 1 failed for: !(1 == 1) -[Summary for test case './failing/conditions/not': 1 test case failed (All 8 assertions failed)] +[Summary for test case './failing/conditions/not': 1 test case - failed (8 assertions - all failed)] [Test case: './succeeding/exceptions/explicit'] ExceptionTests.cpp:39: thisThrows() succeeded @@ -235,38 +235,38 @@ ExceptionTests.cpp:41: thisThrows() succeeded ExceptionTests.cpp:47: thisThrows() failed with unexpected exception with message: 'expected exception' ExceptionTests.cpp:48: thisDoesntThrow() failed because no exception was thrown where one was expected ExceptionTests.cpp:49: thisThrows() failed with unexpected exception with message: 'expected exception' -[Summary for test case './failing/exceptions/explicit': 1 test case failed (All 3 assertions failed)] +[Summary for test case './failing/exceptions/explicit': 1 test case - failed (3 assertions - all failed)] [Test case: './failing/exceptions/implicit'] ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' -[Summary for test case './failing/exceptions/implicit': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/exceptions/implicit': 1 test case - failed (1 assertion - failed)] [Test case: './failing/exceptions/implicit/2'] ExceptionTests.cpp:60: 1 == 1 succeeded ExceptionTests.cpp:60: {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' -[Summary for test case './failing/exceptions/implicit/2': 1 test case failed (1 of 2 assertions failed)] +[Summary for test case './failing/exceptions/implicit/2': 1 test case - failed (2 assertions - 1 failed)] [Test case: './succeeding/exceptions/implicit'] No assertions in test case, './succeeding/exceptions/implicit' -[Summary for test case './succeeding/exceptions/implicit': 1 test case failed (1 assertion failed)] +[Summary for test case './succeeding/exceptions/implicit': 1 test case - failed (1 assertion - failed)] [Test case: './failing/exceptions/custom'] ExceptionTests.cpp:102: Unexpected exception with message: 'custom exception' -[Summary for test case './failing/exceptions/custom': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/exceptions/custom': 1 test case - failed (1 assertion - failed)] [Test case: './failing/exceptions/custom/nothrow'] ExceptionTests.cpp:109: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' -[Summary for test case './failing/exceptions/custom/nothrow': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/exceptions/custom/nothrow': 1 test case - failed (1 assertion - failed)] [Test case: './failing/exceptions/custom/throw'] ExceptionTests.cpp:114: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' -[Summary for test case './failing/exceptions/custom/throw': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/exceptions/custom/throw': 1 test case - failed (1 assertion - failed)] [Test case: './failing/exceptions/custom/double'] ExceptionTests.cpp:118: Unexpected exception with message: '3.14' -[Summary for test case './failing/exceptions/custom/double': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/exceptions/custom/double': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/exceptions/notimplemented'] ExceptionTests.cpp:129: thisFunctionNotImplemented( 7 ) succeeded @@ -424,7 +424,7 @@ MessageTests.cpp:14: [warning: this is a warning] No assertions in test case, './succeeding/message' -[Summary for test case './succeeding/message': 1 test case failed (1 assertion failed)] +[Summary for test case './succeeding/message': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/succeed'] MessageTests.cpp:18: succeeded @@ -435,7 +435,7 @@ MessageTests.cpp:18: succeeded MessageTests.cpp:23: [info: this message should be logged] MessageTests.cpp:24: [info: so should this] MessageTests.cpp:26: a == 1 failed for: 2 == 1 -[Summary for test case './failing/message/info/1': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/message/info/1': 1 test case - failed (1 assertion - failed)] [Test case: './mixed/message/info/2'] MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 @@ -445,22 +445,22 @@ MessageTests.cpp:37: a == 1 failed for: 2 == 1 MessageTests.cpp:39: [info: and this, but later] MessageTests.cpp:41: a == 0 failed for: 2 == 0 MessageTests.cpp:45: a == 2 succeeded for: 2 == 2 -[Summary for test case './mixed/message/info/2': 1 test case failed (2 of 4 assertions failed)] +[Summary for test case './mixed/message/info/2': 1 test case - failed (4 assertions - 2 failed)] [Test case: './failing/message/fail'] MessageTests.cpp:51: failed with message: 'This is a failure' -[Summary for test case './failing/message/fail': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/message/fail': 1 test case - failed (1 assertion - failed)] [Test case: './failing/message/sections'] [Section: 'one'] MessageTests.cpp:58: failed with message: 'Message from section one' -[Summary for section 'one': 1 assertion failed] +[Summary for section 'one': 1 assertion - failed] [Section: 'two'] MessageTests.cpp:63: failed with message: 'Message from section two' -[Summary for section 'two': 1 assertion failed] +[Summary for section 'two': 1 assertion - failed] -[Summary for test case './failing/message/sections': 1 test case failed (All 2 assertions failed)] +[Summary for test case './failing/message/sections': 1 test case - failed (2 assertions - both failed)] Message from section one [Test case: './succeeding/message/sections/stdout'] @@ -468,16 +468,16 @@ Message from section one No assertions in section, 'one' -[Summary for section 'one': 1 assertion failed] +[Summary for section 'one': 1 assertion - failed] Message from section two [Section: 'two'] No assertions in section, 'two' -[Summary for section 'two': 1 assertion failed] +[Summary for section 'two': 1 assertion - failed] -[Summary for test case './succeeding/message/sections/stdout': 1 test case failed (All 2 assertions failed)] +[Summary for test case './succeeding/message/sections/stdout': 1 test case - failed (2 assertions - both failed)] [Test case: './mixed/message/scoped'] MessageTests.cpp:86: i < 10 succeeded for: 0 < 10 @@ -493,14 +493,14 @@ MessageTests.cpp:86: i < 10 succeeded for: 9 < 10 MessageTests.cpp:86: i < 10 succeeded[info: current counter 10] MessageTests.cpp:86: i < 10 succeeded[info: i := 10] MessageTests.cpp:86: i < 10 failed for: 10 < 10 -[Summary for test case './mixed/message/scoped': 1 test case failed (1 of 11 assertions failed)] +[Summary for test case './mixed/message/scoped': 1 test case - failed (11 assertions - 1 failed)] [Test case: './succeeding/nofail'] MessageTests.cpp:92: 1 == 2 failed - but was ok No assertions in test case, './succeeding/nofail' -[Summary for test case './succeeding/nofail': 1 test case failed (1 assertion failed)] +[Summary for test case './succeeding/nofail': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/Misc/Sections'] [Section: 's1'] @@ -530,9 +530,9 @@ MiscTests.cpp:47: a != b succeeded for: 1 != 2 [Section: 's1'] [Section: 's2'] MiscTests.cpp:61: a == b failed for: 1 == 2 -[Summary for section 's2': 1 assertion failed] +[Summary for section 's2': 1 assertion - failed] -[Summary for section 's1': 1 assertion failed] +[Summary for section 's1': 1 assertion - failed] [Section: 's1'] [Section: 's3'] @@ -548,7 +548,7 @@ MiscTests.cpp:70: a < b succeeded for: 1 < 2 [Summary for section 's1': 1 assertion passed] -[Summary for test case './mixed/Misc/Sections/nested2': 1 test case failed (1 of 3 assertions failed)] +[Summary for test case './mixed/Misc/Sections/nested2': 1 test case - failed (3 assertions - 1 failed)] [Test case: './Sections/nested/a/b'] [Section: 'c'] @@ -556,33 +556,33 @@ MiscTests.cpp:70: a < b succeeded for: 1 < 2 No assertions in section, 'd (leaf)' -[Summary for section 'd (leaf)': 1 assertion failed] +[Summary for section 'd (leaf)': 1 assertion - failed] -[Summary for section 'c': 1 assertion failed] +[Summary for section 'c': 1 assertion - failed] [Section: 'c'] [Section: 'e (leaf)'] No assertions in section, 'e (leaf)' -[Summary for section 'e (leaf)': 1 assertion failed] +[Summary for section 'e (leaf)': 1 assertion - failed] -[Summary for section 'c': 1 assertion failed] +[Summary for section 'c': 1 assertion - failed] [Section: 'f (leaf)'] No assertions in section, 'f (leaf)' -[Summary for section 'f (leaf)': 1 assertion failed] +[Summary for section 'f (leaf)': 1 assertion - failed] -[Summary for test case './Sections/nested/a/b': 1 test case failed (All 3 assertions failed)] +[Summary for test case './Sections/nested/a/b': 1 test case - failed (3 assertions - all failed)] [Test case: './mixed/Misc/Sections/loops'] [Section: 's1'] MiscTests.cpp:103: b > a failed for: 0 > 1 -[Summary for section 's1': 1 assertion failed] +[Summary for section 's1': 1 assertion - failed] -[Summary for test case './mixed/Misc/Sections/loops': 1 test case failed (1 assertion failed)] +[Summary for test case './mixed/Misc/Sections/loops': 1 test case - failed (1 assertion - failed)] [Test case: './mixed/Misc/loops'] MiscTests.cpp:114: [info: Testing if fib[0] (1) is even] @@ -601,7 +601,7 @@ MiscTests.cpp:114: [info: Testing if fib[6] (13) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 MiscTests.cpp:114: [info: Testing if fib[7] (21) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -[Summary for test case './mixed/Misc/loops': 1 test case failed (6 of 8 assertions failed)] +[Summary for test case './mixed/Misc/loops': 1 test case - failed (8 assertions - 6 failed)] Some information An error @@ -609,7 +609,7 @@ An error No assertions in test case, './succeeding/Misc/stdout,stderr' -[Summary for test case './succeeding/Misc/stdout,stderr': 1 test case failed (1 assertion failed)] +[Summary for test case './succeeding/Misc/stdout,stderr': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/Misc/null strings'] MiscTests.cpp:133: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} @@ -620,7 +620,7 @@ MiscTests.cpp:134: makeString( true ) == static_cast(__null) succeeded fo MiscTests.cpp:139: [info: hi] MiscTests.cpp:141: [info: i := 7] MiscTests.cpp:142: false failed -[Summary for test case './failing/info': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/info': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/checkedif'] MiscTests.cpp:147: flag succeeded for: true @@ -630,7 +630,7 @@ MiscTests.cpp:155: testCheckedIf( true ) succeeded for: true [Test case: './failing/checkedif'] MiscTests.cpp:147: flag failed for: false MiscTests.cpp:160: testCheckedIf( false ) failed for: false -[Summary for test case './failing/checkedif': 1 test case failed (All 2 assertions failed)] +[Summary for test case './failing/checkedif': 1 test case - failed (2 assertions - both failed)] [Test case: './succeeding/checkedelse'] MiscTests.cpp:165: flag succeeded for: true @@ -640,27 +640,27 @@ MiscTests.cpp:173: testCheckedElse( true ) succeeded for: true [Test case: './failing/checkedelse'] MiscTests.cpp:165: flag failed for: false MiscTests.cpp:178: testCheckedElse( false ) failed for: false -[Summary for test case './failing/checkedelse': 1 test case failed (All 2 assertions failed)] +[Summary for test case './failing/checkedelse': 1 test case - failed (2 assertions - both failed)] [Test case: './misc/xmlentitycheck'] [Section: 'embedded xml'] No assertions in section, 'embedded xml' -[Summary for section 'embedded xml': 1 assertion failed] +[Summary for section 'embedded xml': 1 assertion - failed] [Section: 'encoded chars'] No assertions in section, 'encoded chars' -[Summary for section 'encoded chars': 1 assertion failed] +[Summary for section 'encoded chars': 1 assertion - failed] -[Summary for test case './misc/xmlentitycheck': 1 test case failed (All 2 assertions failed)] +[Summary for test case './misc/xmlentitycheck': 1 test case - failed (2 assertions - both failed)] [Test case: './manual/onechar'] MiscTests.cpp:195: [info: 3] MiscTests.cpp:196: false failed -[Summary for test case './manual/onechar': 1 test case failed (1 assertion failed)] +[Summary for test case './manual/onechar': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/atomic if'] MiscTests.cpp:206: x == 0 succeeded for: 0 == 0 @@ -680,22 +680,22 @@ MiscTests.cpp:220: testStringForMatching() EndsWith( "substring" ) succeeded for [Test case: './failing/matchers/Contains'] MiscTests.cpp:225: testStringForMatching() Contains( "not there" ) failed for: "this string contains 'abc' as a substring" contains: "not there" -[Summary for test case './failing/matchers/Contains': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/matchers/Contains': 1 test case - failed (1 assertion - failed)] [Test case: './failing/matchers/StartsWith'] MiscTests.cpp:230: testStringForMatching() StartsWith( "string" ) failed for: "this string contains 'abc' as a substring" starts with: "string" -[Summary for test case './failing/matchers/StartsWith': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/matchers/StartsWith': 1 test case - failed (1 assertion - failed)] [Test case: './failing/matchers/EndsWith'] MiscTests.cpp:235: testStringForMatching() EndsWith( "this" ) failed for: "this string contains 'abc' as a substring" ends with: "this" -[Summary for test case './failing/matchers/EndsWith': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/matchers/EndsWith': 1 test case - failed (1 assertion - failed)] [Test case: './failing/matchers/Equals'] MiscTests.cpp:240: testStringForMatching() Equals( "something else" ) failed for: "this string contains 'abc' as a substring" equals: "something else" -[Summary for test case './failing/matchers/Equals': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/matchers/Equals': 1 test case - failed (1 assertion - failed)] [Test case: '/succeeding/matchers/AllOf'] MiscTests.cpp:245: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: @@ -726,26 +726,26 @@ MiscTests.cpp:270: Factorial(10) == 3628800 succeeded for: 0x == 362 No assertions in test case, 'empty' -[Summary for test case 'empty': 1 test case failed (1 assertion failed)] +[Summary for test case 'empty': 1 test case - failed (1 assertion - failed)] [Test case: 'Nice descriptive name'] MiscTests.cpp:279: [warning: This one ran] No assertions in test case, 'Nice descriptive name' -[Summary for test case 'Nice descriptive name': 1 test case failed (1 assertion failed)] +[Summary for test case 'Nice descriptive name': 1 test case - failed (1 assertion - failed)] [Test case: 'first tag'] No assertions in test case, 'first tag' -[Summary for test case 'first tag': 1 test case failed (1 assertion failed)] +[Summary for test case 'first tag': 1 test case - failed (1 assertion - failed)] [Test case: 'second tag'] No assertions in test case, 'second tag' -[Summary for test case 'second tag': 1 test case failed (1 assertion failed)] +[Summary for test case 'second tag': 1 test case - failed (1 assertion - failed)] [Test case: 'selftest/main'] [Section: 'selftest/expected result'] @@ -1250,23 +1250,23 @@ TrickyTests.cpp:55: [warning: Uncomment the code in this test to check that it g No assertions in test case, './inprogress/failing/Tricky/trailing expression' -[Summary for test case './inprogress/failing/Tricky/trailing expression': 1 test case failed (1 assertion failed)] +[Summary for test case './inprogress/failing/Tricky/trailing expression': 1 test case - failed (1 assertion - failed)] [Test case: './inprogress/failing/Tricky/compound lhs'] TrickyTests.cpp:71: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] No assertions in test case, './inprogress/failing/Tricky/compound lhs' -[Summary for test case './inprogress/failing/Tricky/compound lhs': 1 test case failed (1 assertion failed)] +[Summary for test case './inprogress/failing/Tricky/compound lhs': 1 test case - failed (1 assertion - failed)] [Test case: './failing/Tricky/non streamable type'] TrickyTests.cpp:95: &o1 == &o2 failed for: 0x == 0x TrickyTests.cpp:96: o1 == o2 failed for: {?} == {?} -[Summary for test case './failing/Tricky/non streamable type': 1 test case failed (All 2 assertions failed)] +[Summary for test case './failing/Tricky/non streamable type': 1 test case - failed (2 assertions - both failed)] [Test case: './failing/string literals'] TrickyTests.cpp:106: std::string( "first" ) == "second" failed for: "first" == "second" -[Summary for test case './failing/string literals': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/string literals': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/side-effects'] TrickyTests.cpp:119: i++ == 7 succeeded for: 7 == 7 @@ -1334,9 +1334,9 @@ BDDTests.cpp:37: itDoesThis() succeeded for: true [Summary for test case 'scenario name': All tests passed (1 assertion in 1 test case)] -[Summary for group '~dummy': 44 of 95 test cases failed (101 of 607 assertions failed)] +[Summary for group '~dummy': 95 test cases - 44 failed (607 assertions - 101 failed)] -[Summary for 'CatchSelfTest': 44 of 95 test cases failed (101 of 607 assertions failed)] +[Summary for 'CatchSelfTest': 95 test cases - 44 failed (607 assertions - 101 failed)] [Started testing: CatchSelfTest] [Group: '~dummy'] @@ -1389,7 +1389,7 @@ ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" [Test case: './failing/TestClass/failingCase'] ClassTests.cpp:28: s == "world" failed for: "hello" == "world" -[Summary for test case './failing/TestClass/failingCase': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/TestClass/failingCase': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/Fixture/succeedingCase'] ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 @@ -1397,7 +1397,7 @@ ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 [Test case: './failing/Fixture/failingCase'] ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 -[Summary for test case './failing/Fixture/failingCase': 1 test case failed (1 assertion failed)] +[Summary for test case './failing/Fixture/failingCase': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/conditions/equality'] ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 @@ -1412,11 +1412,11 @@ ConditionTests.cpp:63: x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) [Test case: './failing/conditions/equality'] ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 -[Summary for test case './failing/conditions/equality': 1 test case failed (All 2 assertions failed)] +[Summary for test case './failing/conditions/equality': 1 test case - failed (2 assertions - both failed)] -[Summary for group '~dummy': 3 of 12 test cases failed (4 of 38 assertions failed)] +[Summary for group '~dummy': 12 test cases - 3 failed (38 assertions - 4 failed)] -[Summary for 'CatchSelfTest': 3 of 12 test cases failed (4 of 38 assertions failed)] +[Summary for 'CatchSelfTest': 12 test cases - 3 failed (38 assertions - 4 failed)] From 6488fc1c88cee78d00c247e0911ae96d8d7aaeaa Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 11 Dec 2012 09:02:31 +0000 Subject: [PATCH 093/296] Console reporter: Don't print full path for every line --- include/reporters/catch_reporter_console.hpp | 27 +- .../SelfTest/Baselines/approvedResults.txt | 1796 +++++++++++------ .../CatchSelfTest.xcodeproj/project.pbxproj | 2 +- 3 files changed, 1169 insertions(+), 656 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 682ba18a..d3c05df1 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -80,10 +80,7 @@ namespace Catch { lazyPrint(); - if( !result.getSourceInfo().empty() ) { - TextColour colour( TextColour::FileName ); - stream << result.getSourceInfo(); - } + printLineInfo( result.getSourceInfo() ); if( result.hasExpression() ) { TextColour colour( TextColour::OriginalExpression ); @@ -241,6 +238,7 @@ namespace Catch { } virtual void sectionEnded( Ptr const& _sectionStats ) { + resetLastPrintedLine(); if( _sectionStats->missingAssertions ) { lazyPrint(); TextColour colour( TextColour::ResultError ); @@ -263,6 +261,7 @@ namespace Catch { AccumulatingReporter::sectionEnded( _sectionStats ); } virtual void testCaseEnded( Ptr const& _testCaseStats ) { + resetLastPrintedLine(); if( _testCaseStats->missingAssertions ) { lazyPrint(); TextColour colour( TextColour::ResultError ); @@ -292,6 +291,26 @@ namespace Catch { AccumulatingReporter::testRunEnded( _testRunStats ); } + void printLineInfo( SourceLineInfo const& lineInfo ) { + if( !lineInfo.empty() ) { + if( m_lastPrintedLine.empty() || + m_lastPrintedLine.file != lineInfo.file || + abs( static_cast( m_lastPrintedLine.line ) - static_cast( lineInfo.line ) ) > 20 ) { + TextColour colour( TextColour::FileName ); + stream << lineInfo << "\n"; + m_lastPrintedLine = lineInfo; + } + else if( lineInfo.line != m_lastPrintedLine.line ) { + TextColour colour( TextColour::FileName ); + stream << "line " << lineInfo.line << ":\n"; + } + } + } + void resetLastPrintedLine() { + m_lastPrintedLine = SourceLineInfo(); + } + SourceLineInfo m_lastPrintedLine; + }; INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 0a6dda24..5fc1dfd9 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,249 +1,410 @@ [Started testing: CatchSelfTest] [Group: '~dummy'] [Test case: './succeeding/Approx/simple'] -ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) -ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) -ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 -ApproxTests.cpp:26: Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 +ApproxTests.cpp:20: +d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +line 21: +d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) +line 22: +d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) +line 24: +Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +line 25: +Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 +line 26: +Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 [Summary for test case './succeeding/Approx/simple': All tests passed (6 assertions in 1 test case)] [Test case: './succeeding/Approx/epsilon'] -ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) -ApproxTests.cpp:39: d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) +ApproxTests.cpp:38: +d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) +line 39: +d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) [Summary for test case './succeeding/Approx/epsilon': All tests passed (2 assertions in 1 test case)] [Test case: './succeeding/Approx/float'] -ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:50: 0.0f == Approx( 0.0f ) succeeded for: 0 == Approx( 0 ) +ApproxTests.cpp:49: +1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) +line 50: +0.0f == Approx( 0.0f ) succeeded for: 0 == Approx( 0 ) [Summary for test case './succeeding/Approx/float': All tests passed (2 assertions in 1 test case)] [Test case: './succeeding/Approx/int'] -ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded -ApproxTests.cpp:61: 0 == Approx( 0 ) succeeded +ApproxTests.cpp:60: +1 == Approx( 1 ) succeeded +line 61: +0 == Approx( 0 ) succeeded [Summary for test case './succeeding/Approx/int': All tests passed (2 assertions in 1 test case)] [Test case: './succeeding/Approx/mixed'] -ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) -ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) -ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) -ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) -ApproxTests.cpp:79: dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) +ApproxTests.cpp:75: +1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) +line 76: +0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) +line 77: +0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) +line 78: +1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) +line 79: +dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) [Summary for test case './succeeding/Approx/mixed': All tests passed (5 assertions in 1 test case)] [Test case: './succeeding/Approx/custom'] -ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) -ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) -ApproxTests.cpp:96: d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) -ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 -ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 -ApproxTests.cpp:101: approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 +ApproxTests.cpp:93: +d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +line 94: +d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) +line 95: +d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) +line 96: +d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) +line 98: +approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +line 99: +approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 +line 100: +approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 +line 101: +approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 [Summary for test case './succeeding/Approx/custom': All tests passed (8 assertions in 1 test case)] [Test case: './succeeding/TestClass/succeedingCase'] -ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" +ClassTests.cpp:24: +s == "hello" succeeded for: "hello" == "hello" [Summary for test case './succeeding/TestClass/succeedingCase': All tests passed (1 assertion in 1 test case)] [Test case: './failing/TestClass/failingCase'] -ClassTests.cpp:28: s == "world" failed for: "hello" == "world" +ClassTests.cpp:28: +s == "world" failed for: "hello" == "world" [Summary for test case './failing/TestClass/failingCase': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/Fixture/succeedingCase'] -ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 +ClassTests.cpp:47: +m_a == 1 succeeded for: 1 == 1 [Summary for test case './succeeding/Fixture/succeedingCase': All tests passed (1 assertion in 1 test case)] [Test case: './failing/Fixture/failingCase'] -ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 +ClassTests.cpp:55: +m_a == 2 failed for: 1 == 2 [Summary for test case './failing/Fixture/failingCase': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/conditions/equality'] -ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 -ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) -ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) -ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" -ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" -ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 -ConditionTests.cpp:63: x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) +ConditionTests.cpp:55: +data.int_seven == 7 succeeded for: 7 == 7 +line 56: +data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) +line 57: +data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) +line 58: +data.str_hello == "hello" succeeded for: "hello" == "hello" +line 59: +"hello" == data.str_hello succeeded for: "hello" == "hello" +line 60: +data.str_hello.size() == 5 succeeded for: 5 == 5 +line 63: +x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) [Summary for test case './succeeding/conditions/equality': All tests passed (7 assertions in 1 test case)] [Test case: './failing/conditions/equality'] -ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 -ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 -ConditionTests.cpp:73: data.int_seven == 0 failed for: 7 == 0 -ConditionTests.cpp:74: data.float_nine_point_one == Approx( 9.11f ) failed for: 9.1 == Approx( 9.11 ) -ConditionTests.cpp:75: data.float_nine_point_one == Approx( 9.0f ) failed for: 9.1 == Approx( 9 ) -ConditionTests.cpp:76: data.float_nine_point_one == Approx( 1 ) failed for: 9.1 == Approx( 1 ) -ConditionTests.cpp:77: data.float_nine_point_one == Approx( 0 ) failed for: 9.1 == Approx( 0 ) -ConditionTests.cpp:78: data.double_pi == Approx( 3.1415 ) failed for: 3.14159 == Approx( 3.1415 ) -ConditionTests.cpp:79: data.str_hello == "goodbye" failed for: "hello" == "goodbye" -ConditionTests.cpp:80: data.str_hello == "hell" failed for: "hello" == "hell" -ConditionTests.cpp:81: data.str_hello == "hello1" failed for: "hello" == "hello1" -ConditionTests.cpp:82: data.str_hello.size() == 6 failed for: 5 == 6 -ConditionTests.cpp:85: x == Approx( 1.301 ) failed for: 1.3 == Approx( 1.301 ) +ConditionTests.cpp:71: +data.int_seven == 6 failed for: 7 == 6 +line 72: +data.int_seven == 8 failed for: 7 == 8 +line 73: +data.int_seven == 0 failed for: 7 == 0 +line 74: +data.float_nine_point_one == Approx( 9.11f ) failed for: 9.1 == Approx( 9.11 ) +line 75: +data.float_nine_point_one == Approx( 9.0f ) failed for: 9.1 == Approx( 9 ) +line 76: +data.float_nine_point_one == Approx( 1 ) failed for: 9.1 == Approx( 1 ) +line 77: +data.float_nine_point_one == Approx( 0 ) failed for: 9.1 == Approx( 0 ) +line 78: +data.double_pi == Approx( 3.1415 ) failed for: 3.14159 == Approx( 3.1415 ) +line 79: +data.str_hello == "goodbye" failed for: "hello" == "goodbye" +line 80: +data.str_hello == "hell" failed for: "hello" == "hell" +line 81: +data.str_hello == "hello1" failed for: "hello" == "hello1" +line 82: +data.str_hello.size() == 6 failed for: 5 == 6 +line 85: +x == Approx( 1.301 ) failed for: 1.3 == Approx( 1.301 ) [Summary for test case './failing/conditions/equality': 1 test case - failed (13 assertions - all failed)] [Test case: './succeeding/conditions/inequality'] -ConditionTests.cpp:93: data.int_seven != 6 succeeded for: 7 != 6 -ConditionTests.cpp:94: data.int_seven != 8 succeeded for: 7 != 8 -ConditionTests.cpp:95: data.float_nine_point_one != Approx( 9.11f ) succeeded for: 9.1 != Approx( 9.11 ) -ConditionTests.cpp:96: data.float_nine_point_one != Approx( 9.0f ) succeeded for: 9.1 != Approx( 9 ) -ConditionTests.cpp:97: data.float_nine_point_one != Approx( 1 ) succeeded for: 9.1 != Approx( 1 ) -ConditionTests.cpp:98: data.float_nine_point_one != Approx( 0 ) succeeded for: 9.1 != Approx( 0 ) -ConditionTests.cpp:99: data.double_pi != Approx( 3.1415 ) succeeded for: 3.14159 != Approx( 3.1415 ) -ConditionTests.cpp:100: data.str_hello != "goodbye" succeeded for: "hello" != "goodbye" -ConditionTests.cpp:101: data.str_hello != "hell" succeeded for: "hello" != "hell" -ConditionTests.cpp:102: data.str_hello != "hello1" succeeded for: "hello" != "hello1" -ConditionTests.cpp:103: data.str_hello.size() != 6 succeeded for: 5 != 6 +ConditionTests.cpp:93: +data.int_seven != 6 succeeded for: 7 != 6 +line 94: +data.int_seven != 8 succeeded for: 7 != 8 +line 95: +data.float_nine_point_one != Approx( 9.11f ) succeeded for: 9.1 != Approx( 9.11 ) +line 96: +data.float_nine_point_one != Approx( 9.0f ) succeeded for: 9.1 != Approx( 9 ) +line 97: +data.float_nine_point_one != Approx( 1 ) succeeded for: 9.1 != Approx( 1 ) +line 98: +data.float_nine_point_one != Approx( 0 ) succeeded for: 9.1 != Approx( 0 ) +line 99: +data.double_pi != Approx( 3.1415 ) succeeded for: 3.14159 != Approx( 3.1415 ) +line 100: +data.str_hello != "goodbye" succeeded for: "hello" != "goodbye" +line 101: +data.str_hello != "hell" succeeded for: "hello" != "hell" +line 102: +data.str_hello != "hello1" succeeded for: "hello" != "hello1" +line 103: +data.str_hello.size() != 6 succeeded for: 5 != 6 [Summary for test case './succeeding/conditions/inequality': All tests passed (11 assertions in 1 test case)] [Test case: './failing/conditions/inequality'] -ConditionTests.cpp:111: data.int_seven != 7 failed for: 7 != 7 -ConditionTests.cpp:112: data.float_nine_point_one != Approx( 9.1f ) failed for: 9.1 != Approx( 9.1 ) -ConditionTests.cpp:113: data.double_pi != Approx( 3.1415926535 ) failed for: 3.14159 != Approx( 3.14159 ) -ConditionTests.cpp:114: data.str_hello != "hello" failed for: "hello" != "hello" -ConditionTests.cpp:115: data.str_hello.size() != 5 failed for: 5 != 5 +ConditionTests.cpp:111: +data.int_seven != 7 failed for: 7 != 7 +line 112: +data.float_nine_point_one != Approx( 9.1f ) failed for: 9.1 != Approx( 9.1 ) +line 113: +data.double_pi != Approx( 3.1415926535 ) failed for: 3.14159 != Approx( 3.14159 ) +line 114: +data.str_hello != "hello" failed for: "hello" != "hello" +line 115: +data.str_hello.size() != 5 failed for: 5 != 5 [Summary for test case './failing/conditions/inequality': 1 test case - failed (5 assertions - all failed)] [Test case: './succeeding/conditions/ordered'] -ConditionTests.cpp:124: data.int_seven < 8 succeeded for: 7 < 8 -ConditionTests.cpp:125: data.int_seven > 6 succeeded for: 7 > 6 -ConditionTests.cpp:126: data.int_seven > 0 succeeded for: 7 > 0 -ConditionTests.cpp:127: data.int_seven > -1 succeeded for: 7 > -1 -ConditionTests.cpp:129: data.int_seven >= 7 succeeded for: 7 >= 7 -ConditionTests.cpp:130: data.int_seven >= 6 succeeded for: 7 >= 6 -ConditionTests.cpp:131: data.int_seven <= 7 succeeded for: 7 <= 7 -ConditionTests.cpp:132: data.int_seven <= 8 succeeded for: 7 <= 8 -ConditionTests.cpp:134: data.float_nine_point_one > 9 succeeded for: 9.1 > 9 -ConditionTests.cpp:135: data.float_nine_point_one < 10 succeeded for: 9.1 < 10 -ConditionTests.cpp:136: data.float_nine_point_one < 9.2 succeeded for: 9.1 < 9.2 -ConditionTests.cpp:138: data.str_hello <= "hello" succeeded for: "hello" <= "hello" -ConditionTests.cpp:139: data.str_hello >= "hello" succeeded for: "hello" >= "hello" -ConditionTests.cpp:141: data.str_hello < "hellp" succeeded for: "hello" < "hellp" -ConditionTests.cpp:142: data.str_hello < "zebra" succeeded for: "hello" < "zebra" -ConditionTests.cpp:143: data.str_hello > "hellm" succeeded for: "hello" > "hellm" -ConditionTests.cpp:144: data.str_hello > "a" succeeded for: "hello" > "a" +ConditionTests.cpp:124: +data.int_seven < 8 succeeded for: 7 < 8 +line 125: +data.int_seven > 6 succeeded for: 7 > 6 +line 126: +data.int_seven > 0 succeeded for: 7 > 0 +line 127: +data.int_seven > -1 succeeded for: 7 > -1 +line 129: +data.int_seven >= 7 succeeded for: 7 >= 7 +line 130: +data.int_seven >= 6 succeeded for: 7 >= 6 +line 131: +data.int_seven <= 7 succeeded for: 7 <= 7 +line 132: +data.int_seven <= 8 succeeded for: 7 <= 8 +line 134: +data.float_nine_point_one > 9 succeeded for: 9.1 > 9 +line 135: +data.float_nine_point_one < 10 succeeded for: 9.1 < 10 +line 136: +data.float_nine_point_one < 9.2 succeeded for: 9.1 < 9.2 +line 138: +data.str_hello <= "hello" succeeded for: "hello" <= "hello" +line 139: +data.str_hello >= "hello" succeeded for: "hello" >= "hello" +line 141: +data.str_hello < "hellp" succeeded for: "hello" < "hellp" +line 142: +data.str_hello < "zebra" succeeded for: "hello" < "zebra" +line 143: +data.str_hello > "hellm" succeeded for: "hello" > "hellm" +line 144: +data.str_hello > "a" succeeded for: "hello" > "a" [Summary for test case './succeeding/conditions/ordered': All tests passed (17 assertions in 1 test case)] [Test case: './failing/conditions/ordered'] -ConditionTests.cpp:152: data.int_seven > 7 failed for: 7 > 7 -ConditionTests.cpp:153: data.int_seven < 7 failed for: 7 < 7 -ConditionTests.cpp:154: data.int_seven > 8 failed for: 7 > 8 -ConditionTests.cpp:155: data.int_seven < 6 failed for: 7 < 6 -ConditionTests.cpp:156: data.int_seven < 0 failed for: 7 < 0 -ConditionTests.cpp:157: data.int_seven < -1 failed for: 7 < -1 -ConditionTests.cpp:159: data.int_seven >= 8 failed for: 7 >= 8 -ConditionTests.cpp:160: data.int_seven <= 6 failed for: 7 <= 6 -ConditionTests.cpp:162: data.float_nine_point_one < 9 failed for: 9.1 < 9 -ConditionTests.cpp:163: data.float_nine_point_one > 10 failed for: 9.1 > 10 -ConditionTests.cpp:164: data.float_nine_point_one > 9.2 failed for: 9.1 > 9.2 -ConditionTests.cpp:166: data.str_hello > "hello" failed for: "hello" > "hello" -ConditionTests.cpp:167: data.str_hello < "hello" failed for: "hello" < "hello" -ConditionTests.cpp:168: data.str_hello > "hellp" failed for: "hello" > "hellp" -ConditionTests.cpp:169: data.str_hello > "z" failed for: "hello" > "z" -ConditionTests.cpp:170: data.str_hello < "hellm" failed for: "hello" < "hellm" -ConditionTests.cpp:171: data.str_hello < "a" failed for: "hello" < "a" -ConditionTests.cpp:173: data.str_hello >= "z" failed for: "hello" >= "z" -ConditionTests.cpp:174: data.str_hello <= "a" failed for: "hello" <= "a" +ConditionTests.cpp:152: +data.int_seven > 7 failed for: 7 > 7 +line 153: +data.int_seven < 7 failed for: 7 < 7 +line 154: +data.int_seven > 8 failed for: 7 > 8 +line 155: +data.int_seven < 6 failed for: 7 < 6 +line 156: +data.int_seven < 0 failed for: 7 < 0 +line 157: +data.int_seven < -1 failed for: 7 < -1 +line 159: +data.int_seven >= 8 failed for: 7 >= 8 +line 160: +data.int_seven <= 6 failed for: 7 <= 6 +line 162: +data.float_nine_point_one < 9 failed for: 9.1 < 9 +line 163: +data.float_nine_point_one > 10 failed for: 9.1 > 10 +line 164: +data.float_nine_point_one > 9.2 failed for: 9.1 > 9.2 +line 166: +data.str_hello > "hello" failed for: "hello" > "hello" +line 167: +data.str_hello < "hello" failed for: "hello" < "hello" +line 168: +data.str_hello > "hellp" failed for: "hello" > "hellp" +line 169: +data.str_hello > "z" failed for: "hello" > "z" +line 170: +data.str_hello < "hellm" failed for: "hello" < "hellm" +line 171: +data.str_hello < "a" failed for: "hello" < "a" +ConditionTests.cpp:173: +data.str_hello >= "z" failed for: "hello" >= "z" +line 174: +data.str_hello <= "a" failed for: "hello" <= "a" [Summary for test case './failing/conditions/ordered': 1 test case - failed (19 assertions - all failed)] [Test case: './succeeding/conditions/int literals'] -ConditionTests.cpp:188: i == 1 succeeded for: 1 == 1 -ConditionTests.cpp:189: ui == 2 succeeded for: 2 == 2 -ConditionTests.cpp:190: l == 3 succeeded for: 3 == 3 -ConditionTests.cpp:191: ul == 4 succeeded for: 4 == 4 -ConditionTests.cpp:192: c == 5 succeeded for: 5 == 5 -ConditionTests.cpp:193: uc == 6 succeeded for:  == 6 -ConditionTests.cpp:195: 1 == i succeeded for: 1 == 1 -ConditionTests.cpp:196: 2 == ui succeeded for: 2 == 2 -ConditionTests.cpp:197: 3 == l succeeded for: 3 == 3 -ConditionTests.cpp:198: 4 == ul succeeded for: 4 == 4 -ConditionTests.cpp:199: 5 == c succeeded for: 5 == 5 -ConditionTests.cpp:200: 6 == uc succeeded for: 6 ==  -ConditionTests.cpp:202: (std::numeric_limits::max)() > ul succeeded for: 0x > 4 +ConditionTests.cpp:188: +i == 1 succeeded for: 1 == 1 +line 189: +ui == 2 succeeded for: 2 == 2 +line 190: +l == 3 succeeded for: 3 == 3 +line 191: +ul == 4 succeeded for: 4 == 4 +line 192: +c == 5 succeeded for: 5 == 5 +line 193: +uc == 6 succeeded for:  == 6 +line 195: +1 == i succeeded for: 1 == 1 +line 196: +2 == ui succeeded for: 2 == 2 +line 197: +3 == l succeeded for: 3 == 3 +line 198: +4 == ul succeeded for: 4 == 4 +line 199: +5 == c succeeded for: 5 == 5 +line 200: +6 == uc succeeded for: 6 ==  +line 202: +(std::numeric_limits::max)() > ul succeeded for: 0x > 4 [Summary for test case './succeeding/conditions/int literals': All tests passed (13 assertions in 1 test case)] [Test case: './succeeding/conditions//long_to_unsigned_x'] -ConditionTests.cpp:223: long_var == unsigned_char_var succeeded for: 1 ==  -ConditionTests.cpp:224: long_var == unsigned_short_var succeeded for: 1 == 1 -ConditionTests.cpp:225: long_var == unsigned_int_var succeeded for: 1 == 1 -ConditionTests.cpp:226: long_var == unsigned_long_var succeeded for: 1 == 1 +ConditionTests.cpp:223: +long_var == unsigned_char_var succeeded for: 1 ==  +line 224: +long_var == unsigned_short_var succeeded for: 1 == 1 +line 225: +long_var == unsigned_int_var succeeded for: 1 == 1 +line 226: +long_var == unsigned_long_var succeeded for: 1 == 1 [Summary for test case './succeeding/conditions//long_to_unsigned_x': All tests passed (4 assertions in 1 test case)] [Test case: './succeeding/conditions/const ints to int literal'] -ConditionTests.cpp:237: unsigned_char_var == 1 succeeded for:  == 1 -ConditionTests.cpp:238: unsigned_short_var == 1 succeeded for: 1 == 1 -ConditionTests.cpp:239: unsigned_int_var == 1 succeeded for: 1 == 1 -ConditionTests.cpp:240: unsigned_long_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:237: +unsigned_char_var == 1 succeeded for:  == 1 +line 238: +unsigned_short_var == 1 succeeded for: 1 == 1 +line 239: +unsigned_int_var == 1 succeeded for: 1 == 1 +line 240: +unsigned_long_var == 1 succeeded for: 1 == 1 [Summary for test case './succeeding/conditions/const ints to int literal': All tests passed (4 assertions in 1 test case)] [Test case: './succeeding/conditions/negative ints'] -ConditionTests.cpp:246: ( -1 > 2u ) succeeded for: true -ConditionTests.cpp:247: -1 > 2u succeeded for: -1 > 2 -ConditionTests.cpp:249: ( 2u < -1 ) succeeded for: true -ConditionTests.cpp:250: 2u < -1 succeeded for: 2 < -1 -ConditionTests.cpp:253: ( minInt > 2u ) succeeded for: true -ConditionTests.cpp:254: minInt > 2u succeeded for: -2147483648 > 2 +ConditionTests.cpp:246: +( -1 > 2u ) succeeded for: true +line 247: +-1 > 2u succeeded for: -1 > 2 +line 249: +( 2u < -1 ) succeeded for: true +line 250: +2u < -1 succeeded for: 2 < -1 +line 253: +( minInt > 2u ) succeeded for: true +line 254: +minInt > 2u succeeded for: -2147483648 > 2 [Summary for test case './succeeding/conditions/negative ints': All tests passed (6 assertions in 1 test case)] [Test case: './succeeding/conditions/computed ints'] -ConditionTests.cpp:269: 54 == 6*9 succeeded for: 54 == 54 +ConditionTests.cpp:269: +54 == 6*9 succeeded for: 54 == 54 [Summary for test case './succeeding/conditions/computed ints': All tests passed (1 assertion in 1 test case)] [Test case: './succeeding/conditions/ptr'] -ConditionTests.cpp:285: p == __null succeeded for: __null == 0 -ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -ConditionTests.cpp:291: p != __null succeeded for: 0x != 0 -ConditionTests.cpp:294: cp != __null succeeded for: 0x != 0 -ConditionTests.cpp:297: cpc != __null succeeded for: 0x != 0 -ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 -ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x +ConditionTests.cpp:285: +p == __null succeeded for: __null == 0 +line 286: +p == pNULL succeeded for: __null == __null +line 291: +p != __null succeeded for: 0x != 0 +line 294: +cp != __null succeeded for: 0x != 0 +line 297: +cpc != __null succeeded for: 0x != 0 +line 299: +returnsNull() == __null succeeded for: {null string} == 0 +line 300: +returnsConstNull() == __null succeeded for: {null string} == 0 +line 302: +__null != p succeeded for: 0 != 0x [Summary for test case './succeeding/conditions/ptr': All tests passed (8 assertions in 1 test case)] [Test case: './succeeding/conditions/not'] -ConditionTests.cpp:317: false == false succeeded -ConditionTests.cpp:318: true == true succeeded -ConditionTests.cpp:319: !false succeeded for: true -ConditionTests.cpp:320: !false succeeded -ConditionTests.cpp:322: !falseValue succeeded for: true -ConditionTests.cpp:323: !falseValue succeeded for: !false -ConditionTests.cpp:325: !(1 == 2) succeeded for: true -ConditionTests.cpp:326: !1 == 2 succeeded for: !(1 == 2) +ConditionTests.cpp:317: +false == false succeeded +line 318: +true == true succeeded +line 319: +!false succeeded for: true +line 320: +!false succeeded +line 322: +!falseValue succeeded for: true +line 323: +!falseValue succeeded for: !false +line 325: +!(1 == 2) succeeded for: true +line 326: +!1 == 2 succeeded for: !(1 == 2) [Summary for test case './succeeding/conditions/not': All tests passed (8 assertions in 1 test case)] [Test case: './failing/conditions/not'] -ConditionTests.cpp:334: false != false failed -ConditionTests.cpp:335: true != true failed -ConditionTests.cpp:336: !true failed for: false -ConditionTests.cpp:337: !true failed -ConditionTests.cpp:339: !trueValue failed for: false -ConditionTests.cpp:340: !trueValue failed for: !true -ConditionTests.cpp:342: !(1 == 1) failed for: false -ConditionTests.cpp:343: !1 == 1 failed for: !(1 == 1) +ConditionTests.cpp:334: +false != false failed +line 335: +true != true failed +line 336: +!true failed for: false +line 337: +!true failed +line 339: +!trueValue failed for: false +line 340: +!trueValue failed for: !true +line 342: +!(1 == 1) failed for: false +line 343: +!1 == 1 failed for: !(1 == 1) [Summary for test case './failing/conditions/not': 1 test case - failed (8 assertions - all failed)] [Test case: './succeeding/exceptions/explicit'] -ExceptionTests.cpp:39: thisThrows() succeeded -ExceptionTests.cpp:40: thisDoesntThrow() succeeded -ExceptionTests.cpp:41: thisThrows() succeeded +ExceptionTests.cpp:39: +thisThrows() succeeded +line 40: +thisDoesntThrow() succeeded +line 41: +thisThrows() succeeded [Summary for test case './succeeding/exceptions/explicit': All tests passed (3 assertions in 1 test case)] [Test case: './failing/exceptions/explicit'] -ExceptionTests.cpp:47: thisThrows() failed with unexpected exception with message: 'expected exception' -ExceptionTests.cpp:48: thisDoesntThrow() failed because no exception was thrown where one was expected -ExceptionTests.cpp:49: thisThrows() failed with unexpected exception with message: 'expected exception' +ExceptionTests.cpp:47: +thisThrows() failed with unexpected exception with message: 'expected exception' +line 48: +thisDoesntThrow() failed because no exception was thrown where one was expected +line 49: +thisThrows() failed with unexpected exception with message: 'expected exception' [Summary for test case './failing/exceptions/explicit': 1 test case - failed (3 assertions - all failed)] [Test case: './failing/exceptions/implicit'] -ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:52: +Unexpected exception with message: 'unexpected exception' [Summary for test case './failing/exceptions/implicit': 1 test case - failed (1 assertion - failed)] [Test case: './failing/exceptions/implicit/2'] -ExceptionTests.cpp:60: 1 == 1 succeeded -ExceptionTests.cpp:60: {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:60: +1 == 1 succeeded +{Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' [Summary for test case './failing/exceptions/implicit/2': 1 test case - failed (2 assertions - 1 failed)] [Test case: './succeeding/exceptions/implicit'] @@ -253,211 +414,304 @@ No assertions in test case, './succeeding/exceptions/implicit' [Summary for test case './succeeding/exceptions/implicit': 1 test case - failed (1 assertion - failed)] [Test case: './failing/exceptions/custom'] -ExceptionTests.cpp:102: Unexpected exception with message: 'custom exception' +ExceptionTests.cpp:102: +Unexpected exception with message: 'custom exception' [Summary for test case './failing/exceptions/custom': 1 test case - failed (1 assertion - failed)] [Test case: './failing/exceptions/custom/nothrow'] -ExceptionTests.cpp:109: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' +ExceptionTests.cpp:109: +throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' [Summary for test case './failing/exceptions/custom/nothrow': 1 test case - failed (1 assertion - failed)] [Test case: './failing/exceptions/custom/throw'] -ExceptionTests.cpp:114: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' +ExceptionTests.cpp:114: +throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' [Summary for test case './failing/exceptions/custom/throw': 1 test case - failed (1 assertion - failed)] [Test case: './failing/exceptions/custom/double'] -ExceptionTests.cpp:118: Unexpected exception with message: '3.14' +ExceptionTests.cpp:118: +Unexpected exception with message: '3.14' [Summary for test case './failing/exceptions/custom/double': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/exceptions/notimplemented'] -ExceptionTests.cpp:129: thisFunctionNotImplemented( 7 ) succeeded +ExceptionTests.cpp:129: +thisFunctionNotImplemented( 7 ) succeeded [Summary for test case './succeeding/exceptions/notimplemented': All tests passed (1 assertion in 1 test case)] [Test case: './succeeding/generators/1'] -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: +multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +line 27: +multiply( j, 2 ) == j*2 succeeded for: 214 == 214 [Summary for test case './succeeding/generators/1': All tests passed (144 assertions in 1 test case)] [Test case: './succeeding/message'] -MessageTests.cpp:14: [warning: this is a warning] +MessageTests.cpp:14: +[warning: this is a warning] No assertions in test case, './succeeding/message' [Summary for test case './succeeding/message': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/succeed'] -MessageTests.cpp:18: succeeded +MessageTests.cpp:18: + succeeded [with message: this is a success] [Summary for test case './succeeding/succeed': All tests passed (1 assertion in 1 test case)] [Test case: './failing/message/info/1'] -MessageTests.cpp:23: [info: this message should be logged] -MessageTests.cpp:24: [info: so should this] -MessageTests.cpp:26: a == 1 failed for: 2 == 1 +MessageTests.cpp:23: +[info: this message should be logged] +line 24: +[info: so should this] +line 26: +a == 1 failed for: 2 == 1 [Summary for test case './failing/message/info/1': 1 test case - failed (1 assertion - failed)] [Test case: './mixed/message/info/2'] -MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 -MessageTests.cpp:31: [info: this message should be logged] -MessageTests.cpp:35: [info: this message should be logged, too] -MessageTests.cpp:37: a == 1 failed for: 2 == 1 -MessageTests.cpp:39: [info: and this, but later] -MessageTests.cpp:41: a == 0 failed for: 2 == 0 -MessageTests.cpp:45: a == 2 succeeded for: 2 == 2 +MessageTests.cpp:33: +a == 2 succeeded for: 2 == 2 +line 31: +[info: this message should be logged] +line 35: +[info: this message should be logged, too] +line 37: +a == 1 failed for: 2 == 1 +line 39: +[info: and this, but later] +line 41: +a == 0 failed for: 2 == 0 +line 45: +a == 2 succeeded for: 2 == 2 [Summary for test case './mixed/message/info/2': 1 test case - failed (4 assertions - 2 failed)] [Test case: './failing/message/fail'] -MessageTests.cpp:51: failed with message: 'This is a failure' +MessageTests.cpp:51: +failed with message: 'This is a failure' [Summary for test case './failing/message/fail': 1 test case - failed (1 assertion - failed)] [Test case: './failing/message/sections'] [Section: 'one'] -MessageTests.cpp:58: failed with message: 'Message from section one' +MessageTests.cpp:58: +failed with message: 'Message from section one' [Summary for section 'one': 1 assertion - failed] [Section: 'two'] -MessageTests.cpp:63: failed with message: 'Message from section two' +MessageTests.cpp:63: +failed with message: 'Message from section two' [Summary for section 'two': 1 assertion - failed] [Summary for test case './failing/message/sections': 1 test case - failed (2 assertions - both failed)] @@ -480,23 +734,25 @@ No assertions in section, 'two' [Summary for test case './succeeding/message/sections/stdout': 1 test case - failed (2 assertions - both failed)] [Test case: './mixed/message/scoped'] -MessageTests.cpp:86: i < 10 succeeded for: 0 < 10 -MessageTests.cpp:86: i < 10 succeeded for: 1 < 10 -MessageTests.cpp:86: i < 10 succeeded for: 2 < 10 -MessageTests.cpp:86: i < 10 succeeded for: 3 < 10 -MessageTests.cpp:86: i < 10 succeeded for: 4 < 10 -MessageTests.cpp:86: i < 10 succeeded for: 5 < 10 -MessageTests.cpp:86: i < 10 succeeded for: 6 < 10 -MessageTests.cpp:86: i < 10 succeeded for: 7 < 10 -MessageTests.cpp:86: i < 10 succeeded for: 8 < 10 -MessageTests.cpp:86: i < 10 succeeded for: 9 < 10 -MessageTests.cpp:86: i < 10 succeeded[info: current counter 10] -MessageTests.cpp:86: i < 10 succeeded[info: i := 10] -MessageTests.cpp:86: i < 10 failed for: 10 < 10 +MessageTests.cpp:86: +i < 10 succeeded for: 0 < 10 +i < 10 succeeded for: 1 < 10 +i < 10 succeeded for: 2 < 10 +i < 10 succeeded for: 3 < 10 +i < 10 succeeded for: 4 < 10 +i < 10 succeeded for: 5 < 10 +i < 10 succeeded for: 6 < 10 +i < 10 succeeded for: 7 < 10 +i < 10 succeeded for: 8 < 10 +i < 10 succeeded for: 9 < 10 +i < 10 succeeded[info: current counter 10] +i < 10 succeeded[info: i := 10] +i < 10 failed for: 10 < 10 [Summary for test case './mixed/message/scoped': 1 test case - failed (11 assertions - 1 failed)] [Test case: './succeeding/nofail'] -MessageTests.cpp:92: 1 == 2 failed - but was ok +MessageTests.cpp:92: +1 == 2 failed - but was ok No assertions in test case, './succeeding/nofail' @@ -504,22 +760,28 @@ No assertions in test case, './succeeding/nofail' [Test case: './succeeding/Misc/Sections'] [Section: 's1'] -MiscTests.cpp:25: a != b succeeded for: 1 != 2 -MiscTests.cpp:26: b != a succeeded for: 2 != 1 +MiscTests.cpp:25: +a != b succeeded for: 1 != 2 +line 26: +b != a succeeded for: 2 != 1 [Summary for section 's1': All 2 assertions passed] [Section: 's2'] -MiscTests.cpp:31: a != b succeeded for: 1 != 2 +MiscTests.cpp:31: +a != b succeeded for: 1 != 2 [Summary for section 's2': 1 assertion passed] [Summary for test case './succeeding/Misc/Sections': All tests passed (3 assertions in 1 test case)] [Test case: './succeeding/Misc/Sections/nested'] [Section: 's1'] -MiscTests.cpp:42: a != b succeeded for: 1 != 2 -MiscTests.cpp:43: b != a succeeded for: 2 != 1 +MiscTests.cpp:42: +a != b succeeded for: 1 != 2 +line 43: +b != a succeeded for: 2 != 1 [Section: 's2'] -MiscTests.cpp:47: a != b succeeded for: 1 != 2 +line 47: +a != b succeeded for: 1 != 2 [Summary for section 's2': 1 assertion passed] [Summary for section 's1': All 3 assertions passed] @@ -529,21 +791,24 @@ MiscTests.cpp:47: a != b succeeded for: 1 != 2 [Test case: './mixed/Misc/Sections/nested2'] [Section: 's1'] [Section: 's2'] -MiscTests.cpp:61: a == b failed for: 1 == 2 +MiscTests.cpp:61: +a == b failed for: 1 == 2 [Summary for section 's2': 1 assertion - failed] [Summary for section 's1': 1 assertion - failed] [Section: 's1'] [Section: 's3'] -MiscTests.cpp:66: a != b succeeded for: 1 != 2 +MiscTests.cpp:66: +a != b succeeded for: 1 != 2 [Summary for section 's3': 1 assertion passed] [Summary for section 's1': 1 assertion passed] [Section: 's1'] [Section: 's4'] -MiscTests.cpp:70: a < b succeeded for: 1 < 2 +MiscTests.cpp:70: +a < b succeeded for: 1 < 2 [Summary for section 's4': 1 assertion passed] [Summary for section 's1': 1 assertion passed] @@ -579,28 +844,38 @@ No assertions in section, 'f (leaf)' [Test case: './mixed/Misc/Sections/loops'] [Section: 's1'] -MiscTests.cpp:103: b > a failed for: 0 > 1 +MiscTests.cpp:103: +b > a failed for: 0 > 1 [Summary for section 's1': 1 assertion - failed] [Summary for test case './mixed/Misc/Sections/loops': 1 test case - failed (1 assertion - failed)] [Test case: './mixed/Misc/loops'] -MiscTests.cpp:114: [info: Testing if fib[0] (1) is even] -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:114: [info: Testing if fib[1] (1) is even] -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -MiscTests.cpp:114: [info: Testing if fib[2] (2) is even] -MiscTests.cpp:114: [info: Testing if fib[3] (3) is even] -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:114: [info: Testing if fib[4] (5) is even] -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -MiscTests.cpp:114: [info: Testing if fib[5] (8) is even] -MiscTests.cpp:114: [info: Testing if fib[6] (13) is even] -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:114: [info: Testing if fib[7] (21) is even] -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:114: +[info: Testing if fib[0] (1) is even] +line 115: +( fib[i] % 2 ) == 0 failed for: 1 == 0 +[info: Testing if fib[1] (1) is even] +line 115: +( fib[i] % 2 ) == 0 failed for: 1 == 0 +line 115: +( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +[info: Testing if fib[2] (2) is even] +[info: Testing if fib[3] (3) is even] +line 115: +( fib[i] % 2 ) == 0 failed for: 1 == 0 +[info: Testing if fib[4] (5) is even] +line 115: +( fib[i] % 2 ) == 0 failed for: 1 == 0 +line 115: +( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +[info: Testing if fib[5] (8) is even] +[info: Testing if fib[6] (13) is even] +line 115: +( fib[i] % 2 ) == 0 failed for: 1 == 0 +[info: Testing if fib[7] (21) is even] +line 115: +( fib[i] % 2 ) == 0 failed for: 1 == 0 [Summary for test case './mixed/Misc/loops': 1 test case - failed (8 assertions - 6 failed)] Some information @@ -612,34 +887,47 @@ No assertions in test case, './succeeding/Misc/stdout,stderr' [Summary for test case './succeeding/Misc/stdout,stderr': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/Misc/null strings'] -MiscTests.cpp:133: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} -MiscTests.cpp:134: makeString( true ) == static_cast(__null) succeeded for: {null string} == {null string} +MiscTests.cpp:133: +makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} +line 134: +makeString( true ) == static_cast(__null) succeeded for: {null string} == {null string} [Summary for test case './succeeding/Misc/null strings': All tests passed (2 assertions in 1 test case)] [Test case: './failing/info'] -MiscTests.cpp:139: [info: hi] -MiscTests.cpp:141: [info: i := 7] -MiscTests.cpp:142: false failed +MiscTests.cpp:139: +[info: hi] +line 141: +[info: i := 7] +line 142: +false failed [Summary for test case './failing/info': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/checkedif'] -MiscTests.cpp:147: flag succeeded for: true -MiscTests.cpp:155: testCheckedIf( true ) succeeded for: true +MiscTests.cpp:147: +flag succeeded for: true +line 155: +testCheckedIf( true ) succeeded for: true [Summary for test case './succeeding/checkedif': All tests passed (2 assertions in 1 test case)] [Test case: './failing/checkedif'] -MiscTests.cpp:147: flag failed for: false -MiscTests.cpp:160: testCheckedIf( false ) failed for: false +MiscTests.cpp:147: +flag failed for: false +line 160: +testCheckedIf( false ) failed for: false [Summary for test case './failing/checkedif': 1 test case - failed (2 assertions - both failed)] [Test case: './succeeding/checkedelse'] -MiscTests.cpp:165: flag succeeded for: true -MiscTests.cpp:173: testCheckedElse( true ) succeeded for: true +MiscTests.cpp:165: +flag succeeded for: true +line 173: +testCheckedElse( true ) succeeded for: true [Summary for test case './succeeding/checkedelse': All tests passed (2 assertions in 1 test case)] [Test case: './failing/checkedelse'] -MiscTests.cpp:165: flag failed for: false -MiscTests.cpp:178: testCheckedElse( false ) failed for: false +MiscTests.cpp:165: +flag failed for: false +line 178: +testCheckedElse( false ) failed for: false [Summary for test case './failing/checkedelse': 1 test case - failed (2 assertions - both failed)] [Test case: './misc/xmlentitycheck'] @@ -658,68 +946,88 @@ No assertions in section, 'encoded chars' [Summary for test case './misc/xmlentitycheck': 1 test case - failed (2 assertions - both failed)] [Test case: './manual/onechar'] -MiscTests.cpp:195: [info: 3] -MiscTests.cpp:196: false failed +MiscTests.cpp:195: +[info: 3] +line 196: +false failed [Summary for test case './manual/onechar': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/atomic if'] -MiscTests.cpp:206: x == 0 succeeded for: 0 == 0 +MiscTests.cpp:206: +x == 0 succeeded for: 0 == 0 [Summary for test case './succeeding/atomic if': All tests passed (1 assertion in 1 test case)] [Test case: './succeeding/matchers'] -MiscTests.cpp:216: testStringForMatching() Contains( "string" ) succeeded for: +MiscTests.cpp:216: +testStringForMatching() Contains( "string" ) succeeded for: "this string contains 'abc' as a substring" contains: "string" -MiscTests.cpp:217: testStringForMatching() Contains( "abc" ) succeeded for: +line 217: +testStringForMatching() Contains( "abc" ) succeeded for: "this string contains 'abc' as a substring" contains: "abc" -MiscTests.cpp:219: testStringForMatching() StartsWith( "this" ) succeeded for: +line 219: +testStringForMatching() StartsWith( "this" ) succeeded for: "this string contains 'abc' as a substring" starts with: "this" -MiscTests.cpp:220: testStringForMatching() EndsWith( "substring" ) succeeded for: +line 220: +testStringForMatching() EndsWith( "substring" ) succeeded for: "this string contains 'abc' as a substring" ends with: "substring" [Summary for test case './succeeding/matchers': All tests passed (4 assertions in 1 test case)] [Test case: './failing/matchers/Contains'] -MiscTests.cpp:225: testStringForMatching() Contains( "not there" ) failed for: +MiscTests.cpp:225: +testStringForMatching() Contains( "not there" ) failed for: "this string contains 'abc' as a substring" contains: "not there" [Summary for test case './failing/matchers/Contains': 1 test case - failed (1 assertion - failed)] [Test case: './failing/matchers/StartsWith'] -MiscTests.cpp:230: testStringForMatching() StartsWith( "string" ) failed for: +MiscTests.cpp:230: +testStringForMatching() StartsWith( "string" ) failed for: "this string contains 'abc' as a substring" starts with: "string" [Summary for test case './failing/matchers/StartsWith': 1 test case - failed (1 assertion - failed)] [Test case: './failing/matchers/EndsWith'] -MiscTests.cpp:235: testStringForMatching() EndsWith( "this" ) failed for: +MiscTests.cpp:235: +testStringForMatching() EndsWith( "this" ) failed for: "this string contains 'abc' as a substring" ends with: "this" [Summary for test case './failing/matchers/EndsWith': 1 test case - failed (1 assertion - failed)] [Test case: './failing/matchers/Equals'] -MiscTests.cpp:240: testStringForMatching() Equals( "something else" ) failed for: +MiscTests.cpp:240: +testStringForMatching() Equals( "something else" ) failed for: "this string contains 'abc' as a substring" equals: "something else" [Summary for test case './failing/matchers/Equals': 1 test case - failed (1 assertion - failed)] [Test case: '/succeeding/matchers/AllOf'] -MiscTests.cpp:245: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: +MiscTests.cpp:245: +testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) [Summary for test case '/succeeding/matchers/AllOf': All tests passed (1 assertion in 1 test case)] [Test case: '/succeeding/matchers/AnyOf'] -MiscTests.cpp:249: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: +MiscTests.cpp:249: +testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -MiscTests.cpp:250: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: +line 250: +testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) [Summary for test case '/succeeding/matchers/AnyOf': All tests passed (2 assertions in 1 test case)] [Test case: './succeeding/matchers/Equals'] -MiscTests.cpp:255: testStringForMatching() Equals( "this string contains 'abc' as a substring" ) succeeded for: +MiscTests.cpp:255: +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" [Summary for test case './succeeding/matchers/Equals': All tests passed (1 assertion in 1 test case)] [Test case: 'example/factorial'] -MiscTests.cpp:266: Factorial(0) == 1 succeeded for: 1 == 1 -MiscTests.cpp:267: Factorial(1) == 1 succeeded for: 1 == 1 -MiscTests.cpp:268: Factorial(2) == 2 succeeded for: 2 == 2 -MiscTests.cpp:269: Factorial(3) == 6 succeeded for: 6 == 6 -MiscTests.cpp:270: Factorial(10) == 3628800 succeeded for: 0x == 3628800 +MiscTests.cpp:266: +Factorial(0) == 1 succeeded for: 1 == 1 +line 267: +Factorial(1) == 1 succeeded for: 1 == 1 +line 268: +Factorial(2) == 2 succeeded for: 2 == 2 +line 269: +Factorial(3) == 6 succeeded for: 6 == 6 +line 270: +Factorial(10) == 3628800 succeeded for: 0x == 3628800 [Summary for test case 'example/factorial': All tests passed (5 assertions in 1 test case)] [Test case: 'empty'] @@ -729,7 +1037,8 @@ No assertions in test case, 'empty' [Summary for test case 'empty': 1 test case - failed (1 assertion - failed)] [Test case: 'Nice descriptive name'] -MiscTests.cpp:279: [warning: This one ran] +MiscTests.cpp:279: +[warning: This one ran] No assertions in test case, 'Nice descriptive name' @@ -750,55 +1059,56 @@ No assertions in test case, 'second tag' [Test case: 'selftest/main'] [Section: 'selftest/expected result'] [Section: 'selftest/expected result/failing tests'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded + succeeded [with message: Tests failed, as expected] [Summary for section 'selftest/expected result/failing tests': All 25 assertions passed] @@ -806,95 +1116,96 @@ No assertions in test case, 'second tag' [Section: 'selftest/expected result'] [Section: 'selftest/expected result/succeeding tests'] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded +/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] Message from section one Message from section two -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] Some information An error -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded + succeeded [with message: Tests passed, as expected] [Summary for section 'selftest/expected result/succeeding tests': All 43 assertions passed] @@ -906,16 +1217,20 @@ Some information An error [Section: 'selftest/test counts'] [Section: 'selftest/test counts/succeeding tests'] -TestMain.cpp:40: totals.assertions.passed == 291 succeeded for: 291 == 291 -TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 +TestMain.cpp:40: +totals.assertions.passed == 291 succeeded for: 291 == 291 +line 41: +totals.assertions.failed == 0 succeeded for: 0 == 0 [Summary for section 'selftest/test counts/succeeding tests': All 2 assertions passed] [Summary for section 'selftest/test counts': All 2 assertions passed] [Section: 'selftest/test counts'] [Section: 'selftest/test counts/failing tests'] -TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 -TestMain.cpp:48: totals.assertions.failed == 72 succeeded for: 72 == 72 +TestMain.cpp:47: +totals.assertions.passed == 1 succeeded for: 1 == 1 +line 48: +totals.assertions.failed == 72 succeeded for: 72 == 72 [Summary for section 'selftest/test counts/failing tests': All 2 assertions passed] [Summary for section 'selftest/test counts': All 2 assertions passed] @@ -923,83 +1238,116 @@ TestMain.cpp:48: totals.assertions.failed == 72 succeeded for: 72 == 72 [Summary for test case 'selftest/main': All tests passed (72 assertions in 1 test case)] [Test case: 'meta/Misc/Sections'] -TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 -TestMain.cpp:58: totals.assertions.failed == 1 succeeded for: 1 == 1 +TestMain.cpp:57: +totals.assertions.passed == 2 succeeded for: 2 == 2 +line 58: +totals.assertions.failed == 1 succeeded for: 1 == 1 [Summary for test case 'meta/Misc/Sections': All tests passed (2 assertions in 1 test case)] [Test case: 'selftest/parser/2'] [Section: 'default'] -TestMain.cpp:97: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:99: config.shouldDebugBreak == false succeeded for: false == false -TestMain.cpp:100: config.cutoff == -1 succeeded for: -1 == -1 -TestMain.cpp:101: config.allowThrows == true succeeded for: true == true -TestMain.cpp:102: config.reporter.empty() succeeded for: true +TestMain.cpp:97: +parseIntoConfig( argv, config ) succeeded +line 99: +config.shouldDebugBreak == false succeeded for: false == false +line 100: +config.cutoff == -1 succeeded for: -1 == -1 +line 101: +config.allowThrows == true succeeded for: true == true +line 102: +config.reporter.empty() succeeded for: true [Summary for section 'default': All 5 assertions passed] [Section: 'test lists'] [Section: '-t/1'] -TestMain.cpp:108: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:110: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:111: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:112: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:108: +parseIntoConfig( argv, config ) succeeded +line 110: +config.filters.size() == 1 succeeded for: 1 == 1 +line 111: +config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +line 112: +config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [Summary for section '-t/1': All 4 assertions passed] [Summary for section 'test lists': All 4 assertions passed] [Section: 'test lists'] [Section: '-t/exclude:1'] -TestMain.cpp:116: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:118: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:119: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:120: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:116: +parseIntoConfig( argv, config ) succeeded +line 118: +config.filters.size() == 1 succeeded for: 1 == 1 +line 119: +config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +line 120: +config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [Summary for section '-t/exclude:1': All 4 assertions passed] [Summary for section 'test lists': All 4 assertions passed] [Section: 'test lists'] [Section: '--test/1'] -TestMain.cpp:125: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:127: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:128: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:129: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:125: +parseIntoConfig( argv, config ) succeeded +line 127: +config.filters.size() == 1 succeeded for: 1 == 1 +line 128: +config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +line 129: +config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [Summary for section '--test/1': All 4 assertions passed] [Summary for section 'test lists': All 4 assertions passed] [Section: 'test lists'] [Section: '--test/exclude:1'] -TestMain.cpp:134: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:136: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:137: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:138: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:134: +parseIntoConfig( argv, config ) succeeded +line 136: +config.filters.size() == 1 succeeded for: 1 == 1 +line 137: +config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +line 138: +config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [Summary for section '--test/exclude:1': All 4 assertions passed] [Summary for section 'test lists': All 4 assertions passed] [Section: 'test lists'] [Section: '--test/exclude:2'] -TestMain.cpp:143: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:145: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:146: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:147: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:143: +parseIntoConfig( argv, config ) succeeded +line 145: +config.filters.size() == 1 succeeded for: 1 == 1 +line 146: +config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +line 147: +config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [Summary for section '--test/exclude:2': All 4 assertions passed] [Summary for section 'test lists': All 4 assertions passed] [Section: 'test lists'] [Section: '-t/2'] -TestMain.cpp:152: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:154: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:155: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:156: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -TestMain.cpp:157: config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true +TestMain.cpp:152: +parseIntoConfig( argv, config ) succeeded +line 154: +config.filters.size() == 1 succeeded for: 1 == 1 +line 155: +config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +line 156: +config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +line 157: +config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true [Summary for section '-t/2': All 5 assertions passed] [Summary for section 'test lists': All 5 assertions passed] [Section: 'test lists'] [Section: '-t/0'] -TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: +TestMain.cpp:162: +parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" [Summary for section '-t/0': 1 assertion passed] @@ -1007,31 +1355,38 @@ TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at le [Section: 'reporter'] [Section: '-r/basic'] -TestMain.cpp:169: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:171: config.reporter == "console" succeeded for: "console" == "console" +TestMain.cpp:169: +parseIntoConfig( argv, config ) succeeded +line 171: +config.reporter == "console" succeeded for: "console" == "console" [Summary for section '-r/basic': All 2 assertions passed] [Summary for section 'reporter': All 2 assertions passed] [Section: 'reporter'] [Section: '-r/xml'] -TestMain.cpp:175: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:177: config.reporter == "xml" succeeded for: "xml" == "xml" +TestMain.cpp:175: +parseIntoConfig( argv, config ) succeeded +line 177: +config.reporter == "xml" succeeded for: "xml" == "xml" [Summary for section '-r/xml': All 2 assertions passed] [Summary for section 'reporter': All 2 assertions passed] [Section: 'reporter'] [Section: '--reporter/junit'] -TestMain.cpp:181: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:183: config.reporter == "junit" succeeded for: "junit" == "junit" +TestMain.cpp:181: +parseIntoConfig( argv, config ) succeeded +line 183: +config.reporter == "junit" succeeded for: "junit" == "junit" [Summary for section '--reporter/junit': All 2 assertions passed] [Summary for section 'reporter': All 2 assertions passed] [Section: 'reporter'] [Section: '-r/error'] -TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: +TestMain.cpp:187: +parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" [Summary for section '-r/error': 1 assertion passed] @@ -1039,23 +1394,28 @@ TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 arg [Section: 'debugger'] [Section: '-b'] -TestMain.cpp:194: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:196: config.shouldDebugBreak == true succeeded for: true == true +TestMain.cpp:194: +parseIntoConfig( argv, config ) succeeded +line 196: +config.shouldDebugBreak == true succeeded for: true == true [Summary for section '-b': All 2 assertions passed] [Summary for section 'debugger': All 2 assertions passed] [Section: 'debugger'] [Section: '--break'] -TestMain.cpp:200: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:202: config.shouldDebugBreak succeeded for: true +TestMain.cpp:200: +parseIntoConfig( argv, config ) succeeded +line 202: +config.shouldDebugBreak succeeded for: true [Summary for section '--break': All 2 assertions passed] [Summary for section 'debugger': All 2 assertions passed] [Section: 'debugger'] [Section: '-b'] -TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: +TestMain.cpp:206: +parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" [Summary for section '-b': 1 assertion passed] @@ -1063,23 +1423,28 @@ TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arg [Section: 'abort'] [Section: '-a'] -TestMain.cpp:213: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:215: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:213: +parseIntoConfig( argv, config ) succeeded +line 215: +config.cutoff == 1 succeeded for: 1 == 1 [Summary for section '-a': All 2 assertions passed] [Summary for section 'abort': All 2 assertions passed] [Section: 'abort'] [Section: '-a/2'] -TestMain.cpp:219: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:221: config.cutoff == 2 succeeded for: 2 == 2 +TestMain.cpp:219: +parseIntoConfig( argv, config ) succeeded +line 221: +config.cutoff == 2 succeeded for: 2 == 2 [Summary for section '-a/2': All 2 assertions passed] [Summary for section 'abort': All 2 assertions passed] [Section: 'abort'] [Section: '-a/error/0'] -TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +TestMain.cpp:225: +parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" [Summary for section '-a/error/0': 1 assertion passed] @@ -1087,7 +1452,8 @@ TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "great [Section: 'abort'] [Section: '-a/error/non numeric'] -TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +TestMain.cpp:229: +parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" [Summary for section '-a/error/non numeric': 1 assertion passed] @@ -1095,7 +1461,8 @@ TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "great [Section: 'abort'] [Section: '-a/error/two args'] -TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: +TestMain.cpp:233: +parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" [Summary for section '-a/error/two args': 1 assertion passed] @@ -1103,52 +1470,68 @@ TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and [Section: 'nothrow'] [Section: '-nt'] -TestMain.cpp:240: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:242: config.allowThrows == false succeeded for: false == false +TestMain.cpp:240: +parseIntoConfig( argv, config ) succeeded +line 242: +config.allowThrows == false succeeded for: false == false [Summary for section '-nt': All 2 assertions passed] [Summary for section 'nothrow': All 2 assertions passed] [Section: 'nothrow'] [Section: '--nothrow'] -TestMain.cpp:246: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:248: config.allowThrows == false succeeded for: false == false +TestMain.cpp:246: +parseIntoConfig( argv, config ) succeeded +line 248: +config.allowThrows == false succeeded for: false == false [Summary for section '--nothrow': All 2 assertions passed] [Summary for section 'nothrow': All 2 assertions passed] [Section: 'streams'] [Section: '-o filename'] -TestMain.cpp:255: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:257: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -TestMain.cpp:258: config.stream.empty() succeeded for: true +TestMain.cpp:255: +parseIntoConfig( argv, config ) succeeded +line 257: +config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +line 258: +config.stream.empty() succeeded for: true [Summary for section '-o filename': All 3 assertions passed] [Summary for section 'streams': All 3 assertions passed] [Section: 'streams'] [Section: '-o %stdout'] -TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:264: config.stream == "stdout" succeeded for: "stdout" == "stdout" -TestMain.cpp:265: config.outputFilename.empty() succeeded for: true +TestMain.cpp:262: +parseIntoConfig( argv, config ) succeeded +line 264: +config.stream == "stdout" succeeded for: "stdout" == "stdout" +line 265: +config.outputFilename.empty() succeeded for: true [Summary for section '-o %stdout': All 3 assertions passed] [Summary for section 'streams': All 3 assertions passed] [Section: 'streams'] [Section: '--out'] -TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:271: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:269: +parseIntoConfig( argv, config ) succeeded +line 271: +config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" [Summary for section '--out': All 2 assertions passed] [Summary for section 'streams': All 2 assertions passed] [Section: 'combinations'] [Section: '-a -b'] -TestMain.cpp:278: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:280: config.cutoff == 1 succeeded for: 1 == 1 -TestMain.cpp:281: config.shouldDebugBreak succeeded for: true -TestMain.cpp:282: config.allowThrows == false succeeded for: false == false +TestMain.cpp:278: +parseIntoConfig( argv, config ) succeeded +line 280: +config.cutoff == 1 succeeded for: 1 == 1 +line 281: +config.shouldDebugBreak succeeded for: true +line 282: +config.allowThrows == false succeeded for: false == false [Summary for section '-a -b': All 4 assertions passed] [Summary for section 'combinations': All 4 assertions passed] @@ -1156,89 +1539,139 @@ TestMain.cpp:282: config.allowThrows == false succeeded for: false == false [Summary for test case 'selftest/parser/2': All tests passed (66 assertions in 1 test case)] [Test case: 'selftest/test filter'] -TestMain.cpp:291: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -TestMain.cpp:292: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:297: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:298: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -TestMain.cpp:300: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true -TestMain.cpp:301: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false +TestMain.cpp:291: +matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +line 292: +matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +line 297: +matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +line 298: +matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +line 300: +matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true +line 301: +matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false [Summary for test case 'selftest/test filter': All tests passed (6 assertions in 1 test case)] [Test case: 'selftest/test filters'] -TestMain.cpp:312: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -TestMain.cpp:314: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -TestMain.cpp:316: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false +TestMain.cpp:312: +matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +line 314: +filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +line 315: +filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +line 316: +filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false [Summary for test case 'selftest/test filters': All tests passed (4 assertions in 1 test case)] [Test case: 'selftest/filter/prefix wildcard'] -TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -TestMain.cpp:323: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false +TestMain.cpp:322: +matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +line 323: +matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false [Summary for test case 'selftest/filter/prefix wildcard': All tests passed (2 assertions in 1 test case)] [Test case: 'selftest/filter/wildcard at both ends'] -TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true -TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true -TestMain.cpp:331: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false +TestMain.cpp:328: +matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +line 329: +matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true +line 330: +matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true +line 331: +matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false [Summary for test case 'selftest/filter/wildcard at both ends': All tests passed (4 assertions in 1 test case)] [Test case: 'selftest/option parsers'] -TestMain.cpp:351: opt.parseIntoConfig( parser, config ) succeeded -TestMain.cpp:353: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:354: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:355: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:351: +opt.parseIntoConfig( parser, config ) succeeded +line 353: +config.filters.size() == 1 succeeded for: 1 == 1 +line 354: +config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +line 355: +config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [Summary for test case 'selftest/option parsers': All tests passed (4 assertions in 1 test case)] [Test case: 'selftest/tags'] [Section: 'one tag'] -TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:370: oneTag.hasTag( "one" ) succeeded for: true -TestMain.cpp:371: oneTag.getTags().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:373: oneTag.matchesTags( p1 ) == true succeeded for: true == true -TestMain.cpp:374: oneTag.matchesTags( p2 ) == true succeeded for: true == true -TestMain.cpp:375: oneTag.matchesTags( p3 ) == false succeeded for: false == false -TestMain.cpp:376: oneTag.matchesTags( p4 ) == false succeeded for: false == false -TestMain.cpp:377: oneTag.matchesTags( p5 ) == false succeeded for: false == false +TestMain.cpp:369: +oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +line 370: +oneTag.hasTag( "one" ) succeeded for: true +line 371: +oneTag.getTags().size() == 1 succeeded for: 1 == 1 +line 373: +oneTag.matchesTags( p1 ) == true succeeded for: true == true +line 374: +oneTag.matchesTags( p2 ) == true succeeded for: true == true +line 375: +oneTag.matchesTags( p3 ) == false succeeded for: false == false +line 376: +oneTag.matchesTags( p4 ) == false succeeded for: false == false +line 377: +oneTag.matchesTags( p5 ) == false succeeded for: false == false [Summary for section 'one tag': All 8 assertions passed] [Section: 'two tags'] -TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:384: twoTags.hasTag( "one" ) succeeded for: true -TestMain.cpp:385: twoTags.hasTag( "two" ) succeeded for: true -TestMain.cpp:386: twoTags.hasTag( "three" ) == false succeeded for: false == false -TestMain.cpp:387: twoTags.getTags().size() == 2 succeeded for: 2 == 2 -TestMain.cpp:389: twoTags.matchesTags( p1 ) == true succeeded for: true == true -TestMain.cpp:390: twoTags.matchesTags( p2 ) == true succeeded for: true == true -TestMain.cpp:391: twoTags.matchesTags( p3 ) == true succeeded for: true == true -TestMain.cpp:392: twoTags.matchesTags( p4 ) == true succeeded for: true == true -TestMain.cpp:393: twoTags.matchesTags( p5 ) == true succeeded for: true == true +TestMain.cpp:383: +twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" +line 384: +twoTags.hasTag( "one" ) succeeded for: true +line 385: +twoTags.hasTag( "two" ) succeeded for: true +line 386: +twoTags.hasTag( "three" ) == false succeeded for: false == false +line 387: +twoTags.getTags().size() == 2 succeeded for: 2 == 2 +line 389: +twoTags.matchesTags( p1 ) == true succeeded for: true == true +line 390: +twoTags.matchesTags( p2 ) == true succeeded for: true == true +line 391: +twoTags.matchesTags( p3 ) == true succeeded for: true == true +line 392: +twoTags.matchesTags( p4 ) == true succeeded for: true == true +line 393: +twoTags.matchesTags( p5 ) == true succeeded for: true == true [Summary for section 'two tags': All 10 assertions passed] [Section: 'one tag with characters either side'] -TestMain.cpp:399: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" -TestMain.cpp:400: oneTagWithExtras.hasTag( "one" ) succeeded for: true -TestMain.cpp:401: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false -TestMain.cpp:402: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:399: +oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" +line 400: +oneTagWithExtras.hasTag( "one" ) succeeded for: true +line 401: +oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false +line 402: +oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 [Summary for section 'one tag with characters either side': All 4 assertions passed] [Section: 'start of a tag, but not closed'] -TestMain.cpp:409: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" -TestMain.cpp:410: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false -TestMain.cpp:411: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 +TestMain.cpp:409: +oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" +line 410: +oneTagOpen.hasTag( "one" ) == false succeeded for: false == false +line 411: +oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 [Summary for section 'start of a tag, but not closed': All 3 assertions passed] [Section: 'hidden'] -TestMain.cpp:417: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:418: oneTag.hasTag( "hide" ) succeeded for: true -TestMain.cpp:419: oneTag.isHidden() succeeded for: true -TestMain.cpp:421: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false +TestMain.cpp:417: +oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +line 418: +oneTag.hasTag( "hide" ) succeeded for: true +line 419: +oneTag.isHidden() succeeded for: true +line 421: +oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false [Summary for section 'hidden': All 4 assertions passed] [Summary for test case 'selftest/tags': All tests passed (29 assertions in 1 test case)] [Test case: './succeeding/Tricky/std::pair'] -TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: +TrickyTests.cpp:37: +(std::pair( 1, 2 )) == aNicePair succeeded for: std::pair( 1, 2 ) == @@ -1246,86 +1679,109 @@ TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: [Summary for test case './succeeding/Tricky/std::pair': All tests passed (1 assertion in 1 test case)] [Test case: './inprogress/failing/Tricky/trailing expression'] -TrickyTests.cpp:55: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] +TrickyTests.cpp:55: +[warning: Uncomment the code in this test to check that it gives a sensible compiler error] No assertions in test case, './inprogress/failing/Tricky/trailing expression' [Summary for test case './inprogress/failing/Tricky/trailing expression': 1 test case - failed (1 assertion - failed)] [Test case: './inprogress/failing/Tricky/compound lhs'] -TrickyTests.cpp:71: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] +TrickyTests.cpp:71: +[warning: Uncomment the code in this test to check that it gives a sensible compiler error] No assertions in test case, './inprogress/failing/Tricky/compound lhs' [Summary for test case './inprogress/failing/Tricky/compound lhs': 1 test case - failed (1 assertion - failed)] [Test case: './failing/Tricky/non streamable type'] -TrickyTests.cpp:95: &o1 == &o2 failed for: 0x == 0x -TrickyTests.cpp:96: o1 == o2 failed for: {?} == {?} +TrickyTests.cpp:95: +&o1 == &o2 failed for: 0x == 0x +line 96: +o1 == o2 failed for: {?} == {?} [Summary for test case './failing/Tricky/non streamable type': 1 test case - failed (2 assertions - both failed)] [Test case: './failing/string literals'] -TrickyTests.cpp:106: std::string( "first" ) == "second" failed for: "first" == "second" +TrickyTests.cpp:106: +std::string( "first" ) == "second" failed for: "first" == "second" [Summary for test case './failing/string literals': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/side-effects'] -TrickyTests.cpp:119: i++ == 7 succeeded for: 7 == 7 -TrickyTests.cpp:120: i++ == 8 succeeded for: 8 == 8 +TrickyTests.cpp:119: +i++ == 7 succeeded for: 7 == 7 +line 120: +i++ == 8 succeeded for: 8 == 8 [Summary for test case './succeeding/side-effects': All tests passed (2 assertions in 1 test case)] [Test case: './succeeding/koenig'] -TrickyTests.cpp:186: 0x == o succeeded for: 0x == {?} +TrickyTests.cpp:186: +0x == o succeeded for: 0x == {?} [Summary for test case './succeeding/koenig': All tests passed (1 assertion in 1 test case)] [Test case: './succeeding/non-const=='] -TrickyTests.cpp:212: t == 1u succeeded for: {?} == 1 +TrickyTests.cpp:212: +t == 1u succeeded for: {?} == 1 [Summary for test case './succeeding/non-const==': All tests passed (1 assertion in 1 test case)] [Test case: './succeeding/enum/bits'] -TrickyTests.cpp:224: 0x == bit30and31 succeeded for: 0x == 3221225472 +TrickyTests.cpp:224: +0x == bit30and31 succeeded for: 0x == 3221225472 [Summary for test case './succeeding/enum/bits': All tests passed (1 assertion in 1 test case)] [Test case: './succeeding/boolean member'] -TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x != 0 +TrickyTests.cpp:239: +obj.prop != __null succeeded for: 0x != 0 [Summary for test case './succeeding/boolean member': All tests passed (1 assertion in 1 test case)] [Test case: './succeeding/unimplemented static bool'] [Section: 'compare to true'] -TrickyTests.cpp:259: is_true::value == true succeeded for: true == true -TrickyTests.cpp:260: true == is_true::value succeeded for: true == true +TrickyTests.cpp:259: +is_true::value == true succeeded for: true == true +line 260: +true == is_true::value succeeded for: true == true [Summary for section 'compare to true': All 2 assertions passed] [Section: 'compare to false'] -TrickyTests.cpp:264: is_true::value == false succeeded for: false == false -TrickyTests.cpp:265: false == is_true::value succeeded for: false == false +TrickyTests.cpp:264: +is_true::value == false succeeded for: false == false +line 265: +false == is_true::value succeeded for: false == false [Summary for section 'compare to false': All 2 assertions passed] [Section: 'negation'] -TrickyTests.cpp:270: !is_true::value succeeded for: true +TrickyTests.cpp:270: +!is_true::value succeeded for: true [Summary for section 'negation': 1 assertion passed] [Section: 'double negation'] -TrickyTests.cpp:275: !!is_true::value succeeded for: true +TrickyTests.cpp:275: +!!is_true::value succeeded for: true [Summary for section 'double negation': 1 assertion passed] [Section: 'direct'] -TrickyTests.cpp:280: is_true::value succeeded for: true -TrickyTests.cpp:281: !is_true::value succeeded for: !false +TrickyTests.cpp:280: +is_true::value succeeded for: true +line 281: +!is_true::value succeeded for: !false [Summary for section 'direct': All 2 assertions passed] [Summary for test case './succeeding/unimplemented static bool': All tests passed (8 assertions in 1 test case)] [Test case: './succeeding/SafeBool'] -TrickyTests.cpp:313: True succeeded for: true -TrickyTests.cpp:314: !False succeeded for: true -TrickyTests.cpp:315: !False succeeded for: !false +TrickyTests.cpp:313: +True succeeded for: true +line 314: +!False succeeded for: true +line 315: +!False succeeded for: !false [Summary for test case './succeeding/SafeBool': All tests passed (3 assertions in 1 test case)] [Test case: 'scenario name'] [Section: 'This stuff exists'] [Section: 'I do this'] [Section: 'it should do this'] -BDDTests.cpp:37: itDoesThis() succeeded for: true +BDDTests.cpp:37: +itDoesThis() succeeded for: true [Summary for section 'it should do this': 1 assertion passed] [Summary for section 'I do this': 1 assertion passed] @@ -1341,77 +1797,115 @@ BDDTests.cpp:37: itDoesThis() succeeded for: true [Started testing: CatchSelfTest] [Group: '~dummy'] [Test case: './succeeding/Approx/simple'] -ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) -ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) -ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 -ApproxTests.cpp:26: Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 +ApproxTests.cpp:20: +d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +line 21: +d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) +line 22: +d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) +line 24: +Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +line 25: +Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 +line 26: +Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 [Summary for test case './succeeding/Approx/simple': All tests passed (6 assertions in 1 test case)] [Test case: './succeeding/Approx/epsilon'] -ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) -ApproxTests.cpp:39: d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) +ApproxTests.cpp:38: +d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) +line 39: +d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) [Summary for test case './succeeding/Approx/epsilon': All tests passed (2 assertions in 1 test case)] [Test case: './succeeding/Approx/float'] -ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:50: 0.0f == Approx( 0.0f ) succeeded for: 0 == Approx( 0 ) +ApproxTests.cpp:49: +1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) +line 50: +0.0f == Approx( 0.0f ) succeeded for: 0 == Approx( 0 ) [Summary for test case './succeeding/Approx/float': All tests passed (2 assertions in 1 test case)] [Test case: './succeeding/Approx/int'] -ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded -ApproxTests.cpp:61: 0 == Approx( 0 ) succeeded +ApproxTests.cpp:60: +1 == Approx( 1 ) succeeded +line 61: +0 == Approx( 0 ) succeeded [Summary for test case './succeeding/Approx/int': All tests passed (2 assertions in 1 test case)] [Test case: './succeeding/Approx/mixed'] -ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) -ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) -ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) -ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) -ApproxTests.cpp:79: dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) +ApproxTests.cpp:75: +1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) +line 76: +0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) +line 77: +0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) +line 78: +1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) +line 79: +dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) [Summary for test case './succeeding/Approx/mixed': All tests passed (5 assertions in 1 test case)] [Test case: './succeeding/Approx/custom'] -ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) -ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) -ApproxTests.cpp:96: d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) -ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 -ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 -ApproxTests.cpp:101: approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 +ApproxTests.cpp:93: +d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +line 94: +d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) +line 95: +d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) +line 96: +d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) +line 98: +approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +line 99: +approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 +line 100: +approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 +line 101: +approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 [Summary for test case './succeeding/Approx/custom': All tests passed (8 assertions in 1 test case)] [Test case: './succeeding/TestClass/succeedingCase'] -ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" +ClassTests.cpp:24: +s == "hello" succeeded for: "hello" == "hello" [Summary for test case './succeeding/TestClass/succeedingCase': All tests passed (1 assertion in 1 test case)] [Test case: './failing/TestClass/failingCase'] -ClassTests.cpp:28: s == "world" failed for: "hello" == "world" +ClassTests.cpp:28: +s == "world" failed for: "hello" == "world" [Summary for test case './failing/TestClass/failingCase': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/Fixture/succeedingCase'] -ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 +ClassTests.cpp:47: +m_a == 1 succeeded for: 1 == 1 [Summary for test case './succeeding/Fixture/succeedingCase': All tests passed (1 assertion in 1 test case)] [Test case: './failing/Fixture/failingCase'] -ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 +ClassTests.cpp:55: +m_a == 2 failed for: 1 == 2 [Summary for test case './failing/Fixture/failingCase': 1 test case - failed (1 assertion - failed)] [Test case: './succeeding/conditions/equality'] -ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 -ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) -ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) -ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" -ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" -ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 -ConditionTests.cpp:63: x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) +ConditionTests.cpp:55: +data.int_seven == 7 succeeded for: 7 == 7 +line 56: +data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) +line 57: +data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) +line 58: +data.str_hello == "hello" succeeded for: "hello" == "hello" +line 59: +"hello" == data.str_hello succeeded for: "hello" == "hello" +line 60: +data.str_hello.size() == 5 succeeded for: 5 == 5 +line 63: +x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) [Summary for test case './succeeding/conditions/equality': All tests passed (7 assertions in 1 test case)] [Test case: './failing/conditions/equality'] -ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 -ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 +ConditionTests.cpp:71: +data.int_seven == 6 failed for: 7 == 6 +line 72: +data.int_seven == 8 failed for: 7 == 8 [Summary for test case './failing/conditions/equality': 1 test case - failed (2 assertions - both failed)] [Summary for group '~dummy': 12 test cases - 3 failed (38 assertions - 4 failed)] diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 7346eb15..37a53362 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -564,7 +564,7 @@ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++98"; CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; - GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_PREPROCESSOR_DEFINITIONS = CATCH_CONFIG_USE_ANSI_COLOUR_CODES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; PRODUCT_NAME = "$(TARGET_NAME)"; WARNING_CFLAGS = ( From f117812cffa88deb6265ade0d0bec46317d44165 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 11 Dec 2012 09:03:14 +0000 Subject: [PATCH 094/296] build 11: Console reporter changes --- README | 2 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 78 +++++++++++++++++++++--------- 3 files changed, 57 insertions(+), 25 deletions(-) diff --git a/README b/README index 41f6f7c7..0016a818 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 10 (integration branch) +CATCH v0.9 build 11 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 78c4d938..62f02eed 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 10, "integration" ); + Version libraryVersion( 0, 9, 11, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index aa49a4c6..b13567e6 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 10 (integration branch) - * Generated: 2012-12-10 08:54:04.228540 + * CATCH v0.9 build 11 (integration branch) + * Generated: 2012-12-11 09:02:46.394854 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -5710,7 +5710,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 10, "integration" ); + Version libraryVersion( 0, 9, 11, "integration" ); } // #included from: ../reporters/catch_reporter_basic.hpp @@ -6714,12 +6714,10 @@ namespace Catch { void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() ) stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; -// stream << "[Started group: '" << unusedGroupInfo->name << "']" << std::endl; unusedGroupInfo.reset(); } void lazyPrintTestCaseInfo() { stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; -// stream << "[Running: " << unusedTestCaseInfo->name << "]" << std::endl; unusedTestCaseInfo.reset(); } @@ -6732,7 +6730,6 @@ namespace Catch { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { -// stream << "[Started section: " << "'" + (*it)->name + "'" << "]" << std::endl; stream << "[Section: " << "'" + (*it)->name + "'" << "]" << std::endl; (*it)->printed = true; } @@ -6761,10 +6758,7 @@ namespace Catch { lazyPrint(); - if( !result.getSourceInfo().empty() ) { - TextColour colour( TextColour::FileName ); - stream << result.getSourceInfo(); - } + printLineInfo( result.getSourceInfo() ); if( result.hasExpression() ) { TextColour colour( TextColour::OriginalExpression ); @@ -6873,35 +6867,56 @@ namespace Catch { } } - void printAssertionCounts( std::string const& label, Counts const& counts, std::string const& allPrefix = "All " ) { - if( counts.passed ) - stream << counts.failed << " of " << counts.total() << " " << label << "s failed"; - else - stream << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed"; + void printAssertionCounts( std::string const& label, Counts const& counts ) { + if( counts.total() == 1 ) { + stream << "1 " << label << " - "; + if( counts.failed ) + stream << "failed"; + else + stream << "passed"; + } + else { + stream << counts.total() << " " << label << "s "; + if( counts.passed ) { + if( counts.failed ) + stream << "- " << counts.failed << " failed"; + else if( counts.passed == 2 ) + stream << "- both passed"; + else + stream << "- all passed"; + } + else { + if( counts.failed == 2 ) + stream << "- both failed"; + else + stream << "- all failed"; + } + } } - void printTotals( const Totals& totals, const std::string& allPrefix = "All " ) { + void printTotals( const Totals& totals ) { if( totals.assertions.total() == 0 ) { stream << "No tests ran"; } else if( totals.assertions.failed ) { TextColour colour( TextColour::ResultError ); - printAssertionCounts( "test case", totals.testCases, allPrefix ); + printAssertionCounts( "test case", totals.testCases ); if( totals.testCases.failed > 0 ) { stream << " ("; - printAssertionCounts( "assertion", totals.assertions, allPrefix ); + printAssertionCounts( "assertion", totals.assertions ); stream << ")"; } } else { TextColour colour( TextColour::ResultSuccess ); - stream << allPrefix << "tests passed (" + stream << "All tests passed (" << pluralise( totals.assertions.passed, "assertion" ) << " in " << pluralise( totals.testCases.passed, "test case" ) << ")"; } } virtual void sectionEnded( Ptr const& _sectionStats ) { + resetLastPrintedLine(); if( _sectionStats->missingAssertions ) { lazyPrint(); TextColour colour( TextColour::ResultError ); @@ -6909,7 +6924,6 @@ namespace Catch { } if( currentSectionInfo && currentSectionInfo->printed ) { stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; -// stream << "[End of section: '" << _sectionStats->sectionInfo.name << "' "; Counts const& assertions = _sectionStats->assertions; if( assertions.failed ) { TextColour colour( TextColour::ResultError ); @@ -6925,6 +6939,7 @@ namespace Catch { AccumulatingReporter::sectionEnded( _sectionStats ); } virtual void testCaseEnded( Ptr const& _testCaseStats ) { + resetLastPrintedLine(); if( _testCaseStats->missingAssertions ) { lazyPrint(); TextColour colour( TextColour::ResultError ); @@ -6932,7 +6947,6 @@ namespace Catch { } if( !unusedTestCaseInfo ) { stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; -// stream << "[Finished: '" << _testCaseStats->testInfo.name << "' "; printTotals( _testCaseStats->totals ); stream << "]\n" << std::endl; } @@ -6941,7 +6955,6 @@ namespace Catch { virtual void testGroupEnded( Ptr const& _testGroupStats ) { if( !unusedGroupInfo ) { stream << "[Summary for group '" << _testGroupStats->groupInfo.name << "': "; -// stream << "[End of group '" << _testGroupStats->groupInfo.name << "'. "; printTotals( _testGroupStats->totals ); stream << "]\n" << std::endl; } @@ -6950,13 +6963,32 @@ namespace Catch { virtual void testRunEnded( Ptr const& _testRunStats ) { if( !unusedTestCaseInfo ) { stream << "[Summary for '" << _testRunStats->runInfo.name << "': "; -// stream << "[Testing completed. "; printTotals( _testRunStats->totals ); stream << "]\n" << std::endl; } AccumulatingReporter::testRunEnded( _testRunStats ); } + void printLineInfo( SourceLineInfo const& lineInfo ) { + if( !lineInfo.empty() ) { + if( m_lastPrintedLine.empty() || + m_lastPrintedLine.file != lineInfo.file || + abs( static_cast( m_lastPrintedLine.line ) - static_cast( lineInfo.line ) ) > 20 ) { + TextColour colour( TextColour::FileName ); + stream << lineInfo << "\n"; + m_lastPrintedLine = lineInfo; + } + else if( lineInfo.line != m_lastPrintedLine.line ) { + TextColour colour( TextColour::FileName ); + stream << "line " << lineInfo.line << ":\n"; + } + } + } + void resetLastPrintedLine() { + m_lastPrintedLine = SourceLineInfo(); + } + SourceLineInfo m_lastPrintedLine; + }; INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) From a7079a2dbeed5fb24ea50c499b488467dc8e91f1 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 13 Dec 2012 12:46:47 +0000 Subject: [PATCH 095/296] Changed header and summary logs to multiline forms --- include/reporters/catch_reporter_console.hpp | 64 +- .../SelfTest/Baselines/approvedResults.txt | 1230 +++++++++++------ 2 files changed, 866 insertions(+), 428 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index d3c05df1..15a5ba4c 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -16,7 +16,8 @@ namespace Catch { struct ConsoleReporter : AccumulatingReporter { ConsoleReporter( ReporterConfig const& _config ) - : AccumulatingReporter( _config ) + : AccumulatingReporter( _config ), + m_atLeastOneTestCasePrinted( false ) {} virtual ~ConsoleReporter(); @@ -30,19 +31,18 @@ namespace Catch { } void lazyPrintRunInfo() { - stream << "[Started testing: " << testRunInfo->name << "]" << std::endl; + printHeader( "Started testing", testRunInfo->name ); testRunInfo.reset(); } void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() ) - stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; + printHeader( "Group", unusedGroupInfo->name ); unusedGroupInfo.reset(); } void lazyPrintTestCaseInfo() { - stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; + printHeader( "Test case", unusedTestCaseInfo->name ); unusedTestCaseInfo.reset(); - } - + } void lazyPrintSectionInfo() { std::vector sections; for( ThreadedSectionInfo* section = unusedSectionInfo.get(); @@ -52,11 +52,26 @@ namespace Catch { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { - stream << "[Section: " << "'" + (*it)->name + "'" << "]" << std::endl; + printHeader( "Section", (*it)->name ); (*it)->printed = true; } unusedSectionInfo.reset(); } + + static std::string const& getDashes() { + static const std::string dashes = "----------------------------------------------------------------"; + return dashes; + } + static std::string const& getDoubleDashes() { + static const std::string doubleDashes = "================================================================"; + return doubleDashes; + } + void printHeader( std::string const& _type, std::string const& _name ) { + stream << "-- " << _type << ": '" << _name << "' " + << getDashes().substr( 0, getDashes().size() - ( _type.size() + _name.size() + 9 ) ) + << std::endl; + } + void lazyPrint() { if( testRunInfo ) lazyPrintRunInfo(); @@ -245,7 +260,8 @@ namespace Catch { stream << "\nNo assertions in section, '" << _sectionStats->sectionInfo.name << "'\n" << std::endl; } if( currentSectionInfo && currentSectionInfo->printed ) { - stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; + printSummarDivider(); + stream << "Summary for section '" << _sectionStats->sectionInfo.name << "':\n"; Counts const& assertions = _sectionStats->assertions; if( assertions.failed ) { TextColour colour( TextColour::ResultError ); @@ -256,7 +272,7 @@ namespace Catch { stream << ( assertions.passed > 1 ? "All " : "" ) << pluralise( assertions.passed, "assertion" ) << " passed" ; } - stream << "]\n" << std::endl; + stream << "\n" << std::endl; } AccumulatingReporter::sectionEnded( _sectionStats ); } @@ -268,29 +284,40 @@ namespace Catch { stream << "\nNo assertions in test case, '" << _testCaseStats->testInfo.name << "'\n" << std::endl; } if( !unusedTestCaseInfo ) { - stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; + m_atLeastOneTestCasePrinted = true; + printSummarDivider(); + stream << "Summary for test case '" << _testCaseStats->testInfo.name << "':\n"; printTotals( _testCaseStats->totals ); - stream << "]\n" << std::endl; + stream << "\n" << std::endl; } AccumulatingReporter::testCaseEnded( _testCaseStats ); } virtual void testGroupEnded( Ptr const& _testGroupStats ) { if( !unusedGroupInfo ) { - stream << "[Summary for group '" << _testGroupStats->groupInfo.name << "': "; + printSummarDivider(); + stream << "Summary for group '" << _testGroupStats->groupInfo.name << "':\n"; printTotals( _testGroupStats->totals ); - stream << "]\n" << std::endl; + stream << "\n" << std::endl; } AccumulatingReporter::testGroupEnded( _testGroupStats ); } virtual void testRunEnded( Ptr const& _testRunStats ) { - if( !unusedTestCaseInfo ) { - stream << "[Summary for '" << _testRunStats->runInfo.name << "': "; - printTotals( _testRunStats->totals ); - stream << "]\n" << std::endl; - } + if( m_atLeastOneTestCasePrinted ) + printTotalsDivider(); + stream << "Summary for all tests in '" << _testRunStats->runInfo.name << "':\n"; + printTotals( _testRunStats->totals ); + stream << "\n" << std::endl; AccumulatingReporter::testRunEnded( _testRunStats ); } + private: + void printTotalsDivider() { + stream << "================================================================\n"; + } + void printSummarDivider() { + stream << "----------------------------------------------------------------\n"; + } + void printLineInfo( SourceLineInfo const& lineInfo ) { if( !lineInfo.empty() ) { if( m_lastPrintedLine.empty() || @@ -309,6 +336,7 @@ namespace Catch { void resetLastPrintedLine() { m_lastPrintedLine = SourceLineInfo(); } + bool m_atLeastOneTestCasePrinted; SourceLineInfo m_lastPrintedLine; }; diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 5fc1dfd9..2b8419b7 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ -[Started testing: CatchSelfTest] -[Group: '~dummy'] -[Test case: './succeeding/Approx/simple'] +-- Started testing: 'CatchSelfTest' --------------------------- +-- Group: '~dummy' -------------------------------------------- +-- Test case: './succeeding/Approx/simple' -------------------- ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) line 21: @@ -13,30 +13,38 @@ line 25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 line 26: Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 -[Summary for test case './succeeding/Approx/simple': All tests passed (6 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/simple': +All tests passed (6 assertions in 1 test case) -[Test case: './succeeding/Approx/epsilon'] +-- Test case: './succeeding/Approx/epsilon' ------------------- ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) line 39: d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) -[Summary for test case './succeeding/Approx/epsilon': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/epsilon': +All tests passed (2 assertions in 1 test case) -[Test case: './succeeding/Approx/float'] +-- Test case: './succeeding/Approx/float' --------------------- ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) line 50: 0.0f == Approx( 0.0f ) succeeded for: 0 == Approx( 0 ) -[Summary for test case './succeeding/Approx/float': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/float': +All tests passed (2 assertions in 1 test case) -[Test case: './succeeding/Approx/int'] +-- Test case: './succeeding/Approx/int' ----------------------- ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded line 61: 0 == Approx( 0 ) succeeded -[Summary for test case './succeeding/Approx/int': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/int': +All tests passed (2 assertions in 1 test case) -[Test case: './succeeding/Approx/mixed'] +-- Test case: './succeeding/Approx/mixed' --------------------- ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) line 76: @@ -47,9 +55,11 @@ line 78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) line 79: dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) -[Summary for test case './succeeding/Approx/mixed': All tests passed (5 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/mixed': +All tests passed (5 assertions in 1 test case) -[Test case: './succeeding/Approx/custom'] +-- Test case: './succeeding/Approx/custom' -------------------- ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) line 94: @@ -66,29 +76,39 @@ line 100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 line 101: approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 -[Summary for test case './succeeding/Approx/custom': All tests passed (8 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/custom': +All tests passed (8 assertions in 1 test case) -[Test case: './succeeding/TestClass/succeedingCase'] +-- Test case: './succeeding/TestClass/succeedingCase' --------- ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" -[Summary for test case './succeeding/TestClass/succeedingCase': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/TestClass/succeedingCase': +All tests passed (1 assertion in 1 test case) -[Test case: './failing/TestClass/failingCase'] +-- Test case: './failing/TestClass/failingCase' --------------- ClassTests.cpp:28: s == "world" failed for: "hello" == "world" -[Summary for test case './failing/TestClass/failingCase': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/TestClass/failingCase': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/Fixture/succeedingCase'] +-- Test case: './succeeding/Fixture/succeedingCase' ----------- ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 -[Summary for test case './succeeding/Fixture/succeedingCase': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Fixture/succeedingCase': +All tests passed (1 assertion in 1 test case) -[Test case: './failing/Fixture/failingCase'] +-- Test case: './failing/Fixture/failingCase' ----------------- ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 -[Summary for test case './failing/Fixture/failingCase': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/Fixture/failingCase': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/conditions/equality'] +-- Test case: './succeeding/conditions/equality' -------------- ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 line 56: @@ -103,9 +123,11 @@ line 60: data.str_hello.size() == 5 succeeded for: 5 == 5 line 63: x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) -[Summary for test case './succeeding/conditions/equality': All tests passed (7 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions/equality': +All tests passed (7 assertions in 1 test case) -[Test case: './failing/conditions/equality'] +-- Test case: './failing/conditions/equality' ----------------- ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 line 72: @@ -132,9 +154,11 @@ line 82: data.str_hello.size() == 6 failed for: 5 == 6 line 85: x == Approx( 1.301 ) failed for: 1.3 == Approx( 1.301 ) -[Summary for test case './failing/conditions/equality': 1 test case - failed (13 assertions - all failed)] +---------------------------------------------------------------- +Summary for test case './failing/conditions/equality': +1 test case - failed (13 assertions - all failed) -[Test case: './succeeding/conditions/inequality'] +-- Test case: './succeeding/conditions/inequality' ------------ ConditionTests.cpp:93: data.int_seven != 6 succeeded for: 7 != 6 line 94: @@ -157,9 +181,11 @@ line 102: data.str_hello != "hello1" succeeded for: "hello" != "hello1" line 103: data.str_hello.size() != 6 succeeded for: 5 != 6 -[Summary for test case './succeeding/conditions/inequality': All tests passed (11 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions/inequality': +All tests passed (11 assertions in 1 test case) -[Test case: './failing/conditions/inequality'] +-- Test case: './failing/conditions/inequality' --------------- ConditionTests.cpp:111: data.int_seven != 7 failed for: 7 != 7 line 112: @@ -170,9 +196,11 @@ line 114: data.str_hello != "hello" failed for: "hello" != "hello" line 115: data.str_hello.size() != 5 failed for: 5 != 5 -[Summary for test case './failing/conditions/inequality': 1 test case - failed (5 assertions - all failed)] +---------------------------------------------------------------- +Summary for test case './failing/conditions/inequality': +1 test case - failed (5 assertions - all failed) -[Test case: './succeeding/conditions/ordered'] +-- Test case: './succeeding/conditions/ordered' --------------- ConditionTests.cpp:124: data.int_seven < 8 succeeded for: 7 < 8 line 125: @@ -207,9 +235,11 @@ line 143: data.str_hello > "hellm" succeeded for: "hello" > "hellm" line 144: data.str_hello > "a" succeeded for: "hello" > "a" -[Summary for test case './succeeding/conditions/ordered': All tests passed (17 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions/ordered': +All tests passed (17 assertions in 1 test case) -[Test case: './failing/conditions/ordered'] +-- Test case: './failing/conditions/ordered' ------------------ ConditionTests.cpp:152: data.int_seven > 7 failed for: 7 > 7 line 153: @@ -248,9 +278,11 @@ ConditionTests.cpp:173: data.str_hello >= "z" failed for: "hello" >= "z" line 174: data.str_hello <= "a" failed for: "hello" <= "a" -[Summary for test case './failing/conditions/ordered': 1 test case - failed (19 assertions - all failed)] +---------------------------------------------------------------- +Summary for test case './failing/conditions/ordered': +1 test case - failed (19 assertions - all failed) -[Test case: './succeeding/conditions/int literals'] +-- Test case: './succeeding/conditions/int literals' ---------- ConditionTests.cpp:188: i == 1 succeeded for: 1 == 1 line 189: @@ -277,9 +309,11 @@ line 200: 6 == uc succeeded for: 6 ==  line 202: (std::numeric_limits::max)() > ul succeeded for: 0x > 4 -[Summary for test case './succeeding/conditions/int literals': All tests passed (13 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions/int literals': +All tests passed (13 assertions in 1 test case) -[Test case: './succeeding/conditions//long_to_unsigned_x'] +-- Test case: './succeeding/conditions//long_to_unsigned_x' --- ConditionTests.cpp:223: long_var == unsigned_char_var succeeded for: 1 ==  line 224: @@ -288,9 +322,11 @@ line 225: long_var == unsigned_int_var succeeded for: 1 == 1 line 226: long_var == unsigned_long_var succeeded for: 1 == 1 -[Summary for test case './succeeding/conditions//long_to_unsigned_x': All tests passed (4 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions//long_to_unsigned_x': +All tests passed (4 assertions in 1 test case) -[Test case: './succeeding/conditions/const ints to int literal'] +-- Test case: './succeeding/conditions/const ints to int literal' ---------------------------------------------------------------- ConditionTests.cpp:237: unsigned_char_var == 1 succeeded for:  == 1 line 238: @@ -299,9 +335,11 @@ line 239: unsigned_int_var == 1 succeeded for: 1 == 1 line 240: unsigned_long_var == 1 succeeded for: 1 == 1 -[Summary for test case './succeeding/conditions/const ints to int literal': All tests passed (4 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions/const ints to int literal': +All tests passed (4 assertions in 1 test case) -[Test case: './succeeding/conditions/negative ints'] +-- Test case: './succeeding/conditions/negative ints' --------- ConditionTests.cpp:246: ( -1 > 2u ) succeeded for: true line 247: @@ -314,14 +352,18 @@ line 253: ( minInt > 2u ) succeeded for: true line 254: minInt > 2u succeeded for: -2147483648 > 2 -[Summary for test case './succeeding/conditions/negative ints': All tests passed (6 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions/negative ints': +All tests passed (6 assertions in 1 test case) -[Test case: './succeeding/conditions/computed ints'] +-- Test case: './succeeding/conditions/computed ints' --------- ConditionTests.cpp:269: 54 == 6*9 succeeded for: 54 == 54 -[Summary for test case './succeeding/conditions/computed ints': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions/computed ints': +All tests passed (1 assertion in 1 test case) -[Test case: './succeeding/conditions/ptr'] +-- Test case: './succeeding/conditions/ptr' ------------------- ConditionTests.cpp:285: p == __null succeeded for: __null == 0 line 286: @@ -338,9 +380,11 @@ line 300: returnsConstNull() == __null succeeded for: {null string} == 0 line 302: __null != p succeeded for: 0 != 0x -[Summary for test case './succeeding/conditions/ptr': All tests passed (8 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions/ptr': +All tests passed (8 assertions in 1 test case) -[Test case: './succeeding/conditions/not'] +-- Test case: './succeeding/conditions/not' ------------------- ConditionTests.cpp:317: false == false succeeded line 318: @@ -357,9 +401,11 @@ line 325: !(1 == 2) succeeded for: true line 326: !1 == 2 succeeded for: !(1 == 2) -[Summary for test case './succeeding/conditions/not': All tests passed (8 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions/not': +All tests passed (8 assertions in 1 test case) -[Test case: './failing/conditions/not'] +-- Test case: './failing/conditions/not' ---------------------- ConditionTests.cpp:334: false != false failed line 335: @@ -376,69 +422,91 @@ line 342: !(1 == 1) failed for: false line 343: !1 == 1 failed for: !(1 == 1) -[Summary for test case './failing/conditions/not': 1 test case - failed (8 assertions - all failed)] +---------------------------------------------------------------- +Summary for test case './failing/conditions/not': +1 test case - failed (8 assertions - all failed) -[Test case: './succeeding/exceptions/explicit'] +-- Test case: './succeeding/exceptions/explicit' -------------- ExceptionTests.cpp:39: thisThrows() succeeded line 40: thisDoesntThrow() succeeded line 41: thisThrows() succeeded -[Summary for test case './succeeding/exceptions/explicit': All tests passed (3 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/exceptions/explicit': +All tests passed (3 assertions in 1 test case) -[Test case: './failing/exceptions/explicit'] +-- Test case: './failing/exceptions/explicit' ----------------- ExceptionTests.cpp:47: thisThrows() failed with unexpected exception with message: 'expected exception' line 48: thisDoesntThrow() failed because no exception was thrown where one was expected line 49: thisThrows() failed with unexpected exception with message: 'expected exception' -[Summary for test case './failing/exceptions/explicit': 1 test case - failed (3 assertions - all failed)] +---------------------------------------------------------------- +Summary for test case './failing/exceptions/explicit': +1 test case - failed (3 assertions - all failed) -[Test case: './failing/exceptions/implicit'] +-- Test case: './failing/exceptions/implicit' ----------------- ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' -[Summary for test case './failing/exceptions/implicit': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/exceptions/implicit': +1 test case - failed (1 assertion - failed) -[Test case: './failing/exceptions/implicit/2'] +-- Test case: './failing/exceptions/implicit/2' --------------- ExceptionTests.cpp:60: 1 == 1 succeeded {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' -[Summary for test case './failing/exceptions/implicit/2': 1 test case - failed (2 assertions - 1 failed)] +---------------------------------------------------------------- +Summary for test case './failing/exceptions/implicit/2': +1 test case - failed (2 assertions - 1 failed) -[Test case: './succeeding/exceptions/implicit'] +-- Test case: './succeeding/exceptions/implicit' -------------- No assertions in test case, './succeeding/exceptions/implicit' -[Summary for test case './succeeding/exceptions/implicit': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './succeeding/exceptions/implicit': +1 test case - failed (1 assertion - failed) -[Test case: './failing/exceptions/custom'] +-- Test case: './failing/exceptions/custom' ------------------- ExceptionTests.cpp:102: Unexpected exception with message: 'custom exception' -[Summary for test case './failing/exceptions/custom': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/exceptions/custom': +1 test case - failed (1 assertion - failed) -[Test case: './failing/exceptions/custom/nothrow'] +-- Test case: './failing/exceptions/custom/nothrow' ----------- ExceptionTests.cpp:109: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' -[Summary for test case './failing/exceptions/custom/nothrow': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/exceptions/custom/nothrow': +1 test case - failed (1 assertion - failed) -[Test case: './failing/exceptions/custom/throw'] +-- Test case: './failing/exceptions/custom/throw' ------------- ExceptionTests.cpp:114: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' -[Summary for test case './failing/exceptions/custom/throw': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/exceptions/custom/throw': +1 test case - failed (1 assertion - failed) -[Test case: './failing/exceptions/custom/double'] +-- Test case: './failing/exceptions/custom/double' ------------ ExceptionTests.cpp:118: Unexpected exception with message: '3.14' -[Summary for test case './failing/exceptions/custom/double': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/exceptions/custom/double': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/exceptions/notimplemented'] +-- Test case: './succeeding/exceptions/notimplemented' -------- ExceptionTests.cpp:129: thisFunctionNotImplemented( 7 ) succeeded -[Summary for test case './succeeding/exceptions/notimplemented': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/exceptions/notimplemented': +All tests passed (1 assertion in 1 test case) -[Test case: './succeeding/generators/1'] +-- Test case: './succeeding/generators/1' --------------------- GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 line 27: @@ -656,32 +724,40 @@ multiply( j, 2 ) == j*2 succeeded for: 214 == 214 multiply( i, 2 ) == i*2 succeeded for: 72 == 72 line 27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -[Summary for test case './succeeding/generators/1': All tests passed (144 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/generators/1': +All tests passed (144 assertions in 1 test case) -[Test case: './succeeding/message'] +-- Test case: './succeeding/message' -------------------------- MessageTests.cpp:14: [warning: this is a warning] No assertions in test case, './succeeding/message' -[Summary for test case './succeeding/message': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './succeeding/message': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/succeed'] +-- Test case: './succeeding/succeed' -------------------------- MessageTests.cpp:18: succeeded [with message: this is a success] -[Summary for test case './succeeding/succeed': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/succeed': +All tests passed (1 assertion in 1 test case) -[Test case: './failing/message/info/1'] +-- Test case: './failing/message/info/1' ---------------------- MessageTests.cpp:23: [info: this message should be logged] line 24: [info: so should this] line 26: a == 1 failed for: 2 == 1 -[Summary for test case './failing/message/info/1': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/message/info/1': +1 test case - failed (1 assertion - failed) -[Test case: './mixed/message/info/2'] +-- Test case: './mixed/message/info/2' ------------------------ MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 line 31: @@ -696,44 +772,60 @@ line 41: a == 0 failed for: 2 == 0 line 45: a == 2 succeeded for: 2 == 2 -[Summary for test case './mixed/message/info/2': 1 test case - failed (4 assertions - 2 failed)] +---------------------------------------------------------------- +Summary for test case './mixed/message/info/2': +1 test case - failed (4 assertions - 2 failed) -[Test case: './failing/message/fail'] +-- Test case: './failing/message/fail' ------------------------ MessageTests.cpp:51: failed with message: 'This is a failure' -[Summary for test case './failing/message/fail': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/message/fail': +1 test case - failed (1 assertion - failed) -[Test case: './failing/message/sections'] -[Section: 'one'] +-- Test case: './failing/message/sections' -------------------- +-- Section: 'one' --------------------------------------------- MessageTests.cpp:58: failed with message: 'Message from section one' -[Summary for section 'one': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'one': +1 assertion - failed -[Section: 'two'] +-- Section: 'two' --------------------------------------------- MessageTests.cpp:63: failed with message: 'Message from section two' -[Summary for section 'two': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'two': +1 assertion - failed -[Summary for test case './failing/message/sections': 1 test case - failed (2 assertions - both failed)] +---------------------------------------------------------------- +Summary for test case './failing/message/sections': +1 test case - failed (2 assertions - both failed) Message from section one -[Test case: './succeeding/message/sections/stdout'] -[Section: 'one'] +-- Test case: './succeeding/message/sections/stdout' ---------- +-- Section: 'one' --------------------------------------------- No assertions in section, 'one' -[Summary for section 'one': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'one': +1 assertion - failed Message from section two -[Section: 'two'] +-- Section: 'two' --------------------------------------------- No assertions in section, 'two' -[Summary for section 'two': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'two': +1 assertion - failed -[Summary for test case './succeeding/message/sections/stdout': 1 test case - failed (2 assertions - both failed)] +---------------------------------------------------------------- +Summary for test case './succeeding/message/sections/stdout': +1 test case - failed (2 assertions - both failed) -[Test case: './mixed/message/scoped'] +-- Test case: './mixed/message/scoped' ------------------------ MessageTests.cpp:86: i < 10 succeeded for: 0 < 10 i < 10 succeeded for: 1 < 10 @@ -748,109 +840,155 @@ i < 10 succeeded for: 9 < 10 i < 10 succeeded[info: current counter 10] i < 10 succeeded[info: i := 10] i < 10 failed for: 10 < 10 -[Summary for test case './mixed/message/scoped': 1 test case - failed (11 assertions - 1 failed)] +---------------------------------------------------------------- +Summary for test case './mixed/message/scoped': +1 test case - failed (11 assertions - 1 failed) -[Test case: './succeeding/nofail'] +-- Test case: './succeeding/nofail' --------------------------- MessageTests.cpp:92: 1 == 2 failed - but was ok No assertions in test case, './succeeding/nofail' -[Summary for test case './succeeding/nofail': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './succeeding/nofail': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/Misc/Sections'] -[Section: 's1'] +-- Test case: './succeeding/Misc/Sections' -------------------- +-- Section: 's1' ---------------------------------------------- MiscTests.cpp:25: a != b succeeded for: 1 != 2 line 26: b != a succeeded for: 2 != 1 -[Summary for section 's1': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 's1': +All 2 assertions passed -[Section: 's2'] +-- Section: 's2' ---------------------------------------------- MiscTests.cpp:31: a != b succeeded for: 1 != 2 -[Summary for section 's2': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 's2': +1 assertion passed -[Summary for test case './succeeding/Misc/Sections': All tests passed (3 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Misc/Sections': +All tests passed (3 assertions in 1 test case) -[Test case: './succeeding/Misc/Sections/nested'] -[Section: 's1'] +-- Test case: './succeeding/Misc/Sections/nested' ------------- +-- Section: 's1' ---------------------------------------------- MiscTests.cpp:42: a != b succeeded for: 1 != 2 line 43: b != a succeeded for: 2 != 1 -[Section: 's2'] +-- Section: 's2' ---------------------------------------------- line 47: a != b succeeded for: 1 != 2 -[Summary for section 's2': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 's2': +1 assertion passed -[Summary for section 's1': All 3 assertions passed] +---------------------------------------------------------------- +Summary for section 's1': +All 3 assertions passed -[Summary for test case './succeeding/Misc/Sections/nested': All tests passed (3 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Misc/Sections/nested': +All tests passed (3 assertions in 1 test case) -[Test case: './mixed/Misc/Sections/nested2'] -[Section: 's1'] -[Section: 's2'] +-- Test case: './mixed/Misc/Sections/nested2' ----------------- +-- Section: 's1' ---------------------------------------------- +-- Section: 's2' ---------------------------------------------- MiscTests.cpp:61: a == b failed for: 1 == 2 -[Summary for section 's2': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 's2': +1 assertion - failed -[Summary for section 's1': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 's1': +1 assertion - failed -[Section: 's1'] -[Section: 's3'] +-- Section: 's1' ---------------------------------------------- +-- Section: 's3' ---------------------------------------------- MiscTests.cpp:66: a != b succeeded for: 1 != 2 -[Summary for section 's3': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 's3': +1 assertion passed -[Summary for section 's1': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 's1': +1 assertion passed -[Section: 's1'] -[Section: 's4'] +-- Section: 's1' ---------------------------------------------- +-- Section: 's4' ---------------------------------------------- MiscTests.cpp:70: a < b succeeded for: 1 < 2 -[Summary for section 's4': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 's4': +1 assertion passed -[Summary for section 's1': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 's1': +1 assertion passed -[Summary for test case './mixed/Misc/Sections/nested2': 1 test case - failed (3 assertions - 1 failed)] +---------------------------------------------------------------- +Summary for test case './mixed/Misc/Sections/nested2': +1 test case - failed (3 assertions - 1 failed) -[Test case: './Sections/nested/a/b'] -[Section: 'c'] -[Section: 'd (leaf)'] +-- Test case: './Sections/nested/a/b' ------------------------- +-- Section: 'c' ----------------------------------------------- +-- Section: 'd (leaf)' ---------------------------------------- No assertions in section, 'd (leaf)' -[Summary for section 'd (leaf)': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'd (leaf)': +1 assertion - failed -[Summary for section 'c': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'c': +1 assertion - failed -[Section: 'c'] -[Section: 'e (leaf)'] +-- Section: 'c' ----------------------------------------------- +-- Section: 'e (leaf)' ---------------------------------------- No assertions in section, 'e (leaf)' -[Summary for section 'e (leaf)': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'e (leaf)': +1 assertion - failed -[Summary for section 'c': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'c': +1 assertion - failed -[Section: 'f (leaf)'] +-- Section: 'f (leaf)' ---------------------------------------- No assertions in section, 'f (leaf)' -[Summary for section 'f (leaf)': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'f (leaf)': +1 assertion - failed -[Summary for test case './Sections/nested/a/b': 1 test case - failed (3 assertions - all failed)] +---------------------------------------------------------------- +Summary for test case './Sections/nested/a/b': +1 test case - failed (3 assertions - all failed) -[Test case: './mixed/Misc/Sections/loops'] -[Section: 's1'] +-- Test case: './mixed/Misc/Sections/loops' ------------------- +-- Section: 's1' ---------------------------------------------- MiscTests.cpp:103: b > a failed for: 0 > 1 -[Summary for section 's1': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 's1': +1 assertion - failed -[Summary for test case './mixed/Misc/Sections/loops': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './mixed/Misc/Sections/loops': +1 test case - failed (1 assertion - failed) -[Test case: './mixed/Misc/loops'] +-- Test case: './mixed/Misc/loops' ---------------------------- MiscTests.cpp:114: [info: Testing if fib[0] (1) is even] line 115: @@ -876,88 +1014,114 @@ line 115: [info: Testing if fib[7] (21) is even] line 115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -[Summary for test case './mixed/Misc/loops': 1 test case - failed (8 assertions - 6 failed)] +---------------------------------------------------------------- +Summary for test case './mixed/Misc/loops': +1 test case - failed (8 assertions - 6 failed) Some information An error -[Test case: './succeeding/Misc/stdout,stderr'] +-- Test case: './succeeding/Misc/stdout,stderr' --------------- No assertions in test case, './succeeding/Misc/stdout,stderr' -[Summary for test case './succeeding/Misc/stdout,stderr': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './succeeding/Misc/stdout,stderr': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/Misc/null strings'] +-- Test case: './succeeding/Misc/null strings' ---------------- MiscTests.cpp:133: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} line 134: makeString( true ) == static_cast(__null) succeeded for: {null string} == {null string} -[Summary for test case './succeeding/Misc/null strings': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Misc/null strings': +All tests passed (2 assertions in 1 test case) -[Test case: './failing/info'] +-- Test case: './failing/info' -------------------------------- MiscTests.cpp:139: [info: hi] line 141: [info: i := 7] line 142: false failed -[Summary for test case './failing/info': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/info': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/checkedif'] +-- Test case: './succeeding/checkedif' ------------------------ MiscTests.cpp:147: flag succeeded for: true line 155: testCheckedIf( true ) succeeded for: true -[Summary for test case './succeeding/checkedif': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/checkedif': +All tests passed (2 assertions in 1 test case) -[Test case: './failing/checkedif'] +-- Test case: './failing/checkedif' --------------------------- MiscTests.cpp:147: flag failed for: false line 160: testCheckedIf( false ) failed for: false -[Summary for test case './failing/checkedif': 1 test case - failed (2 assertions - both failed)] +---------------------------------------------------------------- +Summary for test case './failing/checkedif': +1 test case - failed (2 assertions - both failed) -[Test case: './succeeding/checkedelse'] +-- Test case: './succeeding/checkedelse' ---------------------- MiscTests.cpp:165: flag succeeded for: true line 173: testCheckedElse( true ) succeeded for: true -[Summary for test case './succeeding/checkedelse': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/checkedelse': +All tests passed (2 assertions in 1 test case) -[Test case: './failing/checkedelse'] +-- Test case: './failing/checkedelse' ------------------------- MiscTests.cpp:165: flag failed for: false line 178: testCheckedElse( false ) failed for: false -[Summary for test case './failing/checkedelse': 1 test case - failed (2 assertions - both failed)] +---------------------------------------------------------------- +Summary for test case './failing/checkedelse': +1 test case - failed (2 assertions - both failed) -[Test case: './misc/xmlentitycheck'] -[Section: 'embedded xml'] +-- Test case: './misc/xmlentitycheck' ------------------------- +-- Section: 'embedded xml' ------------------------------------ No assertions in section, 'embedded xml' -[Summary for section 'embedded xml': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'embedded xml': +1 assertion - failed -[Section: 'encoded chars'] +-- Section: 'encoded chars' ----------------------------------- No assertions in section, 'encoded chars' -[Summary for section 'encoded chars': 1 assertion - failed] +---------------------------------------------------------------- +Summary for section 'encoded chars': +1 assertion - failed -[Summary for test case './misc/xmlentitycheck': 1 test case - failed (2 assertions - both failed)] +---------------------------------------------------------------- +Summary for test case './misc/xmlentitycheck': +1 test case - failed (2 assertions - both failed) -[Test case: './manual/onechar'] +-- Test case: './manual/onechar' ------------------------------ MiscTests.cpp:195: [info: 3] line 196: false failed -[Summary for test case './manual/onechar': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './manual/onechar': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/atomic if'] +-- Test case: './succeeding/atomic if' ------------------------ MiscTests.cpp:206: x == 0 succeeded for: 0 == 0 -[Summary for test case './succeeding/atomic if': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/atomic if': +All tests passed (1 assertion in 1 test case) -[Test case: './succeeding/matchers'] +-- Test case: './succeeding/matchers' ------------------------- MiscTests.cpp:216: testStringForMatching() Contains( "string" ) succeeded for: "this string contains 'abc' as a substring" contains: "string" @@ -970,54 +1134,70 @@ testStringForMatching() StartsWith( "this" ) succeeded for: line 220: testStringForMatching() EndsWith( "substring" ) succeeded for: "this string contains 'abc' as a substring" ends with: "substring" -[Summary for test case './succeeding/matchers': All tests passed (4 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/matchers': +All tests passed (4 assertions in 1 test case) -[Test case: './failing/matchers/Contains'] +-- Test case: './failing/matchers/Contains' ------------------- MiscTests.cpp:225: testStringForMatching() Contains( "not there" ) failed for: "this string contains 'abc' as a substring" contains: "not there" -[Summary for test case './failing/matchers/Contains': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/matchers/Contains': +1 test case - failed (1 assertion - failed) -[Test case: './failing/matchers/StartsWith'] +-- Test case: './failing/matchers/StartsWith' ----------------- MiscTests.cpp:230: testStringForMatching() StartsWith( "string" ) failed for: "this string contains 'abc' as a substring" starts with: "string" -[Summary for test case './failing/matchers/StartsWith': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/matchers/StartsWith': +1 test case - failed (1 assertion - failed) -[Test case: './failing/matchers/EndsWith'] +-- Test case: './failing/matchers/EndsWith' ------------------- MiscTests.cpp:235: testStringForMatching() EndsWith( "this" ) failed for: "this string contains 'abc' as a substring" ends with: "this" -[Summary for test case './failing/matchers/EndsWith': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/matchers/EndsWith': +1 test case - failed (1 assertion - failed) -[Test case: './failing/matchers/Equals'] +-- Test case: './failing/matchers/Equals' --------------------- MiscTests.cpp:240: testStringForMatching() Equals( "something else" ) failed for: "this string contains 'abc' as a substring" equals: "something else" -[Summary for test case './failing/matchers/Equals': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/matchers/Equals': +1 test case - failed (1 assertion - failed) -[Test case: '/succeeding/matchers/AllOf'] +-- Test case: '/succeeding/matchers/AllOf' -------------------- MiscTests.cpp:245: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) -[Summary for test case '/succeeding/matchers/AllOf': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case '/succeeding/matchers/AllOf': +All tests passed (1 assertion in 1 test case) -[Test case: '/succeeding/matchers/AnyOf'] +-- Test case: '/succeeding/matchers/AnyOf' -------------------- MiscTests.cpp:249: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) line 250: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) -[Summary for test case '/succeeding/matchers/AnyOf': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case '/succeeding/matchers/AnyOf': +All tests passed (2 assertions in 1 test case) -[Test case: './succeeding/matchers/Equals'] +-- Test case: './succeeding/matchers/Equals' ------------------ MiscTests.cpp:255: 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" -[Summary for test case './succeeding/matchers/Equals': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/matchers/Equals': +All tests passed (1 assertion in 1 test case) -[Test case: 'example/factorial'] +-- Test case: 'example/factorial' ----------------------------- MiscTests.cpp:266: Factorial(0) == 1 succeeded for: 1 == 1 line 267: @@ -1028,37 +1208,47 @@ line 269: Factorial(3) == 6 succeeded for: 6 == 6 line 270: Factorial(10) == 3628800 succeeded for: 0x == 3628800 -[Summary for test case 'example/factorial': All tests passed (5 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'example/factorial': +All tests passed (5 assertions in 1 test case) -[Test case: 'empty'] +-- Test case: 'empty' ----------------------------------------- No assertions in test case, 'empty' -[Summary for test case 'empty': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case 'empty': +1 test case - failed (1 assertion - failed) -[Test case: 'Nice descriptive name'] +-- Test case: 'Nice descriptive name' ------------------------- MiscTests.cpp:279: [warning: This one ran] No assertions in test case, 'Nice descriptive name' -[Summary for test case 'Nice descriptive name': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case 'Nice descriptive name': +1 test case - failed (1 assertion - failed) -[Test case: 'first tag'] +-- Test case: 'first tag' ------------------------------------- No assertions in test case, 'first tag' -[Summary for test case 'first tag': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case 'first tag': +1 test case - failed (1 assertion - failed) -[Test case: 'second tag'] +-- Test case: 'second tag' ------------------------------------ No assertions in test case, 'second tag' -[Summary for test case 'second tag': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case 'second tag': +1 test case - failed (1 assertion - failed) -[Test case: 'selftest/main'] -[Section: 'selftest/expected result'] -[Section: 'selftest/expected result/failing tests'] +-- Test case: 'selftest/main' --------------------------------- +-- Section: 'selftest/expected result' ------------------------ +-- Section: 'selftest/expected result/failing tests' ---------- /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] @@ -1110,12 +1300,16 @@ No assertions in test case, 'second tag' [with message: Tests failed, as expected] succeeded [with message: Tests failed, as expected] -[Summary for section 'selftest/expected result/failing tests': All 25 assertions passed] +---------------------------------------------------------------- +Summary for section 'selftest/expected result/failing tests': +All 25 assertions passed -[Summary for section 'selftest/expected result': All 25 assertions passed] +---------------------------------------------------------------- +Summary for section 'selftest/expected result': +All 25 assertions passed -[Section: 'selftest/expected result'] -[Section: 'selftest/expected result/succeeding tests'] +-- Section: 'selftest/expected result' ------------------------ +-- Section: 'selftest/expected result/succeeding tests' ------- /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] @@ -1207,45 +1401,61 @@ An error [with message: Tests passed, as expected] succeeded [with message: Tests passed, as expected] -[Summary for section 'selftest/expected result/succeeding tests': All 43 assertions passed] +---------------------------------------------------------------- +Summary for section 'selftest/expected result/succeeding tests': +All 43 assertions passed -[Summary for section 'selftest/expected result': All 43 assertions passed] +---------------------------------------------------------------- +Summary for section 'selftest/expected result': +All 43 assertions passed Message from section one Message from section two Some information An error -[Section: 'selftest/test counts'] -[Section: 'selftest/test counts/succeeding tests'] +-- Section: 'selftest/test counts' ---------------------------- +-- Section: 'selftest/test counts/succeeding tests' ----------- TestMain.cpp:40: totals.assertions.passed == 291 succeeded for: 291 == 291 line 41: totals.assertions.failed == 0 succeeded for: 0 == 0 -[Summary for section 'selftest/test counts/succeeding tests': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'selftest/test counts/succeeding tests': +All 2 assertions passed -[Summary for section 'selftest/test counts': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'selftest/test counts': +All 2 assertions passed -[Section: 'selftest/test counts'] -[Section: 'selftest/test counts/failing tests'] +-- Section: 'selftest/test counts' ---------------------------- +-- Section: 'selftest/test counts/failing tests' -------------- TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 line 48: totals.assertions.failed == 72 succeeded for: 72 == 72 -[Summary for section 'selftest/test counts/failing tests': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'selftest/test counts/failing tests': +All 2 assertions passed -[Summary for section 'selftest/test counts': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'selftest/test counts': +All 2 assertions passed -[Summary for test case 'selftest/main': All tests passed (72 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'selftest/main': +All tests passed (72 assertions in 1 test case) -[Test case: 'meta/Misc/Sections'] +-- Test case: 'meta/Misc/Sections' ---------------------------- TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 line 58: totals.assertions.failed == 1 succeeded for: 1 == 1 -[Summary for test case 'meta/Misc/Sections': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'meta/Misc/Sections': +All tests passed (2 assertions in 1 test case) -[Test case: 'selftest/parser/2'] -[Section: 'default'] +-- Test case: 'selftest/parser/2' ----------------------------- +-- Section: 'default' ----------------------------------------- TestMain.cpp:97: parseIntoConfig( argv, config ) succeeded line 99: @@ -1256,10 +1466,12 @@ line 101: config.allowThrows == true succeeded for: true == true line 102: config.reporter.empty() succeeded for: true -[Summary for section 'default': All 5 assertions passed] +---------------------------------------------------------------- +Summary for section 'default': +All 5 assertions passed -[Section: 'test lists'] -[Section: '-t/1'] +-- Section: 'test lists' -------------------------------------- +-- Section: '-t/1' -------------------------------------------- TestMain.cpp:108: parseIntoConfig( argv, config ) succeeded line 110: @@ -1268,12 +1480,16 @@ line 111: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false line 112: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -[Summary for section '-t/1': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section '-t/1': +All 4 assertions passed -[Summary for section 'test lists': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section 'test lists': +All 4 assertions passed -[Section: 'test lists'] -[Section: '-t/exclude:1'] +-- Section: 'test lists' -------------------------------------- +-- Section: '-t/exclude:1' ------------------------------------ TestMain.cpp:116: parseIntoConfig( argv, config ) succeeded line 118: @@ -1282,12 +1498,16 @@ line 119: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false line 120: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true -[Summary for section '-t/exclude:1': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section '-t/exclude:1': +All 4 assertions passed -[Summary for section 'test lists': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section 'test lists': +All 4 assertions passed -[Section: 'test lists'] -[Section: '--test/1'] +-- Section: 'test lists' -------------------------------------- +-- Section: '--test/1' ---------------------------------------- TestMain.cpp:125: parseIntoConfig( argv, config ) succeeded line 127: @@ -1296,12 +1516,16 @@ line 128: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false line 129: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -[Summary for section '--test/1': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section '--test/1': +All 4 assertions passed -[Summary for section 'test lists': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section 'test lists': +All 4 assertions passed -[Section: 'test lists'] -[Section: '--test/exclude:1'] +-- Section: 'test lists' -------------------------------------- +-- Section: '--test/exclude:1' -------------------------------- TestMain.cpp:134: parseIntoConfig( argv, config ) succeeded line 136: @@ -1310,12 +1534,16 @@ line 137: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false line 138: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true -[Summary for section '--test/exclude:1': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section '--test/exclude:1': +All 4 assertions passed -[Summary for section 'test lists': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section 'test lists': +All 4 assertions passed -[Section: 'test lists'] -[Section: '--test/exclude:2'] +-- Section: 'test lists' -------------------------------------- +-- Section: '--test/exclude:2' -------------------------------- TestMain.cpp:143: parseIntoConfig( argv, config ) succeeded line 145: @@ -1324,12 +1552,16 @@ line 146: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false line 147: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true -[Summary for section '--test/exclude:2': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section '--test/exclude:2': +All 4 assertions passed -[Summary for section 'test lists': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section 'test lists': +All 4 assertions passed -[Section: 'test lists'] -[Section: '-t/2'] +-- Section: 'test lists' -------------------------------------- +-- Section: '-t/2' -------------------------------------------- TestMain.cpp:152: parseIntoConfig( argv, config ) succeeded line 154: @@ -1340,190 +1572,266 @@ line 156: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true line 157: config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true -[Summary for section '-t/2': All 5 assertions passed] +---------------------------------------------------------------- +Summary for section '-t/2': +All 5 assertions passed -[Summary for section 'test lists': All 5 assertions passed] +---------------------------------------------------------------- +Summary for section 'test lists': +All 5 assertions passed -[Section: 'test lists'] -[Section: '-t/0'] +-- Section: 'test lists' -------------------------------------- +-- Section: '-t/0' -------------------------------------------- TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" -[Summary for section '-t/0': 1 assertion passed] +---------------------------------------------------------------- +Summary for section '-t/0': +1 assertion passed -[Summary for section 'test lists': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'test lists': +1 assertion passed -[Section: 'reporter'] -[Section: '-r/basic'] +-- Section: 'reporter' ---------------------------------------- +-- Section: '-r/basic' ---------------------------------------- TestMain.cpp:169: parseIntoConfig( argv, config ) succeeded line 171: config.reporter == "console" succeeded for: "console" == "console" -[Summary for section '-r/basic': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section '-r/basic': +All 2 assertions passed -[Summary for section 'reporter': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'reporter': +All 2 assertions passed -[Section: 'reporter'] -[Section: '-r/xml'] +-- Section: 'reporter' ---------------------------------------- +-- Section: '-r/xml' ------------------------------------------ TestMain.cpp:175: parseIntoConfig( argv, config ) succeeded line 177: config.reporter == "xml" succeeded for: "xml" == "xml" -[Summary for section '-r/xml': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section '-r/xml': +All 2 assertions passed -[Summary for section 'reporter': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'reporter': +All 2 assertions passed -[Section: 'reporter'] -[Section: '--reporter/junit'] +-- Section: 'reporter' ---------------------------------------- +-- Section: '--reporter/junit' -------------------------------- TestMain.cpp:181: parseIntoConfig( argv, config ) succeeded line 183: config.reporter == "junit" succeeded for: "junit" == "junit" -[Summary for section '--reporter/junit': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section '--reporter/junit': +All 2 assertions passed -[Summary for section 'reporter': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'reporter': +All 2 assertions passed -[Section: 'reporter'] -[Section: '-r/error'] +-- Section: 'reporter' ---------------------------------------- +-- Section: '-r/error' ---------------------------------------- TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" -[Summary for section '-r/error': 1 assertion passed] +---------------------------------------------------------------- +Summary for section '-r/error': +1 assertion passed -[Summary for section 'reporter': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'reporter': +1 assertion passed -[Section: 'debugger'] -[Section: '-b'] +-- Section: 'debugger' ---------------------------------------- +-- Section: '-b' ---------------------------------------------- TestMain.cpp:194: parseIntoConfig( argv, config ) succeeded line 196: config.shouldDebugBreak == true succeeded for: true == true -[Summary for section '-b': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section '-b': +All 2 assertions passed -[Summary for section 'debugger': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'debugger': +All 2 assertions passed -[Section: 'debugger'] -[Section: '--break'] +-- Section: 'debugger' ---------------------------------------- +-- Section: '--break' ----------------------------------------- TestMain.cpp:200: parseIntoConfig( argv, config ) succeeded line 202: config.shouldDebugBreak succeeded for: true -[Summary for section '--break': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section '--break': +All 2 assertions passed -[Summary for section 'debugger': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'debugger': +All 2 assertions passed -[Section: 'debugger'] -[Section: '-b'] +-- Section: 'debugger' ---------------------------------------- +-- Section: '-b' ---------------------------------------------- TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" -[Summary for section '-b': 1 assertion passed] +---------------------------------------------------------------- +Summary for section '-b': +1 assertion passed -[Summary for section 'debugger': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'debugger': +1 assertion passed -[Section: 'abort'] -[Section: '-a'] +-- Section: 'abort' ------------------------------------------- +-- Section: '-a' ---------------------------------------------- TestMain.cpp:213: parseIntoConfig( argv, config ) succeeded line 215: config.cutoff == 1 succeeded for: 1 == 1 -[Summary for section '-a': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section '-a': +All 2 assertions passed -[Summary for section 'abort': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'abort': +All 2 assertions passed -[Section: 'abort'] -[Section: '-a/2'] +-- Section: 'abort' ------------------------------------------- +-- Section: '-a/2' -------------------------------------------- TestMain.cpp:219: parseIntoConfig( argv, config ) succeeded line 221: config.cutoff == 2 succeeded for: 2 == 2 -[Summary for section '-a/2': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section '-a/2': +All 2 assertions passed -[Summary for section 'abort': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'abort': +All 2 assertions passed -[Section: 'abort'] -[Section: '-a/error/0'] +-- Section: 'abort' ------------------------------------------- +-- Section: '-a/error/0' -------------------------------------- TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" -[Summary for section '-a/error/0': 1 assertion passed] +---------------------------------------------------------------- +Summary for section '-a/error/0': +1 assertion passed -[Summary for section 'abort': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'abort': +1 assertion passed -[Section: 'abort'] -[Section: '-a/error/non numeric'] +-- Section: 'abort' ------------------------------------------- +-- Section: '-a/error/non numeric' ---------------------------- TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" -[Summary for section '-a/error/non numeric': 1 assertion passed] +---------------------------------------------------------------- +Summary for section '-a/error/non numeric': +1 assertion passed -[Summary for section 'abort': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'abort': +1 assertion passed -[Section: 'abort'] -[Section: '-a/error/two args'] +-- Section: 'abort' ------------------------------------------- +-- Section: '-a/error/two args' ------------------------------- TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" -[Summary for section '-a/error/two args': 1 assertion passed] +---------------------------------------------------------------- +Summary for section '-a/error/two args': +1 assertion passed -[Summary for section 'abort': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'abort': +1 assertion passed -[Section: 'nothrow'] -[Section: '-nt'] +-- Section: 'nothrow' ----------------------------------------- +-- Section: '-nt' --------------------------------------------- TestMain.cpp:240: parseIntoConfig( argv, config ) succeeded line 242: config.allowThrows == false succeeded for: false == false -[Summary for section '-nt': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section '-nt': +All 2 assertions passed -[Summary for section 'nothrow': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'nothrow': +All 2 assertions passed -[Section: 'nothrow'] -[Section: '--nothrow'] +-- Section: 'nothrow' ----------------------------------------- +-- Section: '--nothrow' --------------------------------------- TestMain.cpp:246: parseIntoConfig( argv, config ) succeeded line 248: config.allowThrows == false succeeded for: false == false -[Summary for section '--nothrow': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section '--nothrow': +All 2 assertions passed -[Summary for section 'nothrow': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'nothrow': +All 2 assertions passed -[Section: 'streams'] -[Section: '-o filename'] +-- Section: 'streams' ----------------------------------------- +-- Section: '-o filename' ------------------------------------- TestMain.cpp:255: parseIntoConfig( argv, config ) succeeded line 257: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" line 258: config.stream.empty() succeeded for: true -[Summary for section '-o filename': All 3 assertions passed] +---------------------------------------------------------------- +Summary for section '-o filename': +All 3 assertions passed -[Summary for section 'streams': All 3 assertions passed] +---------------------------------------------------------------- +Summary for section 'streams': +All 3 assertions passed -[Section: 'streams'] -[Section: '-o %stdout'] +-- Section: 'streams' ----------------------------------------- +-- Section: '-o %stdout' -------------------------------------- TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded line 264: config.stream == "stdout" succeeded for: "stdout" == "stdout" line 265: config.outputFilename.empty() succeeded for: true -[Summary for section '-o %stdout': All 3 assertions passed] +---------------------------------------------------------------- +Summary for section '-o %stdout': +All 3 assertions passed -[Summary for section 'streams': All 3 assertions passed] +---------------------------------------------------------------- +Summary for section 'streams': +All 3 assertions passed -[Section: 'streams'] -[Section: '--out'] +-- Section: 'streams' ----------------------------------------- +-- Section: '--out' ------------------------------------------- TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded line 271: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -[Summary for section '--out': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section '--out': +All 2 assertions passed -[Summary for section 'streams': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'streams': +All 2 assertions passed -[Section: 'combinations'] -[Section: '-a -b'] +-- Section: 'combinations' ------------------------------------ +-- Section: '-a -b' ------------------------------------------- TestMain.cpp:278: parseIntoConfig( argv, config ) succeeded line 280: @@ -1532,13 +1840,19 @@ line 281: config.shouldDebugBreak succeeded for: true line 282: config.allowThrows == false succeeded for: false == false -[Summary for section '-a -b': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section '-a -b': +All 4 assertions passed -[Summary for section 'combinations': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section 'combinations': +All 4 assertions passed -[Summary for test case 'selftest/parser/2': All tests passed (66 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'selftest/parser/2': +All tests passed (66 assertions in 1 test case) -[Test case: 'selftest/test filter'] +-- Test case: 'selftest/test filter' -------------------------- TestMain.cpp:291: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true line 292: @@ -1551,9 +1865,11 @@ line 300: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true line 301: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false -[Summary for test case 'selftest/test filter': All tests passed (6 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'selftest/test filter': +All tests passed (6 assertions in 1 test case) -[Test case: 'selftest/test filters'] +-- Test case: 'selftest/test filters' ------------------------- TestMain.cpp:312: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true line 314: @@ -1562,16 +1878,20 @@ line 315: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true line 316: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false -[Summary for test case 'selftest/test filters': All tests passed (4 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'selftest/test filters': +All tests passed (4 assertions in 1 test case) -[Test case: 'selftest/filter/prefix wildcard'] +-- Test case: 'selftest/filter/prefix wildcard' --------------- TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true line 323: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false -[Summary for test case 'selftest/filter/prefix wildcard': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'selftest/filter/prefix wildcard': +All tests passed (2 assertions in 1 test case) -[Test case: 'selftest/filter/wildcard at both ends'] +-- Test case: 'selftest/filter/wildcard at both ends' --------- TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true line 329: @@ -1580,9 +1900,11 @@ line 330: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true line 331: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false -[Summary for test case 'selftest/filter/wildcard at both ends': All tests passed (4 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'selftest/filter/wildcard at both ends': +All tests passed (4 assertions in 1 test case) -[Test case: 'selftest/option parsers'] +-- Test case: 'selftest/option parsers' ----------------------- TestMain.cpp:351: opt.parseIntoConfig( parser, config ) succeeded line 353: @@ -1591,10 +1913,12 @@ line 354: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false line 355: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -[Summary for test case 'selftest/option parsers': All tests passed (4 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'selftest/option parsers': +All tests passed (4 assertions in 1 test case) -[Test case: 'selftest/tags'] -[Section: 'one tag'] +-- Test case: 'selftest/tags' --------------------------------- +-- Section: 'one tag' ----------------------------------------- TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" line 370: @@ -1611,9 +1935,11 @@ line 376: oneTag.matchesTags( p4 ) == false succeeded for: false == false line 377: oneTag.matchesTags( p5 ) == false succeeded for: false == false -[Summary for section 'one tag': All 8 assertions passed] +---------------------------------------------------------------- +Summary for section 'one tag': +All 8 assertions passed -[Section: 'two tags'] +-- Section: 'two tags' ---------------------------------------- TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" line 384: @@ -1634,9 +1960,11 @@ line 392: twoTags.matchesTags( p4 ) == true succeeded for: true == true line 393: twoTags.matchesTags( p5 ) == true succeeded for: true == true -[Summary for section 'two tags': All 10 assertions passed] +---------------------------------------------------------------- +Summary for section 'two tags': +All 10 assertions passed -[Section: 'one tag with characters either side'] +-- Section: 'one tag with characters either side' ------------- TestMain.cpp:399: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" line 400: @@ -1645,18 +1973,22 @@ line 401: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false line 402: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 -[Summary for section 'one tag with characters either side': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section 'one tag with characters either side': +All 4 assertions passed -[Section: 'start of a tag, but not closed'] +-- Section: 'start of a tag, but not closed' ------------------ TestMain.cpp:409: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" line 410: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false line 411: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 -[Summary for section 'start of a tag, but not closed': All 3 assertions passed] +---------------------------------------------------------------- +Summary for section 'start of a tag, but not closed': +All 3 assertions passed -[Section: 'hidden'] +-- Section: 'hidden' ------------------------------------------ TestMain.cpp:417: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" line 418: @@ -1665,138 +1997,188 @@ line 419: oneTag.isHidden() succeeded for: true line 421: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false -[Summary for section 'hidden': All 4 assertions passed] +---------------------------------------------------------------- +Summary for section 'hidden': +All 4 assertions passed -[Summary for test case 'selftest/tags': All tests passed (29 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'selftest/tags': +All tests passed (29 assertions in 1 test case) -[Test case: './succeeding/Tricky/std::pair'] +-- Test case: './succeeding/Tricky/std::pair' ----------------- TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: std::pair( 1, 2 ) == std::pair( 1, 2 ) -[Summary for test case './succeeding/Tricky/std::pair': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Tricky/std::pair': +All tests passed (1 assertion in 1 test case) -[Test case: './inprogress/failing/Tricky/trailing expression'] +-- Test case: './inprogress/failing/Tricky/trailing expression' ---------------------------------------------------------------- TrickyTests.cpp:55: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] No assertions in test case, './inprogress/failing/Tricky/trailing expression' -[Summary for test case './inprogress/failing/Tricky/trailing expression': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './inprogress/failing/Tricky/trailing expression': +1 test case - failed (1 assertion - failed) -[Test case: './inprogress/failing/Tricky/compound lhs'] +-- Test case: './inprogress/failing/Tricky/compound lhs' ------ TrickyTests.cpp:71: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] No assertions in test case, './inprogress/failing/Tricky/compound lhs' -[Summary for test case './inprogress/failing/Tricky/compound lhs': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './inprogress/failing/Tricky/compound lhs': +1 test case - failed (1 assertion - failed) -[Test case: './failing/Tricky/non streamable type'] +-- Test case: './failing/Tricky/non streamable type' ---------- TrickyTests.cpp:95: &o1 == &o2 failed for: 0x == 0x line 96: o1 == o2 failed for: {?} == {?} -[Summary for test case './failing/Tricky/non streamable type': 1 test case - failed (2 assertions - both failed)] +---------------------------------------------------------------- +Summary for test case './failing/Tricky/non streamable type': +1 test case - failed (2 assertions - both failed) -[Test case: './failing/string literals'] +-- Test case: './failing/string literals' --------------------- TrickyTests.cpp:106: std::string( "first" ) == "second" failed for: "first" == "second" -[Summary for test case './failing/string literals': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/string literals': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/side-effects'] +-- Test case: './succeeding/side-effects' --------------------- TrickyTests.cpp:119: i++ == 7 succeeded for: 7 == 7 line 120: i++ == 8 succeeded for: 8 == 8 -[Summary for test case './succeeding/side-effects': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/side-effects': +All tests passed (2 assertions in 1 test case) -[Test case: './succeeding/koenig'] +-- Test case: './succeeding/koenig' --------------------------- TrickyTests.cpp:186: 0x == o succeeded for: 0x == {?} -[Summary for test case './succeeding/koenig': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/koenig': +All tests passed (1 assertion in 1 test case) -[Test case: './succeeding/non-const=='] +-- Test case: './succeeding/non-const==' ---------------------- TrickyTests.cpp:212: t == 1u succeeded for: {?} == 1 -[Summary for test case './succeeding/non-const==': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/non-const==': +All tests passed (1 assertion in 1 test case) -[Test case: './succeeding/enum/bits'] +-- Test case: './succeeding/enum/bits' ------------------------ TrickyTests.cpp:224: 0x == bit30and31 succeeded for: 0x == 3221225472 -[Summary for test case './succeeding/enum/bits': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/enum/bits': +All tests passed (1 assertion in 1 test case) -[Test case: './succeeding/boolean member'] +-- Test case: './succeeding/boolean member' ------------------- TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x != 0 -[Summary for test case './succeeding/boolean member': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/boolean member': +All tests passed (1 assertion in 1 test case) -[Test case: './succeeding/unimplemented static bool'] -[Section: 'compare to true'] +-- Test case: './succeeding/unimplemented static bool' -------- +-- Section: 'compare to true' --------------------------------- TrickyTests.cpp:259: is_true::value == true succeeded for: true == true line 260: true == is_true::value succeeded for: true == true -[Summary for section 'compare to true': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'compare to true': +All 2 assertions passed -[Section: 'compare to false'] +-- Section: 'compare to false' -------------------------------- TrickyTests.cpp:264: is_true::value == false succeeded for: false == false line 265: false == is_true::value succeeded for: false == false -[Summary for section 'compare to false': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'compare to false': +All 2 assertions passed -[Section: 'negation'] +-- Section: 'negation' ---------------------------------------- TrickyTests.cpp:270: !is_true::value succeeded for: true -[Summary for section 'negation': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'negation': +1 assertion passed -[Section: 'double negation'] +-- Section: 'double negation' --------------------------------- TrickyTests.cpp:275: !!is_true::value succeeded for: true -[Summary for section 'double negation': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'double negation': +1 assertion passed -[Section: 'direct'] +-- Section: 'direct' ------------------------------------------ TrickyTests.cpp:280: is_true::value succeeded for: true line 281: !is_true::value succeeded for: !false -[Summary for section 'direct': All 2 assertions passed] +---------------------------------------------------------------- +Summary for section 'direct': +All 2 assertions passed -[Summary for test case './succeeding/unimplemented static bool': All tests passed (8 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/unimplemented static bool': +All tests passed (8 assertions in 1 test case) -[Test case: './succeeding/SafeBool'] +-- Test case: './succeeding/SafeBool' ------------------------- TrickyTests.cpp:313: True succeeded for: true line 314: !False succeeded for: true line 315: !False succeeded for: !false -[Summary for test case './succeeding/SafeBool': All tests passed (3 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/SafeBool': +All tests passed (3 assertions in 1 test case) -[Test case: 'scenario name'] -[Section: 'This stuff exists'] -[Section: 'I do this'] -[Section: 'it should do this'] +-- Test case: 'scenario name' --------------------------------- +-- Section: 'This stuff exists' ------------------------------- +-- Section: 'I do this' --------------------------------------- +-- Section: 'it should do this' ------------------------------- BDDTests.cpp:37: itDoesThis() succeeded for: true -[Summary for section 'it should do this': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'it should do this': +1 assertion passed -[Summary for section 'I do this': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'I do this': +1 assertion passed -[Summary for section 'This stuff exists': 1 assertion passed] +---------------------------------------------------------------- +Summary for section 'This stuff exists': +1 assertion passed -[Summary for test case 'scenario name': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case 'scenario name': +All tests passed (1 assertion in 1 test case) -[Summary for group '~dummy': 95 test cases - 44 failed (607 assertions - 101 failed)] +---------------------------------------------------------------- +Summary for group '~dummy': +95 test cases - 44 failed (607 assertions - 101 failed) -[Summary for 'CatchSelfTest': 95 test cases - 44 failed (607 assertions - 101 failed)] +================================================================ +Summary for all tests in 'CatchSelfTest': +95 test cases - 44 failed (607 assertions - 101 failed) -[Started testing: CatchSelfTest] -[Group: '~dummy'] -[Test case: './succeeding/Approx/simple'] +-- Started testing: 'CatchSelfTest' --------------------------- +-- Group: '~dummy' -------------------------------------------- +-- Test case: './succeeding/Approx/simple' -------------------- ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) line 21: @@ -1809,30 +2191,38 @@ line 25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 line 26: Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 -[Summary for test case './succeeding/Approx/simple': All tests passed (6 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/simple': +All tests passed (6 assertions in 1 test case) -[Test case: './succeeding/Approx/epsilon'] +-- Test case: './succeeding/Approx/epsilon' ------------------- ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) line 39: d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) -[Summary for test case './succeeding/Approx/epsilon': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/epsilon': +All tests passed (2 assertions in 1 test case) -[Test case: './succeeding/Approx/float'] +-- Test case: './succeeding/Approx/float' --------------------- ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) line 50: 0.0f == Approx( 0.0f ) succeeded for: 0 == Approx( 0 ) -[Summary for test case './succeeding/Approx/float': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/float': +All tests passed (2 assertions in 1 test case) -[Test case: './succeeding/Approx/int'] +-- Test case: './succeeding/Approx/int' ----------------------- ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded line 61: 0 == Approx( 0 ) succeeded -[Summary for test case './succeeding/Approx/int': All tests passed (2 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/int': +All tests passed (2 assertions in 1 test case) -[Test case: './succeeding/Approx/mixed'] +-- Test case: './succeeding/Approx/mixed' --------------------- ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) line 76: @@ -1843,9 +2233,11 @@ line 78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) line 79: dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) -[Summary for test case './succeeding/Approx/mixed': All tests passed (5 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/mixed': +All tests passed (5 assertions in 1 test case) -[Test case: './succeeding/Approx/custom'] +-- Test case: './succeeding/Approx/custom' -------------------- ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) line 94: @@ -1862,29 +2254,39 @@ line 100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 line 101: approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 -[Summary for test case './succeeding/Approx/custom': All tests passed (8 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Approx/custom': +All tests passed (8 assertions in 1 test case) -[Test case: './succeeding/TestClass/succeedingCase'] +-- Test case: './succeeding/TestClass/succeedingCase' --------- ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" -[Summary for test case './succeeding/TestClass/succeedingCase': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/TestClass/succeedingCase': +All tests passed (1 assertion in 1 test case) -[Test case: './failing/TestClass/failingCase'] +-- Test case: './failing/TestClass/failingCase' --------------- ClassTests.cpp:28: s == "world" failed for: "hello" == "world" -[Summary for test case './failing/TestClass/failingCase': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/TestClass/failingCase': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/Fixture/succeedingCase'] +-- Test case: './succeeding/Fixture/succeedingCase' ----------- ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 -[Summary for test case './succeeding/Fixture/succeedingCase': All tests passed (1 assertion in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/Fixture/succeedingCase': +All tests passed (1 assertion in 1 test case) -[Test case: './failing/Fixture/failingCase'] +-- Test case: './failing/Fixture/failingCase' ----------------- ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 -[Summary for test case './failing/Fixture/failingCase': 1 test case - failed (1 assertion - failed)] +---------------------------------------------------------------- +Summary for test case './failing/Fixture/failingCase': +1 test case - failed (1 assertion - failed) -[Test case: './succeeding/conditions/equality'] +-- Test case: './succeeding/conditions/equality' -------------- ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 line 56: @@ -1899,18 +2301,26 @@ line 60: data.str_hello.size() == 5 succeeded for: 5 == 5 line 63: x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) -[Summary for test case './succeeding/conditions/equality': All tests passed (7 assertions in 1 test case)] +---------------------------------------------------------------- +Summary for test case './succeeding/conditions/equality': +All tests passed (7 assertions in 1 test case) -[Test case: './failing/conditions/equality'] +-- Test case: './failing/conditions/equality' ----------------- ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 line 72: data.int_seven == 8 failed for: 7 == 8 -[Summary for test case './failing/conditions/equality': 1 test case - failed (2 assertions - both failed)] +---------------------------------------------------------------- +Summary for test case './failing/conditions/equality': +1 test case - failed (2 assertions - both failed) -[Summary for group '~dummy': 12 test cases - 3 failed (38 assertions - 4 failed)] +---------------------------------------------------------------- +Summary for group '~dummy': +12 test cases - 3 failed (38 assertions - 4 failed) -[Summary for 'CatchSelfTest': 12 test cases - 3 failed (38 assertions - 4 failed)] +================================================================ +Summary for all tests in 'CatchSelfTest': +12 test cases - 3 failed (38 assertions - 4 failed) From eac51f38bde932a928312dba00756f1a9d6eec6f Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 13 Dec 2012 12:57:49 +0000 Subject: [PATCH 096/296] Fix for long headers --- include/reporters/catch_reporter_console.hpp | 4 +- .../SelfTest/Baselines/approvedResults.txt | 410 +++++++++--------- 2 files changed, 208 insertions(+), 206 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 15a5ba4c..84e5ea05 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -67,8 +67,10 @@ namespace Catch { return doubleDashes; } void printHeader( std::string const& _type, std::string const& _name ) { + std::size_t labelLen = _type.size() + _name.size() + 8; + std::size_t dashLen = getDashes().size(); stream << "-- " << _type << ": '" << _name << "' " - << getDashes().substr( 0, getDashes().size() - ( _type.size() + _name.size() + 9 ) ) + << getDashes().substr( 0, labelLen < dashLen ? dashLen - labelLen : 0 ) << std::endl; } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 2b8419b7..2840f660 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ --- Started testing: 'CatchSelfTest' --------------------------- --- Group: '~dummy' -------------------------------------------- --- Test case: './succeeding/Approx/simple' -------------------- +-- Started testing: 'CatchSelfTest' ---------------------------- +-- Group: '~dummy' --------------------------------------------- +-- Test case: './succeeding/Approx/simple' --------------------- ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) line 21: @@ -17,7 +17,7 @@ Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 Summary for test case './succeeding/Approx/simple': All tests passed (6 assertions in 1 test case) --- Test case: './succeeding/Approx/epsilon' ------------------- +-- Test case: './succeeding/Approx/epsilon' -------------------- ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) line 39: @@ -26,7 +26,7 @@ d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) Summary for test case './succeeding/Approx/epsilon': All tests passed (2 assertions in 1 test case) --- Test case: './succeeding/Approx/float' --------------------- +-- Test case: './succeeding/Approx/float' ---------------------- ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) line 50: @@ -35,7 +35,7 @@ line 50: Summary for test case './succeeding/Approx/float': All tests passed (2 assertions in 1 test case) --- Test case: './succeeding/Approx/int' ----------------------- +-- Test case: './succeeding/Approx/int' ------------------------ ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded line 61: @@ -44,7 +44,7 @@ line 61: Summary for test case './succeeding/Approx/int': All tests passed (2 assertions in 1 test case) --- Test case: './succeeding/Approx/mixed' --------------------- +-- Test case: './succeeding/Approx/mixed' ---------------------- ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) line 76: @@ -59,7 +59,7 @@ dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) Summary for test case './succeeding/Approx/mixed': All tests passed (5 assertions in 1 test case) --- Test case: './succeeding/Approx/custom' -------------------- +-- Test case: './succeeding/Approx/custom' --------------------- ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) line 94: @@ -80,35 +80,35 @@ approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 Summary for test case './succeeding/Approx/custom': All tests passed (8 assertions in 1 test case) --- Test case: './succeeding/TestClass/succeedingCase' --------- +-- Test case: './succeeding/TestClass/succeedingCase' ---------- ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" ---------------------------------------------------------------- Summary for test case './succeeding/TestClass/succeedingCase': All tests passed (1 assertion in 1 test case) --- Test case: './failing/TestClass/failingCase' --------------- +-- Test case: './failing/TestClass/failingCase' ---------------- ClassTests.cpp:28: s == "world" failed for: "hello" == "world" ---------------------------------------------------------------- Summary for test case './failing/TestClass/failingCase': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/Fixture/succeedingCase' ----------- +-- Test case: './succeeding/Fixture/succeedingCase' ------------ ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 ---------------------------------------------------------------- Summary for test case './succeeding/Fixture/succeedingCase': All tests passed (1 assertion in 1 test case) --- Test case: './failing/Fixture/failingCase' ----------------- +-- Test case: './failing/Fixture/failingCase' ------------------ ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 ---------------------------------------------------------------- Summary for test case './failing/Fixture/failingCase': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/conditions/equality' -------------- +-- Test case: './succeeding/conditions/equality' --------------- ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 line 56: @@ -127,7 +127,7 @@ x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) Summary for test case './succeeding/conditions/equality': All tests passed (7 assertions in 1 test case) --- Test case: './failing/conditions/equality' ----------------- +-- Test case: './failing/conditions/equality' ------------------ ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 line 72: @@ -158,7 +158,7 @@ x == Approx( 1.301 ) failed for: 1.3 == Approx( 1.301 ) Summary for test case './failing/conditions/equality': 1 test case - failed (13 assertions - all failed) --- Test case: './succeeding/conditions/inequality' ------------ +-- Test case: './succeeding/conditions/inequality' ------------- ConditionTests.cpp:93: data.int_seven != 6 succeeded for: 7 != 6 line 94: @@ -185,7 +185,7 @@ data.str_hello.size() != 6 succeeded for: 5 != 6 Summary for test case './succeeding/conditions/inequality': All tests passed (11 assertions in 1 test case) --- Test case: './failing/conditions/inequality' --------------- +-- Test case: './failing/conditions/inequality' ---------------- ConditionTests.cpp:111: data.int_seven != 7 failed for: 7 != 7 line 112: @@ -200,7 +200,7 @@ data.str_hello.size() != 5 failed for: 5 != 5 Summary for test case './failing/conditions/inequality': 1 test case - failed (5 assertions - all failed) --- Test case: './succeeding/conditions/ordered' --------------- +-- Test case: './succeeding/conditions/ordered' ---------------- ConditionTests.cpp:124: data.int_seven < 8 succeeded for: 7 < 8 line 125: @@ -239,7 +239,7 @@ data.str_hello > "a" succeeded for: "hello" > "a" Summary for test case './succeeding/conditions/ordered': All tests passed (17 assertions in 1 test case) --- Test case: './failing/conditions/ordered' ------------------ +-- Test case: './failing/conditions/ordered' ------------------- ConditionTests.cpp:152: data.int_seven > 7 failed for: 7 > 7 line 153: @@ -282,7 +282,7 @@ data.str_hello <= "a" failed for: "hello" <= "a" Summary for test case './failing/conditions/ordered': 1 test case - failed (19 assertions - all failed) --- Test case: './succeeding/conditions/int literals' ---------- +-- Test case: './succeeding/conditions/int literals' ----------- ConditionTests.cpp:188: i == 1 succeeded for: 1 == 1 line 189: @@ -313,7 +313,7 @@ line 202: Summary for test case './succeeding/conditions/int literals': All tests passed (13 assertions in 1 test case) --- Test case: './succeeding/conditions//long_to_unsigned_x' --- +-- Test case: './succeeding/conditions//long_to_unsigned_x' ---- ConditionTests.cpp:223: long_var == unsigned_char_var succeeded for: 1 ==  line 224: @@ -326,7 +326,7 @@ long_var == unsigned_long_var succeeded for: 1 == 1 Summary for test case './succeeding/conditions//long_to_unsigned_x': All tests passed (4 assertions in 1 test case) --- Test case: './succeeding/conditions/const ints to int literal' ---------------------------------------------------------------- +-- Test case: './succeeding/conditions/const ints to int literal' ConditionTests.cpp:237: unsigned_char_var == 1 succeeded for:  == 1 line 238: @@ -339,7 +339,7 @@ unsigned_long_var == 1 succeeded for: 1 == 1 Summary for test case './succeeding/conditions/const ints to int literal': All tests passed (4 assertions in 1 test case) --- Test case: './succeeding/conditions/negative ints' --------- +-- Test case: './succeeding/conditions/negative ints' ---------- ConditionTests.cpp:246: ( -1 > 2u ) succeeded for: true line 247: @@ -356,14 +356,14 @@ minInt > 2u succeeded for: -2147483648 > 2 Summary for test case './succeeding/conditions/negative ints': All tests passed (6 assertions in 1 test case) --- Test case: './succeeding/conditions/computed ints' --------- +-- Test case: './succeeding/conditions/computed ints' ---------- ConditionTests.cpp:269: 54 == 6*9 succeeded for: 54 == 54 ---------------------------------------------------------------- Summary for test case './succeeding/conditions/computed ints': All tests passed (1 assertion in 1 test case) --- Test case: './succeeding/conditions/ptr' ------------------- +-- Test case: './succeeding/conditions/ptr' -------------------- ConditionTests.cpp:285: p == __null succeeded for: __null == 0 line 286: @@ -384,7 +384,7 @@ __null != p succeeded for: 0 != 0x Summary for test case './succeeding/conditions/ptr': All tests passed (8 assertions in 1 test case) --- Test case: './succeeding/conditions/not' ------------------- +-- Test case: './succeeding/conditions/not' -------------------- ConditionTests.cpp:317: false == false succeeded line 318: @@ -405,7 +405,7 @@ line 326: Summary for test case './succeeding/conditions/not': All tests passed (8 assertions in 1 test case) --- Test case: './failing/conditions/not' ---------------------- +-- Test case: './failing/conditions/not' ----------------------- ConditionTests.cpp:334: false != false failed line 335: @@ -426,7 +426,7 @@ line 343: Summary for test case './failing/conditions/not': 1 test case - failed (8 assertions - all failed) --- Test case: './succeeding/exceptions/explicit' -------------- +-- Test case: './succeeding/exceptions/explicit' --------------- ExceptionTests.cpp:39: thisThrows() succeeded line 40: @@ -437,7 +437,7 @@ thisThrows() succeeded Summary for test case './succeeding/exceptions/explicit': All tests passed (3 assertions in 1 test case) --- Test case: './failing/exceptions/explicit' ----------------- +-- Test case: './failing/exceptions/explicit' ------------------ ExceptionTests.cpp:47: thisThrows() failed with unexpected exception with message: 'expected exception' line 48: @@ -448,14 +448,14 @@ thisThrows() failed with unexpected exception with message: 'expected exception' Summary for test case './failing/exceptions/explicit': 1 test case - failed (3 assertions - all failed) --- Test case: './failing/exceptions/implicit' ----------------- +-- Test case: './failing/exceptions/implicit' ------------------ ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' ---------------------------------------------------------------- Summary for test case './failing/exceptions/implicit': 1 test case - failed (1 assertion - failed) --- Test case: './failing/exceptions/implicit/2' --------------- +-- Test case: './failing/exceptions/implicit/2' ---------------- ExceptionTests.cpp:60: 1 == 1 succeeded {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' @@ -463,7 +463,7 @@ ExceptionTests.cpp:60: Summary for test case './failing/exceptions/implicit/2': 1 test case - failed (2 assertions - 1 failed) --- Test case: './succeeding/exceptions/implicit' -------------- +-- Test case: './succeeding/exceptions/implicit' --------------- No assertions in test case, './succeeding/exceptions/implicit' @@ -471,42 +471,42 @@ No assertions in test case, './succeeding/exceptions/implicit' Summary for test case './succeeding/exceptions/implicit': 1 test case - failed (1 assertion - failed) --- Test case: './failing/exceptions/custom' ------------------- +-- Test case: './failing/exceptions/custom' -------------------- ExceptionTests.cpp:102: Unexpected exception with message: 'custom exception' ---------------------------------------------------------------- Summary for test case './failing/exceptions/custom': 1 test case - failed (1 assertion - failed) --- Test case: './failing/exceptions/custom/nothrow' ----------- +-- Test case: './failing/exceptions/custom/nothrow' ------------ ExceptionTests.cpp:109: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' ---------------------------------------------------------------- Summary for test case './failing/exceptions/custom/nothrow': 1 test case - failed (1 assertion - failed) --- Test case: './failing/exceptions/custom/throw' ------------- +-- Test case: './failing/exceptions/custom/throw' -------------- ExceptionTests.cpp:114: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' ---------------------------------------------------------------- Summary for test case './failing/exceptions/custom/throw': 1 test case - failed (1 assertion - failed) --- Test case: './failing/exceptions/custom/double' ------------ +-- Test case: './failing/exceptions/custom/double' ------------- ExceptionTests.cpp:118: Unexpected exception with message: '3.14' ---------------------------------------------------------------- Summary for test case './failing/exceptions/custom/double': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/exceptions/notimplemented' -------- +-- Test case: './succeeding/exceptions/notimplemented' --------- ExceptionTests.cpp:129: thisFunctionNotImplemented( 7 ) succeeded ---------------------------------------------------------------- Summary for test case './succeeding/exceptions/notimplemented': All tests passed (1 assertion in 1 test case) --- Test case: './succeeding/generators/1' --------------------- +-- Test case: './succeeding/generators/1' ---------------------- GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 line 27: @@ -728,7 +728,7 @@ multiply( j, 2 ) == j*2 succeeded for: 214 == 214 Summary for test case './succeeding/generators/1': All tests passed (144 assertions in 1 test case) --- Test case: './succeeding/message' -------------------------- +-- Test case: './succeeding/message' --------------------------- MessageTests.cpp:14: [warning: this is a warning] @@ -738,7 +738,7 @@ No assertions in test case, './succeeding/message' Summary for test case './succeeding/message': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/succeed' -------------------------- +-- Test case: './succeeding/succeed' --------------------------- MessageTests.cpp:18: succeeded [with message: this is a success] @@ -746,7 +746,7 @@ MessageTests.cpp:18: Summary for test case './succeeding/succeed': All tests passed (1 assertion in 1 test case) --- Test case: './failing/message/info/1' ---------------------- +-- Test case: './failing/message/info/1' ----------------------- MessageTests.cpp:23: [info: this message should be logged] line 24: @@ -757,7 +757,7 @@ a == 1 failed for: 2 == 1 Summary for test case './failing/message/info/1': 1 test case - failed (1 assertion - failed) --- Test case: './mixed/message/info/2' ------------------------ +-- Test case: './mixed/message/info/2' ------------------------- MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 line 31: @@ -776,22 +776,22 @@ a == 2 succeeded for: 2 == 2 Summary for test case './mixed/message/info/2': 1 test case - failed (4 assertions - 2 failed) --- Test case: './failing/message/fail' ------------------------ +-- Test case: './failing/message/fail' ------------------------- MessageTests.cpp:51: failed with message: 'This is a failure' ---------------------------------------------------------------- Summary for test case './failing/message/fail': 1 test case - failed (1 assertion - failed) --- Test case: './failing/message/sections' -------------------- --- Section: 'one' --------------------------------------------- +-- Test case: './failing/message/sections' --------------------- +-- Section: 'one' ---------------------------------------------- MessageTests.cpp:58: failed with message: 'Message from section one' ---------------------------------------------------------------- Summary for section 'one': 1 assertion - failed --- Section: 'two' --------------------------------------------- +-- Section: 'two' ---------------------------------------------- MessageTests.cpp:63: failed with message: 'Message from section two' ---------------------------------------------------------------- @@ -803,8 +803,8 @@ Summary for test case './failing/message/sections': 1 test case - failed (2 assertions - both failed) Message from section one --- Test case: './succeeding/message/sections/stdout' ---------- --- Section: 'one' --------------------------------------------- +-- Test case: './succeeding/message/sections/stdout' ----------- +-- Section: 'one' ---------------------------------------------- No assertions in section, 'one' @@ -813,7 +813,7 @@ Summary for section 'one': 1 assertion - failed Message from section two --- Section: 'two' --------------------------------------------- +-- Section: 'two' ---------------------------------------------- No assertions in section, 'two' @@ -825,7 +825,7 @@ Summary for section 'two': Summary for test case './succeeding/message/sections/stdout': 1 test case - failed (2 assertions - both failed) --- Test case: './mixed/message/scoped' ------------------------ +-- Test case: './mixed/message/scoped' ------------------------- MessageTests.cpp:86: i < 10 succeeded for: 0 < 10 i < 10 succeeded for: 1 < 10 @@ -844,7 +844,7 @@ i < 10 failed for: 10 < 10 Summary for test case './mixed/message/scoped': 1 test case - failed (11 assertions - 1 failed) --- Test case: './succeeding/nofail' --------------------------- +-- Test case: './succeeding/nofail' ---------------------------- MessageTests.cpp:92: 1 == 2 failed - but was ok @@ -854,8 +854,8 @@ No assertions in test case, './succeeding/nofail' Summary for test case './succeeding/nofail': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/Misc/Sections' -------------------- --- Section: 's1' ---------------------------------------------- +-- Test case: './succeeding/Misc/Sections' --------------------- +-- Section: 's1' ----------------------------------------------- MiscTests.cpp:25: a != b succeeded for: 1 != 2 line 26: @@ -864,7 +864,7 @@ b != a succeeded for: 2 != 1 Summary for section 's1': All 2 assertions passed --- Section: 's2' ---------------------------------------------- +-- Section: 's2' ----------------------------------------------- MiscTests.cpp:31: a != b succeeded for: 1 != 2 ---------------------------------------------------------------- @@ -875,13 +875,13 @@ Summary for section 's2': Summary for test case './succeeding/Misc/Sections': All tests passed (3 assertions in 1 test case) --- Test case: './succeeding/Misc/Sections/nested' ------------- --- Section: 's1' ---------------------------------------------- +-- Test case: './succeeding/Misc/Sections/nested' -------------- +-- Section: 's1' ----------------------------------------------- MiscTests.cpp:42: a != b succeeded for: 1 != 2 line 43: b != a succeeded for: 2 != 1 --- Section: 's2' ---------------------------------------------- +-- Section: 's2' ----------------------------------------------- line 47: a != b succeeded for: 1 != 2 ---------------------------------------------------------------- @@ -896,9 +896,9 @@ All 3 assertions passed Summary for test case './succeeding/Misc/Sections/nested': All tests passed (3 assertions in 1 test case) --- Test case: './mixed/Misc/Sections/nested2' ----------------- --- Section: 's1' ---------------------------------------------- --- Section: 's2' ---------------------------------------------- +-- Test case: './mixed/Misc/Sections/nested2' ------------------ +-- Section: 's1' ----------------------------------------------- +-- Section: 's2' ----------------------------------------------- MiscTests.cpp:61: a == b failed for: 1 == 2 ---------------------------------------------------------------- @@ -909,8 +909,8 @@ Summary for section 's2': Summary for section 's1': 1 assertion - failed --- Section: 's1' ---------------------------------------------- --- Section: 's3' ---------------------------------------------- +-- Section: 's1' ----------------------------------------------- +-- Section: 's3' ----------------------------------------------- MiscTests.cpp:66: a != b succeeded for: 1 != 2 ---------------------------------------------------------------- @@ -921,8 +921,8 @@ Summary for section 's3': Summary for section 's1': 1 assertion passed --- Section: 's1' ---------------------------------------------- --- Section: 's4' ---------------------------------------------- +-- Section: 's1' ----------------------------------------------- +-- Section: 's4' ----------------------------------------------- MiscTests.cpp:70: a < b succeeded for: 1 < 2 ---------------------------------------------------------------- @@ -937,9 +937,9 @@ Summary for section 's1': Summary for test case './mixed/Misc/Sections/nested2': 1 test case - failed (3 assertions - 1 failed) --- Test case: './Sections/nested/a/b' ------------------------- --- Section: 'c' ----------------------------------------------- --- Section: 'd (leaf)' ---------------------------------------- +-- Test case: './Sections/nested/a/b' -------------------------- +-- Section: 'c' ------------------------------------------------ +-- Section: 'd (leaf)' ----------------------------------------- No assertions in section, 'd (leaf)' @@ -951,8 +951,8 @@ Summary for section 'd (leaf)': Summary for section 'c': 1 assertion - failed --- Section: 'c' ----------------------------------------------- --- Section: 'e (leaf)' ---------------------------------------- +-- Section: 'c' ------------------------------------------------ +-- Section: 'e (leaf)' ----------------------------------------- No assertions in section, 'e (leaf)' @@ -964,7 +964,7 @@ Summary for section 'e (leaf)': Summary for section 'c': 1 assertion - failed --- Section: 'f (leaf)' ---------------------------------------- +-- Section: 'f (leaf)' ----------------------------------------- No assertions in section, 'f (leaf)' @@ -976,8 +976,8 @@ Summary for section 'f (leaf)': Summary for test case './Sections/nested/a/b': 1 test case - failed (3 assertions - all failed) --- Test case: './mixed/Misc/Sections/loops' ------------------- --- Section: 's1' ---------------------------------------------- +-- Test case: './mixed/Misc/Sections/loops' -------------------- +-- Section: 's1' ----------------------------------------------- MiscTests.cpp:103: b > a failed for: 0 > 1 ---------------------------------------------------------------- @@ -988,7 +988,7 @@ Summary for section 's1': Summary for test case './mixed/Misc/Sections/loops': 1 test case - failed (1 assertion - failed) --- Test case: './mixed/Misc/loops' ---------------------------- +-- Test case: './mixed/Misc/loops' ----------------------------- MiscTests.cpp:114: [info: Testing if fib[0] (1) is even] line 115: @@ -1020,7 +1020,7 @@ Summary for test case './mixed/Misc/loops': Some information An error --- Test case: './succeeding/Misc/stdout,stderr' --------------- +-- Test case: './succeeding/Misc/stdout,stderr' ---------------- No assertions in test case, './succeeding/Misc/stdout,stderr' @@ -1028,7 +1028,7 @@ No assertions in test case, './succeeding/Misc/stdout,stderr' Summary for test case './succeeding/Misc/stdout,stderr': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/Misc/null strings' ---------------- +-- Test case: './succeeding/Misc/null strings' ----------------- MiscTests.cpp:133: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} line 134: @@ -1037,7 +1037,7 @@ makeString( true ) == static_cast(__null) succeeded for: {null string} == Summary for test case './succeeding/Misc/null strings': All tests passed (2 assertions in 1 test case) --- Test case: './failing/info' -------------------------------- +-- Test case: './failing/info' --------------------------------- MiscTests.cpp:139: [info: hi] line 141: @@ -1048,7 +1048,7 @@ false failed Summary for test case './failing/info': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/checkedif' ------------------------ +-- Test case: './succeeding/checkedif' ------------------------- MiscTests.cpp:147: flag succeeded for: true line 155: @@ -1057,7 +1057,7 @@ testCheckedIf( true ) succeeded for: true Summary for test case './succeeding/checkedif': All tests passed (2 assertions in 1 test case) --- Test case: './failing/checkedif' --------------------------- +-- Test case: './failing/checkedif' ---------------------------- MiscTests.cpp:147: flag failed for: false line 160: @@ -1066,7 +1066,7 @@ testCheckedIf( false ) failed for: false Summary for test case './failing/checkedif': 1 test case - failed (2 assertions - both failed) --- Test case: './succeeding/checkedelse' ---------------------- +-- Test case: './succeeding/checkedelse' ----------------------- MiscTests.cpp:165: flag succeeded for: true line 173: @@ -1075,7 +1075,7 @@ testCheckedElse( true ) succeeded for: true Summary for test case './succeeding/checkedelse': All tests passed (2 assertions in 1 test case) --- Test case: './failing/checkedelse' ------------------------- +-- Test case: './failing/checkedelse' -------------------------- MiscTests.cpp:165: flag failed for: false line 178: @@ -1084,8 +1084,8 @@ testCheckedElse( false ) failed for: false Summary for test case './failing/checkedelse': 1 test case - failed (2 assertions - both failed) --- Test case: './misc/xmlentitycheck' ------------------------- --- Section: 'embedded xml' ------------------------------------ +-- Test case: './misc/xmlentitycheck' -------------------------- +-- Section: 'embedded xml' ------------------------------------- No assertions in section, 'embedded xml' @@ -1093,7 +1093,7 @@ No assertions in section, 'embedded xml' Summary for section 'embedded xml': 1 assertion - failed --- Section: 'encoded chars' ----------------------------------- +-- Section: 'encoded chars' ------------------------------------ No assertions in section, 'encoded chars' @@ -1105,7 +1105,7 @@ Summary for section 'encoded chars': Summary for test case './misc/xmlentitycheck': 1 test case - failed (2 assertions - both failed) --- Test case: './manual/onechar' ------------------------------ +-- Test case: './manual/onechar' ------------------------------- MiscTests.cpp:195: [info: 3] line 196: @@ -1114,14 +1114,14 @@ false failed Summary for test case './manual/onechar': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/atomic if' ------------------------ +-- Test case: './succeeding/atomic if' ------------------------- MiscTests.cpp:206: x == 0 succeeded for: 0 == 0 ---------------------------------------------------------------- Summary for test case './succeeding/atomic if': All tests passed (1 assertion in 1 test case) --- Test case: './succeeding/matchers' ------------------------- +-- Test case: './succeeding/matchers' -------------------------- MiscTests.cpp:216: testStringForMatching() Contains( "string" ) succeeded for: "this string contains 'abc' as a substring" contains: "string" @@ -1138,7 +1138,7 @@ testStringForMatching() EndsWith( "substring" ) succeeded for: Summary for test case './succeeding/matchers': All tests passed (4 assertions in 1 test case) --- Test case: './failing/matchers/Contains' ------------------- +-- Test case: './failing/matchers/Contains' -------------------- MiscTests.cpp:225: testStringForMatching() Contains( "not there" ) failed for: "this string contains 'abc' as a substring" contains: "not there" @@ -1146,7 +1146,7 @@ testStringForMatching() Contains( "not there" ) failed for: Summary for test case './failing/matchers/Contains': 1 test case - failed (1 assertion - failed) --- Test case: './failing/matchers/StartsWith' ----------------- +-- Test case: './failing/matchers/StartsWith' ------------------ MiscTests.cpp:230: testStringForMatching() StartsWith( "string" ) failed for: "this string contains 'abc' as a substring" starts with: "string" @@ -1154,7 +1154,7 @@ testStringForMatching() StartsWith( "string" ) failed for: Summary for test case './failing/matchers/StartsWith': 1 test case - failed (1 assertion - failed) --- Test case: './failing/matchers/EndsWith' ------------------- +-- Test case: './failing/matchers/EndsWith' -------------------- MiscTests.cpp:235: testStringForMatching() EndsWith( "this" ) failed for: "this string contains 'abc' as a substring" ends with: "this" @@ -1162,7 +1162,7 @@ testStringForMatching() EndsWith( "this" ) failed for: Summary for test case './failing/matchers/EndsWith': 1 test case - failed (1 assertion - failed) --- Test case: './failing/matchers/Equals' --------------------- +-- Test case: './failing/matchers/Equals' ---------------------- MiscTests.cpp:240: testStringForMatching() Equals( "something else" ) failed for: "this string contains 'abc' as a substring" equals: "something else" @@ -1170,7 +1170,7 @@ testStringForMatching() Equals( "something else" ) failed for: Summary for test case './failing/matchers/Equals': 1 test case - failed (1 assertion - failed) --- Test case: '/succeeding/matchers/AllOf' -------------------- +-- Test case: '/succeeding/matchers/AllOf' --------------------- MiscTests.cpp:245: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) @@ -1178,7 +1178,7 @@ testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "ab Summary for test case '/succeeding/matchers/AllOf': All tests passed (1 assertion in 1 test case) --- Test case: '/succeeding/matchers/AnyOf' -------------------- +-- Test case: '/succeeding/matchers/AnyOf' --------------------- MiscTests.cpp:249: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) @@ -1189,7 +1189,7 @@ testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( Summary for test case '/succeeding/matchers/AnyOf': All tests passed (2 assertions in 1 test case) --- Test case: './succeeding/matchers/Equals' ------------------ +-- Test case: './succeeding/matchers/Equals' ------------------- MiscTests.cpp:255: 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" @@ -1197,7 +1197,7 @@ testStringForMatching() Equals( "this string contains 'abc' as a substring" ) su Summary for test case './succeeding/matchers/Equals': All tests passed (1 assertion in 1 test case) --- Test case: 'example/factorial' ----------------------------- +-- Test case: 'example/factorial' ------------------------------ MiscTests.cpp:266: Factorial(0) == 1 succeeded for: 1 == 1 line 267: @@ -1212,7 +1212,7 @@ Factorial(10) == 3628800 succeeded for: 0x == 3628800 Summary for test case 'example/factorial': All tests passed (5 assertions in 1 test case) --- Test case: 'empty' ----------------------------------------- +-- Test case: 'empty' ------------------------------------------ No assertions in test case, 'empty' @@ -1220,7 +1220,7 @@ No assertions in test case, 'empty' Summary for test case 'empty': 1 test case - failed (1 assertion - failed) --- Test case: 'Nice descriptive name' ------------------------- +-- Test case: 'Nice descriptive name' -------------------------- MiscTests.cpp:279: [warning: This one ran] @@ -1230,7 +1230,7 @@ No assertions in test case, 'Nice descriptive name' Summary for test case 'Nice descriptive name': 1 test case - failed (1 assertion - failed) --- Test case: 'first tag' ------------------------------------- +-- Test case: 'first tag' -------------------------------------- No assertions in test case, 'first tag' @@ -1238,7 +1238,7 @@ No assertions in test case, 'first tag' Summary for test case 'first tag': 1 test case - failed (1 assertion - failed) --- Test case: 'second tag' ------------------------------------ +-- Test case: 'second tag' ------------------------------------- No assertions in test case, 'second tag' @@ -1246,9 +1246,9 @@ No assertions in test case, 'second tag' Summary for test case 'second tag': 1 test case - failed (1 assertion - failed) --- Test case: 'selftest/main' --------------------------------- --- Section: 'selftest/expected result' ------------------------ --- Section: 'selftest/expected result/failing tests' ---------- +-- Test case: 'selftest/main' ---------------------------------- +-- Section: 'selftest/expected result' ------------------------- +-- Section: 'selftest/expected result/failing tests' ----------- /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: succeeded [with message: Tests failed, as expected] @@ -1308,8 +1308,8 @@ All 25 assertions passed Summary for section 'selftest/expected result': All 25 assertions passed --- Section: 'selftest/expected result' ------------------------ --- Section: 'selftest/expected result/succeeding tests' ------- +-- Section: 'selftest/expected result' ------------------------- +-- Section: 'selftest/expected result/succeeding tests' -------- /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: succeeded [with message: Tests passed, as expected] @@ -1413,8 +1413,8 @@ Message from section one Message from section two Some information An error --- Section: 'selftest/test counts' ---------------------------- --- Section: 'selftest/test counts/succeeding tests' ----------- +-- Section: 'selftest/test counts' ----------------------------- +-- Section: 'selftest/test counts/succeeding tests' ------------ TestMain.cpp:40: totals.assertions.passed == 291 succeeded for: 291 == 291 line 41: @@ -1427,8 +1427,8 @@ All 2 assertions passed Summary for section 'selftest/test counts': All 2 assertions passed --- Section: 'selftest/test counts' ---------------------------- --- Section: 'selftest/test counts/failing tests' -------------- +-- Section: 'selftest/test counts' ----------------------------- +-- Section: 'selftest/test counts/failing tests' --------------- TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 line 48: @@ -1445,7 +1445,7 @@ All 2 assertions passed Summary for test case 'selftest/main': All tests passed (72 assertions in 1 test case) --- Test case: 'meta/Misc/Sections' ---------------------------- +-- Test case: 'meta/Misc/Sections' ----------------------------- TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 line 58: @@ -1454,8 +1454,8 @@ totals.assertions.failed == 1 succeeded for: 1 == 1 Summary for test case 'meta/Misc/Sections': All tests passed (2 assertions in 1 test case) --- Test case: 'selftest/parser/2' ----------------------------- --- Section: 'default' ----------------------------------------- +-- Test case: 'selftest/parser/2' ------------------------------ +-- Section: 'default' ------------------------------------------ TestMain.cpp:97: parseIntoConfig( argv, config ) succeeded line 99: @@ -1470,8 +1470,8 @@ config.reporter.empty() succeeded for: true Summary for section 'default': All 5 assertions passed --- Section: 'test lists' -------------------------------------- --- Section: '-t/1' -------------------------------------------- +-- Section: 'test lists' --------------------------------------- +-- Section: '-t/1' --------------------------------------------- TestMain.cpp:108: parseIntoConfig( argv, config ) succeeded line 110: @@ -1488,8 +1488,8 @@ All 4 assertions passed Summary for section 'test lists': All 4 assertions passed --- Section: 'test lists' -------------------------------------- --- Section: '-t/exclude:1' ------------------------------------ +-- Section: 'test lists' --------------------------------------- +-- Section: '-t/exclude:1' ------------------------------------- TestMain.cpp:116: parseIntoConfig( argv, config ) succeeded line 118: @@ -1506,8 +1506,8 @@ All 4 assertions passed Summary for section 'test lists': All 4 assertions passed --- Section: 'test lists' -------------------------------------- --- Section: '--test/1' ---------------------------------------- +-- Section: 'test lists' --------------------------------------- +-- Section: '--test/1' ----------------------------------------- TestMain.cpp:125: parseIntoConfig( argv, config ) succeeded line 127: @@ -1524,8 +1524,8 @@ All 4 assertions passed Summary for section 'test lists': All 4 assertions passed --- Section: 'test lists' -------------------------------------- --- Section: '--test/exclude:1' -------------------------------- +-- Section: 'test lists' --------------------------------------- +-- Section: '--test/exclude:1' --------------------------------- TestMain.cpp:134: parseIntoConfig( argv, config ) succeeded line 136: @@ -1542,8 +1542,8 @@ All 4 assertions passed Summary for section 'test lists': All 4 assertions passed --- Section: 'test lists' -------------------------------------- --- Section: '--test/exclude:2' -------------------------------- +-- Section: 'test lists' --------------------------------------- +-- Section: '--test/exclude:2' --------------------------------- TestMain.cpp:143: parseIntoConfig( argv, config ) succeeded line 145: @@ -1560,8 +1560,8 @@ All 4 assertions passed Summary for section 'test lists': All 4 assertions passed --- Section: 'test lists' -------------------------------------- --- Section: '-t/2' -------------------------------------------- +-- Section: 'test lists' --------------------------------------- +-- Section: '-t/2' --------------------------------------------- TestMain.cpp:152: parseIntoConfig( argv, config ) succeeded line 154: @@ -1580,8 +1580,8 @@ All 5 assertions passed Summary for section 'test lists': All 5 assertions passed --- Section: 'test lists' -------------------------------------- --- Section: '-t/0' -------------------------------------------- +-- Section: 'test lists' --------------------------------------- +-- Section: '-t/0' --------------------------------------------- TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" @@ -1593,8 +1593,8 @@ Summary for section '-t/0': Summary for section 'test lists': 1 assertion passed --- Section: 'reporter' ---------------------------------------- --- Section: '-r/basic' ---------------------------------------- +-- Section: 'reporter' ----------------------------------------- +-- Section: '-r/basic' ----------------------------------------- TestMain.cpp:169: parseIntoConfig( argv, config ) succeeded line 171: @@ -1607,8 +1607,8 @@ All 2 assertions passed Summary for section 'reporter': All 2 assertions passed --- Section: 'reporter' ---------------------------------------- --- Section: '-r/xml' ------------------------------------------ +-- Section: 'reporter' ----------------------------------------- +-- Section: '-r/xml' ------------------------------------------- TestMain.cpp:175: parseIntoConfig( argv, config ) succeeded line 177: @@ -1621,8 +1621,8 @@ All 2 assertions passed Summary for section 'reporter': All 2 assertions passed --- Section: 'reporter' ---------------------------------------- --- Section: '--reporter/junit' -------------------------------- +-- Section: 'reporter' ----------------------------------------- +-- Section: '--reporter/junit' --------------------------------- TestMain.cpp:181: parseIntoConfig( argv, config ) succeeded line 183: @@ -1635,8 +1635,8 @@ All 2 assertions passed Summary for section 'reporter': All 2 assertions passed --- Section: 'reporter' ---------------------------------------- --- Section: '-r/error' ---------------------------------------- +-- Section: 'reporter' ----------------------------------------- +-- Section: '-r/error' ----------------------------------------- TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" @@ -1648,8 +1648,8 @@ Summary for section '-r/error': Summary for section 'reporter': 1 assertion passed --- Section: 'debugger' ---------------------------------------- --- Section: '-b' ---------------------------------------------- +-- Section: 'debugger' ----------------------------------------- +-- Section: '-b' ----------------------------------------------- TestMain.cpp:194: parseIntoConfig( argv, config ) succeeded line 196: @@ -1662,8 +1662,8 @@ All 2 assertions passed Summary for section 'debugger': All 2 assertions passed --- Section: 'debugger' ---------------------------------------- --- Section: '--break' ----------------------------------------- +-- Section: 'debugger' ----------------------------------------- +-- Section: '--break' ------------------------------------------ TestMain.cpp:200: parseIntoConfig( argv, config ) succeeded line 202: @@ -1676,8 +1676,8 @@ All 2 assertions passed Summary for section 'debugger': All 2 assertions passed --- Section: 'debugger' ---------------------------------------- --- Section: '-b' ---------------------------------------------- +-- Section: 'debugger' ----------------------------------------- +-- Section: '-b' ----------------------------------------------- TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" @@ -1689,8 +1689,8 @@ Summary for section '-b': Summary for section 'debugger': 1 assertion passed --- Section: 'abort' ------------------------------------------- --- Section: '-a' ---------------------------------------------- +-- Section: 'abort' -------------------------------------------- +-- Section: '-a' ----------------------------------------------- TestMain.cpp:213: parseIntoConfig( argv, config ) succeeded line 215: @@ -1703,8 +1703,8 @@ All 2 assertions passed Summary for section 'abort': All 2 assertions passed --- Section: 'abort' ------------------------------------------- --- Section: '-a/2' -------------------------------------------- +-- Section: 'abort' -------------------------------------------- +-- Section: '-a/2' --------------------------------------------- TestMain.cpp:219: parseIntoConfig( argv, config ) succeeded line 221: @@ -1717,8 +1717,8 @@ All 2 assertions passed Summary for section 'abort': All 2 assertions passed --- Section: 'abort' ------------------------------------------- --- Section: '-a/error/0' -------------------------------------- +-- Section: 'abort' -------------------------------------------- +-- Section: '-a/error/0' --------------------------------------- TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" @@ -1730,8 +1730,8 @@ Summary for section '-a/error/0': Summary for section 'abort': 1 assertion passed --- Section: 'abort' ------------------------------------------- --- Section: '-a/error/non numeric' ---------------------------- +-- Section: 'abort' -------------------------------------------- +-- Section: '-a/error/non numeric' ----------------------------- TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" @@ -1743,8 +1743,8 @@ Summary for section '-a/error/non numeric': Summary for section 'abort': 1 assertion passed --- Section: 'abort' ------------------------------------------- --- Section: '-a/error/two args' ------------------------------- +-- Section: 'abort' -------------------------------------------- +-- Section: '-a/error/two args' -------------------------------- TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" @@ -1756,8 +1756,8 @@ Summary for section '-a/error/two args': Summary for section 'abort': 1 assertion passed --- Section: 'nothrow' ----------------------------------------- --- Section: '-nt' --------------------------------------------- +-- Section: 'nothrow' ------------------------------------------ +-- Section: '-nt' ---------------------------------------------- TestMain.cpp:240: parseIntoConfig( argv, config ) succeeded line 242: @@ -1770,8 +1770,8 @@ All 2 assertions passed Summary for section 'nothrow': All 2 assertions passed --- Section: 'nothrow' ----------------------------------------- --- Section: '--nothrow' --------------------------------------- +-- Section: 'nothrow' ------------------------------------------ +-- Section: '--nothrow' ---------------------------------------- TestMain.cpp:246: parseIntoConfig( argv, config ) succeeded line 248: @@ -1784,8 +1784,8 @@ All 2 assertions passed Summary for section 'nothrow': All 2 assertions passed --- Section: 'streams' ----------------------------------------- --- Section: '-o filename' ------------------------------------- +-- Section: 'streams' ------------------------------------------ +-- Section: '-o filename' -------------------------------------- TestMain.cpp:255: parseIntoConfig( argv, config ) succeeded line 257: @@ -1800,8 +1800,8 @@ All 3 assertions passed Summary for section 'streams': All 3 assertions passed --- Section: 'streams' ----------------------------------------- --- Section: '-o %stdout' -------------------------------------- +-- Section: 'streams' ------------------------------------------ +-- Section: '-o %stdout' --------------------------------------- TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded line 264: @@ -1816,8 +1816,8 @@ All 3 assertions passed Summary for section 'streams': All 3 assertions passed --- Section: 'streams' ----------------------------------------- --- Section: '--out' ------------------------------------------- +-- Section: 'streams' ------------------------------------------ +-- Section: '--out' -------------------------------------------- TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded line 271: @@ -1830,8 +1830,8 @@ All 2 assertions passed Summary for section 'streams': All 2 assertions passed --- Section: 'combinations' ------------------------------------ --- Section: '-a -b' ------------------------------------------- +-- Section: 'combinations' ------------------------------------- +-- Section: '-a -b' -------------------------------------------- TestMain.cpp:278: parseIntoConfig( argv, config ) succeeded line 280: @@ -1852,7 +1852,7 @@ All 4 assertions passed Summary for test case 'selftest/parser/2': All tests passed (66 assertions in 1 test case) --- Test case: 'selftest/test filter' -------------------------- +-- Test case: 'selftest/test filter' --------------------------- TestMain.cpp:291: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true line 292: @@ -1869,7 +1869,7 @@ matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: Summary for test case 'selftest/test filter': All tests passed (6 assertions in 1 test case) --- Test case: 'selftest/test filters' ------------------------- +-- Test case: 'selftest/test filters' -------------------------- TestMain.cpp:312: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true line 314: @@ -1882,7 +1882,7 @@ filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: fa Summary for test case 'selftest/test filters': All tests passed (4 assertions in 1 test case) --- Test case: 'selftest/filter/prefix wildcard' --------------- +-- Test case: 'selftest/filter/prefix wildcard' ---------------- TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true line 323: @@ -1891,7 +1891,7 @@ matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeede Summary for test case 'selftest/filter/prefix wildcard': All tests passed (2 assertions in 1 test case) --- Test case: 'selftest/filter/wildcard at both ends' --------- +-- Test case: 'selftest/filter/wildcard at both ends' ---------- TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true line 329: @@ -1904,7 +1904,7 @@ matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for Summary for test case 'selftest/filter/wildcard at both ends': All tests passed (4 assertions in 1 test case) --- Test case: 'selftest/option parsers' ----------------------- +-- Test case: 'selftest/option parsers' ------------------------ TestMain.cpp:351: opt.parseIntoConfig( parser, config ) succeeded line 353: @@ -1917,8 +1917,8 @@ config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true Summary for test case 'selftest/option parsers': All tests passed (4 assertions in 1 test case) --- Test case: 'selftest/tags' --------------------------------- --- Section: 'one tag' ----------------------------------------- +-- Test case: 'selftest/tags' ---------------------------------- +-- Section: 'one tag' ------------------------------------------ TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" line 370: @@ -1939,7 +1939,7 @@ oneTag.matchesTags( p5 ) == false succeeded for: false == false Summary for section 'one tag': All 8 assertions passed --- Section: 'two tags' ---------------------------------------- +-- Section: 'two tags' ----------------------------------------- TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" line 384: @@ -1964,7 +1964,7 @@ twoTags.matchesTags( p5 ) == true succeeded for: true == true Summary for section 'two tags': All 10 assertions passed --- Section: 'one tag with characters either side' ------------- +-- Section: 'one tag with characters either side' -------------- TestMain.cpp:399: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" line 400: @@ -1977,7 +1977,7 @@ oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 Summary for section 'one tag with characters either side': All 4 assertions passed --- Section: 'start of a tag, but not closed' ------------------ +-- Section: 'start of a tag, but not closed' ------------------- TestMain.cpp:409: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" line 410: @@ -1988,7 +1988,7 @@ oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 Summary for section 'start of a tag, but not closed': All 3 assertions passed --- Section: 'hidden' ------------------------------------------ +-- Section: 'hidden' ------------------------------------------- TestMain.cpp:417: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" line 418: @@ -2005,7 +2005,7 @@ All 4 assertions passed Summary for test case 'selftest/tags': All tests passed (29 assertions in 1 test case) --- Test case: './succeeding/Tricky/std::pair' ----------------- +-- Test case: './succeeding/Tricky/std::pair' ------------------ TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: @@ -2016,7 +2016,7 @@ TrickyTests.cpp:37: Summary for test case './succeeding/Tricky/std::pair': All tests passed (1 assertion in 1 test case) --- Test case: './inprogress/failing/Tricky/trailing expression' ---------------------------------------------------------------- +-- Test case: './inprogress/failing/Tricky/trailing expression' TrickyTests.cpp:55: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] @@ -2026,7 +2026,7 @@ No assertions in test case, './inprogress/failing/Tricky/trailing expression' Summary for test case './inprogress/failing/Tricky/trailing expression': 1 test case - failed (1 assertion - failed) --- Test case: './inprogress/failing/Tricky/compound lhs' ------ +-- Test case: './inprogress/failing/Tricky/compound lhs' ------- TrickyTests.cpp:71: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] @@ -2036,7 +2036,7 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' Summary for test case './inprogress/failing/Tricky/compound lhs': 1 test case - failed (1 assertion - failed) --- Test case: './failing/Tricky/non streamable type' ---------- +-- Test case: './failing/Tricky/non streamable type' ----------- TrickyTests.cpp:95: &o1 == &o2 failed for: 0x == 0x line 96: @@ -2045,14 +2045,14 @@ o1 == o2 failed for: {?} == {?} Summary for test case './failing/Tricky/non streamable type': 1 test case - failed (2 assertions - both failed) --- Test case: './failing/string literals' --------------------- +-- Test case: './failing/string literals' ---------------------- TrickyTests.cpp:106: std::string( "first" ) == "second" failed for: "first" == "second" ---------------------------------------------------------------- Summary for test case './failing/string literals': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/side-effects' --------------------- +-- Test case: './succeeding/side-effects' ---------------------- TrickyTests.cpp:119: i++ == 7 succeeded for: 7 == 7 line 120: @@ -2061,36 +2061,36 @@ i++ == 8 succeeded for: 8 == 8 Summary for test case './succeeding/side-effects': All tests passed (2 assertions in 1 test case) --- Test case: './succeeding/koenig' --------------------------- +-- Test case: './succeeding/koenig' ---------------------------- TrickyTests.cpp:186: 0x == o succeeded for: 0x == {?} ---------------------------------------------------------------- Summary for test case './succeeding/koenig': All tests passed (1 assertion in 1 test case) --- Test case: './succeeding/non-const==' ---------------------- +-- Test case: './succeeding/non-const==' ----------------------- TrickyTests.cpp:212: t == 1u succeeded for: {?} == 1 ---------------------------------------------------------------- Summary for test case './succeeding/non-const==': All tests passed (1 assertion in 1 test case) --- Test case: './succeeding/enum/bits' ------------------------ +-- Test case: './succeeding/enum/bits' ------------------------- TrickyTests.cpp:224: 0x == bit30and31 succeeded for: 0x == 3221225472 ---------------------------------------------------------------- Summary for test case './succeeding/enum/bits': All tests passed (1 assertion in 1 test case) --- Test case: './succeeding/boolean member' ------------------- +-- Test case: './succeeding/boolean member' -------------------- TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x != 0 ---------------------------------------------------------------- Summary for test case './succeeding/boolean member': All tests passed (1 assertion in 1 test case) --- Test case: './succeeding/unimplemented static bool' -------- --- Section: 'compare to true' --------------------------------- +-- Test case: './succeeding/unimplemented static bool' --------- +-- Section: 'compare to true' ---------------------------------- TrickyTests.cpp:259: is_true::value == true succeeded for: true == true line 260: @@ -2099,7 +2099,7 @@ true == is_true::value succeeded for: true == true Summary for section 'compare to true': All 2 assertions passed --- Section: 'compare to false' -------------------------------- +-- Section: 'compare to false' --------------------------------- TrickyTests.cpp:264: is_true::value == false succeeded for: false == false line 265: @@ -2108,21 +2108,21 @@ false == is_true::value succeeded for: false == false Summary for section 'compare to false': All 2 assertions passed --- Section: 'negation' ---------------------------------------- +-- Section: 'negation' ----------------------------------------- TrickyTests.cpp:270: !is_true::value succeeded for: true ---------------------------------------------------------------- Summary for section 'negation': 1 assertion passed --- Section: 'double negation' --------------------------------- +-- Section: 'double negation' ---------------------------------- TrickyTests.cpp:275: !!is_true::value succeeded for: true ---------------------------------------------------------------- Summary for section 'double negation': 1 assertion passed --- Section: 'direct' ------------------------------------------ +-- Section: 'direct' ------------------------------------------- TrickyTests.cpp:280: is_true::value succeeded for: true line 281: @@ -2135,7 +2135,7 @@ All 2 assertions passed Summary for test case './succeeding/unimplemented static bool': All tests passed (8 assertions in 1 test case) --- Test case: './succeeding/SafeBool' ------------------------- +-- Test case: './succeeding/SafeBool' -------------------------- TrickyTests.cpp:313: True succeeded for: true line 314: @@ -2146,10 +2146,10 @@ line 315: Summary for test case './succeeding/SafeBool': All tests passed (3 assertions in 1 test case) --- Test case: 'scenario name' --------------------------------- --- Section: 'This stuff exists' ------------------------------- --- Section: 'I do this' --------------------------------------- --- Section: 'it should do this' ------------------------------- +-- Test case: 'scenario name' ---------------------------------- +-- Section: 'This stuff exists' -------------------------------- +-- Section: 'I do this' ---------------------------------------- +-- Section: 'it should do this' -------------------------------- BDDTests.cpp:37: itDoesThis() succeeded for: true ---------------------------------------------------------------- @@ -2176,9 +2176,9 @@ Summary for group '~dummy': Summary for all tests in 'CatchSelfTest': 95 test cases - 44 failed (607 assertions - 101 failed) --- Started testing: 'CatchSelfTest' --------------------------- --- Group: '~dummy' -------------------------------------------- --- Test case: './succeeding/Approx/simple' -------------------- +-- Started testing: 'CatchSelfTest' ---------------------------- +-- Group: '~dummy' --------------------------------------------- +-- Test case: './succeeding/Approx/simple' --------------------- ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) line 21: @@ -2195,7 +2195,7 @@ Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 Summary for test case './succeeding/Approx/simple': All tests passed (6 assertions in 1 test case) --- Test case: './succeeding/Approx/epsilon' ------------------- +-- Test case: './succeeding/Approx/epsilon' -------------------- ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) line 39: @@ -2204,7 +2204,7 @@ d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) Summary for test case './succeeding/Approx/epsilon': All tests passed (2 assertions in 1 test case) --- Test case: './succeeding/Approx/float' --------------------- +-- Test case: './succeeding/Approx/float' ---------------------- ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) line 50: @@ -2213,7 +2213,7 @@ line 50: Summary for test case './succeeding/Approx/float': All tests passed (2 assertions in 1 test case) --- Test case: './succeeding/Approx/int' ----------------------- +-- Test case: './succeeding/Approx/int' ------------------------ ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded line 61: @@ -2222,7 +2222,7 @@ line 61: Summary for test case './succeeding/Approx/int': All tests passed (2 assertions in 1 test case) --- Test case: './succeeding/Approx/mixed' --------------------- +-- Test case: './succeeding/Approx/mixed' ---------------------- ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) line 76: @@ -2237,7 +2237,7 @@ dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) Summary for test case './succeeding/Approx/mixed': All tests passed (5 assertions in 1 test case) --- Test case: './succeeding/Approx/custom' -------------------- +-- Test case: './succeeding/Approx/custom' --------------------- ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) line 94: @@ -2258,35 +2258,35 @@ approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 Summary for test case './succeeding/Approx/custom': All tests passed (8 assertions in 1 test case) --- Test case: './succeeding/TestClass/succeedingCase' --------- +-- Test case: './succeeding/TestClass/succeedingCase' ---------- ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" ---------------------------------------------------------------- Summary for test case './succeeding/TestClass/succeedingCase': All tests passed (1 assertion in 1 test case) --- Test case: './failing/TestClass/failingCase' --------------- +-- Test case: './failing/TestClass/failingCase' ---------------- ClassTests.cpp:28: s == "world" failed for: "hello" == "world" ---------------------------------------------------------------- Summary for test case './failing/TestClass/failingCase': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/Fixture/succeedingCase' ----------- +-- Test case: './succeeding/Fixture/succeedingCase' ------------ ClassTests.cpp:47: m_a == 1 succeeded for: 1 == 1 ---------------------------------------------------------------- Summary for test case './succeeding/Fixture/succeedingCase': All tests passed (1 assertion in 1 test case) --- Test case: './failing/Fixture/failingCase' ----------------- +-- Test case: './failing/Fixture/failingCase' ------------------ ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 ---------------------------------------------------------------- Summary for test case './failing/Fixture/failingCase': 1 test case - failed (1 assertion - failed) --- Test case: './succeeding/conditions/equality' -------------- +-- Test case: './succeeding/conditions/equality' --------------- ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 line 56: @@ -2305,7 +2305,7 @@ x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) Summary for test case './succeeding/conditions/equality': All tests passed (7 assertions in 1 test case) --- Test case: './failing/conditions/equality' ----------------- +-- Test case: './failing/conditions/equality' ------------------ ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 line 72: From 86ad6348d4865d282c64d88883325c07b35754b3 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 14 Dec 2012 07:49:18 +0000 Subject: [PATCH 097/296] Split original/ expanded expressions over multiple lines --- include/internal/catch_tostring.hpp | 6 +- include/reporters/catch_reporter_console.hpp | 58 +- .../SelfTest/Baselines/approvedResults.txt | 3400 ++++++++++++----- 3 files changed, 2409 insertions(+), 1055 deletions(-) diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index 132d941a..b6802af9 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -121,7 +121,7 @@ inline std::string toString( bool value ) { inline std::string toString( char value ) { return value < ' ' - ? toString( (unsigned int)value ) + ? toString( static_cast( value ) ) : Detail::makeString( value ); } @@ -129,6 +129,10 @@ inline std::string toString( signed char value ) { return toString( static_cast( value ) ); } +inline std::string toString( unsigned char value ) { + return toString( static_cast( value ) ); +} + #ifdef CATCH_CONFIG_CPP11_NULLPTR inline std::string toString( std::nullptr_t ) { return "nullptr"; diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 84e5ea05..de523044 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -66,6 +66,14 @@ namespace Catch { static const std::string doubleDashes = "================================================================"; return doubleDashes; } + static std::string const& getSpaces() { + static const std::string spaces = " "; + return spaces; + } + static std::string getSpaces( int spaces ) { + return getSpaces().substr( 0, spaces > 0 ? static_cast( spaces ) : 0 ); + } + void printHeader( std::string const& _type, std::string const& _name ) { std::size_t labelLen = _type.size() + _name.size() + 8; std::size_t dashLen = getDashes().size(); @@ -97,18 +105,18 @@ namespace Catch { lazyPrint(); - printLineInfo( result.getSourceInfo() ); + int inset = printLineInfo( result.getSourceInfo() ); if( result.hasExpression() ) { TextColour colour( TextColour::OriginalExpression ); - stream << result.getExpression(); + stream << result.getExpression() << "\n"; if( result.succeeded() ) { TextColour successColour( TextColour::Success ); - stream << " succeeded"; + stream << "succeeded"; } else { TextColour errorColour( TextColour::Error ); - stream << " failed"; + stream << "failed"; if( result.isOk() ) { TextColour okAnywayColour( TextColour::Success ); stream << " - but was ok"; @@ -182,17 +190,12 @@ namespace Catch { } if( result.hasExpandedExpression() ) { - stream << " for: "; - if( result.getExpandedExpression().size() > 40 ) { - stream << "\n"; - if( result.getExpandedExpression().size() < 70 ) - stream << "\t"; - } + stream << "\nfor: "; TextColour colour( TextColour::ReconstructedExpression ); - stream << result.getExpandedExpression(); + stream << getSpaces( inset-5 ) << result.getExpandedExpression(); } - stream << std::endl; + stream << "\n" << std::endl; } void streamVariableLengthText( std::string const& prefix, std::string const& text ) { @@ -319,21 +322,26 @@ namespace Catch { void printSummarDivider() { stream << "----------------------------------------------------------------\n"; } + static int countDigits( std::size_t number ) { + int digits = 1; + for( ; number != 0; digits++, number /= 10 ); + return digits; + } - void printLineInfo( SourceLineInfo const& lineInfo ) { - if( !lineInfo.empty() ) { - if( m_lastPrintedLine.empty() || - m_lastPrintedLine.file != lineInfo.file || - abs( static_cast( m_lastPrintedLine.line ) - static_cast( lineInfo.line ) ) > 20 ) { - TextColour colour( TextColour::FileName ); - stream << lineInfo << "\n"; - m_lastPrintedLine = lineInfo; - } - else if( lineInfo.line != m_lastPrintedLine.line ) { - TextColour colour( TextColour::FileName ); - stream << "line " << lineInfo.line << ":\n"; - } + // Returns number of characters printed + int printLineInfo( SourceLineInfo const& lineInfo ) { + if( lineInfo.empty() ) + return 0; + if( m_lastPrintedLine.empty() || + m_lastPrintedLine.file != lineInfo.file || + abs( static_cast( m_lastPrintedLine.line ) - static_cast( lineInfo.line ) ) > 20 ) { + TextColour colour( TextColour::FileName ); + stream << lineInfo << "\n"; } + TextColour colour( TextColour::FileName ); + stream << "[" << lineInfo.line << "] "; + m_lastPrintedLine = lineInfo; + return 3 + countDigits( lineInfo.line ); } void resetLastPrintedLine() { m_lastPrintedLine = SourceLineInfo(); diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 2840f660..28c64f08 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -2,463 +2,798 @@ -- Group: '~dummy' --------------------------------------------- -- Test case: './succeeding/Approx/simple' --------------------- ApproxTests.cpp:20: -d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) -line 21: -d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) -line 22: -d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) -line 24: -Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 -line 25: -Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 -line 26: -Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 +[20] d == Approx( 1.23 ) +succeeded +for: 1.23 == Approx( 1.23 ) + +[21] d != Approx( 1.22 ) +succeeded +for: 1.23 != Approx( 1.22 ) + +[22] d != Approx( 1.24 ) +succeeded +for: 1.23 != Approx( 1.24 ) + +[24] Approx( d ) == 1.23 +succeeded +for: Approx( 1.23 ) == 1.23 + +[25] Approx( d ) != 1.22 +succeeded +for: Approx( 1.23 ) != 1.22 + +[26] Approx( d ) != 1.24 +succeeded +for: Approx( 1.23 ) != 1.24 + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/simple': All tests passed (6 assertions in 1 test case) -- Test case: './succeeding/Approx/epsilon' -------------------- ApproxTests.cpp:38: -d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) -line 39: -d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) +[38] d != Approx( 1.231 ) +succeeded +for: 1.23 != Approx( 1.231 ) + +[39] d == Approx( 1.231 ).epsilon( 0.1 ) +succeeded +for: 1.23 == Approx( 1.231 ) + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/epsilon': All tests passed (2 assertions in 1 test case) -- Test case: './succeeding/Approx/float' ---------------------- ApproxTests.cpp:49: -1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) -line 50: -0.0f == Approx( 0.0f ) succeeded for: 0 == Approx( 0 ) +[49] 1.23f == Approx( 1.23f ) +succeeded +for: 1.23 == Approx( 1.23 ) + +[50] 0.0f == Approx( 0.0f ) +succeeded +for: 0 == Approx( 0 ) + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/float': All tests passed (2 assertions in 1 test case) -- Test case: './succeeding/Approx/int' ------------------------ ApproxTests.cpp:60: -1 == Approx( 1 ) succeeded -line 61: -0 == Approx( 0 ) succeeded +[60] 1 == Approx( 1 ) +succeeded + +[61] 0 == Approx( 0 ) +succeeded + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/int': All tests passed (2 assertions in 1 test case) -- Test case: './succeeding/Approx/mixed' ---------------------- ApproxTests.cpp:75: -1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) -line 76: -0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) -line 77: -0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) -line 78: -1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) -line 79: -dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) +[75] 1.0f == Approx( 1 ) +succeeded +for: 1 == Approx( 1 ) + +[76] 0 == Approx( dZero) +succeeded +for: 0 == Approx( 0 ) + +[77] 0 == Approx( dSmall ).epsilon( 0.001 ) +succeeded +for: 0 == Approx( 1e-05 ) + +[78] 1.234f == Approx( dMedium ) +succeeded +for: 1.234 == Approx( 1.234 ) + +[79] dMedium == Approx( 1.234f ) +succeeded +for: 1.234 == Approx( 1.234 ) + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/mixed': All tests passed (5 assertions in 1 test case) -- Test case: './succeeding/Approx/custom' --------------------- ApproxTests.cpp:93: -d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) -line 94: -d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) -line 95: -d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) -line 96: -d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) -line 98: -approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 -line 99: -approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 -line 100: -approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 -line 101: -approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 +[93] d == approx( 1.23 ) +succeeded +for: 1.23 == Approx( 1.23 ) + +[94] d == approx( 1.22 ) +succeeded +for: 1.23 == Approx( 1.22 ) + +[95] d == approx( 1.24 ) +succeeded +for: 1.23 == Approx( 1.24 ) + +[96] d != approx( 1.25 ) +succeeded +for: 1.23 != Approx( 1.25 ) + +[98] approx( d ) == 1.23 +succeeded +for: Approx( 1.23 ) == 1.23 + +[99] approx( d ) == 1.22 +succeeded +for: Approx( 1.23 ) == 1.22 + +[100] approx( d ) == 1.24 +succeeded +for: Approx( 1.23 ) == 1.24 + +[101] approx( d ) != 1.25 +succeeded +for: Approx( 1.23 ) != 1.25 + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/custom': All tests passed (8 assertions in 1 test case) -- Test case: './succeeding/TestClass/succeedingCase' ---------- ClassTests.cpp:24: -s == "hello" succeeded for: "hello" == "hello" +[24] s == "hello" +succeeded +for: "hello" == "hello" + ---------------------------------------------------------------- Summary for test case './succeeding/TestClass/succeedingCase': All tests passed (1 assertion in 1 test case) -- Test case: './failing/TestClass/failingCase' ---------------- ClassTests.cpp:28: -s == "world" failed for: "hello" == "world" +[28] s == "world" +failed +for: "hello" == "world" + ---------------------------------------------------------------- Summary for test case './failing/TestClass/failingCase': 1 test case - failed (1 assertion - failed) -- Test case: './succeeding/Fixture/succeedingCase' ------------ ClassTests.cpp:47: -m_a == 1 succeeded for: 1 == 1 +[47] m_a == 1 +succeeded +for: 1 == 1 + ---------------------------------------------------------------- Summary for test case './succeeding/Fixture/succeedingCase': All tests passed (1 assertion in 1 test case) -- Test case: './failing/Fixture/failingCase' ------------------ ClassTests.cpp:55: -m_a == 2 failed for: 1 == 2 +[55] m_a == 2 +failed +for: 1 == 2 + ---------------------------------------------------------------- Summary for test case './failing/Fixture/failingCase': 1 test case - failed (1 assertion - failed) -- Test case: './succeeding/conditions/equality' --------------- ConditionTests.cpp:55: -data.int_seven == 7 succeeded for: 7 == 7 -line 56: -data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) -line 57: -data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) -line 58: -data.str_hello == "hello" succeeded for: "hello" == "hello" -line 59: -"hello" == data.str_hello succeeded for: "hello" == "hello" -line 60: -data.str_hello.size() == 5 succeeded for: 5 == 5 -line 63: -x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) +[55] data.int_seven == 7 +succeeded +for: 7 == 7 + +[56] data.float_nine_point_one == Approx( 9.1f ) +succeeded +for: 9.1 == Approx( 9.1 ) + +[57] data.double_pi == Approx( 3.1415926535 ) +succeeded +for: 3.14159 == Approx( 3.14159 ) + +[58] data.str_hello == "hello" +succeeded +for: "hello" == "hello" + +[59] "hello" == data.str_hello +succeeded +for: "hello" == "hello" + +[60] data.str_hello.size() == 5 +succeeded +for: 5 == 5 + +[63] x == Approx( 1.3 ) +succeeded +for: 1.3 == Approx( 1.3 ) + ---------------------------------------------------------------- Summary for test case './succeeding/conditions/equality': All tests passed (7 assertions in 1 test case) -- Test case: './failing/conditions/equality' ------------------ ConditionTests.cpp:71: -data.int_seven == 6 failed for: 7 == 6 -line 72: -data.int_seven == 8 failed for: 7 == 8 -line 73: -data.int_seven == 0 failed for: 7 == 0 -line 74: -data.float_nine_point_one == Approx( 9.11f ) failed for: 9.1 == Approx( 9.11 ) -line 75: -data.float_nine_point_one == Approx( 9.0f ) failed for: 9.1 == Approx( 9 ) -line 76: -data.float_nine_point_one == Approx( 1 ) failed for: 9.1 == Approx( 1 ) -line 77: -data.float_nine_point_one == Approx( 0 ) failed for: 9.1 == Approx( 0 ) -line 78: -data.double_pi == Approx( 3.1415 ) failed for: 3.14159 == Approx( 3.1415 ) -line 79: -data.str_hello == "goodbye" failed for: "hello" == "goodbye" -line 80: -data.str_hello == "hell" failed for: "hello" == "hell" -line 81: -data.str_hello == "hello1" failed for: "hello" == "hello1" -line 82: -data.str_hello.size() == 6 failed for: 5 == 6 -line 85: -x == Approx( 1.301 ) failed for: 1.3 == Approx( 1.301 ) +[71] data.int_seven == 6 +failed +for: 7 == 6 + +[72] data.int_seven == 8 +failed +for: 7 == 8 + +[73] data.int_seven == 0 +failed +for: 7 == 0 + +[74] data.float_nine_point_one == Approx( 9.11f ) +failed +for: 9.1 == Approx( 9.11 ) + +[75] data.float_nine_point_one == Approx( 9.0f ) +failed +for: 9.1 == Approx( 9 ) + +[76] data.float_nine_point_one == Approx( 1 ) +failed +for: 9.1 == Approx( 1 ) + +[77] data.float_nine_point_one == Approx( 0 ) +failed +for: 9.1 == Approx( 0 ) + +[78] data.double_pi == Approx( 3.1415 ) +failed +for: 3.14159 == Approx( 3.1415 ) + +[79] data.str_hello == "goodbye" +failed +for: "hello" == "goodbye" + +[80] data.str_hello == "hell" +failed +for: "hello" == "hell" + +[81] data.str_hello == "hello1" +failed +for: "hello" == "hello1" + +[82] data.str_hello.size() == 6 +failed +for: 5 == 6 + +[85] x == Approx( 1.301 ) +failed +for: 1.3 == Approx( 1.301 ) + ---------------------------------------------------------------- Summary for test case './failing/conditions/equality': 1 test case - failed (13 assertions - all failed) -- Test case: './succeeding/conditions/inequality' ------------- ConditionTests.cpp:93: -data.int_seven != 6 succeeded for: 7 != 6 -line 94: -data.int_seven != 8 succeeded for: 7 != 8 -line 95: -data.float_nine_point_one != Approx( 9.11f ) succeeded for: 9.1 != Approx( 9.11 ) -line 96: -data.float_nine_point_one != Approx( 9.0f ) succeeded for: 9.1 != Approx( 9 ) -line 97: -data.float_nine_point_one != Approx( 1 ) succeeded for: 9.1 != Approx( 1 ) -line 98: -data.float_nine_point_one != Approx( 0 ) succeeded for: 9.1 != Approx( 0 ) -line 99: -data.double_pi != Approx( 3.1415 ) succeeded for: 3.14159 != Approx( 3.1415 ) -line 100: -data.str_hello != "goodbye" succeeded for: "hello" != "goodbye" -line 101: -data.str_hello != "hell" succeeded for: "hello" != "hell" -line 102: -data.str_hello != "hello1" succeeded for: "hello" != "hello1" -line 103: -data.str_hello.size() != 6 succeeded for: 5 != 6 +[93] data.int_seven != 6 +succeeded +for: 7 != 6 + +[94] data.int_seven != 8 +succeeded +for: 7 != 8 + +[95] data.float_nine_point_one != Approx( 9.11f ) +succeeded +for: 9.1 != Approx( 9.11 ) + +[96] data.float_nine_point_one != Approx( 9.0f ) +succeeded +for: 9.1 != Approx( 9 ) + +[97] data.float_nine_point_one != Approx( 1 ) +succeeded +for: 9.1 != Approx( 1 ) + +[98] data.float_nine_point_one != Approx( 0 ) +succeeded +for: 9.1 != Approx( 0 ) + +[99] data.double_pi != Approx( 3.1415 ) +succeeded +for: 3.14159 != Approx( 3.1415 ) + +[100] data.str_hello != "goodbye" +succeeded +for: "hello" != "goodbye" + +[101] data.str_hello != "hell" +succeeded +for: "hello" != "hell" + +[102] data.str_hello != "hello1" +succeeded +for: "hello" != "hello1" + +[103] data.str_hello.size() != 6 +succeeded +for: 5 != 6 + ---------------------------------------------------------------- Summary for test case './succeeding/conditions/inequality': All tests passed (11 assertions in 1 test case) -- Test case: './failing/conditions/inequality' ---------------- ConditionTests.cpp:111: -data.int_seven != 7 failed for: 7 != 7 -line 112: -data.float_nine_point_one != Approx( 9.1f ) failed for: 9.1 != Approx( 9.1 ) -line 113: -data.double_pi != Approx( 3.1415926535 ) failed for: 3.14159 != Approx( 3.14159 ) -line 114: -data.str_hello != "hello" failed for: "hello" != "hello" -line 115: -data.str_hello.size() != 5 failed for: 5 != 5 +[111] data.int_seven != 7 +failed +for: 7 != 7 + +[112] data.float_nine_point_one != Approx( 9.1f ) +failed +for: 9.1 != Approx( 9.1 ) + +[113] data.double_pi != Approx( 3.1415926535 ) +failed +for: 3.14159 != Approx( 3.14159 ) + +[114] data.str_hello != "hello" +failed +for: "hello" != "hello" + +[115] data.str_hello.size() != 5 +failed +for: 5 != 5 + ---------------------------------------------------------------- Summary for test case './failing/conditions/inequality': 1 test case - failed (5 assertions - all failed) -- Test case: './succeeding/conditions/ordered' ---------------- ConditionTests.cpp:124: -data.int_seven < 8 succeeded for: 7 < 8 -line 125: -data.int_seven > 6 succeeded for: 7 > 6 -line 126: -data.int_seven > 0 succeeded for: 7 > 0 -line 127: -data.int_seven > -1 succeeded for: 7 > -1 -line 129: -data.int_seven >= 7 succeeded for: 7 >= 7 -line 130: -data.int_seven >= 6 succeeded for: 7 >= 6 -line 131: -data.int_seven <= 7 succeeded for: 7 <= 7 -line 132: -data.int_seven <= 8 succeeded for: 7 <= 8 -line 134: -data.float_nine_point_one > 9 succeeded for: 9.1 > 9 -line 135: -data.float_nine_point_one < 10 succeeded for: 9.1 < 10 -line 136: -data.float_nine_point_one < 9.2 succeeded for: 9.1 < 9.2 -line 138: -data.str_hello <= "hello" succeeded for: "hello" <= "hello" -line 139: -data.str_hello >= "hello" succeeded for: "hello" >= "hello" -line 141: -data.str_hello < "hellp" succeeded for: "hello" < "hellp" -line 142: -data.str_hello < "zebra" succeeded for: "hello" < "zebra" -line 143: -data.str_hello > "hellm" succeeded for: "hello" > "hellm" -line 144: -data.str_hello > "a" succeeded for: "hello" > "a" +[124] data.int_seven < 8 +succeeded +for: 7 < 8 + +[125] data.int_seven > 6 +succeeded +for: 7 > 6 + +[126] data.int_seven > 0 +succeeded +for: 7 > 0 + +[127] data.int_seven > -1 +succeeded +for: 7 > -1 + +[129] data.int_seven >= 7 +succeeded +for: 7 >= 7 + +[130] data.int_seven >= 6 +succeeded +for: 7 >= 6 + +[131] data.int_seven <= 7 +succeeded +for: 7 <= 7 + +[132] data.int_seven <= 8 +succeeded +for: 7 <= 8 + +[134] data.float_nine_point_one > 9 +succeeded +for: 9.1 > 9 + +[135] data.float_nine_point_one < 10 +succeeded +for: 9.1 < 10 + +[136] data.float_nine_point_one < 9.2 +succeeded +for: 9.1 < 9.2 + +[138] data.str_hello <= "hello" +succeeded +for: "hello" <= "hello" + +[139] data.str_hello >= "hello" +succeeded +for: "hello" >= "hello" + +[141] data.str_hello < "hellp" +succeeded +for: "hello" < "hellp" + +[142] data.str_hello < "zebra" +succeeded +for: "hello" < "zebra" + +[143] data.str_hello > "hellm" +succeeded +for: "hello" > "hellm" + +[144] data.str_hello > "a" +succeeded +for: "hello" > "a" + ---------------------------------------------------------------- Summary for test case './succeeding/conditions/ordered': All tests passed (17 assertions in 1 test case) -- Test case: './failing/conditions/ordered' ------------------- ConditionTests.cpp:152: -data.int_seven > 7 failed for: 7 > 7 -line 153: -data.int_seven < 7 failed for: 7 < 7 -line 154: -data.int_seven > 8 failed for: 7 > 8 -line 155: -data.int_seven < 6 failed for: 7 < 6 -line 156: -data.int_seven < 0 failed for: 7 < 0 -line 157: -data.int_seven < -1 failed for: 7 < -1 -line 159: -data.int_seven >= 8 failed for: 7 >= 8 -line 160: -data.int_seven <= 6 failed for: 7 <= 6 -line 162: -data.float_nine_point_one < 9 failed for: 9.1 < 9 -line 163: -data.float_nine_point_one > 10 failed for: 9.1 > 10 -line 164: -data.float_nine_point_one > 9.2 failed for: 9.1 > 9.2 -line 166: -data.str_hello > "hello" failed for: "hello" > "hello" -line 167: -data.str_hello < "hello" failed for: "hello" < "hello" -line 168: -data.str_hello > "hellp" failed for: "hello" > "hellp" -line 169: -data.str_hello > "z" failed for: "hello" > "z" -line 170: -data.str_hello < "hellm" failed for: "hello" < "hellm" -line 171: -data.str_hello < "a" failed for: "hello" < "a" -ConditionTests.cpp:173: -data.str_hello >= "z" failed for: "hello" >= "z" -line 174: -data.str_hello <= "a" failed for: "hello" <= "a" +[152] data.int_seven > 7 +failed +for: 7 > 7 + +[153] data.int_seven < 7 +failed +for: 7 < 7 + +[154] data.int_seven > 8 +failed +for: 7 > 8 + +[155] data.int_seven < 6 +failed +for: 7 < 6 + +[156] data.int_seven < 0 +failed +for: 7 < 0 + +[157] data.int_seven < -1 +failed +for: 7 < -1 + +[159] data.int_seven >= 8 +failed +for: 7 >= 8 + +[160] data.int_seven <= 6 +failed +for: 7 <= 6 + +[162] data.float_nine_point_one < 9 +failed +for: 9.1 < 9 + +[163] data.float_nine_point_one > 10 +failed +for: 9.1 > 10 + +[164] data.float_nine_point_one > 9.2 +failed +for: 9.1 > 9.2 + +[166] data.str_hello > "hello" +failed +for: "hello" > "hello" + +[167] data.str_hello < "hello" +failed +for: "hello" < "hello" + +[168] data.str_hello > "hellp" +failed +for: "hello" > "hellp" + +[169] data.str_hello > "z" +failed +for: "hello" > "z" + +[170] data.str_hello < "hellm" +failed +for: "hello" < "hellm" + +[171] data.str_hello < "a" +failed +for: "hello" < "a" + +[173] data.str_hello >= "z" +failed +for: "hello" >= "z" + +[174] data.str_hello <= "a" +failed +for: "hello" <= "a" + ---------------------------------------------------------------- Summary for test case './failing/conditions/ordered': 1 test case - failed (19 assertions - all failed) -- Test case: './succeeding/conditions/int literals' ----------- ConditionTests.cpp:188: -i == 1 succeeded for: 1 == 1 -line 189: -ui == 2 succeeded for: 2 == 2 -line 190: -l == 3 succeeded for: 3 == 3 -line 191: -ul == 4 succeeded for: 4 == 4 -line 192: -c == 5 succeeded for: 5 == 5 -line 193: -uc == 6 succeeded for:  == 6 -line 195: -1 == i succeeded for: 1 == 1 -line 196: -2 == ui succeeded for: 2 == 2 -line 197: -3 == l succeeded for: 3 == 3 -line 198: -4 == ul succeeded for: 4 == 4 -line 199: -5 == c succeeded for: 5 == 5 -line 200: -6 == uc succeeded for: 6 ==  -line 202: -(std::numeric_limits::max)() > ul succeeded for: 0x > 4 +[188] i == 1 +succeeded +for: 1 == 1 + +[189] ui == 2 +succeeded +for: 2 == 2 + +[190] l == 3 +succeeded +for: 3 == 3 + +[191] ul == 4 +succeeded +for: 4 == 4 + +[192] c == 5 +succeeded +for: 5 == 5 + +[193] uc == 6 +succeeded +for: 6 == 6 + +[195] 1 == i +succeeded +for: 1 == 1 + +[196] 2 == ui +succeeded +for: 2 == 2 + +[197] 3 == l +succeeded +for: 3 == 3 + +[198] 4 == ul +succeeded +for: 4 == 4 + +[199] 5 == c +succeeded +for: 5 == 5 + +[200] 6 == uc +succeeded +for: 6 == 6 + +[202] (std::numeric_limits::max)() > ul +succeeded +for: 0x > 4 + ---------------------------------------------------------------- Summary for test case './succeeding/conditions/int literals': All tests passed (13 assertions in 1 test case) -- Test case: './succeeding/conditions//long_to_unsigned_x' ---- ConditionTests.cpp:223: -long_var == unsigned_char_var succeeded for: 1 ==  -line 224: -long_var == unsigned_short_var succeeded for: 1 == 1 -line 225: -long_var == unsigned_int_var succeeded for: 1 == 1 -line 226: -long_var == unsigned_long_var succeeded for: 1 == 1 +[223] long_var == unsigned_char_var +succeeded +for: 1 == 1 + +[224] long_var == unsigned_short_var +succeeded +for: 1 == 1 + +[225] long_var == unsigned_int_var +succeeded +for: 1 == 1 + +[226] long_var == unsigned_long_var +succeeded +for: 1 == 1 + ---------------------------------------------------------------- Summary for test case './succeeding/conditions//long_to_unsigned_x': All tests passed (4 assertions in 1 test case) -- Test case: './succeeding/conditions/const ints to int literal' ConditionTests.cpp:237: -unsigned_char_var == 1 succeeded for:  == 1 -line 238: -unsigned_short_var == 1 succeeded for: 1 == 1 -line 239: -unsigned_int_var == 1 succeeded for: 1 == 1 -line 240: -unsigned_long_var == 1 succeeded for: 1 == 1 +[237] unsigned_char_var == 1 +succeeded +for: 1 == 1 + +[238] unsigned_short_var == 1 +succeeded +for: 1 == 1 + +[239] unsigned_int_var == 1 +succeeded +for: 1 == 1 + +[240] unsigned_long_var == 1 +succeeded +for: 1 == 1 + ---------------------------------------------------------------- Summary for test case './succeeding/conditions/const ints to int literal': All tests passed (4 assertions in 1 test case) -- Test case: './succeeding/conditions/negative ints' ---------- ConditionTests.cpp:246: -( -1 > 2u ) succeeded for: true -line 247: --1 > 2u succeeded for: -1 > 2 -line 249: -( 2u < -1 ) succeeded for: true -line 250: -2u < -1 succeeded for: 2 < -1 -line 253: -( minInt > 2u ) succeeded for: true -line 254: -minInt > 2u succeeded for: -2147483648 > 2 +[246] ( -1 > 2u ) +succeeded +for: true + +[247] -1 > 2u +succeeded +for: -1 > 2 + +[249] ( 2u < -1 ) +succeeded +for: true + +[250] 2u < -1 +succeeded +for: 2 < -1 + +[253] ( minInt > 2u ) +succeeded +for: true + +[254] minInt > 2u +succeeded +for: -2147483648 > 2 + ---------------------------------------------------------------- Summary for test case './succeeding/conditions/negative ints': All tests passed (6 assertions in 1 test case) -- Test case: './succeeding/conditions/computed ints' ---------- ConditionTests.cpp:269: -54 == 6*9 succeeded for: 54 == 54 +[269] 54 == 6*9 +succeeded +for: 54 == 54 + ---------------------------------------------------------------- Summary for test case './succeeding/conditions/computed ints': All tests passed (1 assertion in 1 test case) -- Test case: './succeeding/conditions/ptr' -------------------- ConditionTests.cpp:285: -p == __null succeeded for: __null == 0 -line 286: -p == pNULL succeeded for: __null == __null -line 291: -p != __null succeeded for: 0x != 0 -line 294: -cp != __null succeeded for: 0x != 0 -line 297: -cpc != __null succeeded for: 0x != 0 -line 299: -returnsNull() == __null succeeded for: {null string} == 0 -line 300: -returnsConstNull() == __null succeeded for: {null string} == 0 -line 302: -__null != p succeeded for: 0 != 0x +[285] p == __null +succeeded +for: __null == 0 + +[286] p == pNULL +succeeded +for: __null == __null + +[291] p != __null +succeeded +for: 0x != 0 + +[294] cp != __null +succeeded +for: 0x != 0 + +[297] cpc != __null +succeeded +for: 0x != 0 + +[299] returnsNull() == __null +succeeded +for: {null string} == 0 + +[300] returnsConstNull() == __null +succeeded +for: {null string} == 0 + +[302] __null != p +succeeded +for: 0 != 0x + ---------------------------------------------------------------- Summary for test case './succeeding/conditions/ptr': All tests passed (8 assertions in 1 test case) -- Test case: './succeeding/conditions/not' -------------------- ConditionTests.cpp:317: -false == false succeeded -line 318: -true == true succeeded -line 319: -!false succeeded for: true -line 320: -!false succeeded -line 322: -!falseValue succeeded for: true -line 323: -!falseValue succeeded for: !false -line 325: -!(1 == 2) succeeded for: true -line 326: -!1 == 2 succeeded for: !(1 == 2) +[317] false == false +succeeded + +[318] true == true +succeeded + +[319] !false +succeeded +for: true + +[320] !false +succeeded + +[322] !falseValue +succeeded +for: true + +[323] !falseValue +succeeded +for: !false + +[325] !(1 == 2) +succeeded +for: true + +[326] !1 == 2 +succeeded +for: !(1 == 2) + ---------------------------------------------------------------- Summary for test case './succeeding/conditions/not': All tests passed (8 assertions in 1 test case) -- Test case: './failing/conditions/not' ----------------------- ConditionTests.cpp:334: -false != false failed -line 335: -true != true failed -line 336: -!true failed for: false -line 337: -!true failed -line 339: -!trueValue failed for: false -line 340: -!trueValue failed for: !true -line 342: -!(1 == 1) failed for: false -line 343: -!1 == 1 failed for: !(1 == 1) +[334] false != false +failed + +[335] true != true +failed + +[336] !true +failed +for: false + +[337] !true +failed + +[339] !trueValue +failed +for: false + +[340] !trueValue +failed +for: !true + +[342] !(1 == 1) +failed +for: false + +[343] !1 == 1 +failed +for: !(1 == 1) + ---------------------------------------------------------------- Summary for test case './failing/conditions/not': 1 test case - failed (8 assertions - all failed) -- Test case: './succeeding/exceptions/explicit' --------------- ExceptionTests.cpp:39: -thisThrows() succeeded -line 40: -thisDoesntThrow() succeeded -line 41: -thisThrows() succeeded +[39] thisThrows() +succeeded + +[40] thisDoesntThrow() +succeeded + +[41] thisThrows() +succeeded + ---------------------------------------------------------------- Summary for test case './succeeding/exceptions/explicit': All tests passed (3 assertions in 1 test case) -- Test case: './failing/exceptions/explicit' ------------------ ExceptionTests.cpp:47: -thisThrows() failed with unexpected exception with message: 'expected exception' -line 48: -thisDoesntThrow() failed because no exception was thrown where one was expected -line 49: -thisThrows() failed with unexpected exception with message: 'expected exception' +[47] thisThrows() +failed with unexpected exception with message: 'expected exception' + +[48] thisDoesntThrow() +failed because no exception was thrown where one was expected + +[49] thisThrows() +failed with unexpected exception with message: 'expected exception' + ---------------------------------------------------------------- Summary for test case './failing/exceptions/explicit': 1 test case - failed (3 assertions - all failed) -- Test case: './failing/exceptions/implicit' ------------------ ExceptionTests.cpp:52: -Unexpected exception with message: 'unexpected exception' +[52] Unexpected exception with message: 'unexpected exception' + ---------------------------------------------------------------- Summary for test case './failing/exceptions/implicit': 1 test case - failed (1 assertion - failed) -- Test case: './failing/exceptions/implicit/2' ---------------- ExceptionTests.cpp:60: -1 == 1 succeeded -{Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' +[60] 1 == 1 +succeeded + +[60] {Unknown expression after this line} +failed with unexpected exception with message: 'unexpected exception' + ---------------------------------------------------------------- Summary for test case './failing/exceptions/implicit/2': 1 test case - failed (2 assertions - 1 failed) @@ -473,264 +808,633 @@ Summary for test case './succeeding/exceptions/implicit': -- Test case: './failing/exceptions/custom' -------------------- ExceptionTests.cpp:102: -Unexpected exception with message: 'custom exception' +[102] Unexpected exception with message: 'custom exception' + ---------------------------------------------------------------- Summary for test case './failing/exceptions/custom': 1 test case - failed (1 assertion - failed) -- Test case: './failing/exceptions/custom/nothrow' ------------ ExceptionTests.cpp:109: -throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' +[109] throw CustomException( "unexpected custom exception" ) +failed with unexpected exception with message: 'unexpected custom exception' + ---------------------------------------------------------------- Summary for test case './failing/exceptions/custom/nothrow': 1 test case - failed (1 assertion - failed) -- Test case: './failing/exceptions/custom/throw' -------------- ExceptionTests.cpp:114: -throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' +[114] throw CustomException( "custom exception - not std" ) +failed with unexpected exception with message: 'custom exception - not std' + ---------------------------------------------------------------- Summary for test case './failing/exceptions/custom/throw': 1 test case - failed (1 assertion - failed) -- Test case: './failing/exceptions/custom/double' ------------- ExceptionTests.cpp:118: -Unexpected exception with message: '3.14' +[118] Unexpected exception with message: '3.14' + ---------------------------------------------------------------- Summary for test case './failing/exceptions/custom/double': 1 test case - failed (1 assertion - failed) -- Test case: './succeeding/exceptions/notimplemented' --------- ExceptionTests.cpp:129: -thisFunctionNotImplemented( 7 ) succeeded +[129] thisFunctionNotImplemented( 7 ) +succeeded + ---------------------------------------------------------------- Summary for test case './succeeding/exceptions/notimplemented': All tests passed (1 assertion in 1 test case) -- Test case: './succeeding/generators/1' ---------------------- GeneratorTests.cpp:26: -multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 200 == 200 -multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 202 == 202 -multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 204 == 204 -multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 206 == 206 -multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 208 == 208 -multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 210 == 210 -multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 212 == 212 -multiply( i, 2 ) == i*2 succeeded for: 2 == 2 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -multiply( i, 2 ) == i*2 succeeded for: 4 == 4 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -multiply( i, 2 ) == i*2 succeeded for: 6 == 6 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -multiply( i, 2 ) == i*2 succeeded for: 8 == 8 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -multiply( i, 2 ) == i*2 succeeded for: 10 == 10 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -multiply( i, 2 ) == i*2 succeeded for: 30 == 30 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -multiply( i, 2 ) == i*2 succeeded for: 40 == 40 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -multiply( i, 2 ) == i*2 succeeded for: 42 == 42 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 214 == 214 -multiply( i, 2 ) == i*2 succeeded for: 72 == 72 -line 27: -multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +[26] multiply( i, 2 ) == i*2 +succeeded +for: 2 == 2 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 200 == 200 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 4 == 4 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 200 == 200 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 6 == 6 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 200 == 200 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 8 == 8 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 200 == 200 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 10 == 10 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 200 == 200 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 30 == 30 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 200 == 200 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 40 == 40 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 200 == 200 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 42 == 42 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 200 == 200 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 72 == 72 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 200 == 200 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 2 == 2 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 202 == 202 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 4 == 4 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 202 == 202 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 6 == 6 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 202 == 202 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 8 == 8 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 202 == 202 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 10 == 10 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 202 == 202 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 30 == 30 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 202 == 202 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 40 == 40 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 202 == 202 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 42 == 42 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 202 == 202 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 72 == 72 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 202 == 202 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 2 == 2 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 204 == 204 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 4 == 4 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 204 == 204 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 6 == 6 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 204 == 204 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 8 == 8 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 204 == 204 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 10 == 10 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 204 == 204 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 30 == 30 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 204 == 204 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 40 == 40 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 204 == 204 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 42 == 42 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 204 == 204 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 72 == 72 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 204 == 204 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 2 == 2 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 206 == 206 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 4 == 4 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 206 == 206 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 6 == 6 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 206 == 206 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 8 == 8 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 206 == 206 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 10 == 10 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 206 == 206 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 30 == 30 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 206 == 206 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 40 == 40 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 206 == 206 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 42 == 42 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 206 == 206 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 72 == 72 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 206 == 206 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 2 == 2 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 208 == 208 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 4 == 4 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 208 == 208 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 6 == 6 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 208 == 208 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 8 == 8 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 208 == 208 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 10 == 10 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 208 == 208 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 30 == 30 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 208 == 208 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 40 == 40 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 208 == 208 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 42 == 42 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 208 == 208 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 72 == 72 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 208 == 208 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 2 == 2 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 210 == 210 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 4 == 4 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 210 == 210 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 6 == 6 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 210 == 210 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 8 == 8 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 210 == 210 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 10 == 10 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 210 == 210 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 30 == 30 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 210 == 210 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 40 == 40 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 210 == 210 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 42 == 42 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 210 == 210 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 72 == 72 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 210 == 210 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 2 == 2 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 212 == 212 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 4 == 4 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 212 == 212 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 6 == 6 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 212 == 212 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 8 == 8 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 212 == 212 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 10 == 10 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 212 == 212 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 30 == 30 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 212 == 212 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 40 == 40 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 212 == 212 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 42 == 42 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 212 == 212 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 72 == 72 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 212 == 212 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 2 == 2 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 214 == 214 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 4 == 4 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 214 == 214 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 6 == 6 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 214 == 214 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 8 == 8 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 214 == 214 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 10 == 10 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 214 == 214 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 30 == 30 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 214 == 214 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 40 == 40 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 214 == 214 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 42 == 42 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 214 == 214 + +[26] multiply( i, 2 ) == i*2 +succeeded +for: 72 == 72 + +[27] multiply( j, 2 ) == j*2 +succeeded +for: 214 == 214 + ---------------------------------------------------------------- Summary for test case './succeeding/generators/1': All tests passed (144 assertions in 1 test case) -- Test case: './succeeding/message' --------------------------- MessageTests.cpp:14: -[warning: this is a warning] +[14] [warning: this is a warning] + No assertions in test case, './succeeding/message' @@ -740,45 +1444,59 @@ Summary for test case './succeeding/message': -- Test case: './succeeding/succeed' --------------------------- MessageTests.cpp:18: - succeeded +[18] succeeded [with message: this is a success] + ---------------------------------------------------------------- Summary for test case './succeeding/succeed': All tests passed (1 assertion in 1 test case) -- Test case: './failing/message/info/1' ----------------------- MessageTests.cpp:23: -[info: this message should be logged] -line 24: -[info: so should this] -line 26: -a == 1 failed for: 2 == 1 +[23] [info: this message should be logged] + +[24] [info: so should this] + +[26] a == 1 +failed +for: 2 == 1 + ---------------------------------------------------------------- Summary for test case './failing/message/info/1': 1 test case - failed (1 assertion - failed) -- Test case: './mixed/message/info/2' ------------------------- MessageTests.cpp:33: -a == 2 succeeded for: 2 == 2 -line 31: -[info: this message should be logged] -line 35: -[info: this message should be logged, too] -line 37: -a == 1 failed for: 2 == 1 -line 39: -[info: and this, but later] -line 41: -a == 0 failed for: 2 == 0 -line 45: -a == 2 succeeded for: 2 == 2 +[33] a == 2 +succeeded +for: 2 == 2 + +[31] [info: this message should be logged] + +[35] [info: this message should be logged, too] + +[37] a == 1 +failed +for: 2 == 1 + +[39] [info: and this, but later] + +[41] a == 0 +failed +for: 2 == 0 + +[45] a == 2 +succeeded +for: 2 == 2 + ---------------------------------------------------------------- Summary for test case './mixed/message/info/2': 1 test case - failed (4 assertions - 2 failed) -- Test case: './failing/message/fail' ------------------------- MessageTests.cpp:51: -failed with message: 'This is a failure' +[51] failed with message: 'This is a failure' + ---------------------------------------------------------------- Summary for test case './failing/message/fail': 1 test case - failed (1 assertion - failed) @@ -786,14 +1504,16 @@ Summary for test case './failing/message/fail': -- Test case: './failing/message/sections' --------------------- -- Section: 'one' ---------------------------------------------- MessageTests.cpp:58: -failed with message: 'Message from section one' +[58] failed with message: 'Message from section one' + ---------------------------------------------------------------- Summary for section 'one': 1 assertion - failed -- Section: 'two' ---------------------------------------------- MessageTests.cpp:63: -failed with message: 'Message from section two' +[63] failed with message: 'Message from section two' + ---------------------------------------------------------------- Summary for section 'two': 1 assertion - failed @@ -827,26 +1547,65 @@ Summary for test case './succeeding/message/sections/stdout': -- Test case: './mixed/message/scoped' ------------------------- MessageTests.cpp:86: -i < 10 succeeded for: 0 < 10 -i < 10 succeeded for: 1 < 10 -i < 10 succeeded for: 2 < 10 -i < 10 succeeded for: 3 < 10 -i < 10 succeeded for: 4 < 10 -i < 10 succeeded for: 5 < 10 -i < 10 succeeded for: 6 < 10 -i < 10 succeeded for: 7 < 10 -i < 10 succeeded for: 8 < 10 -i < 10 succeeded for: 9 < 10 -i < 10 succeeded[info: current counter 10] -i < 10 succeeded[info: i := 10] -i < 10 failed for: 10 < 10 +[86] i < 10 +succeeded +for: 0 < 10 + +[86] i < 10 +succeeded +for: 1 < 10 + +[86] i < 10 +succeeded +for: 2 < 10 + +[86] i < 10 +succeeded +for: 3 < 10 + +[86] i < 10 +succeeded +for: 4 < 10 + +[86] i < 10 +succeeded +for: 5 < 10 + +[86] i < 10 +succeeded +for: 6 < 10 + +[86] i < 10 +succeeded +for: 7 < 10 + +[86] i < 10 +succeeded +for: 8 < 10 + +[86] i < 10 +succeeded +for: 9 < 10 + +[86] i < 10 +succeeded[info: current counter 10] + +[86] i < 10 +succeeded[info: i := 10] + +[86] i < 10 +failed +for: 10 < 10 + ---------------------------------------------------------------- Summary for test case './mixed/message/scoped': 1 test case - failed (11 assertions - 1 failed) -- Test case: './succeeding/nofail' ---------------------------- MessageTests.cpp:92: -1 == 2 failed - but was ok +[92] 1 == 2 +failed - but was ok + No assertions in test case, './succeeding/nofail' @@ -857,16 +1616,24 @@ Summary for test case './succeeding/nofail': -- Test case: './succeeding/Misc/Sections' --------------------- -- Section: 's1' ----------------------------------------------- MiscTests.cpp:25: -a != b succeeded for: 1 != 2 -line 26: -b != a succeeded for: 2 != 1 +[25] a != b +succeeded +for: 1 != 2 + +[26] b != a +succeeded +for: 2 != 1 + ---------------------------------------------------------------- Summary for section 's1': All 2 assertions passed -- Section: 's2' ----------------------------------------------- MiscTests.cpp:31: -a != b succeeded for: 1 != 2 +[31] a != b +succeeded +for: 1 != 2 + ---------------------------------------------------------------- Summary for section 's2': 1 assertion passed @@ -878,12 +1645,19 @@ All tests passed (3 assertions in 1 test case) -- Test case: './succeeding/Misc/Sections/nested' -------------- -- Section: 's1' ----------------------------------------------- MiscTests.cpp:42: -a != b succeeded for: 1 != 2 -line 43: -b != a succeeded for: 2 != 1 +[42] a != b +succeeded +for: 1 != 2 + +[43] b != a +succeeded +for: 2 != 1 + -- Section: 's2' ----------------------------------------------- -line 47: -a != b succeeded for: 1 != 2 +[47] a != b +succeeded +for: 1 != 2 + ---------------------------------------------------------------- Summary for section 's2': 1 assertion passed @@ -900,7 +1674,10 @@ All tests passed (3 assertions in 1 test case) -- Section: 's1' ----------------------------------------------- -- Section: 's2' ----------------------------------------------- MiscTests.cpp:61: -a == b failed for: 1 == 2 +[61] a == b +failed +for: 1 == 2 + ---------------------------------------------------------------- Summary for section 's2': 1 assertion - failed @@ -912,7 +1689,10 @@ Summary for section 's1': -- Section: 's1' ----------------------------------------------- -- Section: 's3' ----------------------------------------------- MiscTests.cpp:66: -a != b succeeded for: 1 != 2 +[66] a != b +succeeded +for: 1 != 2 + ---------------------------------------------------------------- Summary for section 's3': 1 assertion passed @@ -924,7 +1704,10 @@ Summary for section 's1': -- Section: 's1' ----------------------------------------------- -- Section: 's4' ----------------------------------------------- MiscTests.cpp:70: -a < b succeeded for: 1 < 2 +[70] a < b +succeeded +for: 1 < 2 + ---------------------------------------------------------------- Summary for section 's4': 1 assertion passed @@ -979,7 +1762,10 @@ Summary for test case './Sections/nested/a/b': -- Test case: './mixed/Misc/Sections/loops' -------------------- -- Section: 's1' ----------------------------------------------- MiscTests.cpp:103: -b > a failed for: 0 > 1 +[103] b > a +failed +for: 0 > 1 + ---------------------------------------------------------------- Summary for section 's1': 1 assertion - failed @@ -990,30 +1776,54 @@ Summary for test case './mixed/Misc/Sections/loops': -- Test case: './mixed/Misc/loops' ----------------------------- MiscTests.cpp:114: -[info: Testing if fib[0] (1) is even] -line 115: -( fib[i] % 2 ) == 0 failed for: 1 == 0 -[info: Testing if fib[1] (1) is even] -line 115: -( fib[i] % 2 ) == 0 failed for: 1 == 0 -line 115: -( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -[info: Testing if fib[2] (2) is even] -[info: Testing if fib[3] (3) is even] -line 115: -( fib[i] % 2 ) == 0 failed for: 1 == 0 -[info: Testing if fib[4] (5) is even] -line 115: -( fib[i] % 2 ) == 0 failed for: 1 == 0 -line 115: -( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -[info: Testing if fib[5] (8) is even] -[info: Testing if fib[6] (13) is even] -line 115: -( fib[i] % 2 ) == 0 failed for: 1 == 0 -[info: Testing if fib[7] (21) is even] -line 115: -( fib[i] % 2 ) == 0 failed for: 1 == 0 +[114] [info: Testing if fib[0] (1) is even] + +[115] ( fib[i] % 2 ) == 0 +failed +for: 1 == 0 + +[114] [info: Testing if fib[1] (1) is even] + +[115] ( fib[i] % 2 ) == 0 +failed +for: 1 == 0 + +[115] ( fib[i] % 2 ) == 0 +succeeded +for: 0 == 0 + +[114] [info: Testing if fib[2] (2) is even] + +[114] [info: Testing if fib[3] (3) is even] + +[115] ( fib[i] % 2 ) == 0 +failed +for: 1 == 0 + +[114] [info: Testing if fib[4] (5) is even] + +[115] ( fib[i] % 2 ) == 0 +failed +for: 1 == 0 + +[115] ( fib[i] % 2 ) == 0 +succeeded +for: 0 == 0 + +[114] [info: Testing if fib[5] (8) is even] + +[114] [info: Testing if fib[6] (13) is even] + +[115] ( fib[i] % 2 ) == 0 +failed +for: 1 == 0 + +[114] [info: Testing if fib[7] (21) is even] + +[115] ( fib[i] % 2 ) == 0 +failed +for: 1 == 0 + ---------------------------------------------------------------- Summary for test case './mixed/Misc/loops': 1 test case - failed (8 assertions - 6 failed) @@ -1030,56 +1840,83 @@ Summary for test case './succeeding/Misc/stdout,stderr': -- Test case: './succeeding/Misc/null strings' ----------------- MiscTests.cpp:133: -makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} -line 134: -makeString( true ) == static_cast(__null) succeeded for: {null string} == {null string} +[133] makeString( false ) != static_cast(__null) +succeeded +for: "valid string" != {null string} + +[134] makeString( true ) == static_cast(__null) +succeeded +for: {null string} == {null string} + ---------------------------------------------------------------- Summary for test case './succeeding/Misc/null strings': All tests passed (2 assertions in 1 test case) -- Test case: './failing/info' --------------------------------- MiscTests.cpp:139: -[info: hi] -line 141: -[info: i := 7] -line 142: -false failed +[139] [info: hi] + +[141] [info: i := 7] + +[142] false +failed + ---------------------------------------------------------------- Summary for test case './failing/info': 1 test case - failed (1 assertion - failed) -- Test case: './succeeding/checkedif' ------------------------- MiscTests.cpp:147: -flag succeeded for: true -line 155: -testCheckedIf( true ) succeeded for: true +[147] flag +succeeded +for: true + +[155] testCheckedIf( true ) +succeeded +for: true + ---------------------------------------------------------------- Summary for test case './succeeding/checkedif': All tests passed (2 assertions in 1 test case) -- Test case: './failing/checkedif' ---------------------------- MiscTests.cpp:147: -flag failed for: false -line 160: -testCheckedIf( false ) failed for: false +[147] flag +failed +for: false + +[160] testCheckedIf( false ) +failed +for: false + ---------------------------------------------------------------- Summary for test case './failing/checkedif': 1 test case - failed (2 assertions - both failed) -- Test case: './succeeding/checkedelse' ----------------------- MiscTests.cpp:165: -flag succeeded for: true -line 173: -testCheckedElse( true ) succeeded for: true +[165] flag +succeeded +for: true + +[173] testCheckedElse( true ) +succeeded +for: true + ---------------------------------------------------------------- Summary for test case './succeeding/checkedelse': All tests passed (2 assertions in 1 test case) -- Test case: './failing/checkedelse' -------------------------- MiscTests.cpp:165: -flag failed for: false -line 178: -testCheckedElse( false ) failed for: false +[165] flag +failed +for: false + +[178] testCheckedElse( false ) +failed +for: false + ---------------------------------------------------------------- Summary for test case './failing/checkedelse': 1 test case - failed (2 assertions - both failed) @@ -1107,107 +1944,143 @@ Summary for test case './misc/xmlentitycheck': -- Test case: './manual/onechar' ------------------------------- MiscTests.cpp:195: -[info: 3] -line 196: -false failed +[195] [info: 3] + +[196] false +failed + ---------------------------------------------------------------- Summary for test case './manual/onechar': 1 test case - failed (1 assertion - failed) -- Test case: './succeeding/atomic if' ------------------------- MiscTests.cpp:206: -x == 0 succeeded for: 0 == 0 +[206] x == 0 +succeeded +for: 0 == 0 + ---------------------------------------------------------------- Summary for test case './succeeding/atomic if': All tests passed (1 assertion in 1 test case) -- Test case: './succeeding/matchers' -------------------------- MiscTests.cpp:216: -testStringForMatching() Contains( "string" ) succeeded for: - "this string contains 'abc' as a substring" contains: "string" -line 217: -testStringForMatching() Contains( "abc" ) succeeded for: - "this string contains 'abc' as a substring" contains: "abc" -line 219: -testStringForMatching() StartsWith( "this" ) succeeded for: - "this string contains 'abc' as a substring" starts with: "this" -line 220: -testStringForMatching() EndsWith( "substring" ) succeeded for: - "this string contains 'abc' as a substring" ends with: "substring" +[216] testStringForMatching() Contains( "string" ) +succeeded +for: "this string contains 'abc' as a substring" contains: "string" + +[217] testStringForMatching() Contains( "abc" ) +succeeded +for: "this string contains 'abc' as a substring" contains: "abc" + +[219] testStringForMatching() StartsWith( "this" ) +succeeded +for: "this string contains 'abc' as a substring" starts with: "this" + +[220] testStringForMatching() EndsWith( "substring" ) +succeeded +for: "this string contains 'abc' as a substring" ends with: "substring" + ---------------------------------------------------------------- Summary for test case './succeeding/matchers': All tests passed (4 assertions in 1 test case) -- Test case: './failing/matchers/Contains' -------------------- MiscTests.cpp:225: -testStringForMatching() Contains( "not there" ) failed for: - "this string contains 'abc' as a substring" contains: "not there" +[225] testStringForMatching() Contains( "not there" ) +failed +for: "this string contains 'abc' as a substring" contains: "not there" + ---------------------------------------------------------------- Summary for test case './failing/matchers/Contains': 1 test case - failed (1 assertion - failed) -- Test case: './failing/matchers/StartsWith' ------------------ MiscTests.cpp:230: -testStringForMatching() StartsWith( "string" ) failed for: - "this string contains 'abc' as a substring" starts with: "string" +[230] testStringForMatching() StartsWith( "string" ) +failed +for: "this string contains 'abc' as a substring" starts with: "string" + ---------------------------------------------------------------- Summary for test case './failing/matchers/StartsWith': 1 test case - failed (1 assertion - failed) -- Test case: './failing/matchers/EndsWith' -------------------- MiscTests.cpp:235: -testStringForMatching() EndsWith( "this" ) failed for: - "this string contains 'abc' as a substring" ends with: "this" +[235] testStringForMatching() EndsWith( "this" ) +failed +for: "this string contains 'abc' as a substring" ends with: "this" + ---------------------------------------------------------------- Summary for test case './failing/matchers/EndsWith': 1 test case - failed (1 assertion - failed) -- Test case: './failing/matchers/Equals' ---------------------- MiscTests.cpp:240: -testStringForMatching() Equals( "something else" ) failed for: - "this string contains 'abc' as a substring" equals: "something else" +[240] testStringForMatching() Equals( "something else" ) +failed +for: "this string contains 'abc' as a substring" equals: "something else" + ---------------------------------------------------------------- Summary for test case './failing/matchers/Equals': 1 test case - failed (1 assertion - failed) -- Test case: '/succeeding/matchers/AllOf' --------------------- MiscTests.cpp:245: -testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: -"this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) +[245] testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) +succeeded +for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) + ---------------------------------------------------------------- Summary for test case '/succeeding/matchers/AllOf': All tests passed (1 assertion in 1 test case) -- Test case: '/succeeding/matchers/AnyOf' --------------------- MiscTests.cpp:249: -testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: -"this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -line 250: -testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: -"this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) +[249] testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) +succeeded +for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) + +[250] testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) +succeeded +for: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) + ---------------------------------------------------------------- Summary for test case '/succeeding/matchers/AnyOf': All tests passed (2 assertions in 1 test case) -- Test case: './succeeding/matchers/Equals' ------------------- MiscTests.cpp:255: -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" +[255] 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" + ---------------------------------------------------------------- Summary for test case './succeeding/matchers/Equals': All tests passed (1 assertion in 1 test case) -- Test case: 'example/factorial' ------------------------------ MiscTests.cpp:266: -Factorial(0) == 1 succeeded for: 1 == 1 -line 267: -Factorial(1) == 1 succeeded for: 1 == 1 -line 268: -Factorial(2) == 2 succeeded for: 2 == 2 -line 269: -Factorial(3) == 6 succeeded for: 6 == 6 -line 270: -Factorial(10) == 3628800 succeeded for: 0x == 3628800 +[266] Factorial(0) == 1 +succeeded +for: 1 == 1 + +[267] Factorial(1) == 1 +succeeded +for: 1 == 1 + +[268] Factorial(2) == 2 +succeeded +for: 2 == 2 + +[269] Factorial(3) == 6 +succeeded +for: 6 == 6 + +[270] Factorial(10) == 3628800 +succeeded +for: 0x == 3628800 + ---------------------------------------------------------------- Summary for test case 'example/factorial': All tests passed (5 assertions in 1 test case) @@ -1222,7 +2095,8 @@ Summary for test case 'empty': -- Test case: 'Nice descriptive name' -------------------------- MiscTests.cpp:279: -[warning: This one ran] +[279] [warning: This one ran] + No assertions in test case, 'Nice descriptive name' @@ -1250,56 +2124,81 @@ Summary for test case 'second tag': -- Section: 'selftest/expected result' ------------------------- -- Section: 'selftest/expected result/failing tests' ----------- /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: - succeeded +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] - succeeded + +[106] succeeded [with message: Tests failed, as expected] + ---------------------------------------------------------------- Summary for section 'selftest/expected result/failing tests': All 25 assertions passed @@ -1311,96 +2210,139 @@ All 25 assertions passed -- Section: 'selftest/expected result' ------------------------- -- Section: 'selftest/expected result/succeeding tests' -------- /Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: - succeeded +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] + Message from section one Message from section two - succeeded +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] + Some information An error - succeeded +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] - succeeded + +[95] succeeded [with message: Tests passed, as expected] + ---------------------------------------------------------------- Summary for section 'selftest/expected result/succeeding tests': All 43 assertions passed @@ -1416,9 +2358,14 @@ An error -- Section: 'selftest/test counts' ----------------------------- -- Section: 'selftest/test counts/succeeding tests' ------------ TestMain.cpp:40: -totals.assertions.passed == 291 succeeded for: 291 == 291 -line 41: -totals.assertions.failed == 0 succeeded for: 0 == 0 +[40] totals.assertions.passed == 291 +succeeded +for: 291 == 291 + +[41] totals.assertions.failed == 0 +succeeded +for: 0 == 0 + ---------------------------------------------------------------- Summary for section 'selftest/test counts/succeeding tests': All 2 assertions passed @@ -1430,9 +2377,14 @@ All 2 assertions passed -- Section: 'selftest/test counts' ----------------------------- -- Section: 'selftest/test counts/failing tests' --------------- TestMain.cpp:47: -totals.assertions.passed == 1 succeeded for: 1 == 1 -line 48: -totals.assertions.failed == 72 succeeded for: 72 == 72 +[47] totals.assertions.passed == 1 +succeeded +for: 1 == 1 + +[48] totals.assertions.failed == 72 +succeeded +for: 72 == 72 + ---------------------------------------------------------------- Summary for section 'selftest/test counts/failing tests': All 2 assertions passed @@ -1447,9 +2399,14 @@ All tests passed (72 assertions in 1 test case) -- Test case: 'meta/Misc/Sections' ----------------------------- TestMain.cpp:57: -totals.assertions.passed == 2 succeeded for: 2 == 2 -line 58: -totals.assertions.failed == 1 succeeded for: 1 == 1 +[57] totals.assertions.passed == 2 +succeeded +for: 2 == 2 + +[58] totals.assertions.failed == 1 +succeeded +for: 1 == 1 + ---------------------------------------------------------------- Summary for test case 'meta/Misc/Sections': All tests passed (2 assertions in 1 test case) @@ -1457,15 +2414,25 @@ All tests passed (2 assertions in 1 test case) -- Test case: 'selftest/parser/2' ------------------------------ -- Section: 'default' ------------------------------------------ TestMain.cpp:97: -parseIntoConfig( argv, config ) succeeded -line 99: -config.shouldDebugBreak == false succeeded for: false == false -line 100: -config.cutoff == -1 succeeded for: -1 == -1 -line 101: -config.allowThrows == true succeeded for: true == true -line 102: -config.reporter.empty() succeeded for: true +[97] parseIntoConfig( argv, config ) +succeeded + +[99] config.shouldDebugBreak == false +succeeded +for: false == false + +[100] config.cutoff == -1 +succeeded +for: -1 == -1 + +[101] config.allowThrows == true +succeeded +for: true == true + +[102] config.reporter.empty() +succeeded +for: true + ---------------------------------------------------------------- Summary for section 'default': All 5 assertions passed @@ -1473,13 +2440,21 @@ All 5 assertions passed -- Section: 'test lists' --------------------------------------- -- Section: '-t/1' --------------------------------------------- TestMain.cpp:108: -parseIntoConfig( argv, config ) succeeded -line 110: -config.filters.size() == 1 succeeded for: 1 == 1 -line 111: -config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -line 112: -config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +[108] parseIntoConfig( argv, config ) +succeeded + +[110] config.filters.size() == 1 +succeeded +for: 1 == 1 + +[111] config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false +succeeded +for: false == false + +[112] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) +succeeded +for: true + ---------------------------------------------------------------- Summary for section '-t/1': All 4 assertions passed @@ -1491,13 +2466,21 @@ All 4 assertions passed -- Section: 'test lists' --------------------------------------- -- Section: '-t/exclude:1' ------------------------------------- TestMain.cpp:116: -parseIntoConfig( argv, config ) succeeded -line 118: -config.filters.size() == 1 succeeded for: 1 == 1 -line 119: -config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -line 120: -config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +[116] parseIntoConfig( argv, config ) +succeeded + +[118] config.filters.size() == 1 +succeeded +for: 1 == 1 + +[119] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false +succeeded +for: false == false + +[120] config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) +succeeded +for: true + ---------------------------------------------------------------- Summary for section '-t/exclude:1': All 4 assertions passed @@ -1509,13 +2492,21 @@ All 4 assertions passed -- Section: 'test lists' --------------------------------------- -- Section: '--test/1' ----------------------------------------- TestMain.cpp:125: -parseIntoConfig( argv, config ) succeeded -line 127: -config.filters.size() == 1 succeeded for: 1 == 1 -line 128: -config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -line 129: -config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +[125] parseIntoConfig( argv, config ) +succeeded + +[127] config.filters.size() == 1 +succeeded +for: 1 == 1 + +[128] config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false +succeeded +for: false == false + +[129] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) +succeeded +for: true + ---------------------------------------------------------------- Summary for section '--test/1': All 4 assertions passed @@ -1527,13 +2518,21 @@ All 4 assertions passed -- Section: 'test lists' --------------------------------------- -- Section: '--test/exclude:1' --------------------------------- TestMain.cpp:134: -parseIntoConfig( argv, config ) succeeded -line 136: -config.filters.size() == 1 succeeded for: 1 == 1 -line 137: -config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -line 138: -config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +[134] parseIntoConfig( argv, config ) +succeeded + +[136] config.filters.size() == 1 +succeeded +for: 1 == 1 + +[137] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false +succeeded +for: false == false + +[138] config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) +succeeded +for: true + ---------------------------------------------------------------- Summary for section '--test/exclude:1': All 4 assertions passed @@ -1545,13 +2544,21 @@ All 4 assertions passed -- Section: 'test lists' --------------------------------------- -- Section: '--test/exclude:2' --------------------------------- TestMain.cpp:143: -parseIntoConfig( argv, config ) succeeded -line 145: -config.filters.size() == 1 succeeded for: 1 == 1 -line 146: -config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -line 147: -config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +[143] parseIntoConfig( argv, config ) +succeeded + +[145] config.filters.size() == 1 +succeeded +for: 1 == 1 + +[146] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false +succeeded +for: false == false + +[147] config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) +succeeded +for: true + ---------------------------------------------------------------- Summary for section '--test/exclude:2': All 4 assertions passed @@ -1563,15 +2570,25 @@ All 4 assertions passed -- Section: 'test lists' --------------------------------------- -- Section: '-t/2' --------------------------------------------- TestMain.cpp:152: -parseIntoConfig( argv, config ) succeeded -line 154: -config.filters.size() == 1 succeeded for: 1 == 1 -line 155: -config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -line 156: -config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -line 157: -config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true +[152] parseIntoConfig( argv, config ) +succeeded + +[154] config.filters.size() == 1 +succeeded +for: 1 == 1 + +[155] config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false +succeeded +for: false == false + +[156] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) +succeeded +for: true + +[157] config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) +succeeded +for: true + ---------------------------------------------------------------- Summary for section '-t/2': All 5 assertions passed @@ -1583,8 +2600,10 @@ All 5 assertions passed -- Section: 'test lists' --------------------------------------- -- Section: '-t/0' --------------------------------------------- TestMain.cpp:162: -parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: -"Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" +[162] parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) +succeeded +for: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" + ---------------------------------------------------------------- Summary for section '-t/0': 1 assertion passed @@ -1596,9 +2615,13 @@ Summary for section 'test lists': -- Section: 'reporter' ----------------------------------------- -- Section: '-r/basic' ----------------------------------------- TestMain.cpp:169: -parseIntoConfig( argv, config ) succeeded -line 171: -config.reporter == "console" succeeded for: "console" == "console" +[169] parseIntoConfig( argv, config ) +succeeded + +[171] config.reporter == "console" +succeeded +for: "console" == "console" + ---------------------------------------------------------------- Summary for section '-r/basic': All 2 assertions passed @@ -1610,9 +2633,13 @@ All 2 assertions passed -- Section: 'reporter' ----------------------------------------- -- Section: '-r/xml' ------------------------------------------- TestMain.cpp:175: -parseIntoConfig( argv, config ) succeeded -line 177: -config.reporter == "xml" succeeded for: "xml" == "xml" +[175] parseIntoConfig( argv, config ) +succeeded + +[177] config.reporter == "xml" +succeeded +for: "xml" == "xml" + ---------------------------------------------------------------- Summary for section '-r/xml': All 2 assertions passed @@ -1624,9 +2651,13 @@ All 2 assertions passed -- Section: 'reporter' ----------------------------------------- -- Section: '--reporter/junit' --------------------------------- TestMain.cpp:181: -parseIntoConfig( argv, config ) succeeded -line 183: -config.reporter == "junit" succeeded for: "junit" == "junit" +[181] parseIntoConfig( argv, config ) +succeeded + +[183] config.reporter == "junit" +succeeded +for: "junit" == "junit" + ---------------------------------------------------------------- Summary for section '--reporter/junit': All 2 assertions passed @@ -1638,8 +2669,10 @@ All 2 assertions passed -- Section: 'reporter' ----------------------------------------- -- Section: '-r/error' ----------------------------------------- TestMain.cpp:187: -parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: -"Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" +[187] parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) +succeeded +for: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" + ---------------------------------------------------------------- Summary for section '-r/error': 1 assertion passed @@ -1651,9 +2684,13 @@ Summary for section 'reporter': -- Section: 'debugger' ----------------------------------------- -- Section: '-b' ----------------------------------------------- TestMain.cpp:194: -parseIntoConfig( argv, config ) succeeded -line 196: -config.shouldDebugBreak == true succeeded for: true == true +[194] parseIntoConfig( argv, config ) +succeeded + +[196] config.shouldDebugBreak == true +succeeded +for: true == true + ---------------------------------------------------------------- Summary for section '-b': All 2 assertions passed @@ -1665,9 +2702,13 @@ All 2 assertions passed -- Section: 'debugger' ----------------------------------------- -- Section: '--break' ------------------------------------------ TestMain.cpp:200: -parseIntoConfig( argv, config ) succeeded -line 202: -config.shouldDebugBreak succeeded for: true +[200] parseIntoConfig( argv, config ) +succeeded + +[202] config.shouldDebugBreak +succeeded +for: true + ---------------------------------------------------------------- Summary for section '--break': All 2 assertions passed @@ -1679,8 +2720,10 @@ All 2 assertions passed -- Section: 'debugger' ----------------------------------------- -- Section: '-b' ----------------------------------------------- TestMain.cpp:206: -parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: -"Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" +[206] parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) +succeeded +for: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" + ---------------------------------------------------------------- Summary for section '-b': 1 assertion passed @@ -1692,9 +2735,13 @@ Summary for section 'debugger': -- Section: 'abort' -------------------------------------------- -- Section: '-a' ----------------------------------------------- TestMain.cpp:213: -parseIntoConfig( argv, config ) succeeded -line 215: -config.cutoff == 1 succeeded for: 1 == 1 +[213] parseIntoConfig( argv, config ) +succeeded + +[215] config.cutoff == 1 +succeeded +for: 1 == 1 + ---------------------------------------------------------------- Summary for section '-a': All 2 assertions passed @@ -1706,9 +2753,13 @@ All 2 assertions passed -- Section: 'abort' -------------------------------------------- -- Section: '-a/2' --------------------------------------------- TestMain.cpp:219: -parseIntoConfig( argv, config ) succeeded -line 221: -config.cutoff == 2 succeeded for: 2 == 2 +[219] parseIntoConfig( argv, config ) +succeeded + +[221] config.cutoff == 2 +succeeded +for: 2 == 2 + ---------------------------------------------------------------- Summary for section '-a/2': All 2 assertions passed @@ -1720,8 +2771,10 @@ All 2 assertions passed -- Section: 'abort' -------------------------------------------- -- Section: '-a/error/0' --------------------------------------- TestMain.cpp:225: -parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: -"Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" +[225] parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) +succeeded +for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" + ---------------------------------------------------------------- Summary for section '-a/error/0': 1 assertion passed @@ -1733,8 +2786,10 @@ Summary for section 'abort': -- Section: 'abort' -------------------------------------------- -- Section: '-a/error/non numeric' ----------------------------- TestMain.cpp:229: -parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: -"Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" +[229] parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) +succeeded +for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" + ---------------------------------------------------------------- Summary for section '-a/error/non numeric': 1 assertion passed @@ -1746,8 +2801,10 @@ Summary for section 'abort': -- Section: 'abort' -------------------------------------------- -- Section: '-a/error/two args' -------------------------------- TestMain.cpp:233: -parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: -"Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" +[233] parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) +succeeded +for: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" + ---------------------------------------------------------------- Summary for section '-a/error/two args': 1 assertion passed @@ -1759,9 +2816,13 @@ Summary for section 'abort': -- Section: 'nothrow' ------------------------------------------ -- Section: '-nt' ---------------------------------------------- TestMain.cpp:240: -parseIntoConfig( argv, config ) succeeded -line 242: -config.allowThrows == false succeeded for: false == false +[240] parseIntoConfig( argv, config ) +succeeded + +[242] config.allowThrows == false +succeeded +for: false == false + ---------------------------------------------------------------- Summary for section '-nt': All 2 assertions passed @@ -1773,9 +2834,13 @@ All 2 assertions passed -- Section: 'nothrow' ------------------------------------------ -- Section: '--nothrow' ---------------------------------------- TestMain.cpp:246: -parseIntoConfig( argv, config ) succeeded -line 248: -config.allowThrows == false succeeded for: false == false +[246] parseIntoConfig( argv, config ) +succeeded + +[248] config.allowThrows == false +succeeded +for: false == false + ---------------------------------------------------------------- Summary for section '--nothrow': All 2 assertions passed @@ -1787,11 +2852,17 @@ All 2 assertions passed -- Section: 'streams' ------------------------------------------ -- Section: '-o filename' -------------------------------------- TestMain.cpp:255: -parseIntoConfig( argv, config ) succeeded -line 257: -config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -line 258: -config.stream.empty() succeeded for: true +[255] parseIntoConfig( argv, config ) +succeeded + +[257] config.outputFilename == "filename.ext" +succeeded +for: "filename.ext" == "filename.ext" + +[258] config.stream.empty() +succeeded +for: true + ---------------------------------------------------------------- Summary for section '-o filename': All 3 assertions passed @@ -1803,11 +2874,17 @@ All 3 assertions passed -- Section: 'streams' ------------------------------------------ -- Section: '-o %stdout' --------------------------------------- TestMain.cpp:262: -parseIntoConfig( argv, config ) succeeded -line 264: -config.stream == "stdout" succeeded for: "stdout" == "stdout" -line 265: -config.outputFilename.empty() succeeded for: true +[262] parseIntoConfig( argv, config ) +succeeded + +[264] config.stream == "stdout" +succeeded +for: "stdout" == "stdout" + +[265] config.outputFilename.empty() +succeeded +for: true + ---------------------------------------------------------------- Summary for section '-o %stdout': All 3 assertions passed @@ -1819,9 +2896,13 @@ All 3 assertions passed -- Section: 'streams' ------------------------------------------ -- Section: '--out' -------------------------------------------- TestMain.cpp:269: -parseIntoConfig( argv, config ) succeeded -line 271: -config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +[269] parseIntoConfig( argv, config ) +succeeded + +[271] config.outputFilename == "filename.ext" +succeeded +for: "filename.ext" == "filename.ext" + ---------------------------------------------------------------- Summary for section '--out': All 2 assertions passed @@ -1833,13 +2914,21 @@ All 2 assertions passed -- Section: 'combinations' ------------------------------------- -- Section: '-a -b' -------------------------------------------- TestMain.cpp:278: -parseIntoConfig( argv, config ) succeeded -line 280: -config.cutoff == 1 succeeded for: 1 == 1 -line 281: -config.shouldDebugBreak succeeded for: true -line 282: -config.allowThrows == false succeeded for: false == false +[278] parseIntoConfig( argv, config ) +succeeded + +[280] config.cutoff == 1 +succeeded +for: 1 == 1 + +[281] config.shouldDebugBreak +succeeded +for: true + +[282] config.allowThrows == false +succeeded +for: false == false + ---------------------------------------------------------------- Summary for section '-a -b': All 4 assertions passed @@ -1854,65 +2943,109 @@ All tests passed (66 assertions in 1 test case) -- Test case: 'selftest/test filter' --------------------------- TestMain.cpp:291: -matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -line 292: -matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -line 297: -matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -line 298: -matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -line 300: -matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true -line 301: -matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false +[291] matchAny.shouldInclude( fakeTestCase( "any" ) ) +succeeded +for: true + +[292] matchNone.shouldInclude( fakeTestCase( "any" ) ) == false +succeeded +for: false == false + +[297] matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false +succeeded +for: false == false + +[298] matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) +succeeded +for: true + +[300] matchHidden.shouldInclude( fakeTestCase( "./any" ) ) +succeeded +for: true + +[301] matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false +succeeded +for: false == false + ---------------------------------------------------------------- Summary for test case 'selftest/test filter': All tests passed (6 assertions in 1 test case) -- Test case: 'selftest/test filters' -------------------------- TestMain.cpp:312: -matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -line 314: -filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -line 315: -filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -line 316: -filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false +[312] matchHidden.shouldInclude( fakeTestCase( "./something" ) ) +succeeded +for: true + +[314] filters.shouldInclude( fakeTestCase( "any" ) ) == false +succeeded +for: false == false + +[315] filters.shouldInclude( fakeTestCase( "./something" ) ) +succeeded +for: true + +[316] filters.shouldInclude( fakeTestCase( "./anything" ) ) == false +succeeded +for: false == false + ---------------------------------------------------------------- Summary for test case 'selftest/test filters': All tests passed (4 assertions in 1 test case) -- Test case: 'selftest/filter/prefix wildcard' ---------------- TestMain.cpp:322: -matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -line 323: -matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false +[322] matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) +succeeded +for: true + +[323] matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false +succeeded +for: false == false + ---------------------------------------------------------------- Summary for test case 'selftest/filter/prefix wildcard': All tests passed (2 assertions in 1 test case) -- Test case: 'selftest/filter/wildcard at both ends' ---------- TestMain.cpp:328: -matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -line 329: -matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true -line 330: -matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true -line 331: -matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false +[328] matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) +succeeded +for: true + +[329] matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) +succeeded +for: true + +[330] matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) +succeeded +for: true + +[331] matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false +succeeded +for: false == false + ---------------------------------------------------------------- Summary for test case 'selftest/filter/wildcard at both ends': All tests passed (4 assertions in 1 test case) -- Test case: 'selftest/option parsers' ------------------------ TestMain.cpp:351: -opt.parseIntoConfig( parser, config ) succeeded -line 353: -config.filters.size() == 1 succeeded for: 1 == 1 -line 354: -config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -line 355: -config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +[351] opt.parseIntoConfig( parser, config ) +succeeded + +[353] config.filters.size() == 1 +succeeded +for: 1 == 1 + +[354] config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false +succeeded +for: false == false + +[355] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) +succeeded +for: true + ---------------------------------------------------------------- Summary for test case 'selftest/option parsers': All tests passed (4 assertions in 1 test case) @@ -1920,83 +3053,146 @@ All tests passed (4 assertions in 1 test case) -- Test case: 'selftest/tags' ---------------------------------- -- Section: 'one tag' ------------------------------------------ TestMain.cpp:369: -oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -line 370: -oneTag.hasTag( "one" ) succeeded for: true -line 371: -oneTag.getTags().size() == 1 succeeded for: 1 == 1 -line 373: -oneTag.matchesTags( p1 ) == true succeeded for: true == true -line 374: -oneTag.matchesTags( p2 ) == true succeeded for: true == true -line 375: -oneTag.matchesTags( p3 ) == false succeeded for: false == false -line 376: -oneTag.matchesTags( p4 ) == false succeeded for: false == false -line 377: -oneTag.matchesTags( p5 ) == false succeeded for: false == false +[369] oneTag.getTestCaseInfo().description == "" +succeeded +for: "" == "" + +[370] oneTag.hasTag( "one" ) +succeeded +for: true + +[371] oneTag.getTags().size() == 1 +succeeded +for: 1 == 1 + +[373] oneTag.matchesTags( p1 ) == true +succeeded +for: true == true + +[374] oneTag.matchesTags( p2 ) == true +succeeded +for: true == true + +[375] oneTag.matchesTags( p3 ) == false +succeeded +for: false == false + +[376] oneTag.matchesTags( p4 ) == false +succeeded +for: false == false + +[377] oneTag.matchesTags( p5 ) == false +succeeded +for: false == false + ---------------------------------------------------------------- Summary for section 'one tag': All 8 assertions passed -- Section: 'two tags' ----------------------------------------- TestMain.cpp:383: -twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" -line 384: -twoTags.hasTag( "one" ) succeeded for: true -line 385: -twoTags.hasTag( "two" ) succeeded for: true -line 386: -twoTags.hasTag( "three" ) == false succeeded for: false == false -line 387: -twoTags.getTags().size() == 2 succeeded for: 2 == 2 -line 389: -twoTags.matchesTags( p1 ) == true succeeded for: true == true -line 390: -twoTags.matchesTags( p2 ) == true succeeded for: true == true -line 391: -twoTags.matchesTags( p3 ) == true succeeded for: true == true -line 392: -twoTags.matchesTags( p4 ) == true succeeded for: true == true -line 393: -twoTags.matchesTags( p5 ) == true succeeded for: true == true +[383] twoTags.getTestCaseInfo().description == "" +succeeded +for: "" == "" + +[384] twoTags.hasTag( "one" ) +succeeded +for: true + +[385] twoTags.hasTag( "two" ) +succeeded +for: true + +[386] twoTags.hasTag( "three" ) == false +succeeded +for: false == false + +[387] twoTags.getTags().size() == 2 +succeeded +for: 2 == 2 + +[389] twoTags.matchesTags( p1 ) == true +succeeded +for: true == true + +[390] twoTags.matchesTags( p2 ) == true +succeeded +for: true == true + +[391] twoTags.matchesTags( p3 ) == true +succeeded +for: true == true + +[392] twoTags.matchesTags( p4 ) == true +succeeded +for: true == true + +[393] twoTags.matchesTags( p5 ) == true +succeeded +for: true == true + ---------------------------------------------------------------- Summary for section 'two tags': All 10 assertions passed -- Section: 'one tag with characters either side' -------------- TestMain.cpp:399: -oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" -line 400: -oneTagWithExtras.hasTag( "one" ) succeeded for: true -line 401: -oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false -line 402: -oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 +[399] oneTagWithExtras.getTestCaseInfo().description == "1234" +succeeded +for: "1234" == "1234" + +[400] oneTagWithExtras.hasTag( "one" ) +succeeded +for: true + +[401] oneTagWithExtras.hasTag( "two" ) == false +succeeded +for: false == false + +[402] oneTagWithExtras.getTags().size() == 1 +succeeded +for: 1 == 1 + ---------------------------------------------------------------- Summary for section 'one tag with characters either side': All 4 assertions passed -- Section: 'start of a tag, but not closed' ------------------- TestMain.cpp:409: -oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" -line 410: -oneTagOpen.hasTag( "one" ) == false succeeded for: false == false -line 411: -oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 +[409] oneTagOpen.getTestCaseInfo().description == "[one" +succeeded +for: "[one" == "[one" + +[410] oneTagOpen.hasTag( "one" ) == false +succeeded +for: false == false + +[411] oneTagOpen.getTags().size() == 0 +succeeded +for: 0 == 0 + ---------------------------------------------------------------- Summary for section 'start of a tag, but not closed': All 3 assertions passed -- Section: 'hidden' ------------------------------------------- TestMain.cpp:417: -oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -line 418: -oneTag.hasTag( "hide" ) succeeded for: true -line 419: -oneTag.isHidden() succeeded for: true -line 421: -oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false +[417] oneTag.getTestCaseInfo().description == "" +succeeded +for: "" == "" + +[418] oneTag.hasTag( "hide" ) +succeeded +for: true + +[419] oneTag.isHidden() +succeeded +for: true + +[421] oneTag.matchesTags( "~[hide]" ) == false +succeeded +for: false == false + ---------------------------------------------------------------- Summary for section 'hidden': All 4 assertions passed @@ -2007,18 +3203,21 @@ All tests passed (29 assertions in 1 test case) -- Test case: './succeeding/Tricky/std::pair' ------------------ TrickyTests.cpp:37: -(std::pair( 1, 2 )) == aNicePair succeeded for: - +[37] (std::pair( 1, 2 )) == aNicePair +succeeded +for: std::pair( 1, 2 ) == std::pair( 1, 2 ) + ---------------------------------------------------------------- Summary for test case './succeeding/Tricky/std::pair': All tests passed (1 assertion in 1 test case) -- Test case: './inprogress/failing/Tricky/trailing expression' TrickyTests.cpp:55: -[warning: Uncomment the code in this test to check that it gives a sensible compiler error] +[55] [warning: Uncomment the code in this test to check that it gives a sensible compiler error] + No assertions in test case, './inprogress/failing/Tricky/trailing expression' @@ -2028,7 +3227,8 @@ Summary for test case './inprogress/failing/Tricky/trailing expression': -- Test case: './inprogress/failing/Tricky/compound lhs' ------- TrickyTests.cpp:71: -[warning: Uncomment the code in this test to check that it gives a sensible compiler error] +[71] [warning: Uncomment the code in this test to check that it gives a sensible compiler error] + No assertions in test case, './inprogress/failing/Tricky/compound lhs' @@ -2038,53 +3238,78 @@ Summary for test case './inprogress/failing/Tricky/compound lhs': -- Test case: './failing/Tricky/non streamable type' ----------- TrickyTests.cpp:95: -&o1 == &o2 failed for: 0x == 0x -line 96: -o1 == o2 failed for: {?} == {?} +[95] &o1 == &o2 +failed +for: 0x == 0x + +[96] o1 == o2 +failed +for: {?} == {?} + ---------------------------------------------------------------- Summary for test case './failing/Tricky/non streamable type': 1 test case - failed (2 assertions - both failed) -- Test case: './failing/string literals' ---------------------- TrickyTests.cpp:106: -std::string( "first" ) == "second" failed for: "first" == "second" +[106] std::string( "first" ) == "second" +failed +for: "first" == "second" + ---------------------------------------------------------------- Summary for test case './failing/string literals': 1 test case - failed (1 assertion - failed) -- Test case: './succeeding/side-effects' ---------------------- TrickyTests.cpp:119: -i++ == 7 succeeded for: 7 == 7 -line 120: -i++ == 8 succeeded for: 8 == 8 +[119] i++ == 7 +succeeded +for: 7 == 7 + +[120] i++ == 8 +succeeded +for: 8 == 8 + ---------------------------------------------------------------- Summary for test case './succeeding/side-effects': All tests passed (2 assertions in 1 test case) -- Test case: './succeeding/koenig' ---------------------------- TrickyTests.cpp:186: -0x == o succeeded for: 0x == {?} +[186] 0x == o +succeeded +for: 0x == {?} + ---------------------------------------------------------------- Summary for test case './succeeding/koenig': All tests passed (1 assertion in 1 test case) -- Test case: './succeeding/non-const==' ----------------------- TrickyTests.cpp:212: -t == 1u succeeded for: {?} == 1 +[212] t == 1u +succeeded +for: {?} == 1 + ---------------------------------------------------------------- Summary for test case './succeeding/non-const==': All tests passed (1 assertion in 1 test case) -- Test case: './succeeding/enum/bits' ------------------------- TrickyTests.cpp:224: -0x == bit30and31 succeeded for: 0x == 3221225472 +[224] 0x == bit30and31 +succeeded +for: 0x == 3221225472 + ---------------------------------------------------------------- Summary for test case './succeeding/enum/bits': All tests passed (1 assertion in 1 test case) -- Test case: './succeeding/boolean member' -------------------- TrickyTests.cpp:239: -obj.prop != __null succeeded for: 0x != 0 +[239] obj.prop != __null +succeeded +for: 0x != 0 + ---------------------------------------------------------------- Summary for test case './succeeding/boolean member': All tests passed (1 assertion in 1 test case) @@ -2092,41 +3317,62 @@ All tests passed (1 assertion in 1 test case) -- Test case: './succeeding/unimplemented static bool' --------- -- Section: 'compare to true' ---------------------------------- TrickyTests.cpp:259: -is_true::value == true succeeded for: true == true -line 260: -true == is_true::value succeeded for: true == true +[259] is_true::value == true +succeeded +for: true == true + +[260] true == is_true::value +succeeded +for: true == true + ---------------------------------------------------------------- Summary for section 'compare to true': All 2 assertions passed -- Section: 'compare to false' --------------------------------- TrickyTests.cpp:264: -is_true::value == false succeeded for: false == false -line 265: -false == is_true::value succeeded for: false == false +[264] is_true::value == false +succeeded +for: false == false + +[265] false == is_true::value +succeeded +for: false == false + ---------------------------------------------------------------- Summary for section 'compare to false': All 2 assertions passed -- Section: 'negation' ----------------------------------------- TrickyTests.cpp:270: -!is_true::value succeeded for: true +[270] !is_true::value +succeeded +for: true + ---------------------------------------------------------------- Summary for section 'negation': 1 assertion passed -- Section: 'double negation' ---------------------------------- TrickyTests.cpp:275: -!!is_true::value succeeded for: true +[275] !!is_true::value +succeeded +for: true + ---------------------------------------------------------------- Summary for section 'double negation': 1 assertion passed -- Section: 'direct' ------------------------------------------- TrickyTests.cpp:280: -is_true::value succeeded for: true -line 281: -!is_true::value succeeded for: !false +[280] is_true::value +succeeded +for: true + +[281] !is_true::value +succeeded +for: !false + ---------------------------------------------------------------- Summary for section 'direct': All 2 assertions passed @@ -2137,11 +3383,18 @@ All tests passed (8 assertions in 1 test case) -- Test case: './succeeding/SafeBool' -------------------------- TrickyTests.cpp:313: -True succeeded for: true -line 314: -!False succeeded for: true -line 315: -!False succeeded for: !false +[313] True +succeeded +for: true + +[314] !False +succeeded +for: true + +[315] !False +succeeded +for: !false + ---------------------------------------------------------------- Summary for test case './succeeding/SafeBool': All tests passed (3 assertions in 1 test case) @@ -2151,7 +3404,10 @@ All tests passed (3 assertions in 1 test case) -- Section: 'I do this' ---------------------------------------- -- Section: 'it should do this' -------------------------------- BDDTests.cpp:37: -itDoesThis() succeeded for: true +[37] itDoesThis() +succeeded +for: true + ---------------------------------------------------------------- Summary for section 'it should do this': 1 assertion passed @@ -2180,136 +3436,222 @@ Summary for all tests in 'CatchSelfTest': -- Group: '~dummy' --------------------------------------------- -- Test case: './succeeding/Approx/simple' --------------------- ApproxTests.cpp:20: -d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) -line 21: -d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) -line 22: -d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) -line 24: -Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 -line 25: -Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 -line 26: -Approx( d ) != 1.24 succeeded for: Approx( 1.23 ) != 1.24 +[20] d == Approx( 1.23 ) +succeeded +for: 1.23 == Approx( 1.23 ) + +[21] d != Approx( 1.22 ) +succeeded +for: 1.23 != Approx( 1.22 ) + +[22] d != Approx( 1.24 ) +succeeded +for: 1.23 != Approx( 1.24 ) + +[24] Approx( d ) == 1.23 +succeeded +for: Approx( 1.23 ) == 1.23 + +[25] Approx( d ) != 1.22 +succeeded +for: Approx( 1.23 ) != 1.22 + +[26] Approx( d ) != 1.24 +succeeded +for: Approx( 1.23 ) != 1.24 + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/simple': All tests passed (6 assertions in 1 test case) -- Test case: './succeeding/Approx/epsilon' -------------------- ApproxTests.cpp:38: -d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) -line 39: -d == Approx( 1.231 ).epsilon( 0.1 ) succeeded for: 1.23 == Approx( 1.231 ) +[38] d != Approx( 1.231 ) +succeeded +for: 1.23 != Approx( 1.231 ) + +[39] d == Approx( 1.231 ).epsilon( 0.1 ) +succeeded +for: 1.23 == Approx( 1.231 ) + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/epsilon': All tests passed (2 assertions in 1 test case) -- Test case: './succeeding/Approx/float' ---------------------- ApproxTests.cpp:49: -1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) -line 50: -0.0f == Approx( 0.0f ) succeeded for: 0 == Approx( 0 ) +[49] 1.23f == Approx( 1.23f ) +succeeded +for: 1.23 == Approx( 1.23 ) + +[50] 0.0f == Approx( 0.0f ) +succeeded +for: 0 == Approx( 0 ) + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/float': All tests passed (2 assertions in 1 test case) -- Test case: './succeeding/Approx/int' ------------------------ ApproxTests.cpp:60: -1 == Approx( 1 ) succeeded -line 61: -0 == Approx( 0 ) succeeded +[60] 1 == Approx( 1 ) +succeeded + +[61] 0 == Approx( 0 ) +succeeded + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/int': All tests passed (2 assertions in 1 test case) -- Test case: './succeeding/Approx/mixed' ---------------------- ApproxTests.cpp:75: -1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) -line 76: -0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) -line 77: -0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) -line 78: -1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) -line 79: -dMedium == Approx( 1.234f ) succeeded for: 1.234 == Approx( 1.234 ) +[75] 1.0f == Approx( 1 ) +succeeded +for: 1 == Approx( 1 ) + +[76] 0 == Approx( dZero) +succeeded +for: 0 == Approx( 0 ) + +[77] 0 == Approx( dSmall ).epsilon( 0.001 ) +succeeded +for: 0 == Approx( 1e-05 ) + +[78] 1.234f == Approx( dMedium ) +succeeded +for: 1.234 == Approx( 1.234 ) + +[79] dMedium == Approx( 1.234f ) +succeeded +for: 1.234 == Approx( 1.234 ) + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/mixed': All tests passed (5 assertions in 1 test case) -- Test case: './succeeding/Approx/custom' --------------------- ApproxTests.cpp:93: -d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) -line 94: -d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) -line 95: -d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) -line 96: -d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) -line 98: -approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 -line 99: -approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 -line 100: -approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 -line 101: -approx( d ) != 1.25 succeeded for: Approx( 1.23 ) != 1.25 +[93] d == approx( 1.23 ) +succeeded +for: 1.23 == Approx( 1.23 ) + +[94] d == approx( 1.22 ) +succeeded +for: 1.23 == Approx( 1.22 ) + +[95] d == approx( 1.24 ) +succeeded +for: 1.23 == Approx( 1.24 ) + +[96] d != approx( 1.25 ) +succeeded +for: 1.23 != Approx( 1.25 ) + +[98] approx( d ) == 1.23 +succeeded +for: Approx( 1.23 ) == 1.23 + +[99] approx( d ) == 1.22 +succeeded +for: Approx( 1.23 ) == 1.22 + +[100] approx( d ) == 1.24 +succeeded +for: Approx( 1.23 ) == 1.24 + +[101] approx( d ) != 1.25 +succeeded +for: Approx( 1.23 ) != 1.25 + ---------------------------------------------------------------- Summary for test case './succeeding/Approx/custom': All tests passed (8 assertions in 1 test case) -- Test case: './succeeding/TestClass/succeedingCase' ---------- ClassTests.cpp:24: -s == "hello" succeeded for: "hello" == "hello" +[24] s == "hello" +succeeded +for: "hello" == "hello" + ---------------------------------------------------------------- Summary for test case './succeeding/TestClass/succeedingCase': All tests passed (1 assertion in 1 test case) -- Test case: './failing/TestClass/failingCase' ---------------- ClassTests.cpp:28: -s == "world" failed for: "hello" == "world" +[28] s == "world" +failed +for: "hello" == "world" + ---------------------------------------------------------------- Summary for test case './failing/TestClass/failingCase': 1 test case - failed (1 assertion - failed) -- Test case: './succeeding/Fixture/succeedingCase' ------------ ClassTests.cpp:47: -m_a == 1 succeeded for: 1 == 1 +[47] m_a == 1 +succeeded +for: 1 == 1 + ---------------------------------------------------------------- Summary for test case './succeeding/Fixture/succeedingCase': All tests passed (1 assertion in 1 test case) -- Test case: './failing/Fixture/failingCase' ------------------ ClassTests.cpp:55: -m_a == 2 failed for: 1 == 2 +[55] m_a == 2 +failed +for: 1 == 2 + ---------------------------------------------------------------- Summary for test case './failing/Fixture/failingCase': 1 test case - failed (1 assertion - failed) -- Test case: './succeeding/conditions/equality' --------------- ConditionTests.cpp:55: -data.int_seven == 7 succeeded for: 7 == 7 -line 56: -data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) -line 57: -data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) -line 58: -data.str_hello == "hello" succeeded for: "hello" == "hello" -line 59: -"hello" == data.str_hello succeeded for: "hello" == "hello" -line 60: -data.str_hello.size() == 5 succeeded for: 5 == 5 -line 63: -x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) +[55] data.int_seven == 7 +succeeded +for: 7 == 7 + +[56] data.float_nine_point_one == Approx( 9.1f ) +succeeded +for: 9.1 == Approx( 9.1 ) + +[57] data.double_pi == Approx( 3.1415926535 ) +succeeded +for: 3.14159 == Approx( 3.14159 ) + +[58] data.str_hello == "hello" +succeeded +for: "hello" == "hello" + +[59] "hello" == data.str_hello +succeeded +for: "hello" == "hello" + +[60] data.str_hello.size() == 5 +succeeded +for: 5 == 5 + +[63] x == Approx( 1.3 ) +succeeded +for: 1.3 == Approx( 1.3 ) + ---------------------------------------------------------------- Summary for test case './succeeding/conditions/equality': All tests passed (7 assertions in 1 test case) -- Test case: './failing/conditions/equality' ------------------ ConditionTests.cpp:71: -data.int_seven == 6 failed for: 7 == 6 -line 72: -data.int_seven == 8 failed for: 7 == 8 +[71] data.int_seven == 6 +failed +for: 7 == 6 + +[72] data.int_seven == 8 +failed +for: 7 == 8 + ---------------------------------------------------------------- Summary for test case './failing/conditions/equality': 1 test case - failed (2 assertions - both failed) @@ -3726,7 +5068,7 @@ ConditionTests.cpp" line="193"> uc == 6 -  == 6 + 6 == 6 ConditionTests.cpp" line="195"> @@ -3774,7 +5116,7 @@ ConditionTests.cpp" line="200"> 6 == uc - 6 ==  + 6 == 6 ConditionTests.cpp" line="202"> @@ -3793,7 +5135,7 @@ ConditionTests.cpp" line="223"> long_var == unsigned_char_var - 1 ==  + 1 == 1 ConditionTests.cpp" line="224"> @@ -3828,7 +5170,7 @@ ConditionTests.cpp" line="237"> unsigned_char_var == 1 -  == 1 + 1 == 1 ConditionTests.cpp" line="238"> From cf5ced59d19366ff2c0ef0559bcb11f4cacb17a6 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 14 Dec 2012 07:50:08 +0000 Subject: [PATCH 098/296] Build 12 --- README | 2 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 134 +++++++++++++++++++---------- 3 files changed, 90 insertions(+), 48 deletions(-) diff --git a/README b/README index 0016a818..4c3c45a9 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 11 (integration branch) +CATCH v0.9 build 12 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 62f02eed..88b27b30 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 11, "integration" ); + Version libraryVersion( 0, 9, 12, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index b13567e6..cd5bd053 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 11 (integration branch) - * Generated: 2012-12-11 09:02:46.394854 + * CATCH v0.9 build 12 (integration branch) + * Generated: 2012-12-14 07:49:28.360647 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -593,7 +593,7 @@ inline std::string toString( bool value ) { inline std::string toString( char value ) { return value < ' ' - ? toString( (unsigned int)value ) + ? toString( static_cast( value ) ) : Detail::makeString( value ); } @@ -601,6 +601,10 @@ inline std::string toString( signed char value ) { return toString( static_cast( value ) ); } +inline std::string toString( unsigned char value ) { + return toString( static_cast( value ) ); +} + #ifdef CATCH_CONFIG_CPP11_NULLPTR inline std::string toString( std::nullptr_t ) { return "nullptr"; @@ -5710,7 +5714,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 11, "integration" ); + Version libraryVersion( 0, 9, 12, "integration" ); } // #included from: ../reporters/catch_reporter_basic.hpp @@ -6694,7 +6698,8 @@ namespace Catch { struct ConsoleReporter : AccumulatingReporter { ConsoleReporter( ReporterConfig const& _config ) - : AccumulatingReporter( _config ) + : AccumulatingReporter( _config ), + m_atLeastOneTestCasePrinted( false ) {} virtual ~ConsoleReporter(); @@ -6708,19 +6713,18 @@ namespace Catch { } void lazyPrintRunInfo() { - stream << "[Started testing: " << testRunInfo->name << "]" << std::endl; + printHeader( "Started testing", testRunInfo->name ); testRunInfo.reset(); } void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() ) - stream << "[Group: '" << unusedGroupInfo->name << "']" << std::endl; + printHeader( "Group", unusedGroupInfo->name ); unusedGroupInfo.reset(); } void lazyPrintTestCaseInfo() { - stream << "[Test case: '" << unusedTestCaseInfo->name << "']" << std::endl; + printHeader( "Test case", unusedTestCaseInfo->name ); unusedTestCaseInfo.reset(); } - void lazyPrintSectionInfo() { std::vector sections; for( ThreadedSectionInfo* section = unusedSectionInfo.get(); @@ -6730,11 +6734,36 @@ namespace Catch { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { - stream << "[Section: " << "'" + (*it)->name + "'" << "]" << std::endl; + printHeader( "Section", (*it)->name ); (*it)->printed = true; } unusedSectionInfo.reset(); } + + static std::string const& getDashes() { + static const std::string dashes = "----------------------------------------------------------------"; + return dashes; + } + static std::string const& getDoubleDashes() { + static const std::string doubleDashes = "================================================================"; + return doubleDashes; + } + static std::string const& getSpaces() { + static const std::string spaces = " "; + return spaces; + } + static std::string getSpaces( int spaces ) { + return getSpaces().substr( 0, spaces > 0 ? static_cast( spaces ) : 0 ); + } + + void printHeader( std::string const& _type, std::string const& _name ) { + std::size_t labelLen = _type.size() + _name.size() + 8; + std::size_t dashLen = getDashes().size(); + stream << "-- " << _type << ": '" << _name << "' " + << getDashes().substr( 0, labelLen < dashLen ? dashLen - labelLen : 0 ) + << std::endl; + } + void lazyPrint() { if( testRunInfo ) lazyPrintRunInfo(); @@ -6758,18 +6787,18 @@ namespace Catch { lazyPrint(); - printLineInfo( result.getSourceInfo() ); + int inset = printLineInfo( result.getSourceInfo() ); if( result.hasExpression() ) { TextColour colour( TextColour::OriginalExpression ); - stream << result.getExpression(); + stream << result.getExpression() << "\n"; if( result.succeeded() ) { TextColour successColour( TextColour::Success ); - stream << " succeeded"; + stream << "succeeded"; } else { TextColour errorColour( TextColour::Error ); - stream << " failed"; + stream << "failed"; if( result.isOk() ) { TextColour okAnywayColour( TextColour::Success ); stream << " - but was ok"; @@ -6843,17 +6872,12 @@ namespace Catch { } if( result.hasExpandedExpression() ) { - stream << " for: "; - if( result.getExpandedExpression().size() > 40 ) { - stream << "\n"; - if( result.getExpandedExpression().size() < 70 ) - stream << "\t"; - } + stream << "\nfor: "; TextColour colour( TextColour::ReconstructedExpression ); - stream << result.getExpandedExpression(); + stream << getSpaces( inset-5 ) << result.getExpandedExpression(); } - stream << std::endl; + stream << "\n" << std::endl; } void streamVariableLengthText( std::string const& prefix, std::string const& text ) { @@ -6923,7 +6947,8 @@ namespace Catch { stream << "\nNo assertions in section, '" << _sectionStats->sectionInfo.name << "'\n" << std::endl; } if( currentSectionInfo && currentSectionInfo->printed ) { - stream << "[Summary for section '" << _sectionStats->sectionInfo.name << "': "; + printSummarDivider(); + stream << "Summary for section '" << _sectionStats->sectionInfo.name << "':\n"; Counts const& assertions = _sectionStats->assertions; if( assertions.failed ) { TextColour colour( TextColour::ResultError ); @@ -6934,7 +6959,7 @@ namespace Catch { stream << ( assertions.passed > 1 ? "All " : "" ) << pluralise( assertions.passed, "assertion" ) << " passed" ; } - stream << "]\n" << std::endl; + stream << "\n" << std::endl; } AccumulatingReporter::sectionEnded( _sectionStats ); } @@ -6946,47 +6971,64 @@ namespace Catch { stream << "\nNo assertions in test case, '" << _testCaseStats->testInfo.name << "'\n" << std::endl; } if( !unusedTestCaseInfo ) { - stream << "[Summary for test case '" << _testCaseStats->testInfo.name << "': "; + m_atLeastOneTestCasePrinted = true; + printSummarDivider(); + stream << "Summary for test case '" << _testCaseStats->testInfo.name << "':\n"; printTotals( _testCaseStats->totals ); - stream << "]\n" << std::endl; + stream << "\n" << std::endl; } AccumulatingReporter::testCaseEnded( _testCaseStats ); } virtual void testGroupEnded( Ptr const& _testGroupStats ) { if( !unusedGroupInfo ) { - stream << "[Summary for group '" << _testGroupStats->groupInfo.name << "': "; + printSummarDivider(); + stream << "Summary for group '" << _testGroupStats->groupInfo.name << "':\n"; printTotals( _testGroupStats->totals ); - stream << "]\n" << std::endl; + stream << "\n" << std::endl; } AccumulatingReporter::testGroupEnded( _testGroupStats ); } virtual void testRunEnded( Ptr const& _testRunStats ) { - if( !unusedTestCaseInfo ) { - stream << "[Summary for '" << _testRunStats->runInfo.name << "': "; - printTotals( _testRunStats->totals ); - stream << "]\n" << std::endl; - } + if( m_atLeastOneTestCasePrinted ) + printTotalsDivider(); + stream << "Summary for all tests in '" << _testRunStats->runInfo.name << "':\n"; + printTotals( _testRunStats->totals ); + stream << "\n" << std::endl; AccumulatingReporter::testRunEnded( _testRunStats ); } - void printLineInfo( SourceLineInfo const& lineInfo ) { - if( !lineInfo.empty() ) { - if( m_lastPrintedLine.empty() || - m_lastPrintedLine.file != lineInfo.file || - abs( static_cast( m_lastPrintedLine.line ) - static_cast( lineInfo.line ) ) > 20 ) { - TextColour colour( TextColour::FileName ); - stream << lineInfo << "\n"; - m_lastPrintedLine = lineInfo; - } - else if( lineInfo.line != m_lastPrintedLine.line ) { - TextColour colour( TextColour::FileName ); - stream << "line " << lineInfo.line << ":\n"; - } + private: + void printTotalsDivider() { + stream << "================================================================\n"; + } + void printSummarDivider() { + stream << "----------------------------------------------------------------\n"; + } + static int countDigits( std::size_t number ) { + int digits = 1; + for( ; number != 0; digits++, number /= 10 ); + return digits; + } + + // Returns number of characters printed + int printLineInfo( SourceLineInfo const& lineInfo ) { + if( lineInfo.empty() ) + return 0; + if( m_lastPrintedLine.empty() || + m_lastPrintedLine.file != lineInfo.file || + abs( static_cast( m_lastPrintedLine.line ) - static_cast( lineInfo.line ) ) > 20 ) { + TextColour colour( TextColour::FileName ); + stream << lineInfo << "\n"; } + TextColour colour( TextColour::FileName ); + stream << "[" << lineInfo.line << "] "; + m_lastPrintedLine = lineInfo; + return 3 + countDigits( lineInfo.line ); } void resetLastPrintedLine() { m_lastPrintedLine = SourceLineInfo(); } + bool m_atLeastOneTestCasePrinted; SourceLineInfo m_lastPrintedLine; }; From 8b7115854054591d45340b5cb086fe71f9a78bc0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 14 Dec 2012 18:17:47 +0000 Subject: [PATCH 099/296] Fixed reference to basic reporter (to console reporter) --- include/internal/catch_commandline.hpp | 6 +- .../SelfTest/Baselines/approvedResults.txt | 56 +++++++++---------- projects/SelfTest/MiscTests.cpp | 5 +- projects/SelfTest/TestMain.cpp | 2 +- 4 files changed, 36 insertions(+), 33 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index cd774059..8c88ee27 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -378,12 +378,12 @@ namespace Catch { virtual std::string optionDescription() const { return "A reporter is an object that formats and structures the output of running " - "tests, and potentially summarises the results. By default a basic reporter " - "is used that writes IDE friendly results. CATCH comes bundled with some " + "tests, and potentially summarises the results. By default the console reporter " + "is used which writes IDE friendly results. CATCH comes bundled with some " "alternative reporters, but more can be added in client code.\n" "\n" "The bundled reporters are:\n" - " -r basic\n" + " -r console\n" " -r xml\n" " -r junit\n" "\n" diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 28c64f08..1537b30e 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -2026,8 +2026,8 @@ Summary for test case './failing/matchers/Equals': 1 test case - failed (1 assertion - failed) -- Test case: '/succeeding/matchers/AllOf' --------------------- -MiscTests.cpp:245: -[245] testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) +MiscTests.cpp:248: +[248] testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) @@ -2036,12 +2036,12 @@ Summary for test case '/succeeding/matchers/AllOf': All tests passed (1 assertion in 1 test case) -- Test case: '/succeeding/matchers/AnyOf' --------------------- -MiscTests.cpp:249: -[249] testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) +MiscTests.cpp:252: +[252] testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -[250] testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) +[253] testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) @@ -2050,8 +2050,8 @@ Summary for test case '/succeeding/matchers/AnyOf': All tests passed (2 assertions in 1 test case) -- Test case: './succeeding/matchers/Equals' ------------------- -MiscTests.cpp:255: -[255] testStringForMatching() Equals( "this string contains 'abc' as a substring" ) +MiscTests.cpp:258: +[258] 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" @@ -2060,24 +2060,24 @@ Summary for test case './succeeding/matchers/Equals': All tests passed (1 assertion in 1 test case) -- Test case: 'example/factorial' ------------------------------ -MiscTests.cpp:266: -[266] Factorial(0) == 1 +MiscTests.cpp:269: +[269] Factorial(0) == 1 succeeded for: 1 == 1 -[267] Factorial(1) == 1 +[270] Factorial(1) == 1 succeeded for: 1 == 1 -[268] Factorial(2) == 2 +[271] Factorial(2) == 2 succeeded for: 2 == 2 -[269] Factorial(3) == 6 +[272] Factorial(3) == 6 succeeded for: 6 == 6 -[270] Factorial(10) == 3628800 +[273] Factorial(10) == 3628800 succeeded for: 0x == 3628800 @@ -2094,8 +2094,8 @@ Summary for test case 'empty': 1 test case - failed (1 assertion - failed) -- Test case: 'Nice descriptive name' -------------------------- -MiscTests.cpp:279: -[279] [warning: This one ran] +MiscTests.cpp:282: +[282] [warning: This one ran] No assertions in test case, 'Nice descriptive name' @@ -2613,7 +2613,7 @@ Summary for section 'test lists': 1 assertion passed -- Section: 'reporter' ----------------------------------------- --- Section: '-r/basic' ----------------------------------------- +-- Section: '-r/console' --------------------------------------- TestMain.cpp:169: [169] parseIntoConfig( argv, config ) succeeded @@ -2623,7 +2623,7 @@ succeeded for: "console" == "console" ---------------------------------------------------------------- -Summary for section '-r/basic': +Summary for section '-r/console': All 2 assertions passed ---------------------------------------------------------------- @@ -4084,7 +4084,7 @@ MiscTests.cpp:240: -MiscTests.cpp:279: +MiscTests.cpp:282: @@ -7449,7 +7449,7 @@ MiscTests.cpp" line="240"> -MiscTests.cpp" line="245"> +MiscTests.cpp" line="248"> testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) @@ -7460,7 +7460,7 @@ MiscTests.cpp" line="245"> -MiscTests.cpp" line="249"> +MiscTests.cpp" line="252"> testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) @@ -7468,7 +7468,7 @@ MiscTests.cpp" line="249"> "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -MiscTests.cpp" line="250"> +MiscTests.cpp" line="253"> testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) @@ -7479,7 +7479,7 @@ MiscTests.cpp" line="250"> -MiscTests.cpp" line="255"> +MiscTests.cpp" line="258"> testStringForMatching() Equals( "this string contains 'abc' as a substring" ) @@ -7490,7 +7490,7 @@ MiscTests.cpp" line="255"> -MiscTests.cpp" line="266"> +MiscTests.cpp" line="269"> Factorial(0) == 1 @@ -7498,7 +7498,7 @@ MiscTests.cpp" line="266"> 1 == 1 -MiscTests.cpp" line="267"> +MiscTests.cpp" line="270"> Factorial(1) == 1 @@ -7506,7 +7506,7 @@ MiscTests.cpp" line="267"> 1 == 1 -MiscTests.cpp" line="268"> +MiscTests.cpp" line="271"> Factorial(2) == 2 @@ -7514,7 +7514,7 @@ MiscTests.cpp" line="268"> 2 == 2 -MiscTests.cpp" line="269"> +MiscTests.cpp" line="272"> Factorial(3) == 6 @@ -7522,7 +7522,7 @@ MiscTests.cpp" line="269"> 6 == 6 -MiscTests.cpp" line="270"> +MiscTests.cpp" line="273"> Factorial(10) == 3628800 @@ -7926,7 +7926,7 @@ TestMain.cpp" line="162">
-
+
TestMain.cpp" line="169"> parseIntoConfig( argv, config ) diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index b1cf90ff..1e68fc75 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -239,7 +239,10 @@ TEST_CASE("./failing/matchers/Equals", "") { CHECK_THAT( testStringForMatching(), Equals( "something else" ) ); } - +//TEST_CASE("string", "Equals with NULL") +//{ +// REQUIRE_THAT("", Equals(NULL)); +//} TEST_CASE("/succeeding/matchers/AllOf", "") { CHECK_THAT( testStringForMatching(), AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ); diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 064027b0..8db31ae0 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -164,7 +164,7 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { } SECTION( "reporter", "" ) { - SECTION( "-r/basic", "" ) { + SECTION( "-r/console", "" ) { const char* argv[] = { "test", "-r", "console" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); From 0d4609f5360d4902ad0844b0f5ce41a5b2035c32 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 14 Dec 2012 18:28:03 +0000 Subject: [PATCH 100/296] Clear state in AccumulatingReporter --- include/internal/catch_interfaces_reporter.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index efde354b..557aa6b9 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -232,6 +232,11 @@ namespace Catch unusedGroupInfo.reset(); } virtual void testRunEnded( Ptr const& /* _testRunStats */ ) { + currentSectionInfo.reset(); + unusedSectionInfo.reset(); + unusedTestCaseInfo.reset(); + unusedGroupInfo.reset(); + testRunInfo.reset(); } ReporterConfig m_config; From 74090753021e0ca7d5a0c0b076bc14a3c350523b Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 3 Jan 2013 08:48:05 +0000 Subject: [PATCH 101/296] Approval filter condenses hop filenames as well as cpp --- approvalTests.py | 2 +- projects/SelfTest/Baselines/approvedResults.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/approvalTests.py b/approvalTests.py index 29543425..1ecebe26 100644 --- a/approvalTests.py +++ b/approvalTests.py @@ -3,7 +3,7 @@ import sys import subprocess import re -filenameParser = re.compile( r'\s*.*/(.*\.cpp)(.*)' ) +filenameParser = re.compile( r'\s*.*/(.*\..pp)(.*)' ) hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' ) catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 1537b30e..7a5b1610 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -2123,7 +2123,7 @@ Summary for test case 'second tag': -- Test case: 'selftest/main' ---------------------------------- -- Section: 'selftest/expected result' ------------------------- -- Section: 'selftest/expected result/failing tests' ----------- -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:106: +catch_self_test.hpp:106: [106] succeeded [with message: Tests failed, as expected] @@ -2209,7 +2209,7 @@ All 25 assertions passed -- Section: 'selftest/expected result' ------------------------- -- Section: 'selftest/expected result/succeeding tests' -------- -/Users/Phil/Dev/OSS/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/../../../SelfTest/catch_self_test.hpp:95: +catch_self_test.hpp:95: [95] succeeded [with message: Tests passed, as expected] From bcf722eb81eb3e5222816cf4678e89f9c49fee22 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 3 Jan 2013 09:04:46 +0000 Subject: [PATCH 102/296] Reporter interface uses value types instead of shared ptrs again --- .gitignore | 1 + include/internal/catch_impl.hpp | 5 +- include/internal/catch_interfaces_reporter.h | 173 ++++++++++++++----- include/internal/catch_runner_impl.hpp | 24 +-- include/reporters/catch_reporter_console.hpp | 48 ++--- projects/SelfTest/catch_self_test.hpp | 10 +- 6 files changed, 178 insertions(+), 83 deletions(-) diff --git a/.gitignore b/.gitignore index 14f42f52..2072c5dd 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ UpgradeLog.XML projects/XCode4/iOSTest/Build/Intermediates/PrecompiledHeaders projects/XCode4/iOSTest/Build/Products/Debug-iphonesimulator/iOSTest.app.dSYM/Contents/Resources/DWARF projects/XCode4/iOSTest/Build +projects/XCode4/CatchSelfTest/DerivedData diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 8b4c226c..b6da5488 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -56,9 +56,12 @@ namespace Catch { TestGroupStats::~TestGroupStats() {} TestRunStats::~TestRunStats() {} ThreadedSectionInfo::~ThreadedSectionInfo() {} + TestGroupNode::~TestGroupNode() {} + TestRunNode::~TestRunNode() {} BasicReporter::~BasicReporter() {} - AccumulatingReporter::~AccumulatingReporter() {} + StreamingReporterBase::~StreamingReporterBase() {} + CumulativeReporterBase::~CumulativeReporterBase() {} ConsoleReporter::~ConsoleReporter() {} IRunner::~IRunner() {} IMutableContext::~IMutableContext() {} diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 557aa6b9..29c6a7a9 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -80,7 +80,7 @@ namespace Catch bool printed; }; - struct AssertionStats : SharedImpl<> { + struct AssertionStats { AssertionStats( AssertionResult const& _assertionResult, Totals const& _totals ) : assertionResult( _assertionResult ), @@ -92,7 +92,7 @@ namespace Catch Totals totals; }; - struct SectionStats : SharedImpl<> { + struct SectionStats { SectionStats( SectionInfo const& _sectionInfo, Counts const& _assertions, bool _missingAssertions ) @@ -107,7 +107,7 @@ namespace Catch bool missingAssertions; }; - struct TestCaseStats : SharedImpl<> { + struct TestCaseStats { TestCaseStats( TestCaseInfo const& _testInfo, Totals const& _totals, std::string const& _stdOut, @@ -131,7 +131,7 @@ namespace Catch bool aborting; }; - struct TestGroupStats : SharedImpl<> { + struct TestGroupStats { TestGroupStats( GroupInfo const& _groupInfo, Totals const& _totals, bool _aborting ) @@ -139,6 +139,10 @@ namespace Catch totals( _totals ), aborting( _aborting ) {} + TestGroupStats( GroupInfo const& _groupInfo ) + : groupInfo( _groupInfo ), + aborting( false ) + {} virtual ~TestGroupStats(); GroupInfo groupInfo; @@ -146,7 +150,7 @@ namespace Catch bool aborting; }; - struct TestRunStats : SharedImpl<> { + struct TestRunStats { TestRunStats( TestRunInfo const& _runInfo, Totals const& _totals, bool _aborting ) @@ -154,8 +158,13 @@ namespace Catch totals( _totals ), aborting( _aborting ) {} + TestRunStats( TestRunStats const& _other ) + : runInfo( _other.runInfo ), + totals( _other.totals ), + aborting( _other.aborting ) + {} virtual ~TestRunStats(); - + TestRunInfo runInfo; Totals totals; bool aborting; @@ -178,25 +187,21 @@ namespace Catch virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; - virtual void assertionEnded( Ptr const& assertionStats ) = 0; - virtual void sectionEnded( Ptr const& sectionStats ) = 0; - virtual void testCaseEnded( Ptr const& testCaseStats ) = 0; - virtual void testGroupEnded( Ptr const& testGroupStats ) = 0; - virtual void testRunEnded( Ptr const& testRunStats ) = 0; + virtual void assertionEnded( AssertionStats const& assertionStats ) = 0; + virtual void sectionEnded( SectionStats const& sectionStats ) = 0; + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; + virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; }; - // !TBD: Derived helper that implements the streaming interface but holds the stats - // - declares a new interface where methods are called at the end of each event - // - this would be used by the JUnit reporter, for example. - // - it may be used by the basic reporter, too, but that would clear down the stack - // as it goes - struct AccumulatingReporter : SharedImpl { - AccumulatingReporter( ReporterConfig const& _config ) + struct StreamingReporterBase : SharedImpl { + + StreamingReporterBase( ReporterConfig const& _config ) : m_config( _config ), stream( _config.stream() ) {} - virtual ~AccumulatingReporter(); + virtual ~StreamingReporterBase(); virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { testRunInfo = _testRunInfo; @@ -221,17 +226,17 @@ namespace Catch } } - virtual void sectionEnded( Ptr const& /* _sectionStats */ ) { + virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { currentSectionInfo = currentSectionInfo->parent; unusedSectionInfo = currentSectionInfo; } - virtual void testCaseEnded( Ptr const& /* _testCaseStats */ ) { + virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { unusedTestCaseInfo.reset(); } - virtual void testGroupEnded( Ptr const& /* _testGroupStats */ ) { + virtual void testGroupEnded( TestGroupStats const& /* _testGroupStats */ ) { unusedGroupInfo.reset(); } - virtual void testRunEnded( Ptr const& /* _testRunStats */ ) { + virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { currentSectionInfo.reset(); unusedSectionInfo.reset(); unusedTestCaseInfo.reset(); @@ -249,6 +254,92 @@ namespace Catch std::ostream& stream; }; + struct TestGroupNode : TestGroupStats { + TestGroupNode( TestGroupStats const& _stats ) : TestGroupStats( _stats ) {} +// TestGroupNode( GroupInfo const& _info ) : TestGroupStats( _stats ) {} + ~TestGroupNode(); + + }; + + struct TestRunNode : TestRunStats { + + TestRunNode( TestRunStats const& _stats ) : TestRunStats( _stats ) {} + ~TestRunNode(); + + std::vector groups; + }; + + + + // !TBD: Derived helper that implements the streaming interface but holds the stats + // - declares a new interface where methods are called at the end of each event + // - this would be used by the JUnit reporter, for example. + // - it may be used by the basic reporter, too, but that would clear down the stack + // as it goes + struct CumulativeReporterBase : SharedImpl { + + CumulativeReporterBase( ReporterConfig const& _config ) + : m_config( _config ), + stream( _config.stream() ) + {} + + virtual ~CumulativeReporterBase(); + + virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { +// testRunInfo = _testRunInfo; + } + virtual void testGroupStarting( GroupInfo const& _groupInfo ) { + testGroupNode = TestGroupNode( _groupInfo ); + } + + virtual void testCaseStarting( TestCaseInfo const& _testInfo ) { +// unusedTestCaseInfo = _testInfo; + } + virtual void sectionStarting( SectionInfo const& _sectionInfo ) { +// Ptr sectionInfo = new ThreadedSectionInfo( _sectionInfo ); +// unusedSectionInfo = sectionInfo; +// if( !currentSectionInfo ) { +// currentSectionInfo = sectionInfo; +// } +// else { +// currentSectionInfo->children.push_back( sectionInfo ); +// sectionInfo->parent = currentSectionInfo; +// currentSectionInfo = sectionInfo; +// } + } + + virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { +// currentSectionInfo = currentSectionInfo->parent; +// unusedSectionInfo = currentSectionInfo; + } + virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { +// unusedTestCaseInfo.reset(); + } + virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { +// testGroupNode-> // populate +// Ptr node ( new TestGroupNode( _testGroupStats ) ); +// unusedGroupInfo.reset(); + } + virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { +// currentSectionInfo.reset(); +// unusedSectionInfo.reset(); +// unusedTestCaseInfo.reset(); +// unusedGroupInfo.reset(); +// testRunInfo.reset(); + } + + ReporterConfig m_config; +// Option testRunInfo; +// Option unusedGroupInfo; +// Option unusedTestCaseInfo; +// Ptr unusedSectionInfo; +// Ptr currentSectionInfo; +// bool currentSectionOpen; +// Ptr testGroupNode; + Option testGroupNode; + std::ostream& stream; + }; + // Deprecated @@ -302,30 +393,30 @@ namespace Catch // Not on legacy interface } - virtual void assertionEnded( Ptr const& assertionStats ) { - m_legacyReporter->Result( assertionStats->assertionResult ); + virtual void assertionEnded( AssertionStats const& assertionStats ) { + m_legacyReporter->Result( assertionStats.assertionResult ); } - virtual void sectionEnded( Ptr const& sectionStats ) { - if( sectionStats->missingAssertions ) - m_legacyReporter->NoAssertionsInSection( sectionStats->sectionInfo.name ); - m_legacyReporter->EndSection( sectionStats->sectionInfo.name, sectionStats->assertions ); + virtual void sectionEnded( SectionStats const& sectionStats ) { + if( sectionStats.missingAssertions ) + m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); + m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); } - virtual void testCaseEnded( Ptr const& testCaseStats ) { - if( testCaseStats->missingAssertions ) - m_legacyReporter->NoAssertionsInTestCase( testCaseStats->testInfo.name ); + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { + if( testCaseStats.missingAssertions ) + m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name ); m_legacyReporter->EndTestCase - ( testCaseStats->testInfo, - testCaseStats->totals, - testCaseStats->stdOut, - testCaseStats->stdErr ); + ( testCaseStats.testInfo, + testCaseStats.totals, + testCaseStats.stdOut, + testCaseStats.stdErr ); } - virtual void testGroupEnded( Ptr const& testGroupStats ) { - if( testGroupStats->aborting ) + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { + if( testGroupStats.aborting ) m_legacyReporter->Aborted(); - m_legacyReporter->EndGroup( testGroupStats->groupInfo.name, testGroupStats->totals ); + m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals ); } - virtual void testRunEnded( Ptr const& testRunStats ) { - m_legacyReporter->EndTesting( testRunStats->totals ); + virtual void testRunEnded( TestRunStats const& testRunStats ) { + m_legacyReporter->EndTesting( testRunStats.totals ); } private: diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 72c54467..8c94aa22 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -73,7 +73,7 @@ namespace Catch { } virtual ~Runner() { - m_reporter->testRunEnded( new TestRunStats( m_runInfo, m_totals, aborting() ) ); + m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) ); m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); @@ -84,7 +84,7 @@ namespace Catch { m_reporter->testGroupStarting( GroupInfo( testSpec ) ); } void testGroupEnded( std::string const& testSpec, Totals const& totals ) { - m_reporter->testGroupEnded( new TestGroupStats( GroupInfo( testSpec ), totals, aborting() ) ); + m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec ), totals, aborting() ) ); } Totals runMatching( const std::string& testSpec ) { @@ -135,12 +135,12 @@ namespace Catch { m_totals.testCases += deltaTotals.testCases; - m_reporter->testCaseEnded( new TestCaseStats( testInfo, - deltaTotals, - redirectedCout, - redirectedCerr, - missingAssertions, - aborting() ) ); + m_reporter->testCaseEnded( TestCaseStats( testInfo, + deltaTotals, + redirectedCout, + redirectedCerr, + missingAssertions, + aborting() ) ); delete m_runningTest; @@ -171,13 +171,13 @@ namespace Catch { std::vector::const_iterator it = m_scopedInfos.begin(); std::vector::const_iterator itEnd = m_scopedInfos.end(); for(; it != itEnd; ++it ) - m_reporter->assertionEnded( new AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); + m_reporter->assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); std::vector::const_iterator itEnd = m_assertionResults.end(); for(; it != itEnd; ++it ) - m_reporter->assertionEnded( new AssertionStats( *it, m_totals ) ); + m_reporter->assertionEnded( AssertionStats( *it, m_totals ) ); } m_assertionResults.clear(); } @@ -188,7 +188,7 @@ namespace Catch { m_totals.assertions.info++; } else - m_reporter->assertionEnded( new AssertionStats( result, m_totals ) ); + m_reporter->assertionEnded( AssertionStats( result, m_totals ) ); // Reset AssertionInfo m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); @@ -228,7 +228,7 @@ namespace Catch { } m_runningTest->endSection( info.name ); - m_reporter->sectionEnded( new SectionStats( info, assertions, missingAssertions ) ); + m_reporter->sectionEnded( SectionStats( info, assertions, missingAssertions ) ); } virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index de523044..3a74be88 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -14,9 +14,9 @@ namespace Catch { - struct ConsoleReporter : AccumulatingReporter { + struct ConsoleReporter : StreamingReporterBase { ConsoleReporter( ReporterConfig const& _config ) - : AccumulatingReporter( _config ), + : StreamingReporterBase( _config ), m_atLeastOneTestCasePrinted( false ) {} @@ -95,9 +95,9 @@ namespace Catch { virtual void assertionStarting( AssertionInfo const& ) { } - virtual void assertionEnded( Ptr const& _assertionStats ) { + virtual void assertionEnded( AssertionStats const& _assertionStats ) { - AssertionResult const& result = _assertionStats->assertionResult; + AssertionResult const& result = _assertionStats.assertionResult; // Drop out if result was successful and we're not printing those if( !m_config.includeSuccessfulResults() && result.isOk() ) @@ -257,17 +257,17 @@ namespace Catch { } } - virtual void sectionEnded( Ptr const& _sectionStats ) { + virtual void sectionEnded( SectionStats const& _sectionStats ) { resetLastPrintedLine(); - if( _sectionStats->missingAssertions ) { + if( _sectionStats.missingAssertions ) { lazyPrint(); TextColour colour( TextColour::ResultError ); - stream << "\nNo assertions in section, '" << _sectionStats->sectionInfo.name << "'\n" << std::endl; + stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; } if( currentSectionInfo && currentSectionInfo->printed ) { printSummarDivider(); - stream << "Summary for section '" << _sectionStats->sectionInfo.name << "':\n"; - Counts const& assertions = _sectionStats->assertions; + stream << "Summary for section '" << _sectionStats.sectionInfo.name << "':\n"; + Counts const& assertions = _sectionStats.assertions; if( assertions.failed ) { TextColour colour( TextColour::ResultError ); printAssertionCounts( "assertion", assertions ); @@ -279,40 +279,40 @@ namespace Catch { } stream << "\n" << std::endl; } - AccumulatingReporter::sectionEnded( _sectionStats ); + StreamingReporterBase::sectionEnded( _sectionStats ); } - virtual void testCaseEnded( Ptr const& _testCaseStats ) { + virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) { resetLastPrintedLine(); - if( _testCaseStats->missingAssertions ) { + if( _testCaseStats.missingAssertions ) { lazyPrint(); TextColour colour( TextColour::ResultError ); - stream << "\nNo assertions in test case, '" << _testCaseStats->testInfo.name << "'\n" << std::endl; + stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl; } if( !unusedTestCaseInfo ) { m_atLeastOneTestCasePrinted = true; printSummarDivider(); - stream << "Summary for test case '" << _testCaseStats->testInfo.name << "':\n"; - printTotals( _testCaseStats->totals ); + stream << "Summary for test case '" << _testCaseStats.testInfo.name << "':\n"; + printTotals( _testCaseStats.totals ); stream << "\n" << std::endl; } - AccumulatingReporter::testCaseEnded( _testCaseStats ); + StreamingReporterBase::testCaseEnded( _testCaseStats ); } - virtual void testGroupEnded( Ptr const& _testGroupStats ) { + virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { if( !unusedGroupInfo ) { printSummarDivider(); - stream << "Summary for group '" << _testGroupStats->groupInfo.name << "':\n"; - printTotals( _testGroupStats->totals ); + stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n"; + printTotals( _testGroupStats.totals ); stream << "\n" << std::endl; } - AccumulatingReporter::testGroupEnded( _testGroupStats ); + StreamingReporterBase::testGroupEnded( _testGroupStats ); } - virtual void testRunEnded( Ptr const& _testRunStats ) { + virtual void testRunEnded( TestRunStats const& _testRunStats ) { if( m_atLeastOneTestCasePrinted ) printTotalsDivider(); - stream << "Summary for all tests in '" << _testRunStats->runInfo.name << "':\n"; - printTotals( _testRunStats->totals ); + stream << "Summary for all tests in '" << _testRunStats.runInfo.name << "':\n"; + printTotals( _testRunStats.totals ); stream << "\n" << std::endl; - AccumulatingReporter::testRunEnded( _testRunStats ); + StreamingReporterBase::testRunEnded( _testRunStats ); } private: diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index 9454e221..03505f69 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -40,11 +40,11 @@ namespace Catch { virtual void testCaseStarting( TestCaseInfo const& ) {} virtual void sectionStarting( SectionInfo const& ) {} virtual void assertionStarting( AssertionInfo const& ) {} - virtual void assertionEnded( Ptr const& ) {} - virtual void sectionEnded( Ptr const& ) {} - virtual void testCaseEnded( Ptr const& ) {} - virtual void testGroupEnded( Ptr const& ) {} - virtual void testRunEnded( Ptr const& ) {} + virtual void assertionEnded( AssertionStats const& ) {} + virtual void sectionEnded( SectionStats const& ) {} + virtual void testCaseEnded( TestCaseStats const& ) {} + virtual void testGroupEnded( TestGroupStats const& ) {} + virtual void testRunEnded( TestRunStats const& ) {} }; class EmbeddedRunner { From 619d53439d781a7bdaef18cf8f753577c0966594 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 3 Jan 2013 19:19:00 +0000 Subject: [PATCH 103/296] Added "basic" reports to the Approval results (in addition to the console reports) --- approvalTests.py | 4 +- .../SelfTest/Baselines/approvedResults.txt | 1423 +++++++++++++++++ 2 files changed, 1425 insertions(+), 2 deletions(-) diff --git a/approvalTests.py b/approvalTests.py index 1ecebe26..b0bf4845 100644 --- a/approvalTests.py +++ b/approvalTests.py @@ -14,12 +14,12 @@ filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unap cmdPath = sys.argv[1] f = open( rawResultsPath, 'w' ) -#subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic" ], stdout=f, stderr=f ) -#subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic", "-a", "4" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console", "-a", "4" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "junit" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "xml" ], stdout=f, stderr=f ) +subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic" ], stdout=f, stderr=f ) +subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "basic", "-a", "4" ], stdout=f, stderr=f ) f.close() rawFile = open( rawResultsPath, 'r' ) diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 7a5b1610..2a354847 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -9007,3 +9007,1426 @@ BDDTests.cpp" line="37"> +[Started testing: CatchSelfTest] +[Started group: '~dummy'] + +[Running: ./succeeding/Approx/simple] +ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) +ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) +ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 +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] +ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) +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] +ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) +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] +ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded +ApproxTests.cpp:61: 0 == Approx( 0 ) succeeded +[Finished: './succeeding/Approx/int' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/Approx/mixed] +ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) +ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) +ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) +ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) +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] +ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) +ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) +ApproxTests.cpp:96: d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) +ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 +ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 +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] +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] +ClassTests.cpp:28: s == "world" failed for: "hello" == "world" +[Finished: './failing/TestClass/failingCase' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/Fixture/succeedingCase] +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] +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] +ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 +ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) +ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) +ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" +ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" +ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 +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] +ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 +ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 +ConditionTests.cpp:73: data.int_seven == 0 failed for: 7 == 0 +ConditionTests.cpp:74: data.float_nine_point_one == Approx( 9.11f ) failed for: 9.1 == Approx( 9.11 ) +ConditionTests.cpp:75: data.float_nine_point_one == Approx( 9.0f ) failed for: 9.1 == Approx( 9 ) +ConditionTests.cpp:76: data.float_nine_point_one == Approx( 1 ) failed for: 9.1 == Approx( 1 ) +ConditionTests.cpp:77: data.float_nine_point_one == Approx( 0 ) failed for: 9.1 == Approx( 0 ) +ConditionTests.cpp:78: data.double_pi == Approx( 3.1415 ) failed for: 3.14159 == Approx( 3.1415 ) +ConditionTests.cpp:79: data.str_hello == "goodbye" failed for: "hello" == "goodbye" +ConditionTests.cpp:80: data.str_hello == "hell" failed for: "hello" == "hell" +ConditionTests.cpp:81: data.str_hello == "hello1" failed for: "hello" == "hello1" +ConditionTests.cpp:82: data.str_hello.size() == 6 failed for: 5 == 6 +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] +ConditionTests.cpp:93: data.int_seven != 6 succeeded for: 7 != 6 +ConditionTests.cpp:94: data.int_seven != 8 succeeded for: 7 != 8 +ConditionTests.cpp:95: data.float_nine_point_one != Approx( 9.11f ) succeeded for: 9.1 != Approx( 9.11 ) +ConditionTests.cpp:96: data.float_nine_point_one != Approx( 9.0f ) succeeded for: 9.1 != Approx( 9 ) +ConditionTests.cpp:97: data.float_nine_point_one != Approx( 1 ) succeeded for: 9.1 != Approx( 1 ) +ConditionTests.cpp:98: data.float_nine_point_one != Approx( 0 ) succeeded for: 9.1 != Approx( 0 ) +ConditionTests.cpp:99: data.double_pi != Approx( 3.1415 ) succeeded for: 3.14159 != Approx( 3.1415 ) +ConditionTests.cpp:100: data.str_hello != "goodbye" succeeded for: "hello" != "goodbye" +ConditionTests.cpp:101: data.str_hello != "hell" succeeded for: "hello" != "hell" +ConditionTests.cpp:102: data.str_hello != "hello1" succeeded for: "hello" != "hello1" +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] +ConditionTests.cpp:111: data.int_seven != 7 failed for: 7 != 7 +ConditionTests.cpp:112: data.float_nine_point_one != Approx( 9.1f ) failed for: 9.1 != Approx( 9.1 ) +ConditionTests.cpp:113: data.double_pi != Approx( 3.1415926535 ) failed for: 3.14159 != Approx( 3.14159 ) +ConditionTests.cpp:114: data.str_hello != "hello" failed for: "hello" != "hello" +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] +ConditionTests.cpp:124: data.int_seven < 8 succeeded for: 7 < 8 +ConditionTests.cpp:125: data.int_seven > 6 succeeded for: 7 > 6 +ConditionTests.cpp:126: data.int_seven > 0 succeeded for: 7 > 0 +ConditionTests.cpp:127: data.int_seven > -1 succeeded for: 7 > -1 +ConditionTests.cpp:129: data.int_seven >= 7 succeeded for: 7 >= 7 +ConditionTests.cpp:130: data.int_seven >= 6 succeeded for: 7 >= 6 +ConditionTests.cpp:131: data.int_seven <= 7 succeeded for: 7 <= 7 +ConditionTests.cpp:132: data.int_seven <= 8 succeeded for: 7 <= 8 +ConditionTests.cpp:134: data.float_nine_point_one > 9 succeeded for: 9.1 > 9 +ConditionTests.cpp:135: data.float_nine_point_one < 10 succeeded for: 9.1 < 10 +ConditionTests.cpp:136: data.float_nine_point_one < 9.2 succeeded for: 9.1 < 9.2 +ConditionTests.cpp:138: data.str_hello <= "hello" succeeded for: "hello" <= "hello" +ConditionTests.cpp:139: data.str_hello >= "hello" succeeded for: "hello" >= "hello" +ConditionTests.cpp:141: data.str_hello < "hellp" succeeded for: "hello" < "hellp" +ConditionTests.cpp:142: data.str_hello < "zebra" succeeded for: "hello" < "zebra" +ConditionTests.cpp:143: data.str_hello > "hellm" succeeded for: "hello" > "hellm" +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] +ConditionTests.cpp:152: data.int_seven > 7 failed for: 7 > 7 +ConditionTests.cpp:153: data.int_seven < 7 failed for: 7 < 7 +ConditionTests.cpp:154: data.int_seven > 8 failed for: 7 > 8 +ConditionTests.cpp:155: data.int_seven < 6 failed for: 7 < 6 +ConditionTests.cpp:156: data.int_seven < 0 failed for: 7 < 0 +ConditionTests.cpp:157: data.int_seven < -1 failed for: 7 < -1 +ConditionTests.cpp:159: data.int_seven >= 8 failed for: 7 >= 8 +ConditionTests.cpp:160: data.int_seven <= 6 failed for: 7 <= 6 +ConditionTests.cpp:162: data.float_nine_point_one < 9 failed for: 9.1 < 9 +ConditionTests.cpp:163: data.float_nine_point_one > 10 failed for: 9.1 > 10 +ConditionTests.cpp:164: data.float_nine_point_one > 9.2 failed for: 9.1 > 9.2 +ConditionTests.cpp:166: data.str_hello > "hello" failed for: "hello" > "hello" +ConditionTests.cpp:167: data.str_hello < "hello" failed for: "hello" < "hello" +ConditionTests.cpp:168: data.str_hello > "hellp" failed for: "hello" > "hellp" +ConditionTests.cpp:169: data.str_hello > "z" failed for: "hello" > "z" +ConditionTests.cpp:170: data.str_hello < "hellm" failed for: "hello" < "hellm" +ConditionTests.cpp:171: data.str_hello < "a" failed for: "hello" < "a" +ConditionTests.cpp:173: data.str_hello >= "z" failed for: "hello" >= "z" +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] +ConditionTests.cpp:188: i == 1 succeeded for: 1 == 1 +ConditionTests.cpp:189: ui == 2 succeeded for: 2 == 2 +ConditionTests.cpp:190: l == 3 succeeded for: 3 == 3 +ConditionTests.cpp:191: ul == 4 succeeded for: 4 == 4 +ConditionTests.cpp:192: c == 5 succeeded for: 5 == 5 +ConditionTests.cpp:193: uc == 6 succeeded for: 6 == 6 +ConditionTests.cpp:195: 1 == i succeeded for: 1 == 1 +ConditionTests.cpp:196: 2 == ui succeeded for: 2 == 2 +ConditionTests.cpp:197: 3 == l succeeded for: 3 == 3 +ConditionTests.cpp:198: 4 == ul succeeded for: 4 == 4 +ConditionTests.cpp:199: 5 == c succeeded for: 5 == 5 +ConditionTests.cpp:200: 6 == uc succeeded for: 6 == 6 +ConditionTests.cpp:202: (std::numeric_limits::max)() > ul succeeded for: 0x > 4 +[Finished: './succeeding/conditions/int literals' All tests passed (13 assertions in 1 test case)] + +[Running: ./succeeding/conditions//long_to_unsigned_x] +ConditionTests.cpp:223: long_var == unsigned_char_var succeeded for: 1 == 1 +ConditionTests.cpp:224: long_var == unsigned_short_var succeeded for: 1 == 1 +ConditionTests.cpp:225: long_var == unsigned_int_var succeeded for: 1 == 1 +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/const ints to int literal] +ConditionTests.cpp:237: unsigned_char_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:238: unsigned_short_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:239: unsigned_int_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:240: unsigned_long_var == 1 succeeded for: 1 == 1 +[Finished: './succeeding/conditions/const ints to int literal' All tests passed (4 assertions in 1 test case)] + +[Running: ./succeeding/conditions/negative ints] +ConditionTests.cpp:246: ( -1 > 2u ) succeeded for: true +ConditionTests.cpp:247: -1 > 2u succeeded for: -1 > 2 +ConditionTests.cpp:249: ( 2u < -1 ) succeeded for: true +ConditionTests.cpp:250: 2u < -1 succeeded for: 2 < -1 +ConditionTests.cpp:253: ( minInt > 2u ) succeeded for: true +ConditionTests.cpp:254: 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] +ConditionTests.cpp:269: 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] +ConditionTests.cpp:285: p == __null succeeded for: __null == 0 +ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null +ConditionTests.cpp:291: p != __null succeeded for: 0x != 0 +ConditionTests.cpp:294: cp != __null succeeded for: 0x != 0 +ConditionTests.cpp:297: cpc != __null succeeded for: 0x != 0 +ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 +ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 +ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x +[Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] + +[Running: ./succeeding/conditions/not] +ConditionTests.cpp:317: false == false succeeded +ConditionTests.cpp:318: true == true succeeded +ConditionTests.cpp:319: !false succeeded for: true +ConditionTests.cpp:320: !false succeeded +ConditionTests.cpp:322: !falseValue succeeded for: true +ConditionTests.cpp:323: !falseValue succeeded for: !false +ConditionTests.cpp:325: !(1 == 2) succeeded for: true +ConditionTests.cpp:326: !1 == 2 succeeded for: !(1 == 2) +[Finished: './succeeding/conditions/not' All tests passed (8 assertions in 1 test case)] + +[Running: ./failing/conditions/not] +ConditionTests.cpp:334: false != false failed +ConditionTests.cpp:335: true != true failed +ConditionTests.cpp:336: !true failed for: false +ConditionTests.cpp:337: !true failed +ConditionTests.cpp:339: !trueValue failed for: false +ConditionTests.cpp:340: !trueValue failed for: !true +ConditionTests.cpp:342: !(1 == 1) failed for: false +ConditionTests.cpp:343: !1 == 1 failed for: !(1 == 1) +[Finished: './failing/conditions/not' 1 test case failed (All 8 assertions failed)] + +[Running: ./succeeding/exceptions/explicit] +ExceptionTests.cpp:39: thisThrows() succeeded +ExceptionTests.cpp:40: thisDoesntThrow() succeeded +ExceptionTests.cpp:41: thisThrows() succeeded +[Finished: './succeeding/exceptions/explicit' All tests passed (3 assertions in 1 test case)] + +[Running: ./failing/exceptions/explicit] +ExceptionTests.cpp:47: thisThrows() failed with unexpected exception with message: 'expected exception' +ExceptionTests.cpp:48: thisDoesntThrow() failed because no exception was thrown where one was expected +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] +ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' +[Finished: './failing/exceptions/implicit' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/implicit/2] +ExceptionTests.cpp:60: 1 == 1 succeeded +ExceptionTests.cpp:60: {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' +[Finished: './failing/exceptions/implicit/2' 1 test case failed (1 of 2 assertions failed)] + +[Running: ./succeeding/exceptions/implicit] + +No assertions in test case, './succeeding/exceptions/implicit' + +[Finished: './succeeding/exceptions/implicit' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/custom] +ExceptionTests.cpp:102: Unexpected exception with message: 'custom exception' +[Finished: './failing/exceptions/custom' 1 test case failed (1 assertion failed)] + +[Running: ./failing/exceptions/custom/nothrow] +ExceptionTests.cpp:109: 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] +ExceptionTests.cpp:114: 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] +ExceptionTests.cpp:118: Unexpected exception with message: '3.14' +[Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/exceptions/notimplemented] +ExceptionTests.cpp:129: thisFunctionNotImplemented( 7 ) succeeded +[Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/generators/1] +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 200 == 200 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 202 == 202 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 204 == 204 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 206 == 206 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 208 == 208 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 210 == 210 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 212 == 212 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 2 == 2 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 4 == 4 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 6 == 6 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 8 == 8 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 10 == 10 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 30 == 30 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 40 == 40 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 42 == 42 +GeneratorTests.cpp:27: multiply( j, 2 ) == j*2 succeeded for: 214 == 214 +GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 +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] +MessageTests.cpp:14: [warning: this is a warning] + +No assertions in test case, './succeeding/message' + +[Finished: './succeeding/message' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/succeed] +MessageTests.cpp:18: succeeded +[with message: this is a success] +[Finished: './succeeding/succeed' All tests passed (1 assertion in 1 test case)] + +[Running: ./failing/message/info/1] +MessageTests.cpp:23: [info: this message should be logged] +MessageTests.cpp:24: [info: so should this] +MessageTests.cpp:26: a == 1 failed for: 2 == 1 +[Finished: './failing/message/info/1' 1 test case failed (1 assertion failed)] + +[Running: ./mixed/message/info/2] +MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 +MessageTests.cpp:31: [info: this message should be logged] +MessageTests.cpp:35: [info: this message should be logged, too] +MessageTests.cpp:37: a == 1 failed for: 2 == 1 +MessageTests.cpp:39: [info: and this, but later] +MessageTests.cpp:41: a == 0 failed for: 2 == 0 +MessageTests.cpp:45: a == 2 succeeded for: 2 == 2 +[Finished: './mixed/message/info/2' 1 test case failed (2 of 4 assertions failed)] + +[Running: ./failing/message/fail] +MessageTests.cpp:51: 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'] +MessageTests.cpp:58: failed with message: 'Message from section one' +[End of section: 'one' 1 assertion failed] + +[Started section: 'two'] +MessageTests.cpp:63: 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)] +Message from section one + +[Running: ./succeeding/message/sections/stdout] +[Started section: 'one'] + +No assertions in section, 'one' + +[End of section: 'one' 1 assertion failed] + +Message from section two +[Started section: 'two'] + +No assertions in section, 'two' + +[End of section: 'two' 1 assertion failed] + +[Finished: './succeeding/message/sections/stdout' 1 test case failed (All 2 assertions failed)] + +[Running: ./mixed/message/scoped] +MessageTests.cpp:86: i < 10 succeeded for: 0 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 1 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 2 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 3 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 4 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 5 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 6 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 7 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 8 < 10 +MessageTests.cpp:86: i < 10 succeeded for: 9 < 10 +MessageTests.cpp:86: i < 10 succeeded[info: current counter 10] +MessageTests.cpp:86: i < 10 succeeded[info: i := 10] +MessageTests.cpp:86: i < 10 failed for: 10 < 10 +[Finished: './mixed/message/scoped' 1 test case failed (1 of 11 assertions failed)] + +[Running: ./succeeding/nofail] +MessageTests.cpp:92: 1 == 2 failed - but was ok + +No assertions in test case, './succeeding/nofail' + +[Finished: './succeeding/nofail' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/Misc/Sections] +[Started section: 's1'] +MiscTests.cpp:25: a != b succeeded for: 1 != 2 +MiscTests.cpp:26: b != a succeeded for: 2 != 1 +[End of section: 's1' All 2 assertions passed] + +[Started section: 's2'] +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'] +MiscTests.cpp:42: a != b succeeded for: 1 != 2 +MiscTests.cpp:43: b != a succeeded for: 2 != 1 +[Started section: 's2'] +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: ./mixed/Misc/Sections/nested2] +[Started section: 's1'] +[Started section: 's2'] +MiscTests.cpp:61: a == b failed for: 1 == 2 +[End of section: 's2' 1 assertion failed] + +[End of section: 's1' 1 assertion failed] + +[Started section: 's1'] +[Started section: 's3'] +MiscTests.cpp:66: a != b succeeded for: 1 != 2 +[End of section: 's3' 1 assertion passed] + +[End of section: 's1' 1 assertion passed] + +[Started section: 's1'] +[Started section: 's4'] +MiscTests.cpp:70: a < b succeeded for: 1 < 2 +[End of section: 's4' 1 assertion passed] + +[End of section: 's1' 1 assertion passed] + +[Finished: './mixed/Misc/Sections/nested2' 1 test case failed (1 of 3 assertions failed)] + +[Running: ./Sections/nested/a/b] +[Started section: 'c'] +[Started section: 'd (leaf)'] + +No assertions in section, 'd (leaf)' + +[End of section: 'd (leaf)' 1 assertion failed] + +[End of section: 'c' 1 assertion failed] + +[Started section: 'c'] +[Started section: 'e (leaf)'] + +No assertions in section, 'e (leaf)' + +[End of section: 'e (leaf)' 1 assertion failed] + +[End of section: 'c' 1 assertion failed] + +[Started section: 'f (leaf)'] + +No assertions in section, 'f (leaf)' + +[End of section: 'f (leaf)' 1 assertion failed] + +[Finished: './Sections/nested/a/b' 1 test case failed (All 3 assertions failed)] + +[Running: ./mixed/Misc/Sections/loops] +[Started section: 's1'] +MiscTests.cpp:103: b > a failed for: 0 > 1 +[End of section: 's1' 1 assertion failed] + +[Finished: './mixed/Misc/Sections/loops' 1 test case failed (1 assertion failed)] + +[Running: ./mixed/Misc/loops] +MiscTests.cpp:114: [info: Testing if fib[0] (1) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:114: [info: Testing if fib[1] (1) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +MiscTests.cpp:114: [info: Testing if fib[2] (2) is even] +MiscTests.cpp:114: [info: Testing if fib[3] (3) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:114: [info: Testing if fib[4] (5) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +MiscTests.cpp:114: [info: Testing if fib[5] (8) is even] +MiscTests.cpp:114: [info: Testing if fib[6] (13) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:114: [info: Testing if fib[7] (21) is even] +MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +[Finished: './mixed/Misc/loops' 1 test case failed (6 of 8 assertions failed)] +Some information +An error + +[Running: ./succeeding/Misc/stdout,stderr] + +No assertions in test case, './succeeding/Misc/stdout,stderr' + +[Finished: './succeeding/Misc/stdout,stderr' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/Misc/null strings] +MiscTests.cpp:133: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} +MiscTests.cpp:134: 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] +MiscTests.cpp:139: [info: hi] +MiscTests.cpp:141: [info: i := 7] +MiscTests.cpp:142: false failed +[Finished: './failing/info' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/checkedif] +MiscTests.cpp:147: flag succeeded for: true +MiscTests.cpp:155: testCheckedIf( true ) succeeded for: true +[Finished: './succeeding/checkedif' All tests passed (2 assertions in 1 test case)] + +[Running: ./failing/checkedif] +MiscTests.cpp:147: flag failed for: false +MiscTests.cpp:160: testCheckedIf( false ) failed for: false +[Finished: './failing/checkedif' 1 test case failed (All 2 assertions failed)] + +[Running: ./succeeding/checkedelse] +MiscTests.cpp:165: flag succeeded for: true +MiscTests.cpp:173: testCheckedElse( true ) succeeded for: true +[Finished: './succeeding/checkedelse' All tests passed (2 assertions in 1 test case)] + +[Running: ./failing/checkedelse] +MiscTests.cpp:165: flag failed for: false +MiscTests.cpp:178: testCheckedElse( false ) failed for: false +[Finished: './failing/checkedelse' 1 test case failed (All 2 assertions failed)] + +[Running: ./misc/xmlentitycheck] +[Started section: 'embedded xml'] + +No assertions in section, 'embedded xml' + +[End of section: 'embedded xml' 1 assertion failed] + +[Started section: 'encoded chars'] + +No assertions in section, 'encoded chars' + +[End of section: 'encoded chars' 1 assertion failed] + +[Finished: './misc/xmlentitycheck' 1 test case failed (All 2 assertions failed)] + +[Running: ./manual/onechar] +MiscTests.cpp:195: [info: 3] +MiscTests.cpp:196: false failed +[Finished: './manual/onechar' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/atomic if] +MiscTests.cpp:206: x == 0 succeeded for: 0 == 0 +[Finished: './succeeding/atomic if' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/matchers] +MiscTests.cpp:216: testStringForMatching() Contains( "string" ) succeeded for: + "this string contains 'abc' as a substring" contains: "string" +MiscTests.cpp:217: testStringForMatching() Contains( "abc" ) succeeded for: + "this string contains 'abc' as a substring" contains: "abc" +MiscTests.cpp:219: testStringForMatching() StartsWith( "this" ) succeeded for: + "this string contains 'abc' as a substring" starts with: "this" +MiscTests.cpp:220: 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] +MiscTests.cpp:225: 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] +MiscTests.cpp:230: 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] +MiscTests.cpp:235: 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] +MiscTests.cpp:240: 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/AllOf] +MiscTests.cpp:248: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: +"this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) +[Finished: '/succeeding/matchers/AllOf' All tests passed (1 assertion in 1 test case)] + +[Running: /succeeding/matchers/AnyOf] +MiscTests.cpp:252: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: +"this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) +MiscTests.cpp:253: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: +"this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) +[Finished: '/succeeding/matchers/AnyOf' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/matchers/Equals] +MiscTests.cpp:258: 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: example/factorial] +MiscTests.cpp:269: Factorial(0) == 1 succeeded for: 1 == 1 +MiscTests.cpp:270: Factorial(1) == 1 succeeded for: 1 == 1 +MiscTests.cpp:271: Factorial(2) == 2 succeeded for: 2 == 2 +MiscTests.cpp:272: Factorial(3) == 6 succeeded for: 6 == 6 +MiscTests.cpp:273: Factorial(10) == 3628800 succeeded for: 0x == 3628800 +[Finished: 'example/factorial' All tests passed (5 assertions in 1 test case)] + +[Running: empty] + +No assertions in test case, 'empty' + +[Finished: 'empty' 1 test case failed (1 assertion failed)] + +[Running: Nice descriptive name] +MiscTests.cpp:282: [warning: This one ran] + +No assertions in test case, 'Nice descriptive name' + +[Finished: 'Nice descriptive name' 1 test case failed (1 assertion failed)] + +[Running: first tag] + +No assertions in test case, 'first tag' + +[Finished: 'first tag' 1 test case failed (1 assertion failed)] + +[Running: second tag] + +No assertions in test case, 'second tag' + +[Finished: 'second tag' 1 test case failed (1 assertion failed)] + +[Running: selftest/main] +[Started section: 'selftest/expected result'] +[Started section: 'selftest/expected result/failing tests'] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +catch_self_test.hpp:106: succeeded +[with message: Tests failed, as expected] +[End of section: 'selftest/expected result/failing tests' All 25 assertions passed] + +[End of section: 'selftest/expected result' All 25 assertions passed] + +[Started section: 'selftest/expected result'] +[Started section: 'selftest/expected result/succeeding tests'] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +Message from section one +Message from section two +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +Some information +An error +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:95: succeeded +[with message: Tests passed, as expected] +[End of section: 'selftest/expected result/succeeding tests' All 43 assertions passed] + +[End of section: 'selftest/expected result' All 43 assertions passed] + +Message from section one +Message from section two +Some information +An error +[Started section: 'selftest/test counts'] +[Started section: 'selftest/test counts/succeeding tests'] +TestMain.cpp:40: totals.assertions.passed == 291 succeeded for: 291 == 291 +TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 +[End of section: 'selftest/test counts/succeeding tests' All 2 assertions passed] + +[End of section: 'selftest/test counts' All 2 assertions passed] + +[Started section: 'selftest/test counts'] +[Started section: 'selftest/test counts/failing tests'] +TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 +TestMain.cpp:48: totals.assertions.failed == 72 succeeded for: 72 == 72 +[End of section: 'selftest/test counts/failing tests' All 2 assertions passed] + +[End of section: 'selftest/test counts' All 2 assertions passed] + +[Finished: 'selftest/main' All tests passed (72 assertions in 1 test case)] + +[Running: meta/Misc/Sections] +TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 +TestMain.cpp:58: totals.assertions.failed == 1 succeeded for: 1 == 1 +[Finished: 'meta/Misc/Sections' All tests passed (2 assertions in 1 test case)] + +[Running: selftest/parser/2] +[Started section: 'default'] +TestMain.cpp:97: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:99: config.shouldDebugBreak == false succeeded for: false == false +TestMain.cpp:100: config.cutoff == -1 succeeded for: -1 == -1 +TestMain.cpp:101: config.allowThrows == true succeeded for: true == true +TestMain.cpp:102: config.reporter.empty() succeeded for: true +[End of section: 'default' All 5 assertions passed] + +[Started section: 'test lists'] +[Started section: '-t/1'] +TestMain.cpp:108: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:110: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:111: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:112: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +[End of section: '-t/1' All 4 assertions passed] + +[End of section: 'test lists' All 4 assertions passed] + +[Started section: 'test lists'] +[Started section: '-t/exclude:1'] +TestMain.cpp:116: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:118: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:119: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:120: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +[End of section: '-t/exclude:1' All 4 assertions passed] + +[End of section: 'test lists' All 4 assertions passed] + +[Started section: 'test lists'] +[Started section: '--test/1'] +TestMain.cpp:125: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:127: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:128: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:129: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +[End of section: '--test/1' All 4 assertions passed] + +[End of section: 'test lists' All 4 assertions passed] + +[Started section: 'test lists'] +[Started section: '--test/exclude:1'] +TestMain.cpp:134: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:136: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:137: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:138: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +[End of section: '--test/exclude:1' All 4 assertions passed] + +[End of section: 'test lists' All 4 assertions passed] + +[Started section: 'test lists'] +[Started section: '--test/exclude:2'] +TestMain.cpp:143: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:145: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:146: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:147: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +[End of section: '--test/exclude:2' All 4 assertions passed] + +[End of section: 'test lists' All 4 assertions passed] + +[Started section: 'test lists'] +[Started section: '-t/2'] +TestMain.cpp:152: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:154: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:155: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:156: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:157: config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true +[End of section: '-t/2' All 5 assertions passed] + +[End of section: 'test lists' All 5 assertions passed] + +[Started section: 'test lists'] +[Started section: '-t/0'] +TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: +"Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" +[End of section: '-t/0' 1 assertion passed] + +[End of section: 'test lists' 1 assertion passed] + +[Started section: 'reporter'] +[Started section: '-r/console'] +TestMain.cpp:169: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:171: config.reporter == "console" succeeded for: "console" == "console" +[End of section: '-r/console' All 2 assertions passed] + +[End of section: 'reporter' All 2 assertions passed] + +[Started section: 'reporter'] +[Started section: '-r/xml'] +TestMain.cpp:175: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:177: config.reporter == "xml" succeeded for: "xml" == "xml" +[End of section: '-r/xml' All 2 assertions passed] + +[End of section: 'reporter' All 2 assertions passed] + +[Started section: 'reporter'] +[Started section: '--reporter/junit'] +TestMain.cpp:181: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:183: config.reporter == "junit" succeeded for: "junit" == "junit" +[End of section: '--reporter/junit' All 2 assertions passed] + +[End of section: 'reporter' All 2 assertions passed] + +[Started section: 'reporter'] +[Started section: '-r/error'] +TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: +"Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" +[End of section: '-r/error' 1 assertion passed] + +[End of section: 'reporter' 1 assertion passed] + +[Started section: 'debugger'] +[Started section: '-b'] +TestMain.cpp:194: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:196: config.shouldDebugBreak == true succeeded for: true == true +[End of section: '-b' All 2 assertions passed] + +[End of section: 'debugger' All 2 assertions passed] + +[Started section: 'debugger'] +[Started section: '--break'] +TestMain.cpp:200: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:202: config.shouldDebugBreak succeeded for: true +[End of section: '--break' All 2 assertions passed] + +[End of section: 'debugger' All 2 assertions passed] + +[Started section: 'debugger'] +[Started section: '-b'] +TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: +"Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" +[End of section: '-b' 1 assertion passed] + +[End of section: 'debugger' 1 assertion passed] + +[Started section: 'abort'] +[Started section: '-a'] +TestMain.cpp:213: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:215: config.cutoff == 1 succeeded for: 1 == 1 +[End of section: '-a' All 2 assertions passed] + +[End of section: 'abort' All 2 assertions passed] + +[Started section: 'abort'] +[Started section: '-a/2'] +TestMain.cpp:219: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:221: config.cutoff == 2 succeeded for: 2 == 2 +[End of section: '-a/2' All 2 assertions passed] + +[End of section: 'abort' All 2 assertions passed] + +[Started section: 'abort'] +[Started section: '-a/error/0'] +TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +"Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" +[End of section: '-a/error/0' 1 assertion passed] + +[End of section: 'abort' 1 assertion passed] + +[Started section: 'abort'] +[Started section: '-a/error/non numeric'] +TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +"Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" +[End of section: '-a/error/non numeric' 1 assertion passed] + +[End of section: 'abort' 1 assertion passed] + +[Started section: 'abort'] +[Started section: '-a/error/two args'] +TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: +"Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" +[End of section: '-a/error/two args' 1 assertion passed] + +[End of section: 'abort' 1 assertion passed] + +[Started section: 'nothrow'] +[Started section: '-nt'] +TestMain.cpp:240: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:242: config.allowThrows == false succeeded for: false == false +[End of section: '-nt' All 2 assertions passed] + +[End of section: 'nothrow' All 2 assertions passed] + +[Started section: 'nothrow'] +[Started section: '--nothrow'] +TestMain.cpp:246: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:248: config.allowThrows == false succeeded for: false == false +[End of section: '--nothrow' All 2 assertions passed] + +[End of section: 'nothrow' All 2 assertions passed] + +[Started section: 'streams'] +[Started section: '-o filename'] +TestMain.cpp:255: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:257: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:258: config.stream.empty() succeeded for: true +[End of section: '-o filename' All 3 assertions passed] + +[End of section: 'streams' All 3 assertions passed] + +[Started section: 'streams'] +[Started section: '-o %stdout'] +TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:264: config.stream == "stdout" succeeded for: "stdout" == "stdout" +TestMain.cpp:265: config.outputFilename.empty() succeeded for: true +[End of section: '-o %stdout' All 3 assertions passed] + +[End of section: 'streams' All 3 assertions passed] + +[Started section: 'streams'] +[Started section: '--out'] +TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:271: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +[End of section: '--out' All 2 assertions passed] + +[End of section: 'streams' All 2 assertions passed] + +[Started section: 'combinations'] +[Started section: '-a -b'] +TestMain.cpp:278: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:280: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:281: config.shouldDebugBreak succeeded for: true +TestMain.cpp:282: config.allowThrows == false succeeded for: false == false +[End of section: '-a -b' All 4 assertions passed] + +[End of section: 'combinations' All 4 assertions passed] + +[Finished: 'selftest/parser/2' All tests passed (66 assertions in 1 test case)] + +[Running: selftest/test filter] +TestMain.cpp:291: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:292: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:297: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:298: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:300: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true +TestMain.cpp:301: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false +[Finished: 'selftest/test filter' All tests passed (6 assertions in 1 test case)] + +[Running: selftest/test filters] +TestMain.cpp:312: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:314: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:316: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false +[Finished: 'selftest/test filters' All tests passed (4 assertions in 1 test case)] + +[Running: selftest/filter/prefix wildcard] +TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:323: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false +[Finished: 'selftest/filter/prefix wildcard' All tests passed (2 assertions in 1 test case)] + +[Running: selftest/filter/wildcard at both ends] +TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true +TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true +TestMain.cpp:331: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false +[Finished: 'selftest/filter/wildcard at both ends' All tests passed (4 assertions in 1 test case)] + +[Running: selftest/option parsers] +TestMain.cpp:351: opt.parseIntoConfig( parser, config ) succeeded +TestMain.cpp:353: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:354: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:355: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +[Finished: 'selftest/option parsers' All tests passed (4 assertions in 1 test case)] + +[Running: selftest/tags] +[Started section: 'one tag'] +TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:370: oneTag.hasTag( "one" ) succeeded for: true +TestMain.cpp:371: oneTag.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:373: oneTag.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:374: oneTag.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:375: oneTag.matchesTags( p3 ) == false succeeded for: false == false +TestMain.cpp:376: oneTag.matchesTags( p4 ) == false succeeded for: false == false +TestMain.cpp:377: oneTag.matchesTags( p5 ) == false succeeded for: false == false +[End of section: 'one tag' All 8 assertions passed] + +[Started section: 'two tags'] +TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:384: twoTags.hasTag( "one" ) succeeded for: true +TestMain.cpp:385: twoTags.hasTag( "two" ) succeeded for: true +TestMain.cpp:386: twoTags.hasTag( "three" ) == false succeeded for: false == false +TestMain.cpp:387: twoTags.getTags().size() == 2 succeeded for: 2 == 2 +TestMain.cpp:389: twoTags.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:390: twoTags.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:391: twoTags.matchesTags( p3 ) == true succeeded for: true == true +TestMain.cpp:392: twoTags.matchesTags( p4 ) == true succeeded for: true == true +TestMain.cpp:393: twoTags.matchesTags( p5 ) == true succeeded for: true == true +[End of section: 'two tags' All 10 assertions passed] + +[Started section: 'one tag with characters either side'] +TestMain.cpp:399: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" +TestMain.cpp:400: oneTagWithExtras.hasTag( "one" ) succeeded for: true +TestMain.cpp:401: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false +TestMain.cpp:402: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 +[End of section: 'one tag with characters either side' All 4 assertions passed] + +[Started section: 'start of a tag, but not closed'] +TestMain.cpp:409: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" +TestMain.cpp:410: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false +TestMain.cpp:411: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 +[End of section: 'start of a tag, but not closed' All 3 assertions passed] + +[Started section: 'hidden'] +TestMain.cpp:417: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:418: oneTag.hasTag( "hide" ) succeeded for: true +TestMain.cpp:419: oneTag.isHidden() succeeded for: true +TestMain.cpp:421: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false +[End of section: 'hidden' All 4 assertions passed] + +[Finished: 'selftest/tags' All tests passed (29 assertions in 1 test case)] + +[Running: ./succeeding/Tricky/std::pair] +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: ./inprogress/failing/Tricky/trailing expression] +TrickyTests.cpp:55: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] + +No assertions in test case, './inprogress/failing/Tricky/trailing expression' + +[Finished: './inprogress/failing/Tricky/trailing expression' 1 test case failed (1 assertion failed)] + +[Running: ./inprogress/failing/Tricky/compound lhs] +TrickyTests.cpp:71: [warning: Uncomment the code in this test to check that it gives a sensible compiler error] + +No assertions in test case, './inprogress/failing/Tricky/compound lhs' + +[Finished: './inprogress/failing/Tricky/compound lhs' 1 test case failed (1 assertion failed)] + +[Running: ./failing/Tricky/non streamable type] +TrickyTests.cpp:95: &o1 == &o2 failed for: 0x == 0x +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] +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] +TrickyTests.cpp:119: i++ == 7 succeeded for: 7 == 7 +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] +TrickyTests.cpp:186: 0x == o succeeded for: 0x == {?} +[Finished: './succeeding/koenig' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/non-const==] +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] +TrickyTests.cpp:224: 0x == bit30and31 succeeded for: 0x == 3221225472 +[Finished: './succeeding/enum/bits' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/boolean member] +TrickyTests.cpp:239: obj.prop != __null succeeded for: 0x != 0 +[Finished: './succeeding/boolean member' All tests passed (1 assertion in 1 test case)] + +[Running: ./succeeding/unimplemented static bool] +[Started section: 'compare to true'] +TrickyTests.cpp:259: is_true::value == true succeeded for: true == true +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'] +TrickyTests.cpp:264: is_true::value == false succeeded for: false == false +TrickyTests.cpp:265: false == is_true::value succeeded for: false == false +[End of section: 'compare to false' All 2 assertions passed] + +[Started section: 'negation'] +TrickyTests.cpp:270: !is_true::value succeeded for: true +[End of section: 'negation' 1 assertion passed] + +[Started section: 'double negation'] +TrickyTests.cpp:275: !!is_true::value succeeded for: true +[End of section: 'double negation' 1 assertion passed] + +[Started section: 'direct'] +TrickyTests.cpp:280: is_true::value succeeded for: true +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] +TrickyTests.cpp:313: True succeeded for: true +TrickyTests.cpp:314: !False succeeded for: true +TrickyTests.cpp:315: !False succeeded for: !false +[Finished: './succeeding/SafeBool' All tests passed (3 assertions in 1 test case)] + +[Running: scenario name] +[Started section: 'This stuff exists'] +[Started section: 'I do this'] +[Started section: 'it should do this'] +BDDTests.cpp:37: itDoesThis() succeeded for: true +[End of section: 'it should do this' 1 assertion passed] + +[End of section: 'I do this' 1 assertion passed] + +[End of section: 'This stuff exists' 1 assertion passed] + +[Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] +[End of group: '~dummy'. 44 of 95 test cases failed (101 of 607 assertions failed)] + + +[Testing completed. 44 of 95 test cases failed (101 of 607 assertions failed)] + +[Started testing: CatchSelfTest] +[Started group: '~dummy'] + +[Running: ./succeeding/Approx/simple] +ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) +ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) +ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 +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] +ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) +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] +ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) +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] +ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded +ApproxTests.cpp:61: 0 == Approx( 0 ) succeeded +[Finished: './succeeding/Approx/int' All tests passed (2 assertions in 1 test case)] + +[Running: ./succeeding/Approx/mixed] +ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) +ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) +ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) +ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) +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] +ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) +ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) +ApproxTests.cpp:96: d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) +ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 +ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 +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] +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] +ClassTests.cpp:28: s == "world" failed for: "hello" == "world" +[Finished: './failing/TestClass/failingCase' 1 test case failed (1 assertion failed)] + +[Running: ./succeeding/Fixture/succeedingCase] +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] +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] +ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 +ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) +ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) +ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" +ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" +ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 +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] +ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 +ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 +[Finished: './failing/conditions/equality' 1 test case failed (All 2 assertions failed)] +[End of group: '~dummy'. 3 of 12 test cases failed (4 of 38 assertions failed)] + + +[Testing aborted. 3 of 12 test cases failed (4 of 38 assertions failed)] + From e9305ecd65d0b9a6983dde6b33b6edb19b6633d5 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 9 Jan 2013 19:32:50 +0000 Subject: [PATCH 104/296] Fixed bug in generators --- include/internal/catch_generators.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_generators.hpp b/include/internal/catch_generators.hpp index 295db35d..76a13f44 100644 --- a/include/internal/catch_generators.hpp +++ b/include/internal/catch_generators.hpp @@ -30,7 +30,7 @@ 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 ); + return m_from+static_cast( index ); } virtual std::size_t size() const { From 42aef1d99cc22bb92f80f6e3fb13f2aab071646c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sun, 13 Jan 2013 21:51:44 +0000 Subject: [PATCH 105/296] Fairly major reworking of console reporter (still in progress). Changed reporter interface a bit. --- include/catch_runner.hpp | 61 +--- include/internal/catch_commandline.hpp | 2 +- include/internal/catch_common.h | 6 +- include/internal/catch_impl.hpp | 1 + include/internal/catch_interfaces_reporter.h | 13 +- include/internal/catch_line_wrap.h | 20 ++ include/internal/catch_line_wrap.hpp | 67 ++++ .../catch_notimplemented_exception.hpp | 2 +- include/internal/catch_runner_impl.hpp | 14 +- include/reporters/catch_reporter_basic.hpp | 2 +- include/reporters/catch_reporter_console.hpp | 321 ++++++++---------- projects/SelfTest/GeneratorTests.cpp | 14 + projects/SelfTest/TestMain.cpp | 10 +- projects/SelfTest/catch_self_test.cpp | 4 +- projects/SelfTest/catch_self_test.hpp | 18 +- .../CatchSelfTest.xcodeproj/project.pbxproj | 8 + .../CatchSelfTest/catch_line_wrap.cpp | 2 + 17 files changed, 306 insertions(+), 259 deletions(-) create mode 100644 include/internal/catch_line_wrap.h create mode 100644 include/internal/catch_line_wrap.hpp create mode 100644 projects/XCode4/CatchSelfTest/CatchSelfTest/catch_line_wrap.cpp diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 71f91981..95c466b9 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -13,6 +13,7 @@ #include "internal/catch_runner_impl.hpp" #include "internal/catch_test_spec.h" #include "internal/catch_version.h" +#include "internal/catch_line_wrap.h" #include #include @@ -42,13 +43,10 @@ namespace Catch { Runner context( m_configWrapper, m_reporter ); // This Runner will be renamed Context Totals totals; - std::vector::const_iterator it = filterGroups.begin(); - std::vector::const_iterator itEnd = filterGroups.end(); - - for(; it != itEnd && !context.aborting(); ++it ) { - context.testGroupStarting( it->getName() ); - totals += runTestsForGroup( context, *it ); - context.testGroupEnded( it->getName(), totals ); + for( std::size_t i=0; i < filterGroups.size() && !context.aborting(); ++i ) { + context.testGroupStarting( filterGroups[i].getName(), i, filterGroups.size() ); + totals += runTestsForGroup( context, filterGroups[i] ); + context.testGroupEnded( filterGroups[i].getName(), totals, i, filterGroups.size() ); } return totals; } @@ -153,50 +151,6 @@ namespace Catch { os << "\nFor more detail usage please see: https://github.com/philsquared/Catch/wiki/Command-line\n" << std::endl; } - inline void addIndent( std::ostream& os, std::size_t indent ) { - while( indent-- > 0 ) - os << ' '; - } - - inline void recursivelyWrapLine( std::ostream& os, std::string paragraph, std::size_t columns, std::size_t indent ) { - std::size_t width = columns-indent; - std::size_t tab = 0; - std::size_t wrapPoint = width; - for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) { - if( pos == width ) { - addIndent( os, indent ); - os << paragraph.substr( 0, wrapPoint ) << "\n"; - return recursivelyWrapLine( os, paragraph.substr( wrapPoint+1 ), columns, indent+tab ); - } - if( paragraph[pos] == '\t' ) { - tab = pos; - paragraph = paragraph.substr( 0, tab ) + paragraph.substr( tab+1 ); - pos--; - } - else if( paragraph[pos] == ' ' ) { - wrapPoint = pos; - } - } - addIndent( os, indent ); - os << paragraph << "\n"; - } - - inline std::string addLineBreaks( const std::string& str, std::size_t columns, std::size_t indent = 0 ) { - std::ostringstream oss; - std::string::size_type pos = 0; - std::string::size_type newline = str.find_first_of( '\n' ); - while( newline != std::string::npos ) { - std::string paragraph = str.substr( pos, newline-pos ); - recursivelyWrapLine( oss, paragraph, columns, indent ); - pos = newline+1; - newline = str.find_first_of( '\n', pos ); - } - if( pos != str.size() ) - recursivelyWrapLine( oss, str.substr( pos, str.size()-pos ), columns, indent ); - - return oss.str(); - } - inline void showHelp( const CommandParser& parser ) { AllOptions options; Options::HelpOptionParser helpOpt; @@ -207,13 +161,12 @@ namespace Catch { displayedSpecificOption = true; std::cout << "\n" << opt.optionNames() << " " << opt.argsSynopsis() << "\n\n" << opt.optionSummary() << "\n\n" - - << addLineBreaks( opt.optionDescription(), 80, 2 ) << "\n" << std::endl; + << wrapLongStrings( opt.optionDescription(), 80, 2 ) << "\n" << std::endl; } } if( !displayedSpecificOption ) { - std::cout << "\nCATCH v" << libraryVersion.majorVersion << "." + std::cout << "\nCATCH v" << libraryVersion.majorVersion << "." << libraryVersion.minorVersion << " build " << libraryVersion.buildNumber; if( libraryVersion.branchName != "master" ) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 8c88ee27..660cbffe 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -16,7 +16,7 @@ namespace Catch { class Command { public: Command(){} - + explicit Command( const std::string& name ) : m_name( name ) { } diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index ec8cd2e9..a575b4fa 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -119,9 +119,9 @@ namespace Catch { inline std::ostream& operator << ( std::ostream& os, const SourceLineInfo& info ) { #ifndef __GNUG__ - os << info.file << "(" << info.line << "): "; + os << info.file << "(" << info.line << ")"; #else - os << info.file << ":" << info.line << ": "; + os << info.file << ":" << info.line; #endif return os; } @@ -129,7 +129,7 @@ namespace Catch { CATCH_ATTRIBUTE_NORETURN inline void throwLogicError( const std::string& message, const SourceLineInfo& locationInfo ) { std::ostringstream oss; - oss << "Internal Catch error: '" << message << "' at: " << locationInfo; + oss << locationInfo << ": Internal Catch error: '" << message << "'"; throw std::logic_error( oss.str() ); } } diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index b6da5488..f8f2baa4 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -27,6 +27,7 @@ #include "catch_test_case_info.hpp" #include "catch_tags.hpp" #include "catch_version.hpp" +#include "catch_line_wrap.hpp" #include "../reporters/catch_reporter_basic.hpp" #include "../reporters/catch_reporter_xml.hpp" diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 29c6a7a9..17974a22 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -49,8 +49,17 @@ namespace Catch std::string name; }; struct GroupInfo { - GroupInfo( std::string const& _name ) : name( _name ) {} + GroupInfo( std::string const& _name, + std::size_t _groupIndex, + std::size_t _groupsCount ) + : name( _name ), + groupIndex( _groupIndex ), + groupsCounts( _groupsCount ) + {} + std::string name; + std::size_t groupIndex; + std::size_t groupsCounts; }; struct SectionInfo { @@ -174,7 +183,7 @@ namespace Catch struct IStreamingReporter : IShared { virtual ~IStreamingReporter(); - // Implementing class must also provide the following static methid: + // Implementing class must also provide the following static method: // static std::string getDescription(); virtual ReporterPreferences getPreferences() const = 0; diff --git a/include/internal/catch_line_wrap.h b/include/internal/catch_line_wrap.h new file mode 100644 index 00000000..1197fb0b --- /dev/null +++ b/include/internal/catch_line_wrap.h @@ -0,0 +1,20 @@ +/* + * Created by Phil on 11/1/2013. + * Copyright 2013 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_LINE_WRAP_H_INCLUDED +#define TWOBLUECUBES_CATCH_LINE_WRAP_H_INCLUDED + +#include + +namespace Catch { + + void wrapLongStrings( std::ostream& stream, const std::string& str, std::size_t columns, std::size_t indent = 0 ); + std::string wrapLongStrings( const std::string& str, std::size_t columns, std::size_t indent = 0 ); + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_LINE_WRAP_H_INCLUDED diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp new file mode 100644 index 00000000..c6e03d20 --- /dev/null +++ b/include/internal/catch_line_wrap.hpp @@ -0,0 +1,67 @@ +/* + * Created by Phil on 11/1/2013. + * Copyright 2013 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_LINE_WRAP_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_LINE_WRAP_HPP_INCLUDED + +#include "catch_line_wrap.h" + +namespace Catch { + + namespace { + inline void addIndent( std::ostream& os, std::size_t indent ) { + while( indent-- > 0 ) + os << ' '; + } + + inline void recursivelyWrapLine( std::ostream& os, std::string paragraph, std::size_t columns, std::size_t indent ) { + std::size_t width = columns-indent; + std::size_t tab = 0; + std::size_t wrapPoint = width; + for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) { + if( pos == width ) { + addIndent( os, indent ); + os << paragraph.substr( 0, wrapPoint ) << "\n"; + return recursivelyWrapLine( os, paragraph.substr( wrapPoint+1 ), columns, indent+tab ); + } + if( paragraph[pos] == '\t' ) { + tab = pos; + paragraph = paragraph.substr( 0, tab ) + paragraph.substr( tab+1 ); + pos--; + } + else if( paragraph[pos] == ' ' ) { + wrapPoint = pos; + } + } + addIndent( os, indent ); + os << paragraph; + } + } + + void wrapLongStrings( std::ostream& stream, const std::string& str, std::size_t columns, std::size_t indent ) { + std::string::size_type pos = 0; + std::string::size_type newline = str.find_first_of( '\n' ); + while( newline != std::string::npos ) { + std::string paragraph = str.substr( pos, newline-pos ); + recursivelyWrapLine( stream, paragraph, columns, indent ); + stream << "\n"; + pos = newline+1; + newline = str.find_first_of( '\n', pos ); + } + if( pos != str.size() ) + recursivelyWrapLine( stream, str.substr( pos, str.size()-pos ), columns, indent ); + } + + std::string wrapLongStrings( const std::string& str, std::size_t columns, std::size_t indent ) { + std::ostringstream oss; + wrapLongStrings( oss, str, columns, indent ); + return oss.str(); + } + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_LINE_WRAP_HPP_INCLUDED diff --git a/include/internal/catch_notimplemented_exception.hpp b/include/internal/catch_notimplemented_exception.hpp index f051ed3d..36368e8c 100644 --- a/include/internal/catch_notimplemented_exception.hpp +++ b/include/internal/catch_notimplemented_exception.hpp @@ -16,7 +16,7 @@ namespace Catch { NotImplementedException::NotImplementedException( const SourceLineInfo& lineInfo ) : m_lineInfo( lineInfo ) { std::ostringstream oss; - oss << lineInfo << "function "; + oss << lineInfo << ": function "; oss << "not implemented"; m_what = oss.str(); } diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 8c94aa22..03f1fcde 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -80,27 +80,27 @@ namespace Catch { m_context.setConfig( m_prevConfig ); } - void testGroupStarting( std::string const& testSpec ) { - m_reporter->testGroupStarting( GroupInfo( testSpec ) ); + void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { + m_reporter->testGroupStarting( GroupInfo( testSpec, groupIndex, groupsCount ) ); } - void testGroupEnded( std::string const& testSpec, Totals const& totals ) { - m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec ), totals, aborting() ) ); + void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount ) { + m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, aborting() ) ); } - Totals runMatching( const std::string& testSpec ) { + Totals runMatching( const std::string& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { std::vector matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ); Totals totals; - testGroupStarting( testSpec ); + testGroupStarting( testSpec, groupIndex, groupsCount ); std::vector::const_iterator it = matchingTests.begin(); std::vector::const_iterator itEnd = matchingTests.end(); for(; it != itEnd; ++it ) totals += runTest( *it ); - testGroupEnded( testSpec, totals ); + testGroupEnded( testSpec, totals, groupIndex, groupsCount ); return totals; } diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index e8e1895a..b13f84f4 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -167,7 +167,7 @@ namespace Catch { if( !assertionResult.getSourceInfo().empty() ) { TextColour colour( TextColour::FileName ); - m_config.stream() << assertionResult.getSourceInfo(); + m_config.stream() << assertionResult.getSourceInfo() << ": "; } if( assertionResult.hasExpression() ) { diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 3a74be88..999bfdfa 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -30,33 +30,6 @@ namespace Catch { return prefs; } - void lazyPrintRunInfo() { - printHeader( "Started testing", testRunInfo->name ); - testRunInfo.reset(); - } - void lazyPrintGroupInfo() { - if( !unusedGroupInfo->name.empty() ) - printHeader( "Group", unusedGroupInfo->name ); - unusedGroupInfo.reset(); - } - void lazyPrintTestCaseInfo() { - printHeader( "Test case", unusedTestCaseInfo->name ); - unusedTestCaseInfo.reset(); - } - void lazyPrintSectionInfo() { - std::vector sections; - for( ThreadedSectionInfo* section = unusedSectionInfo.get(); - section && !section->printed; - section = section->parent.get() ) - sections.push_back( section ); - - typedef std::vector::const_reverse_iterator It; - for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { - printHeader( "Section", (*it)->name ); - (*it)->printed = true; - } - unusedSectionInfo.reset(); - } static std::string const& getDashes() { static const std::string dashes = "----------------------------------------------------------------"; @@ -75,14 +48,15 @@ namespace Catch { } void printHeader( std::string const& _type, std::string const& _name ) { - std::size_t labelLen = _type.size() + _name.size() + 8; - std::size_t dashLen = getDashes().size(); - stream << "-- " << _type << ": '" << _name << "' " - << getDashes().substr( 0, labelLen < dashLen ? dashLen - labelLen : 0 ) - << std::endl; + stream << getDashes() << "\n" + << _type << ": '" << _name << "'\n" + << getDashes() << std::endl; } - + void lazyPrint() { + bool needsNewline = unusedTestCaseInfo || ( currentSectionInfo && !currentSectionInfo->printed ); + if( m_lazyTestCaseStats ) + lazyPrintTestCaseStats(); if( testRunInfo ) lazyPrintRunInfo(); if( unusedGroupInfo ) @@ -91,125 +65,148 @@ namespace Catch { lazyPrintTestCaseInfo(); if( currentSectionInfo && !currentSectionInfo->printed ) lazyPrintSectionInfo(); + if( needsNewline ) + stream << "\n"; + } - + void lazyPrintTestCaseStats() { + printTestCaseStats( *m_lazyTestCaseStats ); + m_lazyTestCaseStats.reset(); + } + void lazyPrintRunInfo() { + stream << "\n" << testRunInfo->name + << " is a CATCH v" << libraryVersion.majorVersion << "." + << libraryVersion.minorVersion << " b" + << libraryVersion.buildNumber; + if( libraryVersion.branchName != "master" ) + stream << " (" << libraryVersion.branchName << ")"; + stream << " host application.\n" + << "Run with -? for options\n\n"; + + testRunInfo.reset(); + } + void lazyPrintGroupInfo() { + if( !unusedGroupInfo->name.empty() && unusedGroupInfo->groupsCounts > 1 ) { + printHeader( "Group", unusedGroupInfo->name ); + unusedGroupInfo.reset(); + } + } + void lazyPrintTestCaseInfo() { + printHeader( "Test case", unusedTestCaseInfo->name ); + unusedTestCaseInfo.reset(); + } + void lazyPrintSectionInfo() { + std::vector sections; + for( ThreadedSectionInfo* section = unusedSectionInfo.get(); + section && !section->printed; + section = section->parent.get() ) + sections.push_back( section ); + + typedef std::vector::const_reverse_iterator It; + for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { + printHeader( "Section", (*it)->name ); + (*it)->printed = true; + } + unusedSectionInfo.reset(); + } + virtual void assertionStarting( AssertionInfo const& ) { } - virtual void assertionEnded( AssertionStats const& _assertionStats ) { + virtual void assertionEnded( AssertionStats const& _assertionStats ) { AssertionResult const& result = _assertionStats.assertionResult; // Drop out if result was successful and we're not printing those if( !m_config.includeSuccessfulResults() && result.isOk() ) return; - + lazyPrint(); - int inset = printLineInfo( result.getSourceInfo() ); - - if( result.hasExpression() ) { - TextColour colour( TextColour::OriginalExpression ); - stream << result.getExpression() << "\n"; - if( result.succeeded() ) { - TextColour successColour( TextColour::Success ); - stream << "succeeded"; - } - else { - TextColour errorColour( TextColour::Error ); - stream << "failed"; - if( result.isOk() ) { - TextColour okAnywayColour( TextColour::Success ); - stream << " - but was ok"; - } - } + { + TextColour colour( TextColour::FileName ); + stream << result.getSourceInfo() << ":\n"; } - - switch( result.getResultType() ) { + + if( _assertionStats.totals.assertions.total() > 0 ) { + printOriginalExpression( result ); + printResultType( result ); + printReconstructedExpression( result ); + } + printMessage( result ); + stream << std::endl; + } + + void printResultType( AssertionResult const& _result ) { + if( _result.succeeded() ) { + TextColour successColour( TextColour::Success ); + stream << "passed"; + } + else if( _result.isOk() ) { + TextColour okAnywayColour( TextColour::Success ); + stream << "failed - but was ok"; + } + else { + TextColour errorColour( TextColour::Error ); + stream << "failed"; + } + } + + void printMessage( AssertionResult const& _result ) { + std::pair message = getMessage( _result ); + if( !message.first.empty() ) + stream << " " << message.first << ":\n"; + if( !message.second.empty() ) + printWrappableString( message.second ); + } + std::pair getMessage( AssertionResult const& _result ) { + switch( _result.getResultType() ) { case ResultWas::ThrewException: - { - TextColour colour( TextColour::Error ); - if( result.hasExpression() ) - stream << " with unexpected"; - else - stream << "Unexpected"; - stream << " exception with message: '" << result.getMessage() << "'"; - } - break; + return std::make_pair( "due to unexpected exception with message", _result.getMessage() ); case ResultWas::DidntThrowException: - { - TextColour colour( TextColour::Error ); - if( result.hasExpression() ) - stream << " because no exception was thrown where one was expected"; - else - stream << "No exception thrown where one was expected"; - } - break; + return std::make_pair( "because no exception was thrown where one was expected", "" ); case ResultWas::Info: - { - TextColour colour( TextColour::ReconstructedExpression ); - streamVariableLengthText( "info", result.getMessage() ); - } - break; + return std::make_pair( "with info", _result.getMessage() ); case ResultWas::Warning: - { - TextColour colour( TextColour::ReconstructedExpression ); - streamVariableLengthText( "warning", result.getMessage() ); - } - break; + return std::make_pair( "with warning", _result.getMessage() ); case ResultWas::ExplicitFailure: - { - TextColour colour( TextColour::Error ); - stream << "failed with message: '" << result.getMessage() << "'"; - } - break; + return std::make_pair( "explicitly with message", _result.getMessage() ); + case ResultWas::Unknown: // These cases are here to prevent compiler warnings case ResultWas::Ok: case ResultWas::FailureBit: case ResultWas::ExpressionFailed: case ResultWas::Exception: - if( !result.hasExpression() ) { - if( result.succeeded() ) { - TextColour colour( TextColour::Success ); - stream << " succeeded"; - } - else { - TextColour colour( TextColour::Error ); - stream << " failed"; - if( result.isOk() ) { - TextColour okAnywayColour( TextColour::Success ); - stream << " - but was ok"; - } - } - } - if( result.hasMessage() ) { - stream << "\n"; - TextColour colour( TextColour::ReconstructedExpression ); - streamVariableLengthText( "with message", result.getMessage() ); - } - break; + if( _result.hasMessage() ) + return std::make_pair( "with message", _result.getMessage() ); + else + return std::make_pair( "", "" ); } - - if( result.hasExpandedExpression() ) { - stream << "\nfor: "; + } + void printOriginalExpression( AssertionResult const& _result ) { + if( _result.hasExpression() ) { + TextColour colour( TextColour::OriginalExpression ); + stream << " " << _result.getTestMacroName() << "( " + << _result.getExpression() + << " )\n"; + } + } + void printReconstructedExpression( AssertionResult const& _result ) { + if( _result.hasExpandedExpression() ) { + stream << " with expansion:\n"; TextColour colour( TextColour::ReconstructedExpression ); - stream << getSpaces( inset-5 ) << result.getExpandedExpression(); - } - - stream << "\n" << std::endl; - } - - void streamVariableLengthText( std::string const& prefix, std::string const& text ) { - std::string trimmed = trim( text ); - if( trimmed.find_first_of( "\r\n" ) == std::string::npos ) { - stream << "[" << prefix << ": " << trimmed << "]"; - } - else { - stream << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed - << "\n[end of " << prefix << "] <<<<<<<<<<<<<<<<<<<<<<<<\n"; + printWrappableString( _result.getExpandedExpression() ); } } - void printAssertionCounts( std::string const& label, Counts const& counts ) { + void printWrappableString( std::string const& _string ) { + stream << wrapLongStrings( _string ) << "\n"; + } + + std::string wrapLongStrings( std::string const& _string ) { + return Catch::wrapLongStrings( _string, 70, 2 ); + } + + void printCounts( std::string const& label, Counts const& counts ) { if( counts.total() == 1 ) { stream << "1 " << label << " - "; if( counts.failed ) @@ -242,10 +239,10 @@ namespace Catch { } else if( totals.assertions.failed ) { TextColour colour( TextColour::ResultError ); - printAssertionCounts( "test case", totals.testCases ); + printCounts( "test case", totals.testCases ); if( totals.testCases.failed > 0 ) { stream << " ("; - printAssertionCounts( "assertion", totals.assertions ); + printCounts( "assertion", totals.assertions ); stream << ")"; } } @@ -258,48 +255,36 @@ namespace Catch { } virtual void sectionEnded( SectionStats const& _sectionStats ) { - resetLastPrintedLine(); if( _sectionStats.missingAssertions ) { lazyPrint(); TextColour colour( TextColour::ResultError ); stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; } - if( currentSectionInfo && currentSectionInfo->printed ) { - printSummarDivider(); - stream << "Summary for section '" << _sectionStats.sectionInfo.name << "':\n"; - Counts const& assertions = _sectionStats.assertions; - if( assertions.failed ) { - TextColour colour( TextColour::ResultError ); - printAssertionCounts( "assertion", assertions ); - } - else { - TextColour colour( TextColour::ResultSuccess ); - stream << ( assertions.passed > 1 ? "All " : "" ) - << pluralise( assertions.passed, "assertion" ) << " passed" ; - } - stream << "\n" << std::endl; - } StreamingReporterBase::sectionEnded( _sectionStats ); } + void printTestCaseStats( TestCaseStats const& _testCaseStats ) { + m_atLeastOneTestCasePrinted = true; + } + virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) { - resetLastPrintedLine(); + if( _testCaseStats.missingAssertions ) { lazyPrint(); TextColour colour( TextColour::ResultError ); stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl; } if( !unusedTestCaseInfo ) { - m_atLeastOneTestCasePrinted = true; - printSummarDivider(); - stream << "Summary for test case '" << _testCaseStats.testInfo.name << "':\n"; - printTotals( _testCaseStats.totals ); - stream << "\n" << std::endl; + if( m_atLeastOneTestCasePrinted ) + printTestCaseStats( _testCaseStats ); + else + m_lazyTestCaseStats = _testCaseStats; } + StreamingReporterBase::testCaseEnded( _testCaseStats ); } virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { if( !unusedGroupInfo ) { - printSummarDivider(); + printSummaryDivider(); stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n"; printTotals( _testGroupStats.totals ); stream << "\n" << std::endl; @@ -309,7 +294,7 @@ namespace Catch { virtual void testRunEnded( TestRunStats const& _testRunStats ) { if( m_atLeastOneTestCasePrinted ) printTotalsDivider(); - stream << "Summary for all tests in '" << _testRunStats.runInfo.name << "':\n"; +// stream << "Summary for all tests in '" << _testRunStats.runInfo.name << "':\n"; printTotals( _testRunStats.totals ); stream << "\n" << std::endl; StreamingReporterBase::testRunEnded( _testRunStats ); @@ -317,37 +302,15 @@ namespace Catch { private: void printTotalsDivider() { - stream << "================================================================\n"; + stream << getDoubleDashes() << "\n"; } - void printSummarDivider() { - stream << "----------------------------------------------------------------\n"; - } - static int countDigits( std::size_t number ) { - int digits = 1; - for( ; number != 0; digits++, number /= 10 ); - return digits; - } - - // Returns number of characters printed - int printLineInfo( SourceLineInfo const& lineInfo ) { - if( lineInfo.empty() ) - return 0; - if( m_lastPrintedLine.empty() || - m_lastPrintedLine.file != lineInfo.file || - abs( static_cast( m_lastPrintedLine.line ) - static_cast( lineInfo.line ) ) > 20 ) { - TextColour colour( TextColour::FileName ); - stream << lineInfo << "\n"; - } - TextColour colour( TextColour::FileName ); - stream << "[" << lineInfo.line << "] "; - m_lastPrintedLine = lineInfo; - return 3 + countDigits( lineInfo.line ); - } - void resetLastPrintedLine() { - m_lastPrintedLine = SourceLineInfo(); + void printSummaryDivider() { + stream << getDashes() << "\n"; } + + private: bool m_atLeastOneTestCasePrinted; - SourceLineInfo m_lastPrintedLine; + Option m_lazyTestCaseStats; }; diff --git a/projects/SelfTest/GeneratorTests.cpp b/projects/SelfTest/GeneratorTests.cpp index 700b180b..b21e22dd 100644 --- a/projects/SelfTest/GeneratorTests.cpp +++ b/projects/SelfTest/GeneratorTests.cpp @@ -26,3 +26,17 @@ CATCH_TEST_CASE( "./succeeding/generators/1", "Generators over two ranges" ) CATCH_REQUIRE( multiply( i, 2 ) == i*2 ); CATCH_REQUIRE( multiply( j, 2 ) == j*2 ); } + +struct IntPair { int first, second; }; + +CATCH_TEST_CASE( "./succeeding/generators/2", "Generator over a range of pairs" ) +{ + using namespace Catch::Generators; + + IntPair p[] = { { 0, 1 }, { 2, 3 } }; + + IntPair* i = CATCH_GENERATE( between( p, &p[1] ) ); + + CATCH_REQUIRE( i->first == i->second-1 ); + +} diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 8db31ae0..4085c670 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -20,12 +20,12 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" SECTION( "selftest/expected result/failing tests", "Tests in the 'failing' branch fail" ) { - MetaTestRunner::runMatching( "./failing/*", MetaTestRunner::Expected::ToFail ); + MetaTestRunner::runMatching( "./failing/*", MetaTestRunner::Expected::ToFail, 0, 2 ); } SECTION( "selftest/expected result/succeeding tests", "Tests in the 'succeeding' branch succeed" ) { - MetaTestRunner::runMatching( "./succeeding/*", MetaTestRunner::Expected::ToSucceed ); + MetaTestRunner::runMatching( "./succeeding/*", MetaTestRunner::Expected::ToSucceed, 1, 2 ); } } @@ -36,14 +36,14 @@ 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/*" ); + Totals totals = runner.runMatching( "./succeeding/*", 0, 2 ); CHECK( totals.assertions.passed == 291 ); CHECK( totals.assertions.failed == 0 ); } SECTION( "selftest/test counts/failing tests", "Number of 'failing' tests is fixed" ) { - Totals totals = runner.runMatching( "./failing/*" ); + Totals totals = runner.runMatching( "./failing/*", 1, 2 ); CHECK( totals.assertions.passed == 1 ); CHECK( totals.assertions.failed == 72 ); } @@ -53,7 +53,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" TEST_CASE( "meta/Misc/Sections", "looped tests" ) { Catch::EmbeddedRunner runner; - Catch::Totals totals = runner.runMatching( "./mixed/Misc/Sections/nested2" ); + Catch::Totals totals = runner.runMatching( "./mixed/Misc/Sections/nested2", 0, 1 ); CHECK( totals.assertions.passed == 2 ); CHECK( totals.assertions.failed == 1 ); } diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index 81bc7e23..49592325 100644 --- a/projects/SelfTest/catch_self_test.cpp +++ b/projects/SelfTest/catch_self_test.cpp @@ -17,7 +17,7 @@ namespace Catch{ NullStreamingReporter::~NullStreamingReporter() {} - Totals EmbeddedRunner::runMatching( const std::string& rawTestSpec, const std::string& ) { + Totals EmbeddedRunner::runMatching( const std::string& rawTestSpec, std::size_t groupIndex, std::size_t groupsCount, const std::string& ) { std::ostringstream oss; Config config; config.setStreamBuf( oss.rdbuf() ); @@ -27,7 +27,7 @@ namespace Catch{ // Scoped because Runner doesn't report EndTesting until its destructor { Runner runner( config, m_reporter.get() ); - totals = runner.runMatching( rawTestSpec ); + totals = runner.runMatching( rawTestSpec, groupIndex, groupsCount ); } return totals; } diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index 03505f69..cb62187f 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -53,6 +53,8 @@ namespace Catch { EmbeddedRunner() : m_reporter( new NullStreamingReporter() ) {} Totals runMatching( const std::string& rawTestSpec, + std::size_t groupIndex, + std::size_t groupsCount, const std::string& reporter = "console" ); private: @@ -67,12 +69,18 @@ namespace Catch { ToFail }; }; - MetaTestRunner( Expected::Result expectedResult ) : m_expectedResult( expectedResult ) {} + MetaTestRunner( Expected::Result expectedResult, std::size_t groupIndex, std::size_t groupsCount ) + : m_expectedResult( expectedResult ), + m_groupIndex( groupIndex ), + m_groupsCount( groupsCount ) + {} static void runMatching( const std::string& testSpec, - Expected::Result expectedResult ) { + Expected::Result expectedResult, + std::size_t groupIndex, + std::size_t groupsCount ) { forEach( getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ), - MetaTestRunner( expectedResult ) ); + MetaTestRunner( expectedResult, groupIndex, groupsCount ) ); } void operator()( const TestCase& testCase ) { @@ -81,7 +89,7 @@ namespace Catch { { EmbeddedRunner runner; name = testCase.getTestCaseInfo().name; - totals = runner.runMatching( name ); + totals = runner.runMatching( name, m_groupIndex, m_groupsCount ); } switch( m_expectedResult ) { case Expected::ToSucceed: @@ -111,6 +119,8 @@ namespace Catch { private: Expected::Result m_expectedResult; + std::size_t m_groupIndex; + std::size_t m_groupsCount; }; diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 37a53362..a8d139bb 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 2694A1FD16A0000E004816E3 /* catch_line_wrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */; }; 4A45DA2416161EF9004F8D6B /* catch_console_colour.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA2316161EF9004F8D6B /* catch_console_colour.cpp */; }; 4A45DA2716161F1F004F8D6B /* catch_ptr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA2616161F1F004F8D6B /* catch_ptr.cpp */; }; 4A45DA2916161F3D004F8D6B /* catch_streambuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA2816161F3D004F8D6B /* catch_streambuf.cpp */; }; @@ -52,6 +53,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 2694A1F8169FFF9B004816E3 /* catch_line_wrap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_line_wrap.h; sourceTree = ""; }; + 2694A1FA169FFFEC004816E3 /* catch_line_wrap.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_line_wrap.hpp; sourceTree = ""; }; + 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = catch_line_wrap.cpp; sourceTree = ""; }; 4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_test_case_info.hpp; sourceTree = ""; }; 4A084F1D15DAD15F0027E631 /* catch_test_spec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_test_spec.h; sourceTree = ""; }; 4A3D7DD01503869D005F9203 /* catch_matchers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_matchers.hpp; sourceTree = ""; }; @@ -270,6 +274,7 @@ 4AB3D99F1616219100C9A0F8 /* catch_interfaces_config.cpp */, 4AB3D9A1161621B500C9A0F8 /* catch_interfaces_generators.cpp */, 4ACE21CA166CA1B300FB5509 /* catch_option.cpp */, + 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */, ); name = SurrogateCpps; sourceTree = ""; @@ -288,6 +293,7 @@ 4A90B59D15D24FE900EF71BC /* catch_assertionresult.hpp */, 4A90B59E15D2521E00EF71BC /* catch_expressionresult_builder.hpp */, 4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */, + 2694A1FA169FFFEC004816E3 /* catch_line_wrap.hpp */, ); name = impl; sourceTree = ""; @@ -374,6 +380,7 @@ 4AB77CB51551AEA200857BF0 /* catch_ptr.hpp */, 4AEE0326161431070071E950 /* catch_streambuf.h */, 4ACE21C8166CA19700FB5509 /* catch_option.hpp */, + 2694A1F8169FFF9B004816E3 /* catch_line_wrap.h */, ); name = Infrastructure; sourceTree = ""; @@ -465,6 +472,7 @@ 4AB3D9A01616219100C9A0F8 /* catch_interfaces_config.cpp in Sources */, 4AB3D9A2161621B500C9A0F8 /* catch_interfaces_generators.cpp in Sources */, 4ACE21CC166CA1B300FB5509 /* catch_option.cpp in Sources */, + 2694A1FD16A0000E004816E3 /* catch_line_wrap.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/catch_line_wrap.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/catch_line_wrap.cpp new file mode 100644 index 00000000..d0445cc2 --- /dev/null +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/catch_line_wrap.cpp @@ -0,0 +1,2 @@ +// This file is only here to verify (to the extent possible) the self sufficiency of the header +#include "catch_line_wrap.h" From bb76e477041ac158be62b509d33ab29bc57e3782 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 14 Jan 2013 08:34:50 +0000 Subject: [PATCH 106/296] More console reporter tweaks - mostly newlines --- include/reporters/catch_reporter_console.hpp | 73 ++++++++++++-------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 999bfdfa..4b7ce2a3 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -127,16 +127,19 @@ namespace Catch { stream << result.getSourceInfo() << ":\n"; } + bool endsWithNewLine = false; if( _assertionStats.totals.assertions.total() > 0 ) { - printOriginalExpression( result ); - printResultType( result ); - printReconstructedExpression( result ); + endsWithNewLine = printOriginalExpression( result ); + endsWithNewLine = printResultType( result ); + endsWithNewLine |= printReconstructedExpression( result ); } - printMessage( result ); + endsWithNewLine |= printMessage( result ); + if( !endsWithNewLine ) + stream << "\n"; stream << std::endl; } - void printResultType( AssertionResult const& _result ) { + bool printResultType( AssertionResult const& _result ) { if( _result.succeeded() ) { TextColour successColour( TextColour::Success ); stream << "passed"; @@ -149,14 +152,43 @@ namespace Catch { TextColour errorColour( TextColour::Error ); stream << "failed"; } + return false; } - - void printMessage( AssertionResult const& _result ) { + bool printOriginalExpression( AssertionResult const& _result ) { + if( _result.hasExpression() ) { + TextColour colour( TextColour::OriginalExpression ); + stream << " "; + if( !_result.getTestMacroName().empty() ) + stream << _result.getTestMacroName() << "( "; + stream << _result.getExpression(); + if( !_result.getTestMacroName().empty() ) + stream << " )"; + stream << "\n"; + return true; + } + return false; + } + bool printReconstructedExpression( AssertionResult const& _result ) { + if( _result.hasExpandedExpression() ) { + stream << " with expansion:\n"; + TextColour colour( TextColour::ReconstructedExpression ); + stream << wrapLongStrings( _result.getExpandedExpression() ) << "\n"; + return true; + } + return false; + } + bool printMessage( AssertionResult const& _result ) { std::pair message = getMessage( _result ); - if( !message.first.empty() ) - stream << " " << message.first << ":\n"; - if( !message.second.empty() ) - printWrappableString( message.second ); + bool endsWithNewLine = false; + if( !message.first.empty() ) { + stream << " " << message.first << ":" << "\n"; + endsWithNewLine = true; + } + if( !message.second.empty() ) { + stream << wrapLongStrings( message.second ) << "\n"; + endsWithNewLine = true; + } + return endsWithNewLine; } std::pair getMessage( AssertionResult const& _result ) { switch( _result.getResultType() ) { @@ -182,26 +214,7 @@ namespace Catch { return std::make_pair( "", "" ); } } - void printOriginalExpression( AssertionResult const& _result ) { - if( _result.hasExpression() ) { - TextColour colour( TextColour::OriginalExpression ); - stream << " " << _result.getTestMacroName() << "( " - << _result.getExpression() - << " )\n"; - } - } - void printReconstructedExpression( AssertionResult const& _result ) { - if( _result.hasExpandedExpression() ) { - stream << " with expansion:\n"; - TextColour colour( TextColour::ReconstructedExpression ); - printWrappableString( _result.getExpandedExpression() ); - } - } - void printWrappableString( std::string const& _string ) { - stream << wrapLongStrings( _string ) << "\n"; - } - std::string wrapLongStrings( std::string const& _string ) { return Catch::wrapLongStrings( _string, 70, 2 ); } From 21c479f5aa15dda79f223f65fddc0ca9f85c82dd Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 14 Jan 2013 18:36:25 +0000 Subject: [PATCH 107/296] More console reporter tweaks and approved new output --- include/reporters/catch_reporter_console.hpp | 19 +- .../SelfTest/Baselines/approvedResults.txt | 5961 +++++++++-------- 2 files changed, 3166 insertions(+), 2814 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 4b7ce2a3..da6271d2 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -140,17 +140,20 @@ namespace Catch { } bool printResultType( AssertionResult const& _result ) { - if( _result.succeeded() ) { + if( _result.getResultType() == ResultWas::Info || + _result.getResultType() == ResultWas::Warning ) { + } + else if( _result.succeeded() ) { TextColour successColour( TextColour::Success ); - stream << "passed"; + stream << "passed "; } else if( _result.isOk() ) { TextColour okAnywayColour( TextColour::Success ); - stream << "failed - but was ok"; + stream << "failed - but was ok "; } else { TextColour errorColour( TextColour::Error ); - stream << "failed"; + stream << "failed "; } return false; } @@ -170,7 +173,7 @@ namespace Catch { } bool printReconstructedExpression( AssertionResult const& _result ) { if( _result.hasExpandedExpression() ) { - stream << " with expansion:\n"; + stream << "with expansion:\n"; TextColour colour( TextColour::ReconstructedExpression ); stream << wrapLongStrings( _result.getExpandedExpression() ) << "\n"; return true; @@ -181,7 +184,7 @@ namespace Catch { std::pair message = getMessage( _result ); bool endsWithNewLine = false; if( !message.first.empty() ) { - stream << " " << message.first << ":" << "\n"; + stream << message.first << ":" << "\n"; endsWithNewLine = true; } if( !message.second.empty() ) { @@ -197,9 +200,9 @@ namespace Catch { case ResultWas::DidntThrowException: return std::make_pair( "because no exception was thrown where one was expected", "" ); case ResultWas::Info: - return std::make_pair( "with info", _result.getMessage() ); + return std::make_pair( "info", _result.getMessage() ); case ResultWas::Warning: - return std::make_pair( "with warning", _result.getMessage() ); + return std::make_pair( "warning", _result.getMessage() ); case ResultWas::ExplicitFailure: return std::make_pair( "explicitly with message", _result.getMessage() ); diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 2a354847..b2b1a77e 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,3671 +1,3990 @@ --- Started testing: 'CatchSelfTest' ---------------------------- --- Group: '~dummy' --------------------------------------------- --- Test case: './succeeding/Approx/simple' --------------------- + +CatchSelfTest is a CATCH v0.9 b12 (integration) host application. +Run with -? for options + +---------------------------------------------------------------- +Test case: './succeeding/Approx/simple' +---------------------------------------------------------------- + ApproxTests.cpp:20: -[20] d == Approx( 1.23 ) -succeeded -for: 1.23 == Approx( 1.23 ) + REQUIRE( d == Approx( 1.23 ) ) +passed with expansion: + 1.23 == Approx( 1.23 ) -[21] d != Approx( 1.22 ) -succeeded -for: 1.23 != Approx( 1.22 ) +ApproxTests.cpp:21: + REQUIRE( d != Approx( 1.22 ) ) +passed with expansion: + 1.23 != Approx( 1.22 ) -[22] d != Approx( 1.24 ) -succeeded -for: 1.23 != Approx( 1.24 ) +ApproxTests.cpp:22: + REQUIRE( d != Approx( 1.24 ) ) +passed with expansion: + 1.23 != Approx( 1.24 ) -[24] Approx( d ) == 1.23 -succeeded -for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:24: + REQUIRE( Approx( d ) == 1.23 ) +passed with expansion: + Approx( 1.23 ) == 1.23 -[25] Approx( d ) != 1.22 -succeeded -for: Approx( 1.23 ) != 1.22 +ApproxTests.cpp:25: + REQUIRE( Approx( d ) != 1.22 ) +passed with expansion: + Approx( 1.23 ) != 1.22 -[26] Approx( d ) != 1.24 -succeeded -for: Approx( 1.23 ) != 1.24 +ApproxTests.cpp:26: + REQUIRE( Approx( d ) != 1.24 ) +passed with expansion: + Approx( 1.23 ) != 1.24 ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/simple': -All tests passed (6 assertions in 1 test case) +Test case: './succeeding/Approx/epsilon' +---------------------------------------------------------------- --- Test case: './succeeding/Approx/epsilon' -------------------- ApproxTests.cpp:38: -[38] d != Approx( 1.231 ) -succeeded -for: 1.23 != Approx( 1.231 ) + REQUIRE( d != Approx( 1.231 ) ) +passed with expansion: + 1.23 != Approx( 1.231 ) -[39] d == Approx( 1.231 ).epsilon( 0.1 ) -succeeded -for: 1.23 == Approx( 1.231 ) +ApproxTests.cpp:39: + REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) +passed with expansion: + 1.23 == Approx( 1.231 ) ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/epsilon': -All tests passed (2 assertions in 1 test case) +Test case: './succeeding/Approx/float' +---------------------------------------------------------------- --- Test case: './succeeding/Approx/float' ---------------------- ApproxTests.cpp:49: -[49] 1.23f == Approx( 1.23f ) -succeeded -for: 1.23 == Approx( 1.23 ) + REQUIRE( 1.23f == Approx( 1.23f ) ) +passed with expansion: + 1.23 == Approx( 1.23 ) -[50] 0.0f == Approx( 0.0f ) -succeeded -for: 0 == Approx( 0 ) +ApproxTests.cpp:50: + REQUIRE( 0.0f == Approx( 0.0f ) ) +passed with expansion: + 0 == Approx( 0 ) ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/float': -All tests passed (2 assertions in 1 test case) +Test case: './succeeding/Approx/int' +---------------------------------------------------------------- --- Test case: './succeeding/Approx/int' ------------------------ ApproxTests.cpp:60: -[60] 1 == Approx( 1 ) -succeeded + REQUIRE( 1 == Approx( 1 ) ) +passed -[61] 0 == Approx( 0 ) -succeeded +ApproxTests.cpp:61: + REQUIRE( 0 == Approx( 0 ) ) +passed ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/int': -All tests passed (2 assertions in 1 test case) +Test case: './succeeding/Approx/mixed' +---------------------------------------------------------------- --- Test case: './succeeding/Approx/mixed' ---------------------- ApproxTests.cpp:75: -[75] 1.0f == Approx( 1 ) -succeeded -for: 1 == Approx( 1 ) + REQUIRE( 1.0f == Approx( 1 ) ) +passed with expansion: + 1 == Approx( 1 ) -[76] 0 == Approx( dZero) -succeeded -for: 0 == Approx( 0 ) +ApproxTests.cpp:76: + REQUIRE( 0 == Approx( dZero) ) +passed with expansion: + 0 == Approx( 0 ) -[77] 0 == Approx( dSmall ).epsilon( 0.001 ) -succeeded -for: 0 == Approx( 1e-05 ) +ApproxTests.cpp:77: + REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) +passed with expansion: + 0 == Approx( 1e-05 ) -[78] 1.234f == Approx( dMedium ) -succeeded -for: 1.234 == Approx( 1.234 ) +ApproxTests.cpp:78: + REQUIRE( 1.234f == Approx( dMedium ) ) +passed with expansion: + 1.234 == Approx( 1.234 ) -[79] dMedium == Approx( 1.234f ) -succeeded -for: 1.234 == Approx( 1.234 ) +ApproxTests.cpp:79: + REQUIRE( dMedium == Approx( 1.234f ) ) +passed with expansion: + 1.234 == Approx( 1.234 ) ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/mixed': -All tests passed (5 assertions in 1 test case) +Test case: './succeeding/Approx/custom' +---------------------------------------------------------------- --- Test case: './succeeding/Approx/custom' --------------------- ApproxTests.cpp:93: -[93] d == approx( 1.23 ) -succeeded -for: 1.23 == Approx( 1.23 ) + REQUIRE( d == approx( 1.23 ) ) +passed with expansion: + 1.23 == Approx( 1.23 ) -[94] d == approx( 1.22 ) -succeeded -for: 1.23 == Approx( 1.22 ) +ApproxTests.cpp:94: + REQUIRE( d == approx( 1.22 ) ) +passed with expansion: + 1.23 == Approx( 1.22 ) -[95] d == approx( 1.24 ) -succeeded -for: 1.23 == Approx( 1.24 ) +ApproxTests.cpp:95: + REQUIRE( d == approx( 1.24 ) ) +passed with expansion: + 1.23 == Approx( 1.24 ) -[96] d != approx( 1.25 ) -succeeded -for: 1.23 != Approx( 1.25 ) +ApproxTests.cpp:96: + REQUIRE( d != approx( 1.25 ) ) +passed with expansion: + 1.23 != Approx( 1.25 ) -[98] approx( d ) == 1.23 -succeeded -for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:98: + REQUIRE( approx( d ) == 1.23 ) +passed with expansion: + Approx( 1.23 ) == 1.23 -[99] approx( d ) == 1.22 -succeeded -for: Approx( 1.23 ) == 1.22 +ApproxTests.cpp:99: + REQUIRE( approx( d ) == 1.22 ) +passed with expansion: + Approx( 1.23 ) == 1.22 -[100] approx( d ) == 1.24 -succeeded -for: Approx( 1.23 ) == 1.24 +ApproxTests.cpp:100: + REQUIRE( approx( d ) == 1.24 ) +passed with expansion: + Approx( 1.23 ) == 1.24 -[101] approx( d ) != 1.25 -succeeded -for: Approx( 1.23 ) != 1.25 +ApproxTests.cpp:101: + REQUIRE( approx( d ) != 1.25 ) +passed with expansion: + Approx( 1.23 ) != 1.25 ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/custom': -All tests passed (8 assertions in 1 test case) +Test case: './succeeding/TestClass/succeedingCase' +---------------------------------------------------------------- --- Test case: './succeeding/TestClass/succeedingCase' ---------- ClassTests.cpp:24: -[24] s == "hello" -succeeded -for: "hello" == "hello" + REQUIRE( s == "hello" ) +passed with expansion: + "hello" == "hello" ---------------------------------------------------------------- -Summary for test case './succeeding/TestClass/succeedingCase': -All tests passed (1 assertion in 1 test case) +Test case: './failing/TestClass/failingCase' +---------------------------------------------------------------- --- Test case: './failing/TestClass/failingCase' ---------------- ClassTests.cpp:28: -[28] s == "world" -failed -for: "hello" == "world" + REQUIRE( s == "world" ) +failed with expansion: + "hello" == "world" ---------------------------------------------------------------- -Summary for test case './failing/TestClass/failingCase': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/Fixture/succeedingCase' +---------------------------------------------------------------- --- Test case: './succeeding/Fixture/succeedingCase' ------------ ClassTests.cpp:47: -[47] m_a == 1 -succeeded -for: 1 == 1 + REQUIRE( m_a == 1 ) +passed with expansion: + 1 == 1 ---------------------------------------------------------------- -Summary for test case './succeeding/Fixture/succeedingCase': -All tests passed (1 assertion in 1 test case) +Test case: './failing/Fixture/failingCase' +---------------------------------------------------------------- --- Test case: './failing/Fixture/failingCase' ------------------ ClassTests.cpp:55: -[55] m_a == 2 -failed -for: 1 == 2 + REQUIRE( m_a == 2 ) +failed with expansion: + 1 == 2 ---------------------------------------------------------------- -Summary for test case './failing/Fixture/failingCase': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/conditions/equality' +---------------------------------------------------------------- --- Test case: './succeeding/conditions/equality' --------------- ConditionTests.cpp:55: -[55] data.int_seven == 7 -succeeded -for: 7 == 7 + REQUIRE( data.int_seven == 7 ) +passed with expansion: + 7 == 7 -[56] data.float_nine_point_one == Approx( 9.1f ) -succeeded -for: 9.1 == Approx( 9.1 ) +ConditionTests.cpp:56: + REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) +passed with expansion: + 9.1 == Approx( 9.1 ) -[57] data.double_pi == Approx( 3.1415926535 ) -succeeded -for: 3.14159 == Approx( 3.14159 ) +ConditionTests.cpp:57: + REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) +passed with expansion: + 3.14159 == Approx( 3.14159 ) -[58] data.str_hello == "hello" -succeeded -for: "hello" == "hello" +ConditionTests.cpp:58: + REQUIRE( data.str_hello == "hello" ) +passed with expansion: + "hello" == "hello" -[59] "hello" == data.str_hello -succeeded -for: "hello" == "hello" +ConditionTests.cpp:59: + REQUIRE( "hello" == data.str_hello ) +passed with expansion: + "hello" == "hello" -[60] data.str_hello.size() == 5 -succeeded -for: 5 == 5 +ConditionTests.cpp:60: + REQUIRE( data.str_hello.size() == 5 ) +passed with expansion: + 5 == 5 -[63] x == Approx( 1.3 ) -succeeded -for: 1.3 == Approx( 1.3 ) +ConditionTests.cpp:63: + REQUIRE( x == Approx( 1.3 ) ) +passed with expansion: + 1.3 == Approx( 1.3 ) ---------------------------------------------------------------- -Summary for test case './succeeding/conditions/equality': -All tests passed (7 assertions in 1 test case) +Test case: './failing/conditions/equality' +---------------------------------------------------------------- --- Test case: './failing/conditions/equality' ------------------ ConditionTests.cpp:71: -[71] data.int_seven == 6 -failed -for: 7 == 6 + CHECK( data.int_seven == 6 ) +failed with expansion: + 7 == 6 -[72] data.int_seven == 8 -failed -for: 7 == 8 +ConditionTests.cpp:72: + CHECK( data.int_seven == 8 ) +failed with expansion: + 7 == 8 -[73] data.int_seven == 0 -failed -for: 7 == 0 +ConditionTests.cpp:73: + CHECK( data.int_seven == 0 ) +failed with expansion: + 7 == 0 -[74] data.float_nine_point_one == Approx( 9.11f ) -failed -for: 9.1 == Approx( 9.11 ) +ConditionTests.cpp:74: + CHECK( data.float_nine_point_one == Approx( 9.11f ) ) +failed with expansion: + 9.1 == Approx( 9.11 ) -[75] data.float_nine_point_one == Approx( 9.0f ) -failed -for: 9.1 == Approx( 9 ) +ConditionTests.cpp:75: + CHECK( data.float_nine_point_one == Approx( 9.0f ) ) +failed with expansion: + 9.1 == Approx( 9 ) -[76] data.float_nine_point_one == Approx( 1 ) -failed -for: 9.1 == Approx( 1 ) +ConditionTests.cpp:76: + CHECK( data.float_nine_point_one == Approx( 1 ) ) +failed with expansion: + 9.1 == Approx( 1 ) -[77] data.float_nine_point_one == Approx( 0 ) -failed -for: 9.1 == Approx( 0 ) +ConditionTests.cpp:77: + CHECK( data.float_nine_point_one == Approx( 0 ) ) +failed with expansion: + 9.1 == Approx( 0 ) -[78] data.double_pi == Approx( 3.1415 ) -failed -for: 3.14159 == Approx( 3.1415 ) +ConditionTests.cpp:78: + CHECK( data.double_pi == Approx( 3.1415 ) ) +failed with expansion: + 3.14159 == Approx( 3.1415 ) -[79] data.str_hello == "goodbye" -failed -for: "hello" == "goodbye" +ConditionTests.cpp:79: + CHECK( data.str_hello == "goodbye" ) +failed with expansion: + "hello" == "goodbye" -[80] data.str_hello == "hell" -failed -for: "hello" == "hell" +ConditionTests.cpp:80: + CHECK( data.str_hello == "hell" ) +failed with expansion: + "hello" == "hell" -[81] data.str_hello == "hello1" -failed -for: "hello" == "hello1" +ConditionTests.cpp:81: + CHECK( data.str_hello == "hello1" ) +failed with expansion: + "hello" == "hello1" -[82] data.str_hello.size() == 6 -failed -for: 5 == 6 +ConditionTests.cpp:82: + CHECK( data.str_hello.size() == 6 ) +failed with expansion: + 5 == 6 -[85] x == Approx( 1.301 ) -failed -for: 1.3 == Approx( 1.301 ) +ConditionTests.cpp:85: + CHECK( x == Approx( 1.301 ) ) +failed with expansion: + 1.3 == Approx( 1.301 ) ---------------------------------------------------------------- -Summary for test case './failing/conditions/equality': -1 test case - failed (13 assertions - all failed) +Test case: './succeeding/conditions/inequality' +---------------------------------------------------------------- --- Test case: './succeeding/conditions/inequality' ------------- ConditionTests.cpp:93: -[93] data.int_seven != 6 -succeeded -for: 7 != 6 + REQUIRE( data.int_seven != 6 ) +passed with expansion: + 7 != 6 -[94] data.int_seven != 8 -succeeded -for: 7 != 8 +ConditionTests.cpp:94: + REQUIRE( data.int_seven != 8 ) +passed with expansion: + 7 != 8 -[95] data.float_nine_point_one != Approx( 9.11f ) -succeeded -for: 9.1 != Approx( 9.11 ) +ConditionTests.cpp:95: + REQUIRE( data.float_nine_point_one != Approx( 9.11f ) ) +passed with expansion: + 9.1 != Approx( 9.11 ) -[96] data.float_nine_point_one != Approx( 9.0f ) -succeeded -for: 9.1 != Approx( 9 ) +ConditionTests.cpp:96: + REQUIRE( data.float_nine_point_one != Approx( 9.0f ) ) +passed with expansion: + 9.1 != Approx( 9 ) -[97] data.float_nine_point_one != Approx( 1 ) -succeeded -for: 9.1 != Approx( 1 ) +ConditionTests.cpp:97: + REQUIRE( data.float_nine_point_one != Approx( 1 ) ) +passed with expansion: + 9.1 != Approx( 1 ) -[98] data.float_nine_point_one != Approx( 0 ) -succeeded -for: 9.1 != Approx( 0 ) +ConditionTests.cpp:98: + REQUIRE( data.float_nine_point_one != Approx( 0 ) ) +passed with expansion: + 9.1 != Approx( 0 ) -[99] data.double_pi != Approx( 3.1415 ) -succeeded -for: 3.14159 != Approx( 3.1415 ) +ConditionTests.cpp:99: + REQUIRE( data.double_pi != Approx( 3.1415 ) ) +passed with expansion: + 3.14159 != Approx( 3.1415 ) -[100] data.str_hello != "goodbye" -succeeded -for: "hello" != "goodbye" +ConditionTests.cpp:100: + REQUIRE( data.str_hello != "goodbye" ) +passed with expansion: + "hello" != "goodbye" -[101] data.str_hello != "hell" -succeeded -for: "hello" != "hell" +ConditionTests.cpp:101: + REQUIRE( data.str_hello != "hell" ) +passed with expansion: + "hello" != "hell" -[102] data.str_hello != "hello1" -succeeded -for: "hello" != "hello1" +ConditionTests.cpp:102: + REQUIRE( data.str_hello != "hello1" ) +passed with expansion: + "hello" != "hello1" -[103] data.str_hello.size() != 6 -succeeded -for: 5 != 6 +ConditionTests.cpp:103: + REQUIRE( data.str_hello.size() != 6 ) +passed with expansion: + 5 != 6 ---------------------------------------------------------------- -Summary for test case './succeeding/conditions/inequality': -All tests passed (11 assertions in 1 test case) +Test case: './failing/conditions/inequality' +---------------------------------------------------------------- --- Test case: './failing/conditions/inequality' ---------------- ConditionTests.cpp:111: -[111] data.int_seven != 7 -failed -for: 7 != 7 + CHECK( data.int_seven != 7 ) +failed with expansion: + 7 != 7 -[112] data.float_nine_point_one != Approx( 9.1f ) -failed -for: 9.1 != Approx( 9.1 ) +ConditionTests.cpp:112: + CHECK( data.float_nine_point_one != Approx( 9.1f ) ) +failed with expansion: + 9.1 != Approx( 9.1 ) -[113] data.double_pi != Approx( 3.1415926535 ) -failed -for: 3.14159 != Approx( 3.14159 ) +ConditionTests.cpp:113: + CHECK( data.double_pi != Approx( 3.1415926535 ) ) +failed with expansion: + 3.14159 != Approx( 3.14159 ) -[114] data.str_hello != "hello" -failed -for: "hello" != "hello" +ConditionTests.cpp:114: + CHECK( data.str_hello != "hello" ) +failed with expansion: + "hello" != "hello" -[115] data.str_hello.size() != 5 -failed -for: 5 != 5 +ConditionTests.cpp:115: + CHECK( data.str_hello.size() != 5 ) +failed with expansion: + 5 != 5 ---------------------------------------------------------------- -Summary for test case './failing/conditions/inequality': -1 test case - failed (5 assertions - all failed) +Test case: './succeeding/conditions/ordered' +---------------------------------------------------------------- --- Test case: './succeeding/conditions/ordered' ---------------- ConditionTests.cpp:124: -[124] data.int_seven < 8 -succeeded -for: 7 < 8 + REQUIRE( data.int_seven < 8 ) +passed with expansion: + 7 < 8 -[125] data.int_seven > 6 -succeeded -for: 7 > 6 +ConditionTests.cpp:125: + REQUIRE( data.int_seven > 6 ) +passed with expansion: + 7 > 6 -[126] data.int_seven > 0 -succeeded -for: 7 > 0 +ConditionTests.cpp:126: + REQUIRE( data.int_seven > 0 ) +passed with expansion: + 7 > 0 -[127] data.int_seven > -1 -succeeded -for: 7 > -1 +ConditionTests.cpp:127: + REQUIRE( data.int_seven > -1 ) +passed with expansion: + 7 > -1 -[129] data.int_seven >= 7 -succeeded -for: 7 >= 7 +ConditionTests.cpp:129: + REQUIRE( data.int_seven >= 7 ) +passed with expansion: + 7 >= 7 -[130] data.int_seven >= 6 -succeeded -for: 7 >= 6 +ConditionTests.cpp:130: + REQUIRE( data.int_seven >= 6 ) +passed with expansion: + 7 >= 6 -[131] data.int_seven <= 7 -succeeded -for: 7 <= 7 +ConditionTests.cpp:131: + REQUIRE( data.int_seven <= 7 ) +passed with expansion: + 7 <= 7 -[132] data.int_seven <= 8 -succeeded -for: 7 <= 8 +ConditionTests.cpp:132: + REQUIRE( data.int_seven <= 8 ) +passed with expansion: + 7 <= 8 -[134] data.float_nine_point_one > 9 -succeeded -for: 9.1 > 9 +ConditionTests.cpp:134: + REQUIRE( data.float_nine_point_one > 9 ) +passed with expansion: + 9.1 > 9 -[135] data.float_nine_point_one < 10 -succeeded -for: 9.1 < 10 +ConditionTests.cpp:135: + REQUIRE( data.float_nine_point_one < 10 ) +passed with expansion: + 9.1 < 10 -[136] data.float_nine_point_one < 9.2 -succeeded -for: 9.1 < 9.2 +ConditionTests.cpp:136: + REQUIRE( data.float_nine_point_one < 9.2 ) +passed with expansion: + 9.1 < 9.2 -[138] data.str_hello <= "hello" -succeeded -for: "hello" <= "hello" +ConditionTests.cpp:138: + REQUIRE( data.str_hello <= "hello" ) +passed with expansion: + "hello" <= "hello" -[139] data.str_hello >= "hello" -succeeded -for: "hello" >= "hello" +ConditionTests.cpp:139: + REQUIRE( data.str_hello >= "hello" ) +passed with expansion: + "hello" >= "hello" -[141] data.str_hello < "hellp" -succeeded -for: "hello" < "hellp" +ConditionTests.cpp:141: + REQUIRE( data.str_hello < "hellp" ) +passed with expansion: + "hello" < "hellp" -[142] data.str_hello < "zebra" -succeeded -for: "hello" < "zebra" +ConditionTests.cpp:142: + REQUIRE( data.str_hello < "zebra" ) +passed with expansion: + "hello" < "zebra" -[143] data.str_hello > "hellm" -succeeded -for: "hello" > "hellm" +ConditionTests.cpp:143: + REQUIRE( data.str_hello > "hellm" ) +passed with expansion: + "hello" > "hellm" -[144] data.str_hello > "a" -succeeded -for: "hello" > "a" +ConditionTests.cpp:144: + REQUIRE( data.str_hello > "a" ) +passed with expansion: + "hello" > "a" ---------------------------------------------------------------- -Summary for test case './succeeding/conditions/ordered': -All tests passed (17 assertions in 1 test case) +Test case: './failing/conditions/ordered' +---------------------------------------------------------------- --- Test case: './failing/conditions/ordered' ------------------- ConditionTests.cpp:152: -[152] data.int_seven > 7 -failed -for: 7 > 7 + CHECK( data.int_seven > 7 ) +failed with expansion: + 7 > 7 -[153] data.int_seven < 7 -failed -for: 7 < 7 +ConditionTests.cpp:153: + CHECK( data.int_seven < 7 ) +failed with expansion: + 7 < 7 -[154] data.int_seven > 8 -failed -for: 7 > 8 +ConditionTests.cpp:154: + CHECK( data.int_seven > 8 ) +failed with expansion: + 7 > 8 -[155] data.int_seven < 6 -failed -for: 7 < 6 +ConditionTests.cpp:155: + CHECK( data.int_seven < 6 ) +failed with expansion: + 7 < 6 -[156] data.int_seven < 0 -failed -for: 7 < 0 +ConditionTests.cpp:156: + CHECK( data.int_seven < 0 ) +failed with expansion: + 7 < 0 -[157] data.int_seven < -1 -failed -for: 7 < -1 +ConditionTests.cpp:157: + CHECK( data.int_seven < -1 ) +failed with expansion: + 7 < -1 -[159] data.int_seven >= 8 -failed -for: 7 >= 8 +ConditionTests.cpp:159: + CHECK( data.int_seven >= 8 ) +failed with expansion: + 7 >= 8 -[160] data.int_seven <= 6 -failed -for: 7 <= 6 +ConditionTests.cpp:160: + CHECK( data.int_seven <= 6 ) +failed with expansion: + 7 <= 6 -[162] data.float_nine_point_one < 9 -failed -for: 9.1 < 9 +ConditionTests.cpp:162: + CHECK( data.float_nine_point_one < 9 ) +failed with expansion: + 9.1 < 9 -[163] data.float_nine_point_one > 10 -failed -for: 9.1 > 10 +ConditionTests.cpp:163: + CHECK( data.float_nine_point_one > 10 ) +failed with expansion: + 9.1 > 10 -[164] data.float_nine_point_one > 9.2 -failed -for: 9.1 > 9.2 +ConditionTests.cpp:164: + CHECK( data.float_nine_point_one > 9.2 ) +failed with expansion: + 9.1 > 9.2 -[166] data.str_hello > "hello" -failed -for: "hello" > "hello" +ConditionTests.cpp:166: + CHECK( data.str_hello > "hello" ) +failed with expansion: + "hello" > "hello" -[167] data.str_hello < "hello" -failed -for: "hello" < "hello" +ConditionTests.cpp:167: + CHECK( data.str_hello < "hello" ) +failed with expansion: + "hello" < "hello" -[168] data.str_hello > "hellp" -failed -for: "hello" > "hellp" +ConditionTests.cpp:168: + CHECK( data.str_hello > "hellp" ) +failed with expansion: + "hello" > "hellp" -[169] data.str_hello > "z" -failed -for: "hello" > "z" +ConditionTests.cpp:169: + CHECK( data.str_hello > "z" ) +failed with expansion: + "hello" > "z" -[170] data.str_hello < "hellm" -failed -for: "hello" < "hellm" +ConditionTests.cpp:170: + CHECK( data.str_hello < "hellm" ) +failed with expansion: + "hello" < "hellm" -[171] data.str_hello < "a" -failed -for: "hello" < "a" +ConditionTests.cpp:171: + CHECK( data.str_hello < "a" ) +failed with expansion: + "hello" < "a" -[173] data.str_hello >= "z" -failed -for: "hello" >= "z" +ConditionTests.cpp:173: + CHECK( data.str_hello >= "z" ) +failed with expansion: + "hello" >= "z" -[174] data.str_hello <= "a" -failed -for: "hello" <= "a" +ConditionTests.cpp:174: + CHECK( data.str_hello <= "a" ) +failed with expansion: + "hello" <= "a" ---------------------------------------------------------------- -Summary for test case './failing/conditions/ordered': -1 test case - failed (19 assertions - all failed) +Test case: './succeeding/conditions/int literals' +---------------------------------------------------------------- --- Test case: './succeeding/conditions/int literals' ----------- ConditionTests.cpp:188: -[188] i == 1 -succeeded -for: 1 == 1 + REQUIRE( i == 1 ) +passed with expansion: + 1 == 1 -[189] ui == 2 -succeeded -for: 2 == 2 +ConditionTests.cpp:189: + REQUIRE( ui == 2 ) +passed with expansion: + 2 == 2 -[190] l == 3 -succeeded -for: 3 == 3 +ConditionTests.cpp:190: + REQUIRE( l == 3 ) +passed with expansion: + 3 == 3 -[191] ul == 4 -succeeded -for: 4 == 4 +ConditionTests.cpp:191: + REQUIRE( ul == 4 ) +passed with expansion: + 4 == 4 -[192] c == 5 -succeeded -for: 5 == 5 +ConditionTests.cpp:192: + REQUIRE( c == 5 ) +passed with expansion: + 5 == 5 -[193] uc == 6 -succeeded -for: 6 == 6 +ConditionTests.cpp:193: + REQUIRE( uc == 6 ) +passed with expansion: + 6 == 6 -[195] 1 == i -succeeded -for: 1 == 1 +ConditionTests.cpp:195: + REQUIRE( 1 == i ) +passed with expansion: + 1 == 1 -[196] 2 == ui -succeeded -for: 2 == 2 +ConditionTests.cpp:196: + REQUIRE( 2 == ui ) +passed with expansion: + 2 == 2 -[197] 3 == l -succeeded -for: 3 == 3 +ConditionTests.cpp:197: + REQUIRE( 3 == l ) +passed with expansion: + 3 == 3 -[198] 4 == ul -succeeded -for: 4 == 4 +ConditionTests.cpp:198: + REQUIRE( 4 == ul ) +passed with expansion: + 4 == 4 -[199] 5 == c -succeeded -for: 5 == 5 +ConditionTests.cpp:199: + REQUIRE( 5 == c ) +passed with expansion: + 5 == 5 -[200] 6 == uc -succeeded -for: 6 == 6 +ConditionTests.cpp:200: + REQUIRE( 6 == uc ) +passed with expansion: + 6 == 6 -[202] (std::numeric_limits::max)() > ul -succeeded -for: 0x > 4 +ConditionTests.cpp:202: + REQUIRE( (std::numeric_limits::max)() > ul ) +passed with expansion: + 0x > 4 ---------------------------------------------------------------- -Summary for test case './succeeding/conditions/int literals': -All tests passed (13 assertions in 1 test case) +Test case: './succeeding/conditions//long_to_unsigned_x' +---------------------------------------------------------------- --- Test case: './succeeding/conditions//long_to_unsigned_x' ---- ConditionTests.cpp:223: -[223] long_var == unsigned_char_var -succeeded -for: 1 == 1 + REQUIRE( long_var == unsigned_char_var ) +passed with expansion: + 1 == 1 -[224] long_var == unsigned_short_var -succeeded -for: 1 == 1 +ConditionTests.cpp:224: + REQUIRE( long_var == unsigned_short_var ) +passed with expansion: + 1 == 1 -[225] long_var == unsigned_int_var -succeeded -for: 1 == 1 +ConditionTests.cpp:225: + REQUIRE( long_var == unsigned_int_var ) +passed with expansion: + 1 == 1 -[226] long_var == unsigned_long_var -succeeded -for: 1 == 1 +ConditionTests.cpp:226: + REQUIRE( long_var == unsigned_long_var ) +passed with expansion: + 1 == 1 ---------------------------------------------------------------- -Summary for test case './succeeding/conditions//long_to_unsigned_x': -All tests passed (4 assertions in 1 test case) +Test case: './succeeding/conditions/const ints to int literal' +---------------------------------------------------------------- --- Test case: './succeeding/conditions/const ints to int literal' ConditionTests.cpp:237: -[237] unsigned_char_var == 1 -succeeded -for: 1 == 1 + REQUIRE( unsigned_char_var == 1 ) +passed with expansion: + 1 == 1 -[238] unsigned_short_var == 1 -succeeded -for: 1 == 1 +ConditionTests.cpp:238: + REQUIRE( unsigned_short_var == 1 ) +passed with expansion: + 1 == 1 -[239] unsigned_int_var == 1 -succeeded -for: 1 == 1 +ConditionTests.cpp:239: + REQUIRE( unsigned_int_var == 1 ) +passed with expansion: + 1 == 1 -[240] unsigned_long_var == 1 -succeeded -for: 1 == 1 +ConditionTests.cpp:240: + REQUIRE( unsigned_long_var == 1 ) +passed with expansion: + 1 == 1 ---------------------------------------------------------------- -Summary for test case './succeeding/conditions/const ints to int literal': -All tests passed (4 assertions in 1 test case) +Test case: './succeeding/conditions/negative ints' +---------------------------------------------------------------- --- Test case: './succeeding/conditions/negative ints' ---------- ConditionTests.cpp:246: -[246] ( -1 > 2u ) -succeeded -for: true + CHECK( ( -1 > 2u ) ) +passed with expansion: + true -[247] -1 > 2u -succeeded -for: -1 > 2 +ConditionTests.cpp:247: + CHECK( -1 > 2u ) +passed with expansion: + -1 > 2 -[249] ( 2u < -1 ) -succeeded -for: true +ConditionTests.cpp:249: + CHECK( ( 2u < -1 ) ) +passed with expansion: + true -[250] 2u < -1 -succeeded -for: 2 < -1 +ConditionTests.cpp:250: + CHECK( 2u < -1 ) +passed with expansion: + 2 < -1 -[253] ( minInt > 2u ) -succeeded -for: true +ConditionTests.cpp:253: + CHECK( ( minInt > 2u ) ) +passed with expansion: + true -[254] minInt > 2u -succeeded -for: -2147483648 > 2 +ConditionTests.cpp:254: + CHECK( minInt > 2u ) +passed with expansion: + -2147483648 > 2 ---------------------------------------------------------------- -Summary for test case './succeeding/conditions/negative ints': -All tests passed (6 assertions in 1 test case) +Test case: './succeeding/conditions/computed ints' +---------------------------------------------------------------- --- Test case: './succeeding/conditions/computed ints' ---------- ConditionTests.cpp:269: -[269] 54 == 6*9 -succeeded -for: 54 == 54 + CHECK( 54 == 6*9 ) +passed with expansion: + 54 == 54 ---------------------------------------------------------------- -Summary for test case './succeeding/conditions/computed ints': -All tests passed (1 assertion in 1 test case) +Test case: './succeeding/conditions/ptr' +---------------------------------------------------------------- --- Test case: './succeeding/conditions/ptr' -------------------- ConditionTests.cpp:285: -[285] p == __null -succeeded -for: __null == 0 + REQUIRE( p == __null ) +passed with expansion: + __null == 0 -[286] p == pNULL -succeeded -for: __null == __null +ConditionTests.cpp:286: + REQUIRE( p == pNULL ) +passed with expansion: + __null == __null -[291] p != __null -succeeded -for: 0x != 0 +ConditionTests.cpp:291: + REQUIRE( p != __null ) +passed with expansion: + 0x != 0 -[294] cp != __null -succeeded -for: 0x != 0 +ConditionTests.cpp:294: + REQUIRE( cp != __null ) +passed with expansion: + 0x != 0 -[297] cpc != __null -succeeded -for: 0x != 0 +ConditionTests.cpp:297: + REQUIRE( cpc != __null ) +passed with expansion: + 0x != 0 -[299] returnsNull() == __null -succeeded -for: {null string} == 0 +ConditionTests.cpp:299: + REQUIRE( returnsNull() == __null ) +passed with expansion: + {null string} == 0 -[300] returnsConstNull() == __null -succeeded -for: {null string} == 0 +ConditionTests.cpp:300: + REQUIRE( returnsConstNull() == __null ) +passed with expansion: + {null string} == 0 -[302] __null != p -succeeded -for: 0 != 0x +ConditionTests.cpp:302: + REQUIRE( __null != p ) +passed with expansion: + 0 != 0x ---------------------------------------------------------------- -Summary for test case './succeeding/conditions/ptr': -All tests passed (8 assertions in 1 test case) +Test case: './succeeding/conditions/not' +---------------------------------------------------------------- --- Test case: './succeeding/conditions/not' -------------------- ConditionTests.cpp:317: -[317] false == false -succeeded + REQUIRE( false == false ) +passed -[318] true == true -succeeded +ConditionTests.cpp:318: + REQUIRE( true == true ) +passed -[319] !false -succeeded -for: true +ConditionTests.cpp:319: + REQUIRE( !false ) +passed with expansion: + true -[320] !false -succeeded +ConditionTests.cpp:320: + REQUIRE_FALSE( !false ) +passed -[322] !falseValue -succeeded -for: true +ConditionTests.cpp:322: + REQUIRE( !falseValue ) +passed with expansion: + true -[323] !falseValue -succeeded -for: !false +ConditionTests.cpp:323: + REQUIRE_FALSE( !falseValue ) +passed with expansion: + !false -[325] !(1 == 2) -succeeded -for: true +ConditionTests.cpp:325: + REQUIRE( !(1 == 2) ) +passed with expansion: + true -[326] !1 == 2 -succeeded -for: !(1 == 2) +ConditionTests.cpp:326: + REQUIRE_FALSE( !1 == 2 ) +passed with expansion: + !(1 == 2) ---------------------------------------------------------------- -Summary for test case './succeeding/conditions/not': -All tests passed (8 assertions in 1 test case) +Test case: './failing/conditions/not' +---------------------------------------------------------------- --- Test case: './failing/conditions/not' ----------------------- ConditionTests.cpp:334: -[334] false != false + CHECK( false != false ) failed -[335] true != true +ConditionTests.cpp:335: + CHECK( true != true ) failed -[336] !true -failed -for: false +ConditionTests.cpp:336: + CHECK( !true ) +failed with expansion: + false -[337] !true +ConditionTests.cpp:337: + CHECK_FALSE( !true ) failed -[339] !trueValue -failed -for: false +ConditionTests.cpp:339: + CHECK( !trueValue ) +failed with expansion: + false -[340] !trueValue -failed -for: !true +ConditionTests.cpp:340: + CHECK_FALSE( !trueValue ) +failed with expansion: + !true -[342] !(1 == 1) -failed -for: false +ConditionTests.cpp:342: + CHECK( !(1 == 1) ) +failed with expansion: + false -[343] !1 == 1 -failed -for: !(1 == 1) +ConditionTests.cpp:343: + CHECK_FALSE( !1 == 1 ) +failed with expansion: + !(1 == 1) ---------------------------------------------------------------- -Summary for test case './failing/conditions/not': -1 test case - failed (8 assertions - all failed) +Test case: './succeeding/exceptions/explicit' +---------------------------------------------------------------- --- Test case: './succeeding/exceptions/explicit' --------------- ExceptionTests.cpp:39: -[39] thisThrows() -succeeded + REQUIRE_THROWS_AS( thisThrows() ) +passed -[40] thisDoesntThrow() -succeeded +ExceptionTests.cpp:40: + REQUIRE_NOTHROW( thisDoesntThrow() ) +passed -[41] thisThrows() -succeeded +ExceptionTests.cpp:41: + REQUIRE_THROWS( thisThrows() ) +passed ---------------------------------------------------------------- -Summary for test case './succeeding/exceptions/explicit': -All tests passed (3 assertions in 1 test case) +Test case: './failing/exceptions/explicit' +---------------------------------------------------------------- --- Test case: './failing/exceptions/explicit' ------------------ ExceptionTests.cpp:47: -[47] thisThrows() -failed with unexpected exception with message: 'expected exception' + CHECK_THROWS_AS( thisThrows() ) +failed due to unexpected exception with message: + expected exception -[48] thisDoesntThrow() -failed because no exception was thrown where one was expected +ExceptionTests.cpp:48: + CHECK_THROWS_AS( thisDoesntThrow() ) +failed because no exception was thrown where one was expected: -[49] thisThrows() -failed with unexpected exception with message: 'expected exception' +ExceptionTests.cpp:49: + CHECK_NOTHROW( thisThrows() ) +failed due to unexpected exception with message: + expected exception ---------------------------------------------------------------- -Summary for test case './failing/exceptions/explicit': -1 test case - failed (3 assertions - all failed) +Test case: './failing/exceptions/implicit' +---------------------------------------------------------------- --- Test case: './failing/exceptions/implicit' ------------------ ExceptionTests.cpp:52: -[52] Unexpected exception with message: 'unexpected exception' +failed due to unexpected exception with message: + unexpected exception ---------------------------------------------------------------- -Summary for test case './failing/exceptions/implicit': -1 test case - failed (1 assertion - failed) +Test case: './failing/exceptions/implicit/2' +---------------------------------------------------------------- --- Test case: './failing/exceptions/implicit/2' ---------------- ExceptionTests.cpp:60: -[60] 1 == 1 -succeeded + CHECK( 1 == 1 ) +passed -[60] {Unknown expression after this line} -failed with unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:60: + {Unknown expression after this line} +failed due to unexpected exception with message: + unexpected exception ---------------------------------------------------------------- -Summary for test case './failing/exceptions/implicit/2': -1 test case - failed (2 assertions - 1 failed) +Test case: './succeeding/exceptions/implicit' +---------------------------------------------------------------- --- Test case: './succeeding/exceptions/implicit' --------------- No assertions in test case, './succeeding/exceptions/implicit' ---------------------------------------------------------------- -Summary for test case './succeeding/exceptions/implicit': -1 test case - failed (1 assertion - failed) +Test case: './failing/exceptions/custom' +---------------------------------------------------------------- --- Test case: './failing/exceptions/custom' -------------------- ExceptionTests.cpp:102: -[102] Unexpected exception with message: 'custom exception' +failed due to unexpected exception with message: + custom exception ---------------------------------------------------------------- -Summary for test case './failing/exceptions/custom': -1 test case - failed (1 assertion - failed) +Test case: './failing/exceptions/custom/nothrow' +---------------------------------------------------------------- --- Test case: './failing/exceptions/custom/nothrow' ------------ ExceptionTests.cpp:109: -[109] throw CustomException( "unexpected custom exception" ) -failed with unexpected exception with message: 'unexpected custom exception' + REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) +failed due to unexpected exception with message: + unexpected custom exception ---------------------------------------------------------------- -Summary for test case './failing/exceptions/custom/nothrow': -1 test case - failed (1 assertion - failed) +Test case: './failing/exceptions/custom/throw' +---------------------------------------------------------------- --- Test case: './failing/exceptions/custom/throw' -------------- ExceptionTests.cpp:114: -[114] throw CustomException( "custom exception - not std" ) -failed with unexpected exception with message: 'custom exception - not std' + REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) +failed due to unexpected exception with message: + custom exception - not std ---------------------------------------------------------------- -Summary for test case './failing/exceptions/custom/throw': -1 test case - failed (1 assertion - failed) +Test case: './failing/exceptions/custom/double' +---------------------------------------------------------------- --- Test case: './failing/exceptions/custom/double' ------------- ExceptionTests.cpp:118: -[118] Unexpected exception with message: '3.14' +failed due to unexpected exception with message: + 3.14 ---------------------------------------------------------------- -Summary for test case './failing/exceptions/custom/double': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/exceptions/notimplemented' +---------------------------------------------------------------- --- Test case: './succeeding/exceptions/notimplemented' --------- ExceptionTests.cpp:129: -[129] thisFunctionNotImplemented( 7 ) -succeeded + REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) +passed ---------------------------------------------------------------- -Summary for test case './succeeding/exceptions/notimplemented': -All tests passed (1 assertion in 1 test case) +Test case: './succeeding/generators/1' +---------------------------------------------------------------- --- Test case: './succeeding/generators/1' ---------------------- GeneratorTests.cpp:26: -[26] multiply( i, 2 ) == i*2 -succeeded -for: 2 == 2 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 200 == 200 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 4 == 4 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 200 == 200 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 6 == 6 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 200 == 200 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 8 == 8 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 200 == 200 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 10 == 10 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 200 == 200 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 30 == 30 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 200 == 200 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 40 == 40 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 200 == 200 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 42 == 42 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 200 == 200 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 72 == 72 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 200 == 200 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 2 == 2 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 202 == 202 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 4 == 4 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 202 == 202 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 6 == 6 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 202 == 202 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 8 == 8 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 202 == 202 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 10 == 10 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 202 == 202 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 30 == 30 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 202 == 202 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 40 == 40 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 202 == 202 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 42 == 42 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 202 == 202 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 72 == 72 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 202 == 202 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 2 == 2 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 204 == 204 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 4 == 4 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 204 == 204 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 6 == 6 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 204 == 204 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 8 == 8 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 204 == 204 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 10 == 10 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 204 == 204 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 30 == 30 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 204 == 204 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 40 == 40 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 204 == 204 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 42 == 42 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 204 == 204 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 72 == 72 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 204 == 204 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 2 == 2 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 206 == 206 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 4 == 4 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 206 == 206 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 6 == 6 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 206 == 206 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 8 == 8 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 206 == 206 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 10 == 10 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 206 == 206 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 30 == 30 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 206 == 206 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 40 == 40 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 206 == 206 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 42 == 42 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 206 == 206 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 72 == 72 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 206 == 206 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 2 == 2 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 208 == 208 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 4 == 4 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 208 == 208 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 6 == 6 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 208 == 208 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 8 == 8 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 208 == 208 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 10 == 10 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 208 == 208 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 30 == 30 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 208 == 208 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 40 == 40 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 208 == 208 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 42 == 42 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 208 == 208 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 72 == 72 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 208 == 208 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 2 == 2 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 210 == 210 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 4 == 4 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 210 == 210 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 6 == 6 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 210 == 210 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 8 == 8 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 210 == 210 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 10 == 10 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 210 == 210 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 30 == 30 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 210 == 210 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 40 == 40 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 210 == 210 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 42 == 42 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 210 == 210 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 72 == 72 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 210 == 210 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 2 == 2 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 212 == 212 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 4 == 4 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 212 == 212 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 6 == 6 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 212 == 212 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 8 == 8 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 212 == 212 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 10 == 10 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 212 == 212 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 30 == 30 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 212 == 212 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 40 == 40 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 212 == 212 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 42 == 42 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 212 == 212 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 72 == 72 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 212 == 212 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 2 == 2 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 214 == 214 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 4 == 4 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 214 == 214 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 6 == 6 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 214 == 214 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 8 == 8 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 214 == 214 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 10 == 10 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 214 == 214 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 30 == 30 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 214 == 214 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 40 == 40 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 214 == 214 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 42 == 42 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 214 == 214 - -[26] multiply( i, 2 ) == i*2 -succeeded -for: 72 == 72 - -[27] multiply( j, 2 ) == j*2 -succeeded -for: 214 == 214 + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 2 == 2 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 200 == 200 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 4 == 4 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 200 == 200 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 6 == 6 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 200 == 200 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 8 == 8 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 200 == 200 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 10 == 10 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 200 == 200 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 30 == 30 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 200 == 200 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 40 == 40 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 200 == 200 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 42 == 42 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 200 == 200 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 72 == 72 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 200 == 200 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 2 == 2 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 202 == 202 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 4 == 4 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 202 == 202 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 6 == 6 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 202 == 202 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 8 == 8 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 202 == 202 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 10 == 10 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 202 == 202 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 30 == 30 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 202 == 202 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 40 == 40 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 202 == 202 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 42 == 42 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 202 == 202 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 72 == 72 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 202 == 202 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 2 == 2 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 204 == 204 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 4 == 4 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 204 == 204 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 6 == 6 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 204 == 204 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 8 == 8 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 204 == 204 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 10 == 10 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 204 == 204 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 30 == 30 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 204 == 204 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 40 == 40 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 204 == 204 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 42 == 42 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 204 == 204 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 72 == 72 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 204 == 204 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 2 == 2 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 206 == 206 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 4 == 4 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 206 == 206 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 6 == 6 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 206 == 206 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 8 == 8 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 206 == 206 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 10 == 10 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 206 == 206 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 30 == 30 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 206 == 206 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 40 == 40 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 206 == 206 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 42 == 42 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 206 == 206 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 72 == 72 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 206 == 206 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 2 == 2 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 208 == 208 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 4 == 4 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 208 == 208 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 6 == 6 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 208 == 208 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 8 == 8 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 208 == 208 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 10 == 10 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 208 == 208 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 30 == 30 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 208 == 208 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 40 == 40 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 208 == 208 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 42 == 42 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 208 == 208 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 72 == 72 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 208 == 208 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 2 == 2 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 210 == 210 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 4 == 4 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 210 == 210 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 6 == 6 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 210 == 210 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 8 == 8 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 210 == 210 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 10 == 10 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 210 == 210 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 30 == 30 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 210 == 210 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 40 == 40 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 210 == 210 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 42 == 42 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 210 == 210 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 72 == 72 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 210 == 210 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 2 == 2 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 212 == 212 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 4 == 4 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 212 == 212 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 6 == 6 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 212 == 212 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 8 == 8 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 212 == 212 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 10 == 10 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 212 == 212 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 30 == 30 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 212 == 212 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 40 == 40 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 212 == 212 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 42 == 42 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 212 == 212 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 72 == 72 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 212 == 212 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 2 == 2 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 214 == 214 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 4 == 4 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 214 == 214 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 6 == 6 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 214 == 214 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 8 == 8 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 214 == 214 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 10 == 10 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 214 == 214 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 30 == 30 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 214 == 214 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 40 == 40 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 214 == 214 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 42 == 42 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 214 == 214 + +GeneratorTests.cpp:26: + CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) +passed with expansion: + 72 == 72 + +GeneratorTests.cpp:27: + CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) +passed with expansion: + 214 == 214 ---------------------------------------------------------------- -Summary for test case './succeeding/generators/1': -All tests passed (144 assertions in 1 test case) +Test case: './succeeding/generators/2' +---------------------------------------------------------------- + +GeneratorTests.cpp:40: + CATCH_REQUIRE( i->first == i->second-1 ) +passed with expansion: + 0 == 0 + +GeneratorTests.cpp:40: + CATCH_REQUIRE( i->first == i->second-1 ) +passed with expansion: + 2 == 2 + +---------------------------------------------------------------- +Test case: './succeeding/message' +---------------------------------------------------------------- --- Test case: './succeeding/message' --------------------------- MessageTests.cpp:14: -[14] [warning: this is a warning] +warning: + this is a warning No assertions in test case, './succeeding/message' ---------------------------------------------------------------- -Summary for test case './succeeding/message': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/succeed' +---------------------------------------------------------------- --- Test case: './succeeding/succeed' --------------------------- MessageTests.cpp:18: -[18] succeeded -[with message: this is a success] +passed with message: + this is a success ---------------------------------------------------------------- -Summary for test case './succeeding/succeed': -All tests passed (1 assertion in 1 test case) +Test case: './failing/message/info/1' +---------------------------------------------------------------- --- Test case: './failing/message/info/1' ----------------------- MessageTests.cpp:23: -[23] [info: this message should be logged] +info: + this message should be logged -[24] [info: so should this] +MessageTests.cpp:24: +info: + so should this -[26] a == 1 -failed -for: 2 == 1 +MessageTests.cpp:26: + REQUIRE( a == 1 ) +failed with expansion: + 2 == 1 ---------------------------------------------------------------- -Summary for test case './failing/message/info/1': -1 test case - failed (1 assertion - failed) +Test case: './mixed/message/info/2' +---------------------------------------------------------------- --- Test case: './mixed/message/info/2' ------------------------- MessageTests.cpp:33: -[33] a == 2 -succeeded -for: 2 == 2 + CHECK( a == 2 ) +passed with expansion: + 2 == 2 -[31] [info: this message should be logged] +MessageTests.cpp:31: +info: + this message should be logged -[35] [info: this message should be logged, too] +MessageTests.cpp:35: +info: + this message should be logged, too -[37] a == 1 -failed -for: 2 == 1 +MessageTests.cpp:37: + CHECK( a == 1 ) +failed with expansion: + 2 == 1 -[39] [info: and this, but later] +MessageTests.cpp:39: +info: + and this, but later -[41] a == 0 -failed -for: 2 == 0 +MessageTests.cpp:41: + CHECK( a == 0 ) +failed with expansion: + 2 == 0 -[45] a == 2 -succeeded -for: 2 == 2 +MessageTests.cpp:45: + CHECK( a == 2 ) +passed with expansion: + 2 == 2 ---------------------------------------------------------------- -Summary for test case './mixed/message/info/2': -1 test case - failed (4 assertions - 2 failed) +Test case: './failing/message/fail' +---------------------------------------------------------------- --- Test case: './failing/message/fail' ------------------------- MessageTests.cpp:51: -[51] failed with message: 'This is a failure' +failed explicitly with message: + This is a failure ---------------------------------------------------------------- -Summary for test case './failing/message/fail': -1 test case - failed (1 assertion - failed) +Test case: './failing/message/sections' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'one' +---------------------------------------------------------------- --- Test case: './failing/message/sections' --------------------- --- Section: 'one' ---------------------------------------------- MessageTests.cpp:58: -[58] failed with message: 'Message from section one' +failed explicitly with message: + Message from section one ---------------------------------------------------------------- -Summary for section 'one': -1 assertion - failed +Section: 'two' +---------------------------------------------------------------- --- Section: 'two' ---------------------------------------------- MessageTests.cpp:63: -[63] failed with message: 'Message from section two' - ----------------------------------------------------------------- -Summary for section 'two': -1 assertion - failed - ----------------------------------------------------------------- -Summary for test case './failing/message/sections': -1 test case - failed (2 assertions - both failed) +failed explicitly with message: + Message from section two Message from section one --- Test case: './succeeding/message/sections/stdout' ----------- --- Section: 'one' ---------------------------------------------- +---------------------------------------------------------------- +Test case: './succeeding/message/sections/stdout' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'one' +---------------------------------------------------------------- + No assertions in section, 'one' ----------------------------------------------------------------- -Summary for section 'one': -1 assertion - failed - Message from section two --- Section: 'two' ---------------------------------------------- +---------------------------------------------------------------- +Section: 'two' +---------------------------------------------------------------- + No assertions in section, 'two' ---------------------------------------------------------------- -Summary for section 'two': -1 assertion - failed - +Test case: './mixed/message/scoped' ---------------------------------------------------------------- -Summary for test case './succeeding/message/sections/stdout': -1 test case - failed (2 assertions - both failed) --- Test case: './mixed/message/scoped' ------------------------- MessageTests.cpp:86: -[86] i < 10 -succeeded -for: 0 < 10 + REQUIRE( i < 10 ) +passed with expansion: + 0 < 10 -[86] i < 10 -succeeded -for: 1 < 10 +MessageTests.cpp:86: + REQUIRE( i < 10 ) +passed with expansion: + 1 < 10 -[86] i < 10 -succeeded -for: 2 < 10 +MessageTests.cpp:86: + REQUIRE( i < 10 ) +passed with expansion: + 2 < 10 -[86] i < 10 -succeeded -for: 3 < 10 +MessageTests.cpp:86: + REQUIRE( i < 10 ) +passed with expansion: + 3 < 10 -[86] i < 10 -succeeded -for: 4 < 10 +MessageTests.cpp:86: + REQUIRE( i < 10 ) +passed with expansion: + 4 < 10 -[86] i < 10 -succeeded -for: 5 < 10 +MessageTests.cpp:86: + REQUIRE( i < 10 ) +passed with expansion: + 5 < 10 -[86] i < 10 -succeeded -for: 6 < 10 +MessageTests.cpp:86: + REQUIRE( i < 10 ) +passed with expansion: + 6 < 10 -[86] i < 10 -succeeded -for: 7 < 10 +MessageTests.cpp:86: + REQUIRE( i < 10 ) +passed with expansion: + 7 < 10 -[86] i < 10 -succeeded -for: 8 < 10 +MessageTests.cpp:86: + REQUIRE( i < 10 ) +passed with expansion: + 8 < 10 -[86] i < 10 -succeeded -for: 9 < 10 +MessageTests.cpp:86: + REQUIRE( i < 10 ) +passed with expansion: + 9 < 10 -[86] i < 10 -succeeded[info: current counter 10] +MessageTests.cpp:86: + REQUIRE( i < 10 ) +info: + current counter 10 -[86] i < 10 -succeeded[info: i := 10] +MessageTests.cpp:86: + REQUIRE( i < 10 ) +info: + i := 10 -[86] i < 10 -failed -for: 10 < 10 +MessageTests.cpp:86: + REQUIRE( i < 10 ) +failed with expansion: + 10 < 10 ---------------------------------------------------------------- -Summary for test case './mixed/message/scoped': -1 test case - failed (11 assertions - 1 failed) +Test case: './succeeding/nofail' +---------------------------------------------------------------- --- Test case: './succeeding/nofail' ---------------------------- MessageTests.cpp:92: -[92] 1 == 2 + CHECK_NOFAIL( 1 == 2 ) failed - but was ok No assertions in test case, './succeeding/nofail' ---------------------------------------------------------------- -Summary for test case './succeeding/nofail': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/Misc/Sections' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 's1' +---------------------------------------------------------------- --- Test case: './succeeding/Misc/Sections' --------------------- --- Section: 's1' ----------------------------------------------- MiscTests.cpp:25: -[25] a != b -succeeded -for: 1 != 2 + REQUIRE( a != b ) +passed with expansion: + 1 != 2 -[26] b != a -succeeded -for: 2 != 1 +MiscTests.cpp:26: + REQUIRE( b != a ) +passed with expansion: + 2 != 1 ---------------------------------------------------------------- -Summary for section 's1': -All 2 assertions passed +Section: 's2' +---------------------------------------------------------------- --- Section: 's2' ----------------------------------------------- MiscTests.cpp:31: -[31] a != b -succeeded -for: 1 != 2 + REQUIRE( a != b ) +passed with expansion: + 1 != 2 ---------------------------------------------------------------- -Summary for section 's2': -1 assertion passed - +Test case: './succeeding/Misc/Sections/nested' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 's1' ---------------------------------------------------------------- -Summary for test case './succeeding/Misc/Sections': -All tests passed (3 assertions in 1 test case) --- Test case: './succeeding/Misc/Sections/nested' -------------- --- Section: 's1' ----------------------------------------------- MiscTests.cpp:42: -[42] a != b -succeeded -for: 1 != 2 + REQUIRE( a != b ) +passed with expansion: + 1 != 2 -[43] b != a -succeeded -for: 2 != 1 - --- Section: 's2' ----------------------------------------------- -[47] a != b -succeeded -for: 1 != 2 +MiscTests.cpp:43: + REQUIRE( b != a ) +passed with expansion: + 2 != 1 ---------------------------------------------------------------- -Summary for section 's2': -1 assertion passed +Section: 's2' +---------------------------------------------------------------- + +MiscTests.cpp:47: + REQUIRE( a != b ) +passed with expansion: + 1 != 2 ---------------------------------------------------------------- -Summary for section 's1': -All 3 assertions passed - +Test case: './mixed/Misc/Sections/nested2' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 's1' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 's2' ---------------------------------------------------------------- -Summary for test case './succeeding/Misc/Sections/nested': -All tests passed (3 assertions in 1 test case) --- Test case: './mixed/Misc/Sections/nested2' ------------------ --- Section: 's1' ----------------------------------------------- --- Section: 's2' ----------------------------------------------- MiscTests.cpp:61: -[61] a == b -failed -for: 1 == 2 + REQUIRE( a == b ) +failed with expansion: + 1 == 2 ---------------------------------------------------------------- -Summary for section 's2': -1 assertion - failed - +Section: 's1' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 's3' ---------------------------------------------------------------- -Summary for section 's1': -1 assertion - failed --- Section: 's1' ----------------------------------------------- --- Section: 's3' ----------------------------------------------- MiscTests.cpp:66: -[66] a != b -succeeded -for: 1 != 2 + REQUIRE( a != b ) +passed with expansion: + 1 != 2 ---------------------------------------------------------------- -Summary for section 's3': -1 assertion passed - +Section: 's1' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 's4' ---------------------------------------------------------------- -Summary for section 's1': -1 assertion passed --- Section: 's1' ----------------------------------------------- --- Section: 's4' ----------------------------------------------- MiscTests.cpp:70: -[70] a < b -succeeded -for: 1 < 2 + REQUIRE( a < b ) +passed with expansion: + 1 < 2 ---------------------------------------------------------------- -Summary for section 's4': -1 assertion passed - +Test case: './Sections/nested/a/b' ---------------------------------------------------------------- -Summary for section 's1': -1 assertion passed - ---------------------------------------------------------------- -Summary for test case './mixed/Misc/Sections/nested2': -1 test case - failed (3 assertions - 1 failed) +Section: 'c' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'd (leaf)' +---------------------------------------------------------------- --- Test case: './Sections/nested/a/b' -------------------------- --- Section: 'c' ------------------------------------------------ --- Section: 'd (leaf)' ----------------------------------------- No assertions in section, 'd (leaf)' ---------------------------------------------------------------- -Summary for section 'd (leaf)': -1 assertion - failed - +Section: 'c' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'e (leaf)' ---------------------------------------------------------------- -Summary for section 'c': -1 assertion - failed --- Section: 'c' ------------------------------------------------ --- Section: 'e (leaf)' ----------------------------------------- No assertions in section, 'e (leaf)' ---------------------------------------------------------------- -Summary for section 'e (leaf)': -1 assertion - failed - +Section: 'f (leaf)' ---------------------------------------------------------------- -Summary for section 'c': -1 assertion - failed --- Section: 'f (leaf)' ----------------------------------------- No assertions in section, 'f (leaf)' ---------------------------------------------------------------- -Summary for section 'f (leaf)': -1 assertion - failed - +Test case: './mixed/Misc/Sections/loops' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 's1' ---------------------------------------------------------------- -Summary for test case './Sections/nested/a/b': -1 test case - failed (3 assertions - all failed) --- Test case: './mixed/Misc/Sections/loops' -------------------- --- Section: 's1' ----------------------------------------------- MiscTests.cpp:103: -[103] b > a -failed -for: 0 > 1 + CHECK( b > a ) +failed with expansion: + 0 > 1 ---------------------------------------------------------------- -Summary for section 's1': -1 assertion - failed - +Test case: './mixed/Misc/loops' ---------------------------------------------------------------- -Summary for test case './mixed/Misc/Sections/loops': -1 test case - failed (1 assertion - failed) --- Test case: './mixed/Misc/loops' ----------------------------- MiscTests.cpp:114: -[114] [info: Testing if fib[0] (1) is even] +info: + Testing if fib[0] (1) is even -[115] ( fib[i] % 2 ) == 0 -failed -for: 1 == 0 +MiscTests.cpp:115: + CHECK( ( fib[i] % 2 ) == 0 ) +failed with expansion: + 1 == 0 -[114] [info: Testing if fib[1] (1) is even] +MiscTests.cpp:114: +info: + Testing if fib[1] (1) is even -[115] ( fib[i] % 2 ) == 0 -failed -for: 1 == 0 +MiscTests.cpp:115: + CHECK( ( fib[i] % 2 ) == 0 ) +failed with expansion: + 1 == 0 -[115] ( fib[i] % 2 ) == 0 -succeeded -for: 0 == 0 +MiscTests.cpp:115: + CHECK( ( fib[i] % 2 ) == 0 ) +passed with expansion: + 0 == 0 -[114] [info: Testing if fib[2] (2) is even] +MiscTests.cpp:114: +info: + Testing if fib[2] (2) is even -[114] [info: Testing if fib[3] (3) is even] +MiscTests.cpp:114: +info: + Testing if fib[3] (3) is even -[115] ( fib[i] % 2 ) == 0 -failed -for: 1 == 0 +MiscTests.cpp:115: + CHECK( ( fib[i] % 2 ) == 0 ) +failed with expansion: + 1 == 0 -[114] [info: Testing if fib[4] (5) is even] +MiscTests.cpp:114: +info: + Testing if fib[4] (5) is even -[115] ( fib[i] % 2 ) == 0 -failed -for: 1 == 0 +MiscTests.cpp:115: + CHECK( ( fib[i] % 2 ) == 0 ) +failed with expansion: + 1 == 0 -[115] ( fib[i] % 2 ) == 0 -succeeded -for: 0 == 0 +MiscTests.cpp:115: + CHECK( ( fib[i] % 2 ) == 0 ) +passed with expansion: + 0 == 0 -[114] [info: Testing if fib[5] (8) is even] +MiscTests.cpp:114: +info: + Testing if fib[5] (8) is even -[114] [info: Testing if fib[6] (13) is even] +MiscTests.cpp:114: +info: + Testing if fib[6] (13) is even -[115] ( fib[i] % 2 ) == 0 -failed -for: 1 == 0 +MiscTests.cpp:115: + CHECK( ( fib[i] % 2 ) == 0 ) +failed with expansion: + 1 == 0 -[114] [info: Testing if fib[7] (21) is even] +MiscTests.cpp:114: +info: + Testing if fib[7] (21) is even -[115] ( fib[i] % 2 ) == 0 -failed -for: 1 == 0 - ----------------------------------------------------------------- -Summary for test case './mixed/Misc/loops': -1 test case - failed (8 assertions - 6 failed) +MiscTests.cpp:115: + CHECK( ( fib[i] % 2 ) == 0 ) +failed with expansion: + 1 == 0 Some information An error --- Test case: './succeeding/Misc/stdout,stderr' ---------------- +---------------------------------------------------------------- +Test case: './succeeding/Misc/stdout,stderr' +---------------------------------------------------------------- + No assertions in test case, './succeeding/Misc/stdout,stderr' ---------------------------------------------------------------- -Summary for test case './succeeding/Misc/stdout,stderr': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/Misc/null strings' +---------------------------------------------------------------- --- Test case: './succeeding/Misc/null strings' ----------------- MiscTests.cpp:133: -[133] makeString( false ) != static_cast(__null) -succeeded -for: "valid string" != {null string} + REQUIRE( makeString( false ) != static_cast(__null) ) +passed with expansion: + "valid string" != {null string} -[134] makeString( true ) == static_cast(__null) -succeeded -for: {null string} == {null string} +MiscTests.cpp:134: + REQUIRE( makeString( true ) == static_cast(__null) ) +passed with expansion: + {null string} == {null string} ---------------------------------------------------------------- -Summary for test case './succeeding/Misc/null strings': -All tests passed (2 assertions in 1 test case) +Test case: './failing/info' +---------------------------------------------------------------- --- Test case: './failing/info' --------------------------------- MiscTests.cpp:139: -[139] [info: hi] +info: + hi -[141] [info: i := 7] +MiscTests.cpp:141: +info: + i := 7 -[142] false +MiscTests.cpp:142: + REQUIRE( false ) failed ---------------------------------------------------------------- -Summary for test case './failing/info': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/checkedif' +---------------------------------------------------------------- --- Test case: './succeeding/checkedif' ------------------------- MiscTests.cpp:147: -[147] flag -succeeded -for: true + CHECKED_IF( flag ) +passed with expansion: + true -[155] testCheckedIf( true ) -succeeded -for: true +MiscTests.cpp:155: + REQUIRE( testCheckedIf( true ) ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for test case './succeeding/checkedif': -All tests passed (2 assertions in 1 test case) +Test case: './failing/checkedif' +---------------------------------------------------------------- --- Test case: './failing/checkedif' ---------------------------- MiscTests.cpp:147: -[147] flag -failed -for: false + CHECKED_IF( flag ) +failed with expansion: + false -[160] testCheckedIf( false ) -failed -for: false +MiscTests.cpp:160: + REQUIRE( testCheckedIf( false ) ) +failed with expansion: + false ---------------------------------------------------------------- -Summary for test case './failing/checkedif': -1 test case - failed (2 assertions - both failed) +Test case: './succeeding/checkedelse' +---------------------------------------------------------------- --- Test case: './succeeding/checkedelse' ----------------------- MiscTests.cpp:165: -[165] flag -succeeded -for: true + CHECKED_ELSE( flag ) +passed with expansion: + true -[173] testCheckedElse( true ) -succeeded -for: true +MiscTests.cpp:173: + REQUIRE( testCheckedElse( true ) ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for test case './succeeding/checkedelse': -All tests passed (2 assertions in 1 test case) +Test case: './failing/checkedelse' +---------------------------------------------------------------- --- Test case: './failing/checkedelse' -------------------------- MiscTests.cpp:165: -[165] flag -failed -for: false + CHECKED_ELSE( flag ) +failed with expansion: + false -[178] testCheckedElse( false ) -failed -for: false +MiscTests.cpp:178: + REQUIRE( testCheckedElse( false ) ) +failed with expansion: + false ---------------------------------------------------------------- -Summary for test case './failing/checkedelse': -1 test case - failed (2 assertions - both failed) +Test case: './misc/xmlentitycheck' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'embedded xml' +---------------------------------------------------------------- --- Test case: './misc/xmlentitycheck' -------------------------- --- Section: 'embedded xml' ------------------------------------- No assertions in section, 'embedded xml' ---------------------------------------------------------------- -Summary for section 'embedded xml': -1 assertion - failed +Section: 'encoded chars' +---------------------------------------------------------------- --- Section: 'encoded chars' ------------------------------------ No assertions in section, 'encoded chars' ---------------------------------------------------------------- -Summary for section 'encoded chars': -1 assertion - failed - +Test case: './manual/onechar' ---------------------------------------------------------------- -Summary for test case './misc/xmlentitycheck': -1 test case - failed (2 assertions - both failed) --- Test case: './manual/onechar' ------------------------------- MiscTests.cpp:195: -[195] [info: 3] +info: + 3 -[196] false +MiscTests.cpp:196: + REQUIRE( false ) failed ---------------------------------------------------------------- -Summary for test case './manual/onechar': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/atomic if' +---------------------------------------------------------------- --- Test case: './succeeding/atomic if' ------------------------- MiscTests.cpp:206: -[206] x == 0 -succeeded -for: 0 == 0 + REQUIRE( x == 0 ) +passed with expansion: + 0 == 0 ---------------------------------------------------------------- -Summary for test case './succeeding/atomic if': -All tests passed (1 assertion in 1 test case) +Test case: './succeeding/matchers' +---------------------------------------------------------------- --- Test case: './succeeding/matchers' -------------------------- MiscTests.cpp:216: -[216] testStringForMatching() Contains( "string" ) -succeeded -for: "this string contains 'abc' as a substring" contains: "string" + REQUIRE_THAT( testStringForMatching() Contains( "string" ) ) +passed with expansion: + "this string contains 'abc' as a substring" contains: "string" -[217] testStringForMatching() Contains( "abc" ) -succeeded -for: "this string contains 'abc' as a substring" contains: "abc" +MiscTests.cpp:217: + CHECK_THAT( testStringForMatching() Contains( "abc" ) ) +passed with expansion: + "this string contains 'abc' as a substring" contains: "abc" -[219] testStringForMatching() StartsWith( "this" ) -succeeded -for: "this string contains 'abc' as a substring" starts with: "this" +MiscTests.cpp:219: + CHECK_THAT( testStringForMatching() StartsWith( "this" ) ) +passed with expansion: + "this string contains 'abc' as a substring" starts with: "this" -[220] testStringForMatching() EndsWith( "substring" ) -succeeded -for: "this string contains 'abc' as a substring" ends with: "substring" +MiscTests.cpp:220: + CHECK_THAT( testStringForMatching() EndsWith( "substring" ) ) +passed with expansion: + "this string contains 'abc' as a substring" ends with: "substring" ---------------------------------------------------------------- -Summary for test case './succeeding/matchers': -All tests passed (4 assertions in 1 test case) +Test case: './failing/matchers/Contains' +---------------------------------------------------------------- --- Test case: './failing/matchers/Contains' -------------------- MiscTests.cpp:225: -[225] testStringForMatching() Contains( "not there" ) -failed -for: "this string contains 'abc' as a substring" contains: "not there" + CHECK_THAT( testStringForMatching() Contains( "not there" ) ) +failed with expansion: + "this string contains 'abc' as a substring" contains: "not there" ---------------------------------------------------------------- -Summary for test case './failing/matchers/Contains': -1 test case - failed (1 assertion - failed) +Test case: './failing/matchers/StartsWith' +---------------------------------------------------------------- --- Test case: './failing/matchers/StartsWith' ------------------ MiscTests.cpp:230: -[230] testStringForMatching() StartsWith( "string" ) -failed -for: "this string contains 'abc' as a substring" starts with: "string" + CHECK_THAT( testStringForMatching() StartsWith( "string" ) ) +failed with expansion: + "this string contains 'abc' as a substring" starts with: "string" ---------------------------------------------------------------- -Summary for test case './failing/matchers/StartsWith': -1 test case - failed (1 assertion - failed) +Test case: './failing/matchers/EndsWith' +---------------------------------------------------------------- --- Test case: './failing/matchers/EndsWith' -------------------- MiscTests.cpp:235: -[235] testStringForMatching() EndsWith( "this" ) -failed -for: "this string contains 'abc' as a substring" ends with: "this" + CHECK_THAT( testStringForMatching() EndsWith( "this" ) ) +failed with expansion: + "this string contains 'abc' as a substring" ends with: "this" ---------------------------------------------------------------- -Summary for test case './failing/matchers/EndsWith': -1 test case - failed (1 assertion - failed) +Test case: './failing/matchers/Equals' +---------------------------------------------------------------- --- Test case: './failing/matchers/Equals' ---------------------- MiscTests.cpp:240: -[240] testStringForMatching() Equals( "something else" ) -failed -for: "this string contains 'abc' as a substring" equals: "something else" + CHECK_THAT( testStringForMatching() Equals( "something else" ) ) +failed with expansion: + "this string contains 'abc' as a substring" equals: "something else" ---------------------------------------------------------------- -Summary for test case './failing/matchers/Equals': -1 test case - failed (1 assertion - failed) +Test case: '/succeeding/matchers/AllOf' +---------------------------------------------------------------- --- Test case: '/succeeding/matchers/AllOf' --------------------- MiscTests.cpp:248: -[248] testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) -succeeded -for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) + CHECK_THAT( testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ) +passed with expansion: + "this string contains 'abc' as a substring" ( contains: "string" + and contains: "abc" ) ---------------------------------------------------------------- -Summary for test case '/succeeding/matchers/AllOf': -All tests passed (1 assertion in 1 test case) +Test case: '/succeeding/matchers/AnyOf' +---------------------------------------------------------------- --- Test case: '/succeeding/matchers/AnyOf' --------------------- MiscTests.cpp:252: -[252] testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) -succeeded -for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) + CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) ) +passed with expansion: + "this string contains 'abc' as a substring" ( contains: "string" or + contains: "not there" ) -[253] testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) -succeeded -for: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) +MiscTests.cpp:253: + CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) ) +passed with expansion: + "this string contains 'abc' as a substring" ( contains: "not there" + or contains: "string" ) ---------------------------------------------------------------- -Summary for test case '/succeeding/matchers/AnyOf': -All tests passed (2 assertions in 1 test case) +Test case: './succeeding/matchers/Equals' +---------------------------------------------------------------- --- Test case: './succeeding/matchers/Equals' ------------------- MiscTests.cpp:258: -[258] 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" + CHECK_THAT( testStringForMatching() Equals( "this string contains 'abc' as a substring" ) ) +passed with expansion: + "this string contains 'abc' as a substring" equals: "this string + contains 'abc' as a substring" ---------------------------------------------------------------- -Summary for test case './succeeding/matchers/Equals': -All tests passed (1 assertion in 1 test case) +Test case: 'example/factorial' +---------------------------------------------------------------- --- Test case: 'example/factorial' ------------------------------ MiscTests.cpp:269: -[269] Factorial(0) == 1 -succeeded -for: 1 == 1 + REQUIRE( Factorial(0) == 1 ) +passed with expansion: + 1 == 1 -[270] Factorial(1) == 1 -succeeded -for: 1 == 1 +MiscTests.cpp:270: + REQUIRE( Factorial(1) == 1 ) +passed with expansion: + 1 == 1 -[271] Factorial(2) == 2 -succeeded -for: 2 == 2 +MiscTests.cpp:271: + REQUIRE( Factorial(2) == 2 ) +passed with expansion: + 2 == 2 -[272] Factorial(3) == 6 -succeeded -for: 6 == 6 +MiscTests.cpp:272: + REQUIRE( Factorial(3) == 6 ) +passed with expansion: + 6 == 6 -[273] Factorial(10) == 3628800 -succeeded -for: 0x == 3628800 +MiscTests.cpp:273: + REQUIRE( Factorial(10) == 3628800 ) +passed with expansion: + 0x == 3628800 ---------------------------------------------------------------- -Summary for test case 'example/factorial': -All tests passed (5 assertions in 1 test case) +Test case: 'empty' +---------------------------------------------------------------- --- Test case: 'empty' ------------------------------------------ No assertions in test case, 'empty' ---------------------------------------------------------------- -Summary for test case 'empty': -1 test case - failed (1 assertion - failed) +Test case: 'Nice descriptive name' +---------------------------------------------------------------- --- Test case: 'Nice descriptive name' -------------------------- MiscTests.cpp:282: -[282] [warning: This one ran] +warning: + This one ran No assertions in test case, 'Nice descriptive name' ---------------------------------------------------------------- -Summary for test case 'Nice descriptive name': -1 test case - failed (1 assertion - failed) +Test case: 'first tag' +---------------------------------------------------------------- --- Test case: 'first tag' -------------------------------------- No assertions in test case, 'first tag' ---------------------------------------------------------------- -Summary for test case 'first tag': -1 test case - failed (1 assertion - failed) +Test case: 'second tag' +---------------------------------------------------------------- --- Test case: 'second tag' ------------------------------------- No assertions in test case, 'second tag' ---------------------------------------------------------------- -Summary for test case 'second tag': -1 test case - failed (1 assertion - failed) +Test case: 'selftest/main' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'selftest/expected result' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'selftest/expected result/failing tests' +---------------------------------------------------------------- --- Test case: 'selftest/main' ---------------------------------- --- Section: 'selftest/expected result' ------------------------- --- Section: 'selftest/expected result/failing tests' ----------- -catch_self_test.hpp:106: -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected -[106] succeeded -[with message: Tests failed, as expected] +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected ---------------------------------------------------------------- -Summary for section 'selftest/expected result/failing tests': -All 25 assertions passed - +Section: 'selftest/expected result' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'selftest/expected result/succeeding tests' ---------------------------------------------------------------- -Summary for section 'selftest/expected result': -All 25 assertions passed --- Section: 'selftest/expected result' ------------------------- --- Section: 'selftest/expected result/succeeding tests' -------- -catch_self_test.hpp:95: -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected Message from section one Message from section two -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected Some information An error -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected -[95] succeeded -[with message: Tests passed, as expected] - ----------------------------------------------------------------- -Summary for section 'selftest/expected result/succeeding tests': -All 43 assertions passed - ----------------------------------------------------------------- -Summary for section 'selftest/expected result': -All 43 assertions passed +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected Message from section one Message from section two Some information An error --- Section: 'selftest/test counts' ----------------------------- --- Section: 'selftest/test counts/succeeding tests' ------------ +---------------------------------------------------------------- +Section: 'selftest/test counts' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'selftest/test counts/succeeding tests' +---------------------------------------------------------------- + TestMain.cpp:40: -[40] totals.assertions.passed == 291 -succeeded -for: 291 == 291 + CHECK( totals.assertions.passed == 291 ) +failed with expansion: + 293 == 291 -[41] totals.assertions.failed == 0 -succeeded -for: 0 == 0 +TestMain.cpp:41: + CHECK( totals.assertions.failed == 0 ) +passed with expansion: + 0 == 0 ---------------------------------------------------------------- -Summary for section 'selftest/test counts/succeeding tests': -All 2 assertions passed - +Section: 'selftest/test counts' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'selftest/test counts/failing tests' ---------------------------------------------------------------- -Summary for section 'selftest/test counts': -All 2 assertions passed --- Section: 'selftest/test counts' ----------------------------- --- Section: 'selftest/test counts/failing tests' --------------- TestMain.cpp:47: -[47] totals.assertions.passed == 1 -succeeded -for: 1 == 1 + CHECK( totals.assertions.passed == 1 ) +passed with expansion: + 1 == 1 -[48] totals.assertions.failed == 72 -succeeded -for: 72 == 72 +TestMain.cpp:48: + CHECK( totals.assertions.failed == 72 ) +passed with expansion: + 72 == 72 ---------------------------------------------------------------- -Summary for section 'selftest/test counts/failing tests': -All 2 assertions passed - +Test case: 'meta/Misc/Sections' ---------------------------------------------------------------- -Summary for section 'selftest/test counts': -All 2 assertions passed ----------------------------------------------------------------- -Summary for test case 'selftest/main': -All tests passed (72 assertions in 1 test case) - --- Test case: 'meta/Misc/Sections' ----------------------------- TestMain.cpp:57: -[57] totals.assertions.passed == 2 -succeeded -for: 2 == 2 + CHECK( totals.assertions.passed == 2 ) +passed with expansion: + 2 == 2 -[58] totals.assertions.failed == 1 -succeeded -for: 1 == 1 +TestMain.cpp:58: + CHECK( totals.assertions.failed == 1 ) +passed with expansion: + 1 == 1 ---------------------------------------------------------------- -Summary for test case 'meta/Misc/Sections': -All tests passed (2 assertions in 1 test case) +Test case: 'selftest/parser/2' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'default' +---------------------------------------------------------------- --- Test case: 'selftest/parser/2' ------------------------------ --- Section: 'default' ------------------------------------------ TestMain.cpp:97: -[97] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[99] config.shouldDebugBreak == false -succeeded -for: false == false +TestMain.cpp:99: + CHECK( config.shouldDebugBreak == false ) +passed with expansion: + false == false -[100] config.cutoff == -1 -succeeded -for: -1 == -1 +TestMain.cpp:100: + CHECK( config.cutoff == -1 ) +passed with expansion: + -1 == -1 -[101] config.allowThrows == true -succeeded -for: true == true +TestMain.cpp:101: + CHECK( config.allowThrows == true ) +passed with expansion: + true == true -[102] config.reporter.empty() -succeeded -for: true +TestMain.cpp:102: + CHECK( config.reporter.empty() ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section 'default': -All 5 assertions passed +Section: 'test lists' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-t/1' +---------------------------------------------------------------- --- Section: 'test lists' --------------------------------------- --- Section: '-t/1' --------------------------------------------- TestMain.cpp:108: -[108] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[110] config.filters.size() == 1 -succeeded -for: 1 == 1 +TestMain.cpp:110: + REQUIRE( config.filters.size() == 1 ) +passed with expansion: + 1 == 1 -[111] config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false -succeeded -for: false == false +TestMain.cpp:111: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) +passed with expansion: + false == false -[112] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) -succeeded -for: true +TestMain.cpp:112: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section '-t/1': -All 4 assertions passed - +Section: 'test lists' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-t/exclude:1' ---------------------------------------------------------------- -Summary for section 'test lists': -All 4 assertions passed --- Section: 'test lists' --------------------------------------- --- Section: '-t/exclude:1' ------------------------------------- TestMain.cpp:116: -[116] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[118] config.filters.size() == 1 -succeeded -for: 1 == 1 +TestMain.cpp:118: + REQUIRE( config.filters.size() == 1 ) +passed with expansion: + 1 == 1 -[119] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false -succeeded -for: false == false +TestMain.cpp:119: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) +passed with expansion: + false == false -[120] config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) -succeeded -for: true +TestMain.cpp:120: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section '-t/exclude:1': -All 4 assertions passed - +Section: 'test lists' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '--test/1' ---------------------------------------------------------------- -Summary for section 'test lists': -All 4 assertions passed --- Section: 'test lists' --------------------------------------- --- Section: '--test/1' ----------------------------------------- TestMain.cpp:125: -[125] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[127] config.filters.size() == 1 -succeeded -for: 1 == 1 +TestMain.cpp:127: + REQUIRE( config.filters.size() == 1 ) +passed with expansion: + 1 == 1 -[128] config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false -succeeded -for: false == false +TestMain.cpp:128: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) +passed with expansion: + false == false -[129] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) -succeeded -for: true +TestMain.cpp:129: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section '--test/1': -All 4 assertions passed - +Section: 'test lists' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '--test/exclude:1' ---------------------------------------------------------------- -Summary for section 'test lists': -All 4 assertions passed --- Section: 'test lists' --------------------------------------- --- Section: '--test/exclude:1' --------------------------------- TestMain.cpp:134: -[134] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[136] config.filters.size() == 1 -succeeded -for: 1 == 1 +TestMain.cpp:136: + REQUIRE( config.filters.size() == 1 ) +passed with expansion: + 1 == 1 -[137] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false -succeeded -for: false == false +TestMain.cpp:137: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) +passed with expansion: + false == false -[138] config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) -succeeded -for: true +TestMain.cpp:138: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section '--test/exclude:1': -All 4 assertions passed - +Section: 'test lists' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '--test/exclude:2' ---------------------------------------------------------------- -Summary for section 'test lists': -All 4 assertions passed --- Section: 'test lists' --------------------------------------- --- Section: '--test/exclude:2' --------------------------------- TestMain.cpp:143: -[143] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[145] config.filters.size() == 1 -succeeded -for: 1 == 1 +TestMain.cpp:145: + REQUIRE( config.filters.size() == 1 ) +passed with expansion: + 1 == 1 -[146] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false -succeeded -for: false == false +TestMain.cpp:146: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) +passed with expansion: + false == false -[147] config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) -succeeded -for: true +TestMain.cpp:147: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section '--test/exclude:2': -All 4 assertions passed - +Section: 'test lists' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-t/2' ---------------------------------------------------------------- -Summary for section 'test lists': -All 4 assertions passed --- Section: 'test lists' --------------------------------------- --- Section: '-t/2' --------------------------------------------- TestMain.cpp:152: -[152] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[154] config.filters.size() == 1 -succeeded -for: 1 == 1 +TestMain.cpp:154: + REQUIRE( config.filters.size() == 1 ) +passed with expansion: + 1 == 1 -[155] config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false -succeeded -for: false == false +TestMain.cpp:155: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) +passed with expansion: + false == false -[156] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) -succeeded -for: true +TestMain.cpp:156: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) +passed with expansion: + true -[157] config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) -succeeded -for: true +TestMain.cpp:157: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section '-t/2': -All 5 assertions passed - +Section: 'test lists' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-t/0' ---------------------------------------------------------------- -Summary for section 'test lists': -All 5 assertions passed --- Section: 'test lists' --------------------------------------- --- Section: '-t/0' --------------------------------------------- TestMain.cpp:162: -[162] parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) -succeeded -for: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" + REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) ) +passed with expansion: + "Error while parsing arguments. Expected at least 1 argument." + contains: "at least 1" ---------------------------------------------------------------- -Summary for section '-t/0': -1 assertion passed - +Section: 'reporter' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-r/console' ---------------------------------------------------------------- -Summary for section 'test lists': -1 assertion passed --- Section: 'reporter' ----------------------------------------- --- Section: '-r/console' --------------------------------------- TestMain.cpp:169: -[169] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[171] config.reporter == "console" -succeeded -for: "console" == "console" +TestMain.cpp:171: + REQUIRE( config.reporter == "console" ) +passed with expansion: + "console" == "console" ---------------------------------------------------------------- -Summary for section '-r/console': -All 2 assertions passed - +Section: 'reporter' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-r/xml' ---------------------------------------------------------------- -Summary for section 'reporter': -All 2 assertions passed --- Section: 'reporter' ----------------------------------------- --- Section: '-r/xml' ------------------------------------------- TestMain.cpp:175: -[175] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[177] config.reporter == "xml" -succeeded -for: "xml" == "xml" +TestMain.cpp:177: + REQUIRE( config.reporter == "xml" ) +passed with expansion: + "xml" == "xml" ---------------------------------------------------------------- -Summary for section '-r/xml': -All 2 assertions passed - +Section: 'reporter' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '--reporter/junit' ---------------------------------------------------------------- -Summary for section 'reporter': -All 2 assertions passed --- Section: 'reporter' ----------------------------------------- --- Section: '--reporter/junit' --------------------------------- TestMain.cpp:181: -[181] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[183] config.reporter == "junit" -succeeded -for: "junit" == "junit" +TestMain.cpp:183: + REQUIRE( config.reporter == "junit" ) +passed with expansion: + "junit" == "junit" ---------------------------------------------------------------- -Summary for section '--reporter/junit': -All 2 assertions passed - +Section: 'reporter' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-r/error' ---------------------------------------------------------------- -Summary for section 'reporter': -All 2 assertions passed --- Section: 'reporter' ----------------------------------------- --- Section: '-r/error' ----------------------------------------- TestMain.cpp:187: -[187] parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) -succeeded -for: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" + REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) ) +passed with expansion: + "Error while parsing arguments. Expected 1 argument. Arguments + were: one two" contains: "1 argument" ---------------------------------------------------------------- -Summary for section '-r/error': -1 assertion passed - +Section: 'debugger' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-b' ---------------------------------------------------------------- -Summary for section 'reporter': -1 assertion passed --- Section: 'debugger' ----------------------------------------- --- Section: '-b' ----------------------------------------------- TestMain.cpp:194: -[194] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[196] config.shouldDebugBreak == true -succeeded -for: true == true +TestMain.cpp:196: + REQUIRE( config.shouldDebugBreak == true ) +passed with expansion: + true == true ---------------------------------------------------------------- -Summary for section '-b': -All 2 assertions passed - +Section: 'debugger' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '--break' ---------------------------------------------------------------- -Summary for section 'debugger': -All 2 assertions passed --- Section: 'debugger' ----------------------------------------- --- Section: '--break' ------------------------------------------ TestMain.cpp:200: -[200] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[202] config.shouldDebugBreak -succeeded -for: true +TestMain.cpp:202: + REQUIRE( config.shouldDebugBreak ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section '--break': -All 2 assertions passed - +Section: 'debugger' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-b' ---------------------------------------------------------------- -Summary for section 'debugger': -All 2 assertions passed --- Section: 'debugger' ----------------------------------------- --- Section: '-b' ----------------------------------------------- TestMain.cpp:206: -[206] parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) -succeeded -for: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" + REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) ) +passed with expansion: + "Error while parsing arguments. Expected 0 arguments. Arguments + were: unexpected" contains: "0 arguments" ---------------------------------------------------------------- -Summary for section '-b': -1 assertion passed - +Section: 'abort' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-a' ---------------------------------------------------------------- -Summary for section 'debugger': -1 assertion passed --- Section: 'abort' -------------------------------------------- --- Section: '-a' ----------------------------------------------- TestMain.cpp:213: -[213] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[215] config.cutoff == 1 -succeeded -for: 1 == 1 +TestMain.cpp:215: + REQUIRE( config.cutoff == 1 ) +passed with expansion: + 1 == 1 ---------------------------------------------------------------- -Summary for section '-a': -All 2 assertions passed - +Section: 'abort' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-a/2' ---------------------------------------------------------------- -Summary for section 'abort': -All 2 assertions passed --- Section: 'abort' -------------------------------------------- --- Section: '-a/2' --------------------------------------------- TestMain.cpp:219: -[219] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[221] config.cutoff == 2 -succeeded -for: 2 == 2 +TestMain.cpp:221: + REQUIRE( config.cutoff == 2 ) +passed with expansion: + 2 == 2 ---------------------------------------------------------------- -Summary for section '-a/2': -All 2 assertions passed - +Section: 'abort' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-a/error/0' ---------------------------------------------------------------- -Summary for section 'abort': -All 2 assertions passed --- Section: 'abort' -------------------------------------------- --- Section: '-a/error/0' --------------------------------------- TestMain.cpp:225: -[225] parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) -succeeded -for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" + REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) +passed with expansion: + "Error while parsing arguments. threshold must be a number greater + than zero. Arguments were: 0" contains: "greater than zero" ---------------------------------------------------------------- -Summary for section '-a/error/0': -1 assertion passed - +Section: 'abort' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-a/error/non numeric' ---------------------------------------------------------------- -Summary for section 'abort': -1 assertion passed --- Section: 'abort' -------------------------------------------- --- Section: '-a/error/non numeric' ----------------------------- TestMain.cpp:229: -[229] parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) -succeeded -for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" + REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) +passed with expansion: + "Error while parsing arguments. threshold must be a number greater + than zero. Arguments were: oops" contains: "greater than zero" ---------------------------------------------------------------- -Summary for section '-a/error/non numeric': -1 assertion passed - +Section: 'abort' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-a/error/two args' ---------------------------------------------------------------- -Summary for section 'abort': -1 assertion passed --- Section: 'abort' -------------------------------------------- --- Section: '-a/error/two args' -------------------------------- TestMain.cpp:233: -[233] parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) -succeeded -for: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" + REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) ) +passed with expansion: + "Error while parsing arguments. Expected between 0 and 1 argument. + Arguments were: 1 2" contains: "0 and 1 argument" ---------------------------------------------------------------- -Summary for section '-a/error/two args': -1 assertion passed - +Section: 'nothrow' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-nt' ---------------------------------------------------------------- -Summary for section 'abort': -1 assertion passed --- Section: 'nothrow' ------------------------------------------ --- Section: '-nt' ---------------------------------------------- TestMain.cpp:240: -[240] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[242] config.allowThrows == false -succeeded -for: false == false +TestMain.cpp:242: + REQUIRE( config.allowThrows == false ) +passed with expansion: + false == false ---------------------------------------------------------------- -Summary for section '-nt': -All 2 assertions passed - +Section: 'nothrow' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '--nothrow' ---------------------------------------------------------------- -Summary for section 'nothrow': -All 2 assertions passed --- Section: 'nothrow' ------------------------------------------ --- Section: '--nothrow' ---------------------------------------- TestMain.cpp:246: -[246] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[248] config.allowThrows == false -succeeded -for: false == false +TestMain.cpp:248: + REQUIRE( config.allowThrows == false ) +passed with expansion: + false == false ---------------------------------------------------------------- -Summary for section '--nothrow': -All 2 assertions passed - +Section: 'streams' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-o filename' ---------------------------------------------------------------- -Summary for section 'nothrow': -All 2 assertions passed --- Section: 'streams' ------------------------------------------ --- Section: '-o filename' -------------------------------------- TestMain.cpp:255: -[255] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[257] config.outputFilename == "filename.ext" -succeeded -for: "filename.ext" == "filename.ext" +TestMain.cpp:257: + REQUIRE( config.outputFilename == "filename.ext" ) +passed with expansion: + "filename.ext" == "filename.ext" -[258] config.stream.empty() -succeeded -for: true +TestMain.cpp:258: + REQUIRE( config.stream.empty() ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section '-o filename': -All 3 assertions passed - +Section: 'streams' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-o %stdout' ---------------------------------------------------------------- -Summary for section 'streams': -All 3 assertions passed --- Section: 'streams' ------------------------------------------ --- Section: '-o %stdout' --------------------------------------- TestMain.cpp:262: -[262] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[264] config.stream == "stdout" -succeeded -for: "stdout" == "stdout" +TestMain.cpp:264: + REQUIRE( config.stream == "stdout" ) +passed with expansion: + "stdout" == "stdout" -[265] config.outputFilename.empty() -succeeded -for: true +TestMain.cpp:265: + REQUIRE( config.outputFilename.empty() ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section '-o %stdout': -All 3 assertions passed - +Section: 'streams' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '--out' ---------------------------------------------------------------- -Summary for section 'streams': -All 3 assertions passed --- Section: 'streams' ------------------------------------------ --- Section: '--out' -------------------------------------------- TestMain.cpp:269: -[269] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[271] config.outputFilename == "filename.ext" -succeeded -for: "filename.ext" == "filename.ext" +TestMain.cpp:271: + REQUIRE( config.outputFilename == "filename.ext" ) +passed with expansion: + "filename.ext" == "filename.ext" ---------------------------------------------------------------- -Summary for section '--out': -All 2 assertions passed - +Section: 'combinations' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: '-a -b' ---------------------------------------------------------------- -Summary for section 'streams': -All 2 assertions passed --- Section: 'combinations' ------------------------------------- --- Section: '-a -b' -------------------------------------------- TestMain.cpp:278: -[278] parseIntoConfig( argv, config ) -succeeded + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) +passed -[280] config.cutoff == 1 -succeeded -for: 1 == 1 +TestMain.cpp:280: + CHECK( config.cutoff == 1 ) +passed with expansion: + 1 == 1 -[281] config.shouldDebugBreak -succeeded -for: true +TestMain.cpp:281: + CHECK( config.shouldDebugBreak ) +passed with expansion: + true -[282] config.allowThrows == false -succeeded -for: false == false +TestMain.cpp:282: + CHECK( config.allowThrows == false ) +passed with expansion: + false == false ---------------------------------------------------------------- -Summary for section '-a -b': -All 4 assertions passed - +Test case: 'selftest/test filter' ---------------------------------------------------------------- -Summary for section 'combinations': -All 4 assertions passed ----------------------------------------------------------------- -Summary for test case 'selftest/parser/2': -All tests passed (66 assertions in 1 test case) - --- Test case: 'selftest/test filter' --------------------------- TestMain.cpp:291: -[291] matchAny.shouldInclude( fakeTestCase( "any" ) ) -succeeded -for: true + CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) +passed with expansion: + true -[292] matchNone.shouldInclude( fakeTestCase( "any" ) ) == false -succeeded -for: false == false +TestMain.cpp:292: + CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ) +passed with expansion: + false == false -[297] matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false -succeeded -for: false == false +TestMain.cpp:297: + CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ) +passed with expansion: + false == false -[298] matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) -succeeded -for: true +TestMain.cpp:298: + CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ) +passed with expansion: + true -[300] matchHidden.shouldInclude( fakeTestCase( "./any" ) ) -succeeded -for: true +TestMain.cpp:300: + CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ) +passed with expansion: + true -[301] matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false -succeeded -for: false == false +TestMain.cpp:301: + CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ) +passed with expansion: + false == false ---------------------------------------------------------------- -Summary for test case 'selftest/test filter': -All tests passed (6 assertions in 1 test case) +Test case: 'selftest/test filters' +---------------------------------------------------------------- --- Test case: 'selftest/test filters' -------------------------- TestMain.cpp:312: -[312] matchHidden.shouldInclude( fakeTestCase( "./something" ) ) -succeeded -for: true + CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) +passed with expansion: + true -[314] filters.shouldInclude( fakeTestCase( "any" ) ) == false -succeeded -for: false == false +TestMain.cpp:314: + CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ) +passed with expansion: + false == false -[315] filters.shouldInclude( fakeTestCase( "./something" ) ) -succeeded -for: true +TestMain.cpp:315: + CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ) +passed with expansion: + true -[316] filters.shouldInclude( fakeTestCase( "./anything" ) ) == false -succeeded -for: false == false +TestMain.cpp:316: + CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ) +passed with expansion: + false == false ---------------------------------------------------------------- -Summary for test case 'selftest/test filters': -All tests passed (4 assertions in 1 test case) +Test case: 'selftest/filter/prefix wildcard' +---------------------------------------------------------------- --- Test case: 'selftest/filter/prefix wildcard' ---------------- TestMain.cpp:322: -[322] matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) -succeeded -for: true + CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) +passed with expansion: + true -[323] matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false -succeeded -for: false == false +TestMain.cpp:323: + CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) +passed with expansion: + false == false ---------------------------------------------------------------- -Summary for test case 'selftest/filter/prefix wildcard': -All tests passed (2 assertions in 1 test case) +Test case: 'selftest/filter/wildcard at both ends' +---------------------------------------------------------------- --- Test case: 'selftest/filter/wildcard at both ends' ---------- TestMain.cpp:328: -[328] matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) -succeeded -for: true + CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) +passed with expansion: + true -[329] matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) -succeeded -for: true +TestMain.cpp:329: + CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ) +passed with expansion: + true -[330] matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) -succeeded -for: true +TestMain.cpp:330: + CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ) +passed with expansion: + true -[331] matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false -succeeded -for: false == false +TestMain.cpp:331: + CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ) +passed with expansion: + false == false ---------------------------------------------------------------- -Summary for test case 'selftest/filter/wildcard at both ends': -All tests passed (4 assertions in 1 test case) +Test case: 'selftest/option parsers' +---------------------------------------------------------------- --- Test case: 'selftest/option parsers' ------------------------ TestMain.cpp:351: -[351] opt.parseIntoConfig( parser, config ) -succeeded + CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) +passed -[353] config.filters.size() == 1 -succeeded -for: 1 == 1 +TestMain.cpp:353: + REQUIRE( config.filters.size() == 1 ) +passed with expansion: + 1 == 1 -[354] config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false -succeeded -for: false == false +TestMain.cpp:354: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) +passed with expansion: + false == false -[355] config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) -succeeded -for: true +TestMain.cpp:355: + REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for test case 'selftest/option parsers': -All tests passed (4 assertions in 1 test case) +Test case: 'selftest/tags' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'one tag' +---------------------------------------------------------------- --- Test case: 'selftest/tags' ---------------------------------- --- Section: 'one tag' ------------------------------------------ TestMain.cpp:369: -[369] oneTag.getTestCaseInfo().description == "" -succeeded -for: "" == "" + CHECK( oneTag.getTestCaseInfo().description == "" ) +passed with expansion: + "" == "" -[370] oneTag.hasTag( "one" ) -succeeded -for: true +TestMain.cpp:370: + CHECK( oneTag.hasTag( "one" ) ) +passed with expansion: + true -[371] oneTag.getTags().size() == 1 -succeeded -for: 1 == 1 +TestMain.cpp:371: + CHECK( oneTag.getTags().size() == 1 ) +passed with expansion: + 1 == 1 -[373] oneTag.matchesTags( p1 ) == true -succeeded -for: true == true +TestMain.cpp:373: + CHECK( oneTag.matchesTags( p1 ) == true ) +passed with expansion: + true == true -[374] oneTag.matchesTags( p2 ) == true -succeeded -for: true == true +TestMain.cpp:374: + CHECK( oneTag.matchesTags( p2 ) == true ) +passed with expansion: + true == true -[375] oneTag.matchesTags( p3 ) == false -succeeded -for: false == false +TestMain.cpp:375: + CHECK( oneTag.matchesTags( p3 ) == false ) +passed with expansion: + false == false -[376] oneTag.matchesTags( p4 ) == false -succeeded -for: false == false +TestMain.cpp:376: + CHECK( oneTag.matchesTags( p4 ) == false ) +passed with expansion: + false == false -[377] oneTag.matchesTags( p5 ) == false -succeeded -for: false == false +TestMain.cpp:377: + CHECK( oneTag.matchesTags( p5 ) == false ) +passed with expansion: + false == false ---------------------------------------------------------------- -Summary for section 'one tag': -All 8 assertions passed +Section: 'two tags' +---------------------------------------------------------------- --- Section: 'two tags' ----------------------------------------- TestMain.cpp:383: -[383] twoTags.getTestCaseInfo().description == "" -succeeded -for: "" == "" + CHECK( twoTags.getTestCaseInfo().description == "" ) +passed with expansion: + "" == "" -[384] twoTags.hasTag( "one" ) -succeeded -for: true +TestMain.cpp:384: + CHECK( twoTags.hasTag( "one" ) ) +passed with expansion: + true -[385] twoTags.hasTag( "two" ) -succeeded -for: true +TestMain.cpp:385: + CHECK( twoTags.hasTag( "two" ) ) +passed with expansion: + true -[386] twoTags.hasTag( "three" ) == false -succeeded -for: false == false +TestMain.cpp:386: + CHECK( twoTags.hasTag( "three" ) == false ) +passed with expansion: + false == false -[387] twoTags.getTags().size() == 2 -succeeded -for: 2 == 2 +TestMain.cpp:387: + CHECK( twoTags.getTags().size() == 2 ) +passed with expansion: + 2 == 2 -[389] twoTags.matchesTags( p1 ) == true -succeeded -for: true == true +TestMain.cpp:389: + CHECK( twoTags.matchesTags( p1 ) == true ) +passed with expansion: + true == true -[390] twoTags.matchesTags( p2 ) == true -succeeded -for: true == true +TestMain.cpp:390: + CHECK( twoTags.matchesTags( p2 ) == true ) +passed with expansion: + true == true -[391] twoTags.matchesTags( p3 ) == true -succeeded -for: true == true +TestMain.cpp:391: + CHECK( twoTags.matchesTags( p3 ) == true ) +passed with expansion: + true == true -[392] twoTags.matchesTags( p4 ) == true -succeeded -for: true == true +TestMain.cpp:392: + CHECK( twoTags.matchesTags( p4 ) == true ) +passed with expansion: + true == true -[393] twoTags.matchesTags( p5 ) == true -succeeded -for: true == true +TestMain.cpp:393: + CHECK( twoTags.matchesTags( p5 ) == true ) +passed with expansion: + true == true ---------------------------------------------------------------- -Summary for section 'two tags': -All 10 assertions passed +Section: 'one tag with characters either side' +---------------------------------------------------------------- --- Section: 'one tag with characters either side' -------------- TestMain.cpp:399: -[399] oneTagWithExtras.getTestCaseInfo().description == "1234" -succeeded -for: "1234" == "1234" + CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) +passed with expansion: + "1234" == "1234" -[400] oneTagWithExtras.hasTag( "one" ) -succeeded -for: true +TestMain.cpp:400: + CHECK( oneTagWithExtras.hasTag( "one" ) ) +passed with expansion: + true -[401] oneTagWithExtras.hasTag( "two" ) == false -succeeded -for: false == false +TestMain.cpp:401: + CHECK( oneTagWithExtras.hasTag( "two" ) == false ) +passed with expansion: + false == false -[402] oneTagWithExtras.getTags().size() == 1 -succeeded -for: 1 == 1 +TestMain.cpp:402: + CHECK( oneTagWithExtras.getTags().size() == 1 ) +passed with expansion: + 1 == 1 ---------------------------------------------------------------- -Summary for section 'one tag with characters either side': -All 4 assertions passed +Section: 'start of a tag, but not closed' +---------------------------------------------------------------- --- Section: 'start of a tag, but not closed' ------------------- TestMain.cpp:409: -[409] oneTagOpen.getTestCaseInfo().description == "[one" -succeeded -for: "[one" == "[one" + CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) +passed with expansion: + "[one" == "[one" -[410] oneTagOpen.hasTag( "one" ) == false -succeeded -for: false == false +TestMain.cpp:410: + CHECK( oneTagOpen.hasTag( "one" ) == false ) +passed with expansion: + false == false -[411] oneTagOpen.getTags().size() == 0 -succeeded -for: 0 == 0 +TestMain.cpp:411: + CHECK( oneTagOpen.getTags().size() == 0 ) +passed with expansion: + 0 == 0 ---------------------------------------------------------------- -Summary for section 'start of a tag, but not closed': -All 3 assertions passed +Section: 'hidden' +---------------------------------------------------------------- --- Section: 'hidden' ------------------------------------------- TestMain.cpp:417: -[417] oneTag.getTestCaseInfo().description == "" -succeeded -for: "" == "" + CHECK( oneTag.getTestCaseInfo().description == "" ) +passed with expansion: + "" == "" -[418] oneTag.hasTag( "hide" ) -succeeded -for: true +TestMain.cpp:418: + CHECK( oneTag.hasTag( "hide" ) ) +passed with expansion: + true -[419] oneTag.isHidden() -succeeded -for: true +TestMain.cpp:419: + CHECK( oneTag.isHidden() ) +passed with expansion: + true -[421] oneTag.matchesTags( "~[hide]" ) == false -succeeded -for: false == false +TestMain.cpp:421: + CHECK( oneTag.matchesTags( "~[hide]" ) == false ) +passed with expansion: + false == false ---------------------------------------------------------------- -Summary for section 'hidden': -All 4 assertions passed - +Test case: './succeeding/Tricky/std::pair' ---------------------------------------------------------------- -Summary for test case 'selftest/tags': -All tests passed (29 assertions in 1 test case) --- Test case: './succeeding/Tricky/std::pair' ------------------ TrickyTests.cpp:37: -[37] (std::pair( 1, 2 )) == aNicePair -succeeded -for: - std::pair( 1, 2 ) - == - std::pair( 1, 2 ) + REQUIRE( (std::pair( 1, 2 )) == aNicePair ) +passed with expansion: + + std::pair( 1, 2 ) + == + std::pair( 1, 2 ) ---------------------------------------------------------------- -Summary for test case './succeeding/Tricky/std::pair': -All tests passed (1 assertion in 1 test case) +Test case: './inprogress/failing/Tricky/trailing expression' +---------------------------------------------------------------- --- Test case: './inprogress/failing/Tricky/trailing expression' TrickyTests.cpp:55: -[55] [warning: Uncomment the code in this test to check that it gives a sensible compiler error] +warning: + Uncomment the code in this test to check that it gives a sensible + compiler error No assertions in test case, './inprogress/failing/Tricky/trailing expression' ---------------------------------------------------------------- -Summary for test case './inprogress/failing/Tricky/trailing expression': -1 test case - failed (1 assertion - failed) +Test case: './inprogress/failing/Tricky/compound lhs' +---------------------------------------------------------------- --- Test case: './inprogress/failing/Tricky/compound lhs' ------- TrickyTests.cpp:71: -[71] [warning: Uncomment the code in this test to check that it gives a sensible compiler error] +warning: + Uncomment the code in this test to check that it gives a sensible + compiler error No assertions in test case, './inprogress/failing/Tricky/compound lhs' ---------------------------------------------------------------- -Summary for test case './inprogress/failing/Tricky/compound lhs': -1 test case - failed (1 assertion - failed) +Test case: './failing/Tricky/non streamable type' +---------------------------------------------------------------- --- Test case: './failing/Tricky/non streamable type' ----------- TrickyTests.cpp:95: -[95] &o1 == &o2 -failed -for: 0x == 0x + CHECK( &o1 == &o2 ) +failed with expansion: + 0x == 0x -[96] o1 == o2 -failed -for: {?} == {?} +TrickyTests.cpp:96: + CHECK( o1 == o2 ) +failed with expansion: + {?} == {?} ---------------------------------------------------------------- -Summary for test case './failing/Tricky/non streamable type': -1 test case - failed (2 assertions - both failed) +Test case: './failing/string literals' +---------------------------------------------------------------- --- Test case: './failing/string literals' ---------------------- TrickyTests.cpp:106: -[106] std::string( "first" ) == "second" -failed -for: "first" == "second" + REQUIRE( std::string( "first" ) == "second" ) +failed with expansion: + "first" == "second" ---------------------------------------------------------------- -Summary for test case './failing/string literals': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/side-effects' +---------------------------------------------------------------- --- Test case: './succeeding/side-effects' ---------------------- TrickyTests.cpp:119: -[119] i++ == 7 -succeeded -for: 7 == 7 + REQUIRE( i++ == 7 ) +passed with expansion: + 7 == 7 -[120] i++ == 8 -succeeded -for: 8 == 8 +TrickyTests.cpp:120: + REQUIRE( i++ == 8 ) +passed with expansion: + 8 == 8 ---------------------------------------------------------------- -Summary for test case './succeeding/side-effects': -All tests passed (2 assertions in 1 test case) +Test case: './succeeding/koenig' +---------------------------------------------------------------- --- Test case: './succeeding/koenig' ---------------------------- TrickyTests.cpp:186: -[186] 0x == o -succeeded -for: 0x == {?} + REQUIRE( 0x == o ) +passed with expansion: + 0x == {?} ---------------------------------------------------------------- -Summary for test case './succeeding/koenig': -All tests passed (1 assertion in 1 test case) +Test case: './succeeding/non-const==' +---------------------------------------------------------------- --- Test case: './succeeding/non-const==' ----------------------- TrickyTests.cpp:212: -[212] t == 1u -succeeded -for: {?} == 1 + REQUIRE( t == 1u ) +passed with expansion: + {?} == 1 ---------------------------------------------------------------- -Summary for test case './succeeding/non-const==': -All tests passed (1 assertion in 1 test case) +Test case: './succeeding/enum/bits' +---------------------------------------------------------------- --- Test case: './succeeding/enum/bits' ------------------------- TrickyTests.cpp:224: -[224] 0x == bit30and31 -succeeded -for: 0x == 3221225472 + REQUIRE( 0x == bit30and31 ) +passed with expansion: + 0x == 3221225472 ---------------------------------------------------------------- -Summary for test case './succeeding/enum/bits': -All tests passed (1 assertion in 1 test case) +Test case: './succeeding/boolean member' +---------------------------------------------------------------- --- Test case: './succeeding/boolean member' -------------------- TrickyTests.cpp:239: -[239] obj.prop != __null -succeeded -for: 0x != 0 + REQUIRE( obj.prop != __null ) +passed with expansion: + 0x != 0 ---------------------------------------------------------------- -Summary for test case './succeeding/boolean member': -All tests passed (1 assertion in 1 test case) +Test case: './succeeding/unimplemented static bool' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'compare to true' +---------------------------------------------------------------- --- Test case: './succeeding/unimplemented static bool' --------- --- Section: 'compare to true' ---------------------------------- TrickyTests.cpp:259: -[259] is_true::value == true -succeeded -for: true == true + REQUIRE( is_true::value == true ) +passed with expansion: + true == true -[260] true == is_true::value -succeeded -for: true == true +TrickyTests.cpp:260: + REQUIRE( true == is_true::value ) +passed with expansion: + true == true ---------------------------------------------------------------- -Summary for section 'compare to true': -All 2 assertions passed +Section: 'compare to false' +---------------------------------------------------------------- --- Section: 'compare to false' --------------------------------- TrickyTests.cpp:264: -[264] is_true::value == false -succeeded -for: false == false + REQUIRE( is_true::value == false ) +passed with expansion: + false == false -[265] false == is_true::value -succeeded -for: false == false +TrickyTests.cpp:265: + REQUIRE( false == is_true::value ) +passed with expansion: + false == false ---------------------------------------------------------------- -Summary for section 'compare to false': -All 2 assertions passed +Section: 'negation' +---------------------------------------------------------------- --- Section: 'negation' ----------------------------------------- TrickyTests.cpp:270: -[270] !is_true::value -succeeded -for: true + REQUIRE( !is_true::value ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section 'negation': -1 assertion passed +Section: 'double negation' +---------------------------------------------------------------- --- Section: 'double negation' ---------------------------------- TrickyTests.cpp:275: -[275] !!is_true::value -succeeded -for: true + REQUIRE( !!is_true::value ) +passed with expansion: + true ---------------------------------------------------------------- -Summary for section 'double negation': -1 assertion passed +Section: 'direct' +---------------------------------------------------------------- --- Section: 'direct' ------------------------------------------- TrickyTests.cpp:280: -[280] is_true::value -succeeded -for: true + REQUIRE( is_true::value ) +passed with expansion: + true -[281] !is_true::value -succeeded -for: !false +TrickyTests.cpp:281: + REQUIRE_FALSE( !is_true::value ) +passed with expansion: + !false ---------------------------------------------------------------- -Summary for section 'direct': -All 2 assertions passed - +Test case: './succeeding/SafeBool' ---------------------------------------------------------------- -Summary for test case './succeeding/unimplemented static bool': -All tests passed (8 assertions in 1 test case) --- Test case: './succeeding/SafeBool' -------------------------- TrickyTests.cpp:313: -[313] True -succeeded -for: true + CHECK( True ) +passed with expansion: + true -[314] !False -succeeded -for: true +TrickyTests.cpp:314: + CHECK( !False ) +passed with expansion: + true -[315] !False -succeeded -for: !false +TrickyTests.cpp:315: + CHECK_FALSE( !False ) +passed with expansion: + !false ---------------------------------------------------------------- -Summary for test case './succeeding/SafeBool': -All tests passed (3 assertions in 1 test case) +Test case: 'scenario name' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'This stuff exists' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'I do this' +---------------------------------------------------------------- +---------------------------------------------------------------- +Section: 'it should do this' +---------------------------------------------------------------- --- Test case: 'scenario name' ---------------------------------- --- Section: 'This stuff exists' -------------------------------- --- Section: 'I do this' ---------------------------------------- --- Section: 'it should do this' -------------------------------- BDDTests.cpp:37: -[37] itDoesThis() -succeeded -for: true - ----------------------------------------------------------------- -Summary for section 'it should do this': -1 assertion passed - ----------------------------------------------------------------- -Summary for section 'I do this': -1 assertion passed - ----------------------------------------------------------------- -Summary for section 'This stuff exists': -1 assertion passed - ----------------------------------------------------------------- -Summary for test case 'scenario name': -All tests passed (1 assertion in 1 test case) - ----------------------------------------------------------------- -Summary for group '~dummy': -95 test cases - 44 failed (607 assertions - 101 failed) + REQUIRE( itDoesThis() ) +passed with expansion: + true ================================================================ -Summary for all tests in 'CatchSelfTest': -95 test cases - 44 failed (607 assertions - 101 failed) +96 test cases - 45 failed (610 assertions - 102 failed) + + +CatchSelfTest is a CATCH v0.9 b12 (integration) host application. +Run with -? for options + +---------------------------------------------------------------- +Test case: './succeeding/Approx/simple' +---------------------------------------------------------------- --- Started testing: 'CatchSelfTest' ---------------------------- --- Group: '~dummy' --------------------------------------------- --- Test case: './succeeding/Approx/simple' --------------------- ApproxTests.cpp:20: -[20] d == Approx( 1.23 ) -succeeded -for: 1.23 == Approx( 1.23 ) + REQUIRE( d == Approx( 1.23 ) ) +passed with expansion: + 1.23 == Approx( 1.23 ) -[21] d != Approx( 1.22 ) -succeeded -for: 1.23 != Approx( 1.22 ) +ApproxTests.cpp:21: + REQUIRE( d != Approx( 1.22 ) ) +passed with expansion: + 1.23 != Approx( 1.22 ) -[22] d != Approx( 1.24 ) -succeeded -for: 1.23 != Approx( 1.24 ) +ApproxTests.cpp:22: + REQUIRE( d != Approx( 1.24 ) ) +passed with expansion: + 1.23 != Approx( 1.24 ) -[24] Approx( d ) == 1.23 -succeeded -for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:24: + REQUIRE( Approx( d ) == 1.23 ) +passed with expansion: + Approx( 1.23 ) == 1.23 -[25] Approx( d ) != 1.22 -succeeded -for: Approx( 1.23 ) != 1.22 +ApproxTests.cpp:25: + REQUIRE( Approx( d ) != 1.22 ) +passed with expansion: + Approx( 1.23 ) != 1.22 -[26] Approx( d ) != 1.24 -succeeded -for: Approx( 1.23 ) != 1.24 +ApproxTests.cpp:26: + REQUIRE( Approx( d ) != 1.24 ) +passed with expansion: + Approx( 1.23 ) != 1.24 ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/simple': -All tests passed (6 assertions in 1 test case) +Test case: './succeeding/Approx/epsilon' +---------------------------------------------------------------- --- Test case: './succeeding/Approx/epsilon' -------------------- ApproxTests.cpp:38: -[38] d != Approx( 1.231 ) -succeeded -for: 1.23 != Approx( 1.231 ) + REQUIRE( d != Approx( 1.231 ) ) +passed with expansion: + 1.23 != Approx( 1.231 ) -[39] d == Approx( 1.231 ).epsilon( 0.1 ) -succeeded -for: 1.23 == Approx( 1.231 ) +ApproxTests.cpp:39: + REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) +passed with expansion: + 1.23 == Approx( 1.231 ) ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/epsilon': -All tests passed (2 assertions in 1 test case) +Test case: './succeeding/Approx/float' +---------------------------------------------------------------- --- Test case: './succeeding/Approx/float' ---------------------- ApproxTests.cpp:49: -[49] 1.23f == Approx( 1.23f ) -succeeded -for: 1.23 == Approx( 1.23 ) + REQUIRE( 1.23f == Approx( 1.23f ) ) +passed with expansion: + 1.23 == Approx( 1.23 ) -[50] 0.0f == Approx( 0.0f ) -succeeded -for: 0 == Approx( 0 ) +ApproxTests.cpp:50: + REQUIRE( 0.0f == Approx( 0.0f ) ) +passed with expansion: + 0 == Approx( 0 ) ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/float': -All tests passed (2 assertions in 1 test case) +Test case: './succeeding/Approx/int' +---------------------------------------------------------------- --- Test case: './succeeding/Approx/int' ------------------------ ApproxTests.cpp:60: -[60] 1 == Approx( 1 ) -succeeded + REQUIRE( 1 == Approx( 1 ) ) +passed -[61] 0 == Approx( 0 ) -succeeded +ApproxTests.cpp:61: + REQUIRE( 0 == Approx( 0 ) ) +passed ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/int': -All tests passed (2 assertions in 1 test case) +Test case: './succeeding/Approx/mixed' +---------------------------------------------------------------- --- Test case: './succeeding/Approx/mixed' ---------------------- ApproxTests.cpp:75: -[75] 1.0f == Approx( 1 ) -succeeded -for: 1 == Approx( 1 ) + REQUIRE( 1.0f == Approx( 1 ) ) +passed with expansion: + 1 == Approx( 1 ) -[76] 0 == Approx( dZero) -succeeded -for: 0 == Approx( 0 ) +ApproxTests.cpp:76: + REQUIRE( 0 == Approx( dZero) ) +passed with expansion: + 0 == Approx( 0 ) -[77] 0 == Approx( dSmall ).epsilon( 0.001 ) -succeeded -for: 0 == Approx( 1e-05 ) +ApproxTests.cpp:77: + REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) +passed with expansion: + 0 == Approx( 1e-05 ) -[78] 1.234f == Approx( dMedium ) -succeeded -for: 1.234 == Approx( 1.234 ) +ApproxTests.cpp:78: + REQUIRE( 1.234f == Approx( dMedium ) ) +passed with expansion: + 1.234 == Approx( 1.234 ) -[79] dMedium == Approx( 1.234f ) -succeeded -for: 1.234 == Approx( 1.234 ) +ApproxTests.cpp:79: + REQUIRE( dMedium == Approx( 1.234f ) ) +passed with expansion: + 1.234 == Approx( 1.234 ) ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/mixed': -All tests passed (5 assertions in 1 test case) +Test case: './succeeding/Approx/custom' +---------------------------------------------------------------- --- Test case: './succeeding/Approx/custom' --------------------- ApproxTests.cpp:93: -[93] d == approx( 1.23 ) -succeeded -for: 1.23 == Approx( 1.23 ) + REQUIRE( d == approx( 1.23 ) ) +passed with expansion: + 1.23 == Approx( 1.23 ) -[94] d == approx( 1.22 ) -succeeded -for: 1.23 == Approx( 1.22 ) +ApproxTests.cpp:94: + REQUIRE( d == approx( 1.22 ) ) +passed with expansion: + 1.23 == Approx( 1.22 ) -[95] d == approx( 1.24 ) -succeeded -for: 1.23 == Approx( 1.24 ) +ApproxTests.cpp:95: + REQUIRE( d == approx( 1.24 ) ) +passed with expansion: + 1.23 == Approx( 1.24 ) -[96] d != approx( 1.25 ) -succeeded -for: 1.23 != Approx( 1.25 ) +ApproxTests.cpp:96: + REQUIRE( d != approx( 1.25 ) ) +passed with expansion: + 1.23 != Approx( 1.25 ) -[98] approx( d ) == 1.23 -succeeded -for: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:98: + REQUIRE( approx( d ) == 1.23 ) +passed with expansion: + Approx( 1.23 ) == 1.23 -[99] approx( d ) == 1.22 -succeeded -for: Approx( 1.23 ) == 1.22 +ApproxTests.cpp:99: + REQUIRE( approx( d ) == 1.22 ) +passed with expansion: + Approx( 1.23 ) == 1.22 -[100] approx( d ) == 1.24 -succeeded -for: Approx( 1.23 ) == 1.24 +ApproxTests.cpp:100: + REQUIRE( approx( d ) == 1.24 ) +passed with expansion: + Approx( 1.23 ) == 1.24 -[101] approx( d ) != 1.25 -succeeded -for: Approx( 1.23 ) != 1.25 +ApproxTests.cpp:101: + REQUIRE( approx( d ) != 1.25 ) +passed with expansion: + Approx( 1.23 ) != 1.25 ---------------------------------------------------------------- -Summary for test case './succeeding/Approx/custom': -All tests passed (8 assertions in 1 test case) +Test case: './succeeding/TestClass/succeedingCase' +---------------------------------------------------------------- --- Test case: './succeeding/TestClass/succeedingCase' ---------- ClassTests.cpp:24: -[24] s == "hello" -succeeded -for: "hello" == "hello" + REQUIRE( s == "hello" ) +passed with expansion: + "hello" == "hello" ---------------------------------------------------------------- -Summary for test case './succeeding/TestClass/succeedingCase': -All tests passed (1 assertion in 1 test case) +Test case: './failing/TestClass/failingCase' +---------------------------------------------------------------- --- Test case: './failing/TestClass/failingCase' ---------------- ClassTests.cpp:28: -[28] s == "world" -failed -for: "hello" == "world" + REQUIRE( s == "world" ) +failed with expansion: + "hello" == "world" ---------------------------------------------------------------- -Summary for test case './failing/TestClass/failingCase': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/Fixture/succeedingCase' +---------------------------------------------------------------- --- Test case: './succeeding/Fixture/succeedingCase' ------------ ClassTests.cpp:47: -[47] m_a == 1 -succeeded -for: 1 == 1 + REQUIRE( m_a == 1 ) +passed with expansion: + 1 == 1 ---------------------------------------------------------------- -Summary for test case './succeeding/Fixture/succeedingCase': -All tests passed (1 assertion in 1 test case) +Test case: './failing/Fixture/failingCase' +---------------------------------------------------------------- --- Test case: './failing/Fixture/failingCase' ------------------ ClassTests.cpp:55: -[55] m_a == 2 -failed -for: 1 == 2 + REQUIRE( m_a == 2 ) +failed with expansion: + 1 == 2 ---------------------------------------------------------------- -Summary for test case './failing/Fixture/failingCase': -1 test case - failed (1 assertion - failed) +Test case: './succeeding/conditions/equality' +---------------------------------------------------------------- --- Test case: './succeeding/conditions/equality' --------------- ConditionTests.cpp:55: -[55] data.int_seven == 7 -succeeded -for: 7 == 7 + REQUIRE( data.int_seven == 7 ) +passed with expansion: + 7 == 7 -[56] data.float_nine_point_one == Approx( 9.1f ) -succeeded -for: 9.1 == Approx( 9.1 ) +ConditionTests.cpp:56: + REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) +passed with expansion: + 9.1 == Approx( 9.1 ) -[57] data.double_pi == Approx( 3.1415926535 ) -succeeded -for: 3.14159 == Approx( 3.14159 ) +ConditionTests.cpp:57: + REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) +passed with expansion: + 3.14159 == Approx( 3.14159 ) -[58] data.str_hello == "hello" -succeeded -for: "hello" == "hello" +ConditionTests.cpp:58: + REQUIRE( data.str_hello == "hello" ) +passed with expansion: + "hello" == "hello" -[59] "hello" == data.str_hello -succeeded -for: "hello" == "hello" +ConditionTests.cpp:59: + REQUIRE( "hello" == data.str_hello ) +passed with expansion: + "hello" == "hello" -[60] data.str_hello.size() == 5 -succeeded -for: 5 == 5 +ConditionTests.cpp:60: + REQUIRE( data.str_hello.size() == 5 ) +passed with expansion: + 5 == 5 -[63] x == Approx( 1.3 ) -succeeded -for: 1.3 == Approx( 1.3 ) +ConditionTests.cpp:63: + REQUIRE( x == Approx( 1.3 ) ) +passed with expansion: + 1.3 == Approx( 1.3 ) ---------------------------------------------------------------- -Summary for test case './succeeding/conditions/equality': -All tests passed (7 assertions in 1 test case) +Test case: './failing/conditions/equality' +---------------------------------------------------------------- --- Test case: './failing/conditions/equality' ------------------ ConditionTests.cpp:71: -[71] data.int_seven == 6 -failed -for: 7 == 6 + CHECK( data.int_seven == 6 ) +failed with expansion: + 7 == 6 -[72] data.int_seven == 8 -failed -for: 7 == 8 - ----------------------------------------------------------------- -Summary for test case './failing/conditions/equality': -1 test case - failed (2 assertions - both failed) - ----------------------------------------------------------------- -Summary for group '~dummy': -12 test cases - 3 failed (38 assertions - 4 failed) +ConditionTests.cpp:72: + CHECK( data.int_seven == 8 ) +failed with expansion: + 7 == 8 ================================================================ -Summary for all tests in 'CatchSelfTest': 12 test cases - 3 failed (38 assertions - 4 failed) - + @@ -3675,133 +3994,133 @@ Summary for all tests in 'CatchSelfTest': -ClassTests.cpp:28: +ClassTests.cpp:28 -ClassTests.cpp:55: +ClassTests.cpp:55 -ConditionTests.cpp:71: +ConditionTests.cpp:71 -ConditionTests.cpp:72: +ConditionTests.cpp:72 -ConditionTests.cpp:73: +ConditionTests.cpp:73 -ConditionTests.cpp:74: +ConditionTests.cpp:74 -ConditionTests.cpp:75: +ConditionTests.cpp:75 -ConditionTests.cpp:76: +ConditionTests.cpp:76 -ConditionTests.cpp:77: +ConditionTests.cpp:77 -ConditionTests.cpp:78: +ConditionTests.cpp:78 -ConditionTests.cpp:79: +ConditionTests.cpp:79 -ConditionTests.cpp:80: +ConditionTests.cpp:80 -ConditionTests.cpp:81: +ConditionTests.cpp:81 -ConditionTests.cpp:82: +ConditionTests.cpp:82 -ConditionTests.cpp:85: +ConditionTests.cpp:85 -ConditionTests.cpp:111: +ConditionTests.cpp:111 -ConditionTests.cpp:112: +ConditionTests.cpp:112 -ConditionTests.cpp:113: +ConditionTests.cpp:113 -ConditionTests.cpp:114: +ConditionTests.cpp:114 -ConditionTests.cpp:115: +ConditionTests.cpp:115 -ConditionTests.cpp:152: +ConditionTests.cpp:152 -ConditionTests.cpp:153: +ConditionTests.cpp:153 -ConditionTests.cpp:154: +ConditionTests.cpp:154 -ConditionTests.cpp:155: +ConditionTests.cpp:155 -ConditionTests.cpp:156: +ConditionTests.cpp:156 -ConditionTests.cpp:157: +ConditionTests.cpp:157 -ConditionTests.cpp:159: +ConditionTests.cpp:159 -ConditionTests.cpp:160: +ConditionTests.cpp:160 -ConditionTests.cpp:162: +ConditionTests.cpp:162 -ConditionTests.cpp:163: +ConditionTests.cpp:163 -ConditionTests.cpp:164: +ConditionTests.cpp:164 -ConditionTests.cpp:166: +ConditionTests.cpp:166 -ConditionTests.cpp:167: +ConditionTests.cpp:167 -ConditionTests.cpp:168: +ConditionTests.cpp:168 -ConditionTests.cpp:169: +ConditionTests.cpp:169 -ConditionTests.cpp:170: +ConditionTests.cpp:170 -ConditionTests.cpp:171: +ConditionTests.cpp:171 -ConditionTests.cpp:173: +ConditionTests.cpp:173 -ConditionTests.cpp:174: +ConditionTests.cpp:174 @@ -3813,120 +4132,121 @@ ConditionTests.cpp:174: -ConditionTests.cpp:334: +ConditionTests.cpp:334 -ConditionTests.cpp:335: +ConditionTests.cpp:335 -ConditionTests.cpp:336: +ConditionTests.cpp:336 -ConditionTests.cpp:337: +ConditionTests.cpp:337 -ConditionTests.cpp:339: +ConditionTests.cpp:339 -ConditionTests.cpp:340: +ConditionTests.cpp:340 -ConditionTests.cpp:342: +ConditionTests.cpp:342 -ConditionTests.cpp:343: +ConditionTests.cpp:343 -ExceptionTests.cpp:47: +ExceptionTests.cpp:47 < message="thisDoesntThrow()" type="CHECK_THROWS_AS"> -ExceptionTests.cpp:48: +ExceptionTests.cpp:48 -ExceptionTests.cpp:49: +ExceptionTests.cpp:49 -ExceptionTests.cpp:52: +ExceptionTests.cpp:52 -ExceptionTests.cpp:60: +ExceptionTests.cpp:60 -ExceptionTests.cpp:102: +ExceptionTests.cpp:102 -ExceptionTests.cpp:109: +ExceptionTests.cpp:109 -ExceptionTests.cpp:114: +ExceptionTests.cpp:114 -ExceptionTests.cpp:118: +ExceptionTests.cpp:118 + -MessageTests.cpp:14: +MessageTests.cpp:14 -MessageTests.cpp:23: +MessageTests.cpp:23 -MessageTests.cpp:24: +MessageTests.cpp:24 -MessageTests.cpp:26: +MessageTests.cpp:26 -MessageTests.cpp:31: +MessageTests.cpp:31 -MessageTests.cpp:35: +MessageTests.cpp:35 -MessageTests.cpp:37: +MessageTests.cpp:37 -MessageTests.cpp:39: +MessageTests.cpp:39 -MessageTests.cpp:41: +MessageTests.cpp:41 -MessageTests.cpp:51: +MessageTests.cpp:51 -MessageTests.cpp:58: +MessageTests.cpp:58 -MessageTests.cpp:63: +MessageTests.cpp:63 @@ -3937,75 +4257,75 @@ Message from section two -MessageTests.cpp:86: +MessageTests.cpp:86 -MessageTests.cpp:86: +MessageTests.cpp:86 -MessageTests.cpp:86: +MessageTests.cpp:86 -MessageTests.cpp:92: +MessageTests.cpp:92 -MiscTests.cpp:61: +MiscTests.cpp:61 -MiscTests.cpp:103: +MiscTests.cpp:103 -MiscTests.cpp:114: +MiscTests.cpp:114 -MiscTests.cpp:115: +MiscTests.cpp:115 -MiscTests.cpp:114: +MiscTests.cpp:114 -MiscTests.cpp:115: +MiscTests.cpp:115 -MiscTests.cpp:114: +MiscTests.cpp:114 -MiscTests.cpp:114: +MiscTests.cpp:114 -MiscTests.cpp:115: +MiscTests.cpp:115 -MiscTests.cpp:114: +MiscTests.cpp:114 -MiscTests.cpp:115: +MiscTests.cpp:115 -MiscTests.cpp:114: +MiscTests.cpp:114 -MiscTests.cpp:114: +MiscTests.cpp:114 -MiscTests.cpp:115: +MiscTests.cpp:115 -MiscTests.cpp:114: +MiscTests.cpp:114 -MiscTests.cpp:115: +MiscTests.cpp:115 @@ -4019,62 +4339,62 @@ An error -MiscTests.cpp:139: +MiscTests.cpp:139 -MiscTests.cpp:141: +MiscTests.cpp:141 -MiscTests.cpp:142: +MiscTests.cpp:142 -MiscTests.cpp:147: +MiscTests.cpp:147 -MiscTests.cpp:160: +MiscTests.cpp:160 -MiscTests.cpp:165: +MiscTests.cpp:165 -MiscTests.cpp:178: +MiscTests.cpp:178 -MiscTests.cpp:195: +MiscTests.cpp:195 -MiscTests.cpp:196: +MiscTests.cpp:196 -MiscTests.cpp:225: +MiscTests.cpp:225 -MiscTests.cpp:230: +MiscTests.cpp:230 -MiscTests.cpp:235: +MiscTests.cpp:235 -MiscTests.cpp:240: +MiscTests.cpp:240 @@ -4084,12 +4404,15 @@ MiscTests.cpp:240: -MiscTests.cpp:282: +MiscTests.cpp:282 + +TestMain.cpp:40 + Message from section one Message from section two @@ -4114,25 +4437,25 @@ An error -TrickyTests.cpp:55: +TrickyTests.cpp:55 -TrickyTests.cpp:71: +TrickyTests.cpp:71 -TrickyTests.cpp:95: +TrickyTests.cpp:95 -TrickyTests.cpp:96: +TrickyTests.cpp:96 -TrickyTests.cpp:106: +TrickyTests.cpp:106 @@ -6759,6 +7082,25 @@ GeneratorTests.cpp" line="27"> + +GeneratorTests.cpp" line="40"> + + i->first == i->second-1 + + + 0 == 0 + + +GeneratorTests.cpp" line="40"> + + i->first == i->second-1 + + + 2 == 2 + + + + this is a warning @@ -7556,9 +7898,9 @@ MiscTests.cpp" line="273">
- +
- +
@@ -7570,7 +7912,7 @@ TestMain.cpp" line="40"> totals.assertions.passed == 291 - 291 == 291 + 293 == 291 TestMain.cpp" line="41"> @@ -7581,9 +7923,9 @@ TestMain.cpp" line="41"> 0 == 0 - +
- +
@@ -7607,7 +7949,7 @@ TestMain.cpp" line="48">
- + TestMain.cpp" line="57"> @@ -9003,9 +9345,9 @@ BDDTests.cpp" line="37">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -9429,6 +9771,11 @@ GeneratorTests.cpp:26: multiply( i, 2 ) == i*2 succeeded for: 72 == 72 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/generators/2] +GeneratorTests.cpp:40: i->first == i->second-1 succeeded for: 0 == 0 +GeneratorTests.cpp:40: i->first == i->second-1 succeeded for: 2 == 2 +[Finished: './succeeding/generators/2' All tests passed (2 assertions in 1 test case)] + [Running: ./succeeding/message] MessageTests.cpp:14: [warning: this is a warning] @@ -9761,55 +10108,55 @@ No assertions in test case, 'second tag' [Running: selftest/main] [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/failing tests'] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:106: succeeded +catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] [End of section: 'selftest/expected result/failing tests' All 25 assertions passed] @@ -9817,99 +10164,101 @@ catch_self_test.hpp:106: succeeded [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/succeeding tests'] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] Message from section one Message from section two -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] Some information An error -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:95: succeeded +catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -[End of section: 'selftest/expected result/succeeding tests' All 43 assertions passed] +[End of section: 'selftest/expected result/succeeding tests' All 44 assertions passed] -[End of section: 'selftest/expected result' All 43 assertions passed] +[End of section: 'selftest/expected result' All 44 assertions passed] Message from section one Message from section two @@ -9917,11 +10266,11 @@ Some information An error [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/succeeding tests'] -TestMain.cpp:40: totals.assertions.passed == 291 succeeded for: 291 == 291 +TestMain.cpp:40: totals.assertions.passed == 291 failed for: 293 == 291 TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 -[End of section: 'selftest/test counts/succeeding tests' All 2 assertions passed] +[End of section: 'selftest/test counts/succeeding tests' 1 of 2 assertions failed] -[End of section: 'selftest/test counts' All 2 assertions passed] +[End of section: 'selftest/test counts' 1 of 2 assertions failed] [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/failing tests'] @@ -9931,7 +10280,7 @@ TestMain.cpp:48: totals.assertions.failed == 72 succeeded for: 72 == 72 [End of section: 'selftest/test counts' All 2 assertions passed] -[Finished: 'selftest/main' All tests passed (72 assertions in 1 test case)] +[Finished: 'selftest/main' 1 test case failed (1 of 73 assertions failed)] [Running: meta/Misc/Sections] TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 @@ -10344,10 +10693,10 @@ BDDTests.cpp:37: itDoesThis() succeeded for: true [End of section: 'This stuff exists' 1 assertion passed] [Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 44 of 95 test cases failed (101 of 607 assertions failed)] +[End of group: '~dummy'. 45 of 96 test cases failed (102 of 610 assertions failed)] -[Testing completed. 44 of 95 test cases failed (101 of 607 assertions failed)] +[Testing completed. 45 of 96 test cases failed (102 of 610 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] From 60ed3c142c2e7394f7cef9936f5b55b7b1057822 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 14 Jan 2013 18:51:49 +0000 Subject: [PATCH 108/296] Some tidy up --- include/reporters/catch_reporter_console.hpp | 277 +++++++++---------- 1 file changed, 127 insertions(+), 150 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index da6271d2..ee9f5fa7 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -30,85 +30,6 @@ namespace Catch { return prefs; } - - static std::string const& getDashes() { - static const std::string dashes = "----------------------------------------------------------------"; - return dashes; - } - static std::string const& getDoubleDashes() { - static const std::string doubleDashes = "================================================================"; - return doubleDashes; - } - static std::string const& getSpaces() { - static const std::string spaces = " "; - return spaces; - } - static std::string getSpaces( int spaces ) { - return getSpaces().substr( 0, spaces > 0 ? static_cast( spaces ) : 0 ); - } - - void printHeader( std::string const& _type, std::string const& _name ) { - stream << getDashes() << "\n" - << _type << ": '" << _name << "'\n" - << getDashes() << std::endl; - } - - void lazyPrint() { - bool needsNewline = unusedTestCaseInfo || ( currentSectionInfo && !currentSectionInfo->printed ); - if( m_lazyTestCaseStats ) - lazyPrintTestCaseStats(); - if( testRunInfo ) - lazyPrintRunInfo(); - if( unusedGroupInfo ) - lazyPrintGroupInfo(); - if( unusedTestCaseInfo ) - lazyPrintTestCaseInfo(); - if( currentSectionInfo && !currentSectionInfo->printed ) - lazyPrintSectionInfo(); - if( needsNewline ) - stream << "\n"; - - } - void lazyPrintTestCaseStats() { - printTestCaseStats( *m_lazyTestCaseStats ); - m_lazyTestCaseStats.reset(); - } - void lazyPrintRunInfo() { - stream << "\n" << testRunInfo->name - << " is a CATCH v" << libraryVersion.majorVersion << "." - << libraryVersion.minorVersion << " b" - << libraryVersion.buildNumber; - if( libraryVersion.branchName != "master" ) - stream << " (" << libraryVersion.branchName << ")"; - stream << " host application.\n" - << "Run with -? for options\n\n"; - - testRunInfo.reset(); - } - void lazyPrintGroupInfo() { - if( !unusedGroupInfo->name.empty() && unusedGroupInfo->groupsCounts > 1 ) { - printHeader( "Group", unusedGroupInfo->name ); - unusedGroupInfo.reset(); - } - } - void lazyPrintTestCaseInfo() { - printHeader( "Test case", unusedTestCaseInfo->name ); - unusedTestCaseInfo.reset(); - } - void lazyPrintSectionInfo() { - std::vector sections; - for( ThreadedSectionInfo* section = unusedSectionInfo.get(); - section && !section->printed; - section = section->parent.get() ) - sections.push_back( section ); - - typedef std::vector::const_reverse_iterator It; - for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { - printHeader( "Section", (*it)->name ); - (*it)->printed = true; - } - unusedSectionInfo.reset(); - } virtual void assertionStarting( AssertionInfo const& ) { } @@ -217,11 +138,126 @@ namespace Catch { return std::make_pair( "", "" ); } } - + + virtual void sectionEnded( SectionStats const& _sectionStats ) { + if( _sectionStats.missingAssertions ) { + lazyPrint(); + TextColour colour( TextColour::ResultError ); + stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; + } + StreamingReporterBase::sectionEnded( _sectionStats ); + } + + virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) { + + if( _testCaseStats.missingAssertions ) { + lazyPrint(); + TextColour colour( TextColour::ResultError ); + stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl; + } + StreamingReporterBase::testCaseEnded( _testCaseStats ); + } + virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { + if( !unusedGroupInfo ) { + printSummaryDivider(); + stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n"; + printTotals( _testGroupStats.totals ); + stream << "\n" << std::endl; + } + StreamingReporterBase::testGroupEnded( _testGroupStats ); + } + virtual void testRunEnded( TestRunStats const& _testRunStats ) { + if( m_atLeastOneTestCasePrinted ) + printTotalsDivider(); + printTotals( _testRunStats.totals ); + stream << "\n" << std::endl; + StreamingReporterBase::testRunEnded( _testRunStats ); + } + + private: std::string wrapLongStrings( std::string const& _string ) { return Catch::wrapLongStrings( _string, 70, 2 ); } + void lazyPrint() { + + bool needsNewline = unusedTestCaseInfo || ( currentSectionInfo && !currentSectionInfo->printed ); + + if( testRunInfo ) + lazyPrintRunInfo(); + if( unusedGroupInfo ) + lazyPrintGroupInfo(); + if( unusedTestCaseInfo ) + lazyPrintTestCaseInfo(); + if( currentSectionInfo && !currentSectionInfo->printed ) + lazyPrintSectionInfo(); + if( needsNewline ) + stream << "\n"; + + m_atLeastOneTestCasePrinted = true; + } + void lazyPrintRunInfo() { + stream << "\n" << testRunInfo->name + << " is a CATCH v" << libraryVersion.majorVersion << "." + << libraryVersion.minorVersion << " b" + << libraryVersion.buildNumber; + if( libraryVersion.branchName != "master" ) + stream << " (" << libraryVersion.branchName << ")"; + stream << " host application.\n" + << "Run with -? for options\n\n"; + + testRunInfo.reset(); + } + void lazyPrintGroupInfo() { + if( !unusedGroupInfo->name.empty() && unusedGroupInfo->groupsCounts > 1 ) { + printHeader( "Group", unusedGroupInfo->name ); + unusedGroupInfo.reset(); + } + } + void lazyPrintTestCaseInfo() { + printHeader( "Test case", unusedTestCaseInfo->name ); + unusedTestCaseInfo.reset(); + } + void lazyPrintSectionInfo() { + std::vector sections; + for( ThreadedSectionInfo* section = unusedSectionInfo.get(); + section && !section->printed; + section = section->parent.get() ) + sections.push_back( section ); + + typedef std::vector::const_reverse_iterator It; + for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { + printHeader( "Section", (*it)->name ); + (*it)->printed = true; + } + unusedSectionInfo.reset(); + } + + void printHeader( std::string const& _type, std::string const& _name ) { + stream << getDashes() << "\n" + << _type << ": '" << _name << "'\n" + << getDashes() << std::endl; + } + void printTotals( const Totals& totals ) { + if( totals.assertions.total() == 0 ) { + stream << "No tests ran"; + } + else if( totals.assertions.failed ) { + TextColour colour( TextColour::ResultError ); + printCounts( "test case", totals.testCases ); + if( totals.testCases.failed > 0 ) { + stream << " ("; + printCounts( "assertion", totals.assertions ); + stream << ")"; + } + } + else { + TextColour colour( TextColour::ResultSuccess ); + stream << "All tests passed (" + << pluralise( totals.assertions.passed, "assertion" ) << " in " + << pluralise( totals.testCases.passed, "test case" ) << ")"; + } + } void printCounts( std::string const& label, Counts const& counts ) { if( counts.total() == 1 ) { stream << "1 " << label << " - "; @@ -248,85 +284,26 @@ namespace Catch { } } } - - void printTotals( const Totals& totals ) { - if( totals.assertions.total() == 0 ) { - stream << "No tests ran"; - } - else if( totals.assertions.failed ) { - TextColour colour( TextColour::ResultError ); - printCounts( "test case", totals.testCases ); - if( totals.testCases.failed > 0 ) { - stream << " ("; - printCounts( "assertion", totals.assertions ); - stream << ")"; - } - } - else { - TextColour colour( TextColour::ResultSuccess ); - stream << "All tests passed (" - << pluralise( totals.assertions.passed, "assertion" ) << " in " - << pluralise( totals.testCases.passed, "test case" ) << ")"; - } - } - - virtual void sectionEnded( SectionStats const& _sectionStats ) { - if( _sectionStats.missingAssertions ) { - lazyPrint(); - TextColour colour( TextColour::ResultError ); - stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; - } - StreamingReporterBase::sectionEnded( _sectionStats ); - } - void printTestCaseStats( TestCaseStats const& _testCaseStats ) { - m_atLeastOneTestCasePrinted = true; - } - - virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) { - - if( _testCaseStats.missingAssertions ) { - lazyPrint(); - TextColour colour( TextColour::ResultError ); - stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl; - } - if( !unusedTestCaseInfo ) { - if( m_atLeastOneTestCasePrinted ) - printTestCaseStats( _testCaseStats ); - else - m_lazyTestCaseStats = _testCaseStats; - } - - StreamingReporterBase::testCaseEnded( _testCaseStats ); - } - virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { - if( !unusedGroupInfo ) { - printSummaryDivider(); - stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n"; - printTotals( _testGroupStats.totals ); - stream << "\n" << std::endl; - } - StreamingReporterBase::testGroupEnded( _testGroupStats ); - } - virtual void testRunEnded( TestRunStats const& _testRunStats ) { - if( m_atLeastOneTestCasePrinted ) - printTotalsDivider(); -// stream << "Summary for all tests in '" << _testRunStats.runInfo.name << "':\n"; - printTotals( _testRunStats.totals ); - stream << "\n" << std::endl; - StreamingReporterBase::testRunEnded( _testRunStats ); - } - - private: + void printTotalsDivider() { stream << getDoubleDashes() << "\n"; } void printSummaryDivider() { stream << getDashes() << "\n"; } + static std::string const& getDashes() { + static const std::string dashes + = "----------------------------------------------------------------"; + return dashes; + } + static std::string const& getDoubleDashes() { + static const std::string doubleDashes + = "================================================================"; + return doubleDashes; + } private: bool m_atLeastOneTestCasePrinted; - Option m_lazyTestCaseStats; }; From 3b970e20e9effbcafc5f6490998ff9ef68cfe9ec Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 14 Jan 2013 18:58:50 +0000 Subject: [PATCH 109/296] Refactored printResultType into switch --- include/reporters/catch_reporter_console.hpp | 33 +++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index ee9f5fa7..c9ef00ee 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -61,20 +61,25 @@ namespace Catch { } bool printResultType( AssertionResult const& _result ) { - if( _result.getResultType() == ResultWas::Info || - _result.getResultType() == ResultWas::Warning ) { - } - else if( _result.succeeded() ) { - TextColour successColour( TextColour::Success ); - stream << "passed "; - } - else if( _result.isOk() ) { - TextColour okAnywayColour( TextColour::Success ); - stream << "failed - but was ok "; - } - else { - TextColour errorColour( TextColour::Error ); - stream << "failed "; + switch( _result.getResultType() ) { + case ResultWas::Info: + case ResultWas::Warning: + break; + case ResultWas::Ok: + { + TextColour successColour( TextColour::Success ); + stream << "passed "; + } + break; + default: + if( _result.isOk() ) { + TextColour okAnywayColour( TextColour::Success ); + stream << "failed - but was ok "; + } + else { + TextColour errorColour( TextColour::Error ); + stream << "failed "; + } } return false; } From 313481006fb2f2bd59eec547ec42c76c51faa836 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 14 Jan 2013 19:28:28 +0000 Subject: [PATCH 110/296] Refactored printResultType and printMessage to work off a single switch --- include/reporters/catch_reporter_console.hpp | 143 ++++++++++++------- 1 file changed, 88 insertions(+), 55 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index c9ef00ee..f83b4434 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -48,40 +48,98 @@ namespace Catch { stream << result.getSourceInfo() << ":\n"; } + ResultComponents components( result ); bool endsWithNewLine = false; if( _assertionStats.totals.assertions.total() > 0 ) { - endsWithNewLine = printOriginalExpression( result ); - endsWithNewLine = printResultType( result ); - endsWithNewLine |= printReconstructedExpression( result ); + printOriginalExpression( result ); + printResultType( components ); + endsWithNewLine = printReconstructedExpression( result ); } - endsWithNewLine |= printMessage( result ); + endsWithNewLine |= printMessage( components ); if( !endsWithNewLine ) stream << "\n"; stream << std::endl; } - bool printResultType( AssertionResult const& _result ) { - switch( _result.getResultType() ) { - case ResultWas::Info: - case ResultWas::Warning: - break; - case ResultWas::Ok: - { - TextColour successColour( TextColour::Success ); - stream << "passed "; - } - break; - default: - if( _result.isOk() ) { - TextColour okAnywayColour( TextColour::Success ); - stream << "failed - but was ok "; - } - else { - TextColour errorColour( TextColour::Error ); - stream << "failed "; - } + struct ResultComponents { + ResultComponents( AssertionResult const& _result ) + : colour( TextColour::None ) + { + switch( _result.getResultType() ) { + case ResultWas::Ok: + colour = TextColour::Success; + passOrFail = "passed"; + if( _result.hasMessage() ){ + messageLabel = "with message"; + message = _result.getMessage(); + } + break; + case ResultWas::ExpressionFailed: + if( _result.isOk() ) { + colour = TextColour::Success; + passOrFail = "failed - but was ok"; + } + else { + colour = TextColour::Error; + passOrFail = "failed"; + } + if( _result.hasMessage() ){ + messageLabel = "with message"; + message = _result.getMessage(); + } + break; + case ResultWas::ThrewException: + colour = TextColour::Error; + passOrFail = "failed"; + messageLabel = "due to unexpected exception with message"; + message = _result.getMessage(); + break; + case ResultWas::DidntThrowException: + colour = TextColour::Error; + passOrFail = "failed"; + messageLabel = "because no exception was thrown where one was expected"; + break; + case ResultWas::Info: + messageLabel = "info"; + message = _result.getMessage(); + break; + case ResultWas::Warning: + messageLabel = "warning"; + message = _result.getMessage(); + break; + case ResultWas::ExplicitFailure: + passOrFail = "failed"; + colour = TextColour::Error; + messageLabel = "explicitly with message"; + message = _result.getMessage(); + break; + case ResultWas::Exception: + passOrFail = "failed"; + colour = TextColour::Error; + if( _result.hasMessage() ){ + messageLabel = "with message"; + message = _result.getMessage(); + } + break; + case ResultWas::Unknown: // These cases are here to prevent compiler warnings + case ResultWas::FailureBit: + passOrFail = "** internal error **"; + colour = TextColour::Error; + break; + } + } + + TextColour::Colours colour; + std::string passOrFail; + std::string messageLabel; + std::string message; + }; + + void printResultType( ResultComponents const& _components ) { + if( !_components.passOrFail.empty() ) { + TextColour colour( _components.colour ); + stream << _components.passOrFail << " "; } - return false; } bool printOriginalExpression( AssertionResult const& _result ) { if( _result.hasExpression() ) { @@ -106,43 +164,18 @@ namespace Catch { } return false; } - bool printMessage( AssertionResult const& _result ) { - std::pair message = getMessage( _result ); + bool printMessage( ResultComponents const& _components ) { bool endsWithNewLine = false; - if( !message.first.empty() ) { - stream << message.first << ":" << "\n"; + if( !_components.messageLabel.empty() ) { + stream << _components.messageLabel << ":" << "\n"; endsWithNewLine = true; } - if( !message.second.empty() ) { - stream << wrapLongStrings( message.second ) << "\n"; + if( !_components.message.empty() ) { + stream << wrapLongStrings( _components.message ) << "\n"; endsWithNewLine = true; } return endsWithNewLine; } - std::pair getMessage( AssertionResult const& _result ) { - switch( _result.getResultType() ) { - case ResultWas::ThrewException: - return std::make_pair( "due to unexpected exception with message", _result.getMessage() ); - case ResultWas::DidntThrowException: - return std::make_pair( "because no exception was thrown where one was expected", "" ); - case ResultWas::Info: - return std::make_pair( "info", _result.getMessage() ); - case ResultWas::Warning: - return std::make_pair( "warning", _result.getMessage() ); - case ResultWas::ExplicitFailure: - return std::make_pair( "explicitly with message", _result.getMessage() ); - - case ResultWas::Unknown: // These cases are here to prevent compiler warnings - case ResultWas::Ok: - case ResultWas::FailureBit: - case ResultWas::ExpressionFailed: - case ResultWas::Exception: - if( _result.hasMessage() ) - return std::make_pair( "with message", _result.getMessage() ); - else - return std::make_pair( "", "" ); - } - } virtual void sectionEnded( SectionStats const& _sectionStats ) { if( _sectionStats.missingAssertions ) { From 9beb6f24a17361be026985661ce0fa96cc4da9c8 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 15 Jan 2013 08:09:20 +0000 Subject: [PATCH 111/296] More console reporter refactoring --- include/reporters/catch_reporter_console.hpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index f83b4434..92a8f20a 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -63,16 +63,15 @@ namespace Catch { struct ResultComponents { ResultComponents( AssertionResult const& _result ) - : colour( TextColour::None ) + : colour( TextColour::None ), + message( _result.getMessage() ) { switch( _result.getResultType() ) { case ResultWas::Ok: colour = TextColour::Success; passOrFail = "passed"; - if( _result.hasMessage() ){ + if( _result.hasMessage() ) messageLabel = "with message"; - message = _result.getMessage(); - } break; case ResultWas::ExpressionFailed: if( _result.isOk() ) { @@ -85,14 +84,12 @@ namespace Catch { } if( _result.hasMessage() ){ messageLabel = "with message"; - message = _result.getMessage(); } break; case ResultWas::ThrewException: colour = TextColour::Error; passOrFail = "failed"; messageLabel = "due to unexpected exception with message"; - message = _result.getMessage(); break; case ResultWas::DidntThrowException: colour = TextColour::Error; @@ -101,27 +98,24 @@ namespace Catch { break; case ResultWas::Info: messageLabel = "info"; - message = _result.getMessage(); break; case ResultWas::Warning: messageLabel = "warning"; - message = _result.getMessage(); break; case ResultWas::ExplicitFailure: passOrFail = "failed"; colour = TextColour::Error; messageLabel = "explicitly with message"; - message = _result.getMessage(); break; case ResultWas::Exception: passOrFail = "failed"; colour = TextColour::Error; - if( _result.hasMessage() ){ + if( _result.hasMessage() ) messageLabel = "with message"; - message = _result.getMessage(); - } break; - case ResultWas::Unknown: // These cases are here to prevent compiler warnings + + // These cases are here to prevent compiler warnings + case ResultWas::Unknown: case ResultWas::FailureBit: passOrFail = "** internal error **"; colour = TextColour::Error; From 097282e00e3e7307add6bacd64abdf2e9ea4ccb1 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 15 Jan 2013 08:43:27 +0000 Subject: [PATCH 112/296] Merged test case/ sections headers --- include/reporters/catch_reporter_console.hpp | 43 ++++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 92a8f20a..182c2bd4 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -247,22 +247,49 @@ namespace Catch { } } void lazyPrintTestCaseInfo() { - printHeader( "Test case", unusedTestCaseInfo->name ); - unusedTestCaseInfo.reset(); + if( !currentSectionInfo ) { + stream << getDashes() << "\n" + << "Test case" << ": '" << unusedTestCaseInfo->name << "'\n"; + stream << getDashes() << std::endl; + unusedTestCaseInfo.reset(); + } } void lazyPrintSectionInfo() { + std::vector sections; for( ThreadedSectionInfo* section = unusedSectionInfo.get(); - section && !section->printed; + section; section = section->parent.get() ) sections.push_back( section ); - typedef std::vector::const_reverse_iterator It; - for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { - printHeader( "Section", (*it)->name ); - (*it)->printed = true; + // Sections + if( !sections.empty() ) { + stream << getDashes() << "\n" + << "Test case" << ": '" << unusedTestCaseInfo->name << "'\n" + << getDashes() << "\n"; + + std::string firstInset; + std::string inset; + if( sections.size() > 1 ) { + firstInset = "Sections: "; + inset = " "; + } + else { + firstInset = "Section: "; + inset = " "; + } + typedef std::vector::const_reverse_iterator It; + for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { + if( it == sections.rbegin() ) + stream << firstInset; + else + stream << inset; + stream << (*it)->name << "\n"; + // (*it)->printed = true; // !TBD remove flag? + } + stream << getDashes() << std::endl; + unusedSectionInfo.reset(); } - unusedSectionInfo.reset(); } void printHeader( std::string const& _type, std::string const& _name ) { From f8ba2277d3d489365bdd373180b7660d209094d2 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 15 Jan 2013 23:14:52 +0000 Subject: [PATCH 113/296] console reporter: Always print test case + sections in header for every new section. Group sections into single block Tweaked BDD mappings to print out nicely with above --- include/internal/catch_interfaces_reporter.h | 4 +- include/reporters/catch_reporter_console.hpp | 5 +- .../SelfTest/Baselines/approvedResults.txt | 654 +++++++++++------- .../CatchSelfTest/CatchSelfTest/BDDTests.cpp | 27 +- 4 files changed, 411 insertions(+), 279 deletions(-) diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 17974a22..420b2826 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -79,14 +79,12 @@ namespace Catch struct ThreadedSectionInfo : SectionInfo, SharedImpl<> { ThreadedSectionInfo( SectionInfo const& _sectionInfo, Ptr const& _parent = Ptr() ) : SectionInfo( _sectionInfo ), - parent( _parent ), - printed( false ) + parent( _parent ) {} virtual ~ThreadedSectionInfo(); std::vector > children; Ptr parent; - bool printed; }; struct AssertionStats { diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 182c2bd4..1c9d927d 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -213,7 +213,7 @@ namespace Catch { void lazyPrint() { - bool needsNewline = unusedTestCaseInfo || ( currentSectionInfo && !currentSectionInfo->printed ); + bool needsNewline = unusedTestCaseInfo || currentSectionInfo; if( testRunInfo ) lazyPrintRunInfo(); @@ -221,7 +221,7 @@ namespace Catch { lazyPrintGroupInfo(); if( unusedTestCaseInfo ) lazyPrintTestCaseInfo(); - if( currentSectionInfo && !currentSectionInfo->printed ) + if( currentSectionInfo) lazyPrintSectionInfo(); if( needsNewline ) stream << "\n"; @@ -285,7 +285,6 @@ namespace Catch { else stream << inset; stream << (*it)->name << "\n"; - // (*it)->printed = true; // !TBD remove flag? } stream << getDashes() << std::endl; unusedSectionInfo.reset(); diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index b2b1a77e..fa259473 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1780,8 +1780,7 @@ failed explicitly with message: ---------------------------------------------------------------- Test case: './failing/message/sections' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'one' +Section: one ---------------------------------------------------------------- MessageTests.cpp:58: @@ -1789,7 +1788,9 @@ failed explicitly with message: Message from section one ---------------------------------------------------------------- -Section: 'two' +Test case: './failing/message/sections' +---------------------------------------------------------------- +Section: two ---------------------------------------------------------------- MessageTests.cpp:63: @@ -1800,8 +1801,7 @@ Message from section one ---------------------------------------------------------------- Test case: './succeeding/message/sections/stdout' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'one' +Section: one ---------------------------------------------------------------- @@ -1809,7 +1809,9 @@ No assertions in section, 'one' Message from section two ---------------------------------------------------------------- -Section: 'two' +Test case: './succeeding/message/sections/stdout' +---------------------------------------------------------------- +Section: two ---------------------------------------------------------------- @@ -1898,8 +1900,7 @@ No assertions in test case, './succeeding/nofail' ---------------------------------------------------------------- Test case: './succeeding/Misc/Sections' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 's1' +Section: s1 ---------------------------------------------------------------- MiscTests.cpp:25: @@ -1907,13 +1908,16 @@ MiscTests.cpp:25: passed with expansion: 1 != 2 + MiscTests.cpp:26: REQUIRE( b != a ) passed with expansion: 2 != 1 ---------------------------------------------------------------- -Section: 's2' +Test case: './succeeding/Misc/Sections' +---------------------------------------------------------------- +Section: s2 ---------------------------------------------------------------- MiscTests.cpp:31: @@ -1924,8 +1928,7 @@ passed with expansion: ---------------------------------------------------------------- Test case: './succeeding/Misc/Sections/nested' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 's1' +Section: s1 ---------------------------------------------------------------- MiscTests.cpp:42: @@ -1933,13 +1936,17 @@ MiscTests.cpp:42: passed with expansion: 1 != 2 + MiscTests.cpp:43: REQUIRE( b != a ) passed with expansion: 2 != 1 ---------------------------------------------------------------- -Section: 's2' +Test case: './succeeding/Misc/Sections/nested' +---------------------------------------------------------------- +Sections: s1 + s2 ---------------------------------------------------------------- MiscTests.cpp:47: @@ -1950,11 +1957,8 @@ passed with expansion: ---------------------------------------------------------------- Test case: './mixed/Misc/Sections/nested2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 's1' ----------------------------------------------------------------- ----------------------------------------------------------------- -Section: 's2' +Sections: s1 + s2 ---------------------------------------------------------------- MiscTests.cpp:61: @@ -1963,10 +1967,10 @@ failed with expansion: 1 == 2 ---------------------------------------------------------------- -Section: 's1' +Test case: './mixed/Misc/Sections/nested2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 's3' +Sections: s1 + s3 ---------------------------------------------------------------- MiscTests.cpp:66: @@ -1975,10 +1979,10 @@ passed with expansion: 1 != 2 ---------------------------------------------------------------- -Section: 's1' +Test case: './mixed/Misc/Sections/nested2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 's4' +Sections: s1 + s4 ---------------------------------------------------------------- MiscTests.cpp:70: @@ -1989,28 +1993,27 @@ passed with expansion: ---------------------------------------------------------------- Test case: './Sections/nested/a/b' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'c' ----------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'd (leaf)' +Sections: c + d (leaf) ---------------------------------------------------------------- No assertions in section, 'd (leaf)' ---------------------------------------------------------------- -Section: 'c' +Test case: './Sections/nested/a/b' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'e (leaf)' +Sections: c + e (leaf) ---------------------------------------------------------------- No assertions in section, 'e (leaf)' ---------------------------------------------------------------- -Section: 'f (leaf)' +Test case: './Sections/nested/a/b' +---------------------------------------------------------------- +Section: f (leaf) ---------------------------------------------------------------- @@ -2019,8 +2022,7 @@ No assertions in section, 'f (leaf)' ---------------------------------------------------------------- Test case: './mixed/Misc/Sections/loops' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 's1' +Section: s1 ---------------------------------------------------------------- MiscTests.cpp:103: @@ -2202,15 +2204,16 @@ failed with expansion: ---------------------------------------------------------------- Test case: './misc/xmlentitycheck' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'embedded xml' +Section: embedded xml ---------------------------------------------------------------- No assertions in section, 'embedded xml' ---------------------------------------------------------------- -Section: 'encoded chars' +Test case: './misc/xmlentitycheck' +---------------------------------------------------------------- +Section: encoded chars ---------------------------------------------------------------- @@ -2397,296 +2400,360 @@ No assertions in test case, 'second tag' ---------------------------------------------------------------- Test case: 'selftest/main' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'selftest/expected result' ----------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'selftest/expected result/failing tests' +Sections: selftest/expected result + selftest/expected result/failing tests ---------------------------------------------------------------- catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected + catch_self_test.hpp:114: passed with message: Tests failed, as expected + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected + + catch_self_test.hpp:114: passed with message: Tests failed, as expected ---------------------------------------------------------------- -Section: 'selftest/expected result' +Test case: 'selftest/main' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'selftest/expected result/succeeding tests' +Sections: selftest/expected result + selftest/expected result/succeeding tests ---------------------------------------------------------------- catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected + catch_self_test.hpp:103: passed with message: Tests passed, as expected + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + catch_self_test.hpp:103: passed with message: Tests passed, as expected Message from section one Message from section two -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected + catch_self_test.hpp:103: passed with message: Tests passed, as expected + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + catch_self_test.hpp:103: passed with message: Tests passed, as expected Some information An error -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected + + catch_self_test.hpp:103: passed with message: Tests passed, as expected @@ -2696,10 +2763,10 @@ Message from section two Some information An error ---------------------------------------------------------------- -Section: 'selftest/test counts' +Test case: 'selftest/main' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'selftest/test counts/succeeding tests' +Sections: selftest/test counts + selftest/test counts/succeeding tests ---------------------------------------------------------------- TestMain.cpp:40: @@ -2707,16 +2774,17 @@ TestMain.cpp:40: failed with expansion: 293 == 291 + TestMain.cpp:41: CHECK( totals.assertions.failed == 0 ) passed with expansion: 0 == 0 ---------------------------------------------------------------- -Section: 'selftest/test counts' +Test case: 'selftest/main' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'selftest/test counts/failing tests' +Sections: selftest/test counts + selftest/test counts/failing tests ---------------------------------------------------------------- TestMain.cpp:47: @@ -2724,6 +2792,7 @@ TestMain.cpp:47: passed with expansion: 1 == 1 + TestMain.cpp:48: CHECK( totals.assertions.failed == 72 ) passed with expansion: @@ -2746,200 +2815,222 @@ passed with expansion: ---------------------------------------------------------------- Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'default' +Section: default ---------------------------------------------------------------- TestMain.cpp:97: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:99: CHECK( config.shouldDebugBreak == false ) passed with expansion: false == false + TestMain.cpp:100: CHECK( config.cutoff == -1 ) passed with expansion: -1 == -1 + TestMain.cpp:101: CHECK( config.allowThrows == true ) passed with expansion: true == true + TestMain.cpp:102: CHECK( config.reporter.empty() ) passed with expansion: true ---------------------------------------------------------------- -Section: 'test lists' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-t/1' +Sections: test lists + -t/1 ---------------------------------------------------------------- TestMain.cpp:108: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:110: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 + TestMain.cpp:111: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) passed with expansion: false == false + TestMain.cpp:112: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) passed with expansion: true ---------------------------------------------------------------- -Section: 'test lists' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-t/exclude:1' +Sections: test lists + -t/exclude:1 ---------------------------------------------------------------- TestMain.cpp:116: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:118: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 + TestMain.cpp:119: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) passed with expansion: false == false + TestMain.cpp:120: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) passed with expansion: true ---------------------------------------------------------------- -Section: 'test lists' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '--test/1' +Sections: test lists + --test/1 ---------------------------------------------------------------- TestMain.cpp:125: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:127: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 + TestMain.cpp:128: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) passed with expansion: false == false + TestMain.cpp:129: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) passed with expansion: true ---------------------------------------------------------------- -Section: 'test lists' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '--test/exclude:1' +Sections: test lists + --test/exclude:1 ---------------------------------------------------------------- TestMain.cpp:134: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:136: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 + TestMain.cpp:137: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) passed with expansion: false == false + TestMain.cpp:138: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) passed with expansion: true ---------------------------------------------------------------- -Section: 'test lists' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '--test/exclude:2' +Sections: test lists + --test/exclude:2 ---------------------------------------------------------------- TestMain.cpp:143: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:145: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 + TestMain.cpp:146: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) passed with expansion: false == false + TestMain.cpp:147: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) passed with expansion: true ---------------------------------------------------------------- -Section: 'test lists' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-t/2' +Sections: test lists + -t/2 ---------------------------------------------------------------- TestMain.cpp:152: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:154: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 + TestMain.cpp:155: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) passed with expansion: false == false + TestMain.cpp:156: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) passed with expansion: true + TestMain.cpp:157: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ) passed with expansion: true ---------------------------------------------------------------- -Section: 'test lists' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-t/0' +Sections: test lists + -t/0 ---------------------------------------------------------------- TestMain.cpp:162: @@ -2949,58 +3040,61 @@ passed with expansion: contains: "at least 1" ---------------------------------------------------------------- -Section: 'reporter' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-r/console' +Sections: reporter + -r/console ---------------------------------------------------------------- TestMain.cpp:169: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:171: REQUIRE( config.reporter == "console" ) passed with expansion: "console" == "console" ---------------------------------------------------------------- -Section: 'reporter' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-r/xml' +Sections: reporter + -r/xml ---------------------------------------------------------------- TestMain.cpp:175: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:177: REQUIRE( config.reporter == "xml" ) passed with expansion: "xml" == "xml" ---------------------------------------------------------------- -Section: 'reporter' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '--reporter/junit' +Sections: reporter + --reporter/junit ---------------------------------------------------------------- TestMain.cpp:181: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:183: REQUIRE( config.reporter == "junit" ) passed with expansion: "junit" == "junit" ---------------------------------------------------------------- -Section: 'reporter' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-r/error' +Sections: reporter + -r/error ---------------------------------------------------------------- TestMain.cpp:187: @@ -3010,42 +3104,44 @@ passed with expansion: were: one two" contains: "1 argument" ---------------------------------------------------------------- -Section: 'debugger' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-b' +Sections: debugger + -b ---------------------------------------------------------------- TestMain.cpp:194: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:196: REQUIRE( config.shouldDebugBreak == true ) passed with expansion: true == true ---------------------------------------------------------------- -Section: 'debugger' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '--break' +Sections: debugger + --break ---------------------------------------------------------------- TestMain.cpp:200: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:202: REQUIRE( config.shouldDebugBreak ) passed with expansion: true ---------------------------------------------------------------- -Section: 'debugger' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-b' +Sections: debugger + -b ---------------------------------------------------------------- TestMain.cpp:206: @@ -3055,42 +3151,44 @@ passed with expansion: were: unexpected" contains: "0 arguments" ---------------------------------------------------------------- -Section: 'abort' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-a' +Sections: abort + -a ---------------------------------------------------------------- TestMain.cpp:213: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:215: REQUIRE( config.cutoff == 1 ) passed with expansion: 1 == 1 ---------------------------------------------------------------- -Section: 'abort' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-a/2' +Sections: abort + -a/2 ---------------------------------------------------------------- TestMain.cpp:219: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:221: REQUIRE( config.cutoff == 2 ) passed with expansion: 2 == 2 ---------------------------------------------------------------- -Section: 'abort' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-a/error/0' +Sections: abort + -a/error/0 ---------------------------------------------------------------- TestMain.cpp:225: @@ -3100,10 +3198,10 @@ passed with expansion: than zero. Arguments were: 0" contains: "greater than zero" ---------------------------------------------------------------- -Section: 'abort' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-a/error/non numeric' +Sections: abort + -a/error/non numeric ---------------------------------------------------------------- TestMain.cpp:229: @@ -3113,10 +3211,10 @@ passed with expansion: than zero. Arguments were: oops" contains: "greater than zero" ---------------------------------------------------------------- -Section: 'abort' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-a/error/two args' +Sections: abort + -a/error/two args ---------------------------------------------------------------- TestMain.cpp:233: @@ -3126,116 +3224,126 @@ passed with expansion: Arguments were: 1 2" contains: "0 and 1 argument" ---------------------------------------------------------------- -Section: 'nothrow' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-nt' +Sections: nothrow + -nt ---------------------------------------------------------------- TestMain.cpp:240: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:242: REQUIRE( config.allowThrows == false ) passed with expansion: false == false ---------------------------------------------------------------- -Section: 'nothrow' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '--nothrow' +Sections: nothrow + --nothrow ---------------------------------------------------------------- TestMain.cpp:246: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:248: REQUIRE( config.allowThrows == false ) passed with expansion: false == false ---------------------------------------------------------------- -Section: 'streams' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-o filename' +Sections: streams + -o filename ---------------------------------------------------------------- TestMain.cpp:255: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:257: REQUIRE( config.outputFilename == "filename.ext" ) passed with expansion: "filename.ext" == "filename.ext" + TestMain.cpp:258: REQUIRE( config.stream.empty() ) passed with expansion: true ---------------------------------------------------------------- -Section: 'streams' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-o %stdout' +Sections: streams + -o %stdout ---------------------------------------------------------------- TestMain.cpp:262: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:264: REQUIRE( config.stream == "stdout" ) passed with expansion: "stdout" == "stdout" + TestMain.cpp:265: REQUIRE( config.outputFilename.empty() ) passed with expansion: true ---------------------------------------------------------------- -Section: 'streams' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '--out' +Sections: streams + --out ---------------------------------------------------------------- TestMain.cpp:269: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:271: REQUIRE( config.outputFilename == "filename.ext" ) passed with expansion: "filename.ext" == "filename.ext" ---------------------------------------------------------------- -Section: 'combinations' +Test case: 'selftest/parser/2' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: '-a -b' +Sections: combinations + -a -b ---------------------------------------------------------------- TestMain.cpp:278: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed + TestMain.cpp:280: CHECK( config.cutoff == 1 ) passed with expansion: 1 == 1 + TestMain.cpp:281: CHECK( config.shouldDebugBreak ) passed with expansion: true + TestMain.cpp:282: CHECK( config.allowThrows == false ) passed with expansion: @@ -3363,8 +3471,7 @@ passed with expansion: ---------------------------------------------------------------- Test case: 'selftest/tags' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'one tag' +Section: one tag ---------------------------------------------------------------- TestMain.cpp:369: @@ -3372,43 +3479,52 @@ TestMain.cpp:369: passed with expansion: "" == "" + TestMain.cpp:370: CHECK( oneTag.hasTag( "one" ) ) passed with expansion: true + TestMain.cpp:371: CHECK( oneTag.getTags().size() == 1 ) passed with expansion: 1 == 1 + TestMain.cpp:373: CHECK( oneTag.matchesTags( p1 ) == true ) passed with expansion: true == true + TestMain.cpp:374: CHECK( oneTag.matchesTags( p2 ) == true ) passed with expansion: true == true + TestMain.cpp:375: CHECK( oneTag.matchesTags( p3 ) == false ) passed with expansion: false == false + TestMain.cpp:376: CHECK( oneTag.matchesTags( p4 ) == false ) passed with expansion: false == false + TestMain.cpp:377: CHECK( oneTag.matchesTags( p5 ) == false ) passed with expansion: false == false ---------------------------------------------------------------- -Section: 'two tags' +Test case: 'selftest/tags' +---------------------------------------------------------------- +Section: two tags ---------------------------------------------------------------- TestMain.cpp:383: @@ -3416,53 +3532,64 @@ TestMain.cpp:383: passed with expansion: "" == "" + TestMain.cpp:384: CHECK( twoTags.hasTag( "one" ) ) passed with expansion: true + TestMain.cpp:385: CHECK( twoTags.hasTag( "two" ) ) passed with expansion: true + TestMain.cpp:386: CHECK( twoTags.hasTag( "three" ) == false ) passed with expansion: false == false + TestMain.cpp:387: CHECK( twoTags.getTags().size() == 2 ) passed with expansion: 2 == 2 + TestMain.cpp:389: CHECK( twoTags.matchesTags( p1 ) == true ) passed with expansion: true == true + TestMain.cpp:390: CHECK( twoTags.matchesTags( p2 ) == true ) passed with expansion: true == true + TestMain.cpp:391: CHECK( twoTags.matchesTags( p3 ) == true ) passed with expansion: true == true + TestMain.cpp:392: CHECK( twoTags.matchesTags( p4 ) == true ) passed with expansion: true == true + TestMain.cpp:393: CHECK( twoTags.matchesTags( p5 ) == true ) passed with expansion: true == true ---------------------------------------------------------------- -Section: 'one tag with characters either side' +Test case: 'selftest/tags' +---------------------------------------------------------------- +Section: one tag with characters either side ---------------------------------------------------------------- TestMain.cpp:399: @@ -3470,23 +3597,28 @@ TestMain.cpp:399: passed with expansion: "1234" == "1234" + TestMain.cpp:400: CHECK( oneTagWithExtras.hasTag( "one" ) ) passed with expansion: true + TestMain.cpp:401: CHECK( oneTagWithExtras.hasTag( "two" ) == false ) passed with expansion: false == false + TestMain.cpp:402: CHECK( oneTagWithExtras.getTags().size() == 1 ) passed with expansion: 1 == 1 ---------------------------------------------------------------- -Section: 'start of a tag, but not closed' +Test case: 'selftest/tags' +---------------------------------------------------------------- +Section: start of a tag, but not closed ---------------------------------------------------------------- TestMain.cpp:409: @@ -3494,18 +3626,22 @@ TestMain.cpp:409: passed with expansion: "[one" == "[one" + TestMain.cpp:410: CHECK( oneTagOpen.hasTag( "one" ) == false ) passed with expansion: false == false + TestMain.cpp:411: CHECK( oneTagOpen.getTags().size() == 0 ) passed with expansion: 0 == 0 ---------------------------------------------------------------- -Section: 'hidden' +Test case: 'selftest/tags' +---------------------------------------------------------------- +Section: hidden ---------------------------------------------------------------- TestMain.cpp:417: @@ -3513,16 +3649,19 @@ TestMain.cpp:417: passed with expansion: "" == "" + TestMain.cpp:418: CHECK( oneTag.hasTag( "hide" ) ) passed with expansion: true + TestMain.cpp:419: CHECK( oneTag.isHidden() ) passed with expansion: true + TestMain.cpp:421: CHECK( oneTag.matchesTags( "~[hide]" ) == false ) passed with expansion: @@ -3640,8 +3779,7 @@ passed with expansion: ---------------------------------------------------------------- Test case: './succeeding/unimplemented static bool' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'compare to true' +Section: compare to true ---------------------------------------------------------------- TrickyTests.cpp:259: @@ -3649,13 +3787,16 @@ TrickyTests.cpp:259: passed with expansion: true == true + TrickyTests.cpp:260: REQUIRE( true == is_true::value ) passed with expansion: true == true ---------------------------------------------------------------- -Section: 'compare to false' +Test case: './succeeding/unimplemented static bool' +---------------------------------------------------------------- +Section: compare to false ---------------------------------------------------------------- TrickyTests.cpp:264: @@ -3663,13 +3804,16 @@ TrickyTests.cpp:264: passed with expansion: false == false + TrickyTests.cpp:265: REQUIRE( false == is_true::value ) passed with expansion: false == false ---------------------------------------------------------------- -Section: 'negation' +Test case: './succeeding/unimplemented static bool' +---------------------------------------------------------------- +Section: negation ---------------------------------------------------------------- TrickyTests.cpp:270: @@ -3678,7 +3822,9 @@ passed with expansion: true ---------------------------------------------------------------- -Section: 'double negation' +Test case: './succeeding/unimplemented static bool' +---------------------------------------------------------------- +Section: double negation ---------------------------------------------------------------- TrickyTests.cpp:275: @@ -3687,7 +3833,9 @@ passed with expansion: true ---------------------------------------------------------------- -Section: 'direct' +Test case: './succeeding/unimplemented static bool' +---------------------------------------------------------------- +Section: direct ---------------------------------------------------------------- TrickyTests.cpp:280: @@ -3695,6 +3843,7 @@ TrickyTests.cpp:280: passed with expansion: true + TrickyTests.cpp:281: REQUIRE_FALSE( !is_true::value ) passed with expansion: @@ -3720,19 +3869,14 @@ passed with expansion: !false ---------------------------------------------------------------- -Test case: 'scenario name' +Test case: 'Scenario: Do that thing with the thing' ---------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'This stuff exists' ----------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'I do this' ----------------------------------------------------------------- ----------------------------------------------------------------- -Section: 'it should do this' +Sections: Given: This stuff exists + When: I do this + Then: it should do this ---------------------------------------------------------------- -BDDTests.cpp:37: +BDDTests.cpp:29: REQUIRE( itDoesThis() ) passed with expansion: true @@ -4465,7 +4609,7 @@ TrickyTests.cpp:106 - +
Message from section one @@ -9325,11 +9469,11 @@ TrickyTests.cpp" line="315"> - -
-
-
-BDDTests.cpp" line="37"> + +
+
+
+BDDTests.cpp" line="29"> itDoesThis() @@ -10681,18 +10825,18 @@ TrickyTests.cpp:314: !False succeeded for: true TrickyTests.cpp:315: !False succeeded for: !false [Finished: './succeeding/SafeBool' All tests passed (3 assertions in 1 test case)] -[Running: scenario name] -[Started section: 'This stuff exists'] -[Started section: 'I do this'] -[Started section: 'it should do this'] -BDDTests.cpp:37: itDoesThis() succeeded for: true -[End of section: 'it should do this' 1 assertion passed] +[Running: Scenario: Do that thing with the thing] +[Started section: 'Given: This stuff exists'] +[Started section: 'When: I do this'] +[Started section: 'Then: it should do this'] +BDDTests.cpp:29: itDoesThis() succeeded for: true +[End of section: 'Then: it should do this' 1 assertion passed] -[End of section: 'I do this' 1 assertion passed] +[End of section: 'When: I do this' 1 assertion passed] -[End of section: 'This stuff exists' 1 assertion passed] +[End of section: 'Given: This stuff exists' 1 assertion passed] -[Finished: 'scenario name' All tests passed (1 assertion in 1 test case)] +[Finished: 'Scenario: Do that thing with the thing' All tests passed (1 assertion in 1 test case)] [End of group: '~dummy'. 45 of 96 test cases failed (102 of 610 assertions failed)] diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index a54595a2..dd43189e 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -12,31 +12,22 @@ #include "catch.hpp" -#define STORY( a, b ) -#define SCENARIO( storyName, desc ) TEST_CASE( desc, "" ) -#define GIVEN( desc ) SECTION( desc, "" ) -#define WHEN( desc ) SECTION( desc, "" ) -#define THEN( desc ) SECTION( desc, "" ) +// !TBD: story scenarios map to class based tests +#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) +#define GIVEN( desc ) SECTION( "Given: " desc, "" ) +#define WHEN( desc ) SECTION( "When: " desc, "" ) +#define THEN( desc ) SECTION( "Then: " desc, "" ) inline bool itDoesThis(){ return true; } -STORY( storyName, "once upon a time" ) - -SCENARIO( storyName, "scenario name" ) -{ - GIVEN( "This stuff exists" ) - { +SCENARIO( "Do that thing with the thing", "[tags]" ) { + GIVEN( "This stuff exists" ) { // make stuff exist - - WHEN( "I do this" ) - { + WHEN( "I do this" ) { // do this - THEN( "it should do this") - { REQUIRE( itDoesThis() ); - } } - + } } From 5a60ce211746785f017eda8b59d13cdc2991a920 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 16 Jan 2013 09:30:41 +0000 Subject: [PATCH 114/296] console reporter: got rid of spurious blank lines --- include/reporters/catch_reporter_console.hpp | 10 +- .../SelfTest/Baselines/approvedResults.txt | 312 +++++------------- 2 files changed, 90 insertions(+), 232 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 1c9d927d..48b843c2 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -213,18 +213,14 @@ namespace Catch { void lazyPrint() { - bool needsNewline = unusedTestCaseInfo || currentSectionInfo; - if( testRunInfo ) lazyPrintRunInfo(); if( unusedGroupInfo ) lazyPrintGroupInfo(); if( unusedTestCaseInfo ) lazyPrintTestCaseInfo(); - if( currentSectionInfo) + if( unusedSectionInfo) lazyPrintSectionInfo(); - if( needsNewline ) - stream << "\n"; m_atLeastOneTestCasePrinted = true; } @@ -250,7 +246,7 @@ namespace Catch { if( !currentSectionInfo ) { stream << getDashes() << "\n" << "Test case" << ": '" << unusedTestCaseInfo->name << "'\n"; - stream << getDashes() << std::endl; + stream << getDashes() << "\n" << std::endl; unusedTestCaseInfo.reset(); } } @@ -286,7 +282,7 @@ namespace Catch { stream << inset; stream << (*it)->name << "\n"; } - stream << getDashes() << std::endl; + stream << getDashes() << "\n" << std::endl; unusedSectionInfo.reset(); } } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index fa259473..ec744ad7 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1908,7 +1908,6 @@ MiscTests.cpp:25: passed with expansion: 1 != 2 - MiscTests.cpp:26: REQUIRE( b != a ) passed with expansion: @@ -1936,7 +1935,6 @@ MiscTests.cpp:42: passed with expansion: 1 != 2 - MiscTests.cpp:43: REQUIRE( b != a ) passed with expansion: @@ -2408,122 +2406,98 @@ catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected - catch_self_test.hpp:114: passed with message: Tests failed, as expected - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - catch_self_test.hpp:114: passed with message: Tests failed, as expected @@ -2539,221 +2513,178 @@ catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected - catch_self_test.hpp:103: passed with message: Tests passed, as expected - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - catch_self_test.hpp:103: passed with message: Tests passed, as expected Message from section one Message from section two +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected - catch_self_test.hpp:103: passed with message: Tests passed, as expected - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - catch_self_test.hpp:103: passed with message: Tests passed, as expected Some information An error +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected - catch_self_test.hpp:103: passed with message: Tests passed, as expected - catch_self_test.hpp:103: passed with message: Tests passed, as expected - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - catch_self_test.hpp:103: passed with message: Tests passed, as expected @@ -2774,7 +2705,6 @@ TestMain.cpp:40: failed with expansion: 293 == 291 - TestMain.cpp:41: CHECK( totals.assertions.failed == 0 ) passed with expansion: @@ -2792,7 +2722,6 @@ TestMain.cpp:47: passed with expansion: 1 == 1 - TestMain.cpp:48: CHECK( totals.assertions.failed == 72 ) passed with expansion: @@ -2822,25 +2751,21 @@ TestMain.cpp:97: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:99: CHECK( config.shouldDebugBreak == false ) passed with expansion: false == false - TestMain.cpp:100: CHECK( config.cutoff == -1 ) passed with expansion: -1 == -1 - TestMain.cpp:101: CHECK( config.allowThrows == true ) passed with expansion: true == true - TestMain.cpp:102: CHECK( config.reporter.empty() ) passed with expansion: @@ -2857,19 +2782,16 @@ TestMain.cpp:108: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:110: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:111: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) passed with expansion: false == false - TestMain.cpp:112: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) passed with expansion: @@ -2886,19 +2808,16 @@ TestMain.cpp:116: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:118: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:119: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) passed with expansion: false == false - TestMain.cpp:120: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) passed with expansion: @@ -2915,19 +2834,16 @@ TestMain.cpp:125: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:127: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:128: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) passed with expansion: false == false - TestMain.cpp:129: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) passed with expansion: @@ -2944,19 +2860,16 @@ TestMain.cpp:134: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:136: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:137: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) passed with expansion: false == false - TestMain.cpp:138: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) passed with expansion: @@ -2973,19 +2886,16 @@ TestMain.cpp:143: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:145: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:146: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) passed with expansion: false == false - TestMain.cpp:147: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) passed with expansion: @@ -3002,25 +2912,21 @@ TestMain.cpp:152: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:154: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:155: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) passed with expansion: false == false - TestMain.cpp:156: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) passed with expansion: true - TestMain.cpp:157: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ) passed with expansion: @@ -3050,7 +2956,6 @@ TestMain.cpp:169: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:171: REQUIRE( config.reporter == "console" ) passed with expansion: @@ -3067,7 +2972,6 @@ TestMain.cpp:175: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:177: REQUIRE( config.reporter == "xml" ) passed with expansion: @@ -3084,7 +2988,6 @@ TestMain.cpp:181: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:183: REQUIRE( config.reporter == "junit" ) passed with expansion: @@ -3114,7 +3017,6 @@ TestMain.cpp:194: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:196: REQUIRE( config.shouldDebugBreak == true ) passed with expansion: @@ -3131,7 +3033,6 @@ TestMain.cpp:200: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:202: REQUIRE( config.shouldDebugBreak ) passed with expansion: @@ -3161,7 +3062,6 @@ TestMain.cpp:213: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:215: REQUIRE( config.cutoff == 1 ) passed with expansion: @@ -3178,7 +3078,6 @@ TestMain.cpp:219: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:221: REQUIRE( config.cutoff == 2 ) passed with expansion: @@ -3234,7 +3133,6 @@ TestMain.cpp:240: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:242: REQUIRE( config.allowThrows == false ) passed with expansion: @@ -3251,7 +3149,6 @@ TestMain.cpp:246: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:248: REQUIRE( config.allowThrows == false ) passed with expansion: @@ -3268,13 +3165,11 @@ TestMain.cpp:255: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:257: REQUIRE( config.outputFilename == "filename.ext" ) passed with expansion: "filename.ext" == "filename.ext" - TestMain.cpp:258: REQUIRE( config.stream.empty() ) passed with expansion: @@ -3291,13 +3186,11 @@ TestMain.cpp:262: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:264: REQUIRE( config.stream == "stdout" ) passed with expansion: "stdout" == "stdout" - TestMain.cpp:265: REQUIRE( config.outputFilename.empty() ) passed with expansion: @@ -3314,7 +3207,6 @@ TestMain.cpp:269: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:271: REQUIRE( config.outputFilename == "filename.ext" ) passed with expansion: @@ -3331,19 +3223,16 @@ TestMain.cpp:278: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:280: CHECK( config.cutoff == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:281: CHECK( config.shouldDebugBreak ) passed with expansion: true - TestMain.cpp:282: CHECK( config.allowThrows == false ) passed with expansion: @@ -3479,43 +3368,36 @@ TestMain.cpp:369: passed with expansion: "" == "" - TestMain.cpp:370: CHECK( oneTag.hasTag( "one" ) ) passed with expansion: true - TestMain.cpp:371: CHECK( oneTag.getTags().size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:373: CHECK( oneTag.matchesTags( p1 ) == true ) passed with expansion: true == true - TestMain.cpp:374: CHECK( oneTag.matchesTags( p2 ) == true ) passed with expansion: true == true - TestMain.cpp:375: CHECK( oneTag.matchesTags( p3 ) == false ) passed with expansion: false == false - TestMain.cpp:376: CHECK( oneTag.matchesTags( p4 ) == false ) passed with expansion: false == false - TestMain.cpp:377: CHECK( oneTag.matchesTags( p5 ) == false ) passed with expansion: @@ -3532,55 +3414,46 @@ TestMain.cpp:383: passed with expansion: "" == "" - TestMain.cpp:384: CHECK( twoTags.hasTag( "one" ) ) passed with expansion: true - TestMain.cpp:385: CHECK( twoTags.hasTag( "two" ) ) passed with expansion: true - TestMain.cpp:386: CHECK( twoTags.hasTag( "three" ) == false ) passed with expansion: false == false - TestMain.cpp:387: CHECK( twoTags.getTags().size() == 2 ) passed with expansion: 2 == 2 - TestMain.cpp:389: CHECK( twoTags.matchesTags( p1 ) == true ) passed with expansion: true == true - TestMain.cpp:390: CHECK( twoTags.matchesTags( p2 ) == true ) passed with expansion: true == true - TestMain.cpp:391: CHECK( twoTags.matchesTags( p3 ) == true ) passed with expansion: true == true - TestMain.cpp:392: CHECK( twoTags.matchesTags( p4 ) == true ) passed with expansion: true == true - TestMain.cpp:393: CHECK( twoTags.matchesTags( p5 ) == true ) passed with expansion: @@ -3597,19 +3470,16 @@ TestMain.cpp:399: passed with expansion: "1234" == "1234" - TestMain.cpp:400: CHECK( oneTagWithExtras.hasTag( "one" ) ) passed with expansion: true - TestMain.cpp:401: CHECK( oneTagWithExtras.hasTag( "two" ) == false ) passed with expansion: false == false - TestMain.cpp:402: CHECK( oneTagWithExtras.getTags().size() == 1 ) passed with expansion: @@ -3626,13 +3496,11 @@ TestMain.cpp:409: passed with expansion: "[one" == "[one" - TestMain.cpp:410: CHECK( oneTagOpen.hasTag( "one" ) == false ) passed with expansion: false == false - TestMain.cpp:411: CHECK( oneTagOpen.getTags().size() == 0 ) passed with expansion: @@ -3649,19 +3517,16 @@ TestMain.cpp:417: passed with expansion: "" == "" - TestMain.cpp:418: CHECK( oneTag.hasTag( "hide" ) ) passed with expansion: true - TestMain.cpp:419: CHECK( oneTag.isHidden() ) passed with expansion: true - TestMain.cpp:421: CHECK( oneTag.matchesTags( "~[hide]" ) == false ) passed with expansion: @@ -3787,7 +3652,6 @@ TrickyTests.cpp:259: passed with expansion: true == true - TrickyTests.cpp:260: REQUIRE( true == is_true::value ) passed with expansion: @@ -3804,7 +3668,6 @@ TrickyTests.cpp:264: passed with expansion: false == false - TrickyTests.cpp:265: REQUIRE( false == is_true::value ) passed with expansion: @@ -3843,7 +3706,6 @@ TrickyTests.cpp:280: passed with expansion: true - TrickyTests.cpp:281: REQUIRE_FALSE( !is_true::value ) passed with expansion: From 0a87795535f73d8a5c4ebbe1db220d7775245592 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 16 Jan 2013 09:39:08 +0000 Subject: [PATCH 115/296] Some test case header refactoring --- include/reporters/catch_reporter_console.hpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 48b843c2..17292c9e 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -244,9 +244,8 @@ namespace Catch { } void lazyPrintTestCaseInfo() { if( !currentSectionInfo ) { - stream << getDashes() << "\n" - << "Test case" << ": '" << unusedTestCaseInfo->name << "'\n"; - stream << getDashes() << "\n" << std::endl; + printTestCaseHeader(); + stream << std::endl; unusedTestCaseInfo.reset(); } } @@ -260,9 +259,7 @@ namespace Catch { // Sections if( !sections.empty() ) { - stream << getDashes() << "\n" - << "Test case" << ": '" << unusedTestCaseInfo->name << "'\n" - << getDashes() << "\n"; + printTestCaseHeader(); std::string firstInset; std::string inset; @@ -286,12 +283,16 @@ namespace Catch { unusedSectionInfo.reset(); } } - + + void printTestCaseHeader() { + printHeader( "Test case", unusedTestCaseInfo->name ); + } void printHeader( std::string const& _type, std::string const& _name ) { stream << getDashes() << "\n" << _type << ": '" << _name << "'\n" - << getDashes() << std::endl; + << getDashes() << "\n"; } + void printTotals( const Totals& totals ) { if( totals.assertions.total() == 0 ) { stream << "No tests ran"; From 2e7d966b762a1785e281cf8dc8fa39a04e31d38a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 16 Jan 2013 09:44:43 +0000 Subject: [PATCH 116/296] Generated build 13 --- README | 2 +- include/internal/catch_interfaces_reporter.h | 2 - include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 918 +++++++++++-------- 4 files changed, 528 insertions(+), 396 deletions(-) diff --git a/README b/README index 4c3c45a9..24d5c31f 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 12 (integration branch) +CATCH v0.9 build 13 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 420b2826..85b82d1f 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -257,7 +257,6 @@ namespace Catch Option unusedTestCaseInfo; Ptr unusedSectionInfo; Ptr currentSectionInfo; - bool currentSectionOpen; std::ostream& stream; }; @@ -341,7 +340,6 @@ namespace Catch // Option unusedTestCaseInfo; // Ptr unusedSectionInfo; // Ptr currentSectionInfo; -// bool currentSectionOpen; // Ptr testGroupNode; Option testGroupNode; std::ostream& stream; diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 88b27b30..247f5afd 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 12, "integration" ); + Version libraryVersion( 0, 9, 13, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index cd5bd053..51dff101 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 12 (integration branch) - * Generated: 2012-12-14 07:49:28.360647 + * CATCH v0.9 build 13 (integration branch) + * Generated: 2013-01-16 09:43:42.849422 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -137,9 +137,9 @@ namespace Catch { inline std::ostream& operator << ( std::ostream& os, const SourceLineInfo& info ) { #ifndef __GNUG__ - os << info.file << "(" << info.line << "): "; + os << info.file << "(" << info.line << ")"; #else - os << info.file << ":" << info.line << ": "; + os << info.file << ":" << info.line; #endif return os; } @@ -147,7 +147,7 @@ namespace Catch { CATCH_ATTRIBUTE_NORETURN inline void throwLogicError( const std::string& message, const SourceLineInfo& locationInfo ) { std::ostringstream oss; - oss << "Internal Catch error: '" << message << "' at: " << locationInfo; + oss << locationInfo << ": Internal Catch error: '" << message << "'"; throw std::logic_error( oss.str() ); } } @@ -1973,8 +1973,17 @@ namespace Catch std::string name; }; struct GroupInfo { - GroupInfo( std::string const& _name ) : name( _name ) {} + GroupInfo( std::string const& _name, + std::size_t _groupIndex, + std::size_t _groupsCount ) + : name( _name ), + groupIndex( _groupIndex ), + groupsCounts( _groupsCount ) + {} + std::string name; + std::size_t groupIndex; + std::size_t groupsCounts; }; struct SectionInfo { @@ -1994,17 +2003,15 @@ namespace Catch struct ThreadedSectionInfo : SectionInfo, SharedImpl<> { ThreadedSectionInfo( SectionInfo const& _sectionInfo, Ptr const& _parent = Ptr() ) : SectionInfo( _sectionInfo ), - parent( _parent ), - printed( false ) + parent( _parent ) {} virtual ~ThreadedSectionInfo(); std::vector > children; Ptr parent; - bool printed; }; - struct AssertionStats : SharedImpl<> { + struct AssertionStats { AssertionStats( AssertionResult const& _assertionResult, Totals const& _totals ) : assertionResult( _assertionResult ), @@ -2016,7 +2023,7 @@ namespace Catch Totals totals; }; - struct SectionStats : SharedImpl<> { + struct SectionStats { SectionStats( SectionInfo const& _sectionInfo, Counts const& _assertions, bool _missingAssertions ) @@ -2031,7 +2038,7 @@ namespace Catch bool missingAssertions; }; - struct TestCaseStats : SharedImpl<> { + struct TestCaseStats { TestCaseStats( TestCaseInfo const& _testInfo, Totals const& _totals, std::string const& _stdOut, @@ -2055,7 +2062,7 @@ namespace Catch bool aborting; }; - struct TestGroupStats : SharedImpl<> { + struct TestGroupStats { TestGroupStats( GroupInfo const& _groupInfo, Totals const& _totals, bool _aborting ) @@ -2063,6 +2070,10 @@ namespace Catch totals( _totals ), aborting( _aborting ) {} + TestGroupStats( GroupInfo const& _groupInfo ) + : groupInfo( _groupInfo ), + aborting( false ) + {} virtual ~TestGroupStats(); GroupInfo groupInfo; @@ -2070,7 +2081,7 @@ namespace Catch bool aborting; }; - struct TestRunStats : SharedImpl<> { + struct TestRunStats { TestRunStats( TestRunInfo const& _runInfo, Totals const& _totals, bool _aborting ) @@ -2078,6 +2089,11 @@ namespace Catch totals( _totals ), aborting( _aborting ) {} + TestRunStats( TestRunStats const& _other ) + : runInfo( _other.runInfo ), + totals( _other.totals ), + aborting( _other.aborting ) + {} virtual ~TestRunStats(); TestRunInfo runInfo; @@ -2089,7 +2105,7 @@ namespace Catch struct IStreamingReporter : IShared { virtual ~IStreamingReporter(); - // Implementing class must also provide the following static methid: + // Implementing class must also provide the following static method: // static std::string getDescription(); virtual ReporterPreferences getPreferences() const = 0; @@ -2102,25 +2118,21 @@ namespace Catch virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; - virtual void assertionEnded( Ptr const& assertionStats ) = 0; - virtual void sectionEnded( Ptr const& sectionStats ) = 0; - virtual void testCaseEnded( Ptr const& testCaseStats ) = 0; - virtual void testGroupEnded( Ptr const& testGroupStats ) = 0; - virtual void testRunEnded( Ptr const& testRunStats ) = 0; + virtual void assertionEnded( AssertionStats const& assertionStats ) = 0; + virtual void sectionEnded( SectionStats const& sectionStats ) = 0; + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; + virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; }; - // !TBD: Derived helper that implements the streaming interface but holds the stats - // - declares a new interface where methods are called at the end of each event - // - this would be used by the JUnit reporter, for example. - // - it may be used by the basic reporter, too, but that would clear down the stack - // as it goes - struct AccumulatingReporter : SharedImpl { - AccumulatingReporter( ReporterConfig const& _config ) + struct StreamingReporterBase : SharedImpl { + + StreamingReporterBase( ReporterConfig const& _config ) : m_config( _config ), stream( _config.stream() ) {} - virtual ~AccumulatingReporter(); + virtual ~StreamingReporterBase(); virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { testRunInfo = _testRunInfo; @@ -2145,17 +2157,22 @@ namespace Catch } } - virtual void sectionEnded( Ptr const& /* _sectionStats */ ) { + virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { currentSectionInfo = currentSectionInfo->parent; unusedSectionInfo = currentSectionInfo; } - virtual void testCaseEnded( Ptr const& /* _testCaseStats */ ) { + virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { unusedTestCaseInfo.reset(); } - virtual void testGroupEnded( Ptr const& /* _testGroupStats */ ) { + virtual void testGroupEnded( TestGroupStats const& /* _testGroupStats */ ) { unusedGroupInfo.reset(); } - virtual void testRunEnded( Ptr const& /* _testRunStats */ ) { + virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { + currentSectionInfo.reset(); + unusedSectionInfo.reset(); + unusedTestCaseInfo.reset(); + unusedGroupInfo.reset(); + testRunInfo.reset(); } ReporterConfig m_config; @@ -2164,7 +2181,89 @@ namespace Catch Option unusedTestCaseInfo; Ptr unusedSectionInfo; Ptr currentSectionInfo; - bool currentSectionOpen; + std::ostream& stream; + }; + + struct TestGroupNode : TestGroupStats { + TestGroupNode( TestGroupStats const& _stats ) : TestGroupStats( _stats ) {} +// TestGroupNode( GroupInfo const& _info ) : TestGroupStats( _stats ) {} + ~TestGroupNode(); + + }; + + struct TestRunNode : TestRunStats { + + TestRunNode( TestRunStats const& _stats ) : TestRunStats( _stats ) {} + ~TestRunNode(); + + std::vector groups; + }; + + // !TBD: Derived helper that implements the streaming interface but holds the stats + // - declares a new interface where methods are called at the end of each event + // - this would be used by the JUnit reporter, for example. + // - it may be used by the basic reporter, too, but that would clear down the stack + // as it goes + struct CumulativeReporterBase : SharedImpl { + + CumulativeReporterBase( ReporterConfig const& _config ) + : m_config( _config ), + stream( _config.stream() ) + {} + + virtual ~CumulativeReporterBase(); + + virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { +// testRunInfo = _testRunInfo; + } + virtual void testGroupStarting( GroupInfo const& _groupInfo ) { + testGroupNode = TestGroupNode( _groupInfo ); + } + + virtual void testCaseStarting( TestCaseInfo const& _testInfo ) { +// unusedTestCaseInfo = _testInfo; + } + virtual void sectionStarting( SectionInfo const& _sectionInfo ) { +// Ptr sectionInfo = new ThreadedSectionInfo( _sectionInfo ); +// unusedSectionInfo = sectionInfo; +// if( !currentSectionInfo ) { +// currentSectionInfo = sectionInfo; +// } +// else { +// currentSectionInfo->children.push_back( sectionInfo ); +// sectionInfo->parent = currentSectionInfo; +// currentSectionInfo = sectionInfo; +// } + } + + virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { +// currentSectionInfo = currentSectionInfo->parent; +// unusedSectionInfo = currentSectionInfo; + } + virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { +// unusedTestCaseInfo.reset(); + } + virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { +// testGroupNode-> // populate +// Ptr node ( new TestGroupNode( _testGroupStats ) ); +// unusedGroupInfo.reset(); + } + virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { +// currentSectionInfo.reset(); +// unusedSectionInfo.reset(); +// unusedTestCaseInfo.reset(); +// unusedGroupInfo.reset(); +// testRunInfo.reset(); + } + + ReporterConfig m_config; +// Option testRunInfo; +// Option unusedGroupInfo; +// Option unusedTestCaseInfo; +// Ptr unusedSectionInfo; +// Ptr currentSectionInfo; +// Ptr testGroupNode; + Option testGroupNode; std::ostream& stream; }; @@ -2219,30 +2318,30 @@ namespace Catch // Not on legacy interface } - virtual void assertionEnded( Ptr const& assertionStats ) { - m_legacyReporter->Result( assertionStats->assertionResult ); + virtual void assertionEnded( AssertionStats const& assertionStats ) { + m_legacyReporter->Result( assertionStats.assertionResult ); } - virtual void sectionEnded( Ptr const& sectionStats ) { - if( sectionStats->missingAssertions ) - m_legacyReporter->NoAssertionsInSection( sectionStats->sectionInfo.name ); - m_legacyReporter->EndSection( sectionStats->sectionInfo.name, sectionStats->assertions ); + virtual void sectionEnded( SectionStats const& sectionStats ) { + if( sectionStats.missingAssertions ) + m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); + m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); } - virtual void testCaseEnded( Ptr const& testCaseStats ) { - if( testCaseStats->missingAssertions ) - m_legacyReporter->NoAssertionsInTestCase( testCaseStats->testInfo.name ); + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { + if( testCaseStats.missingAssertions ) + m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name ); m_legacyReporter->EndTestCase - ( testCaseStats->testInfo, - testCaseStats->totals, - testCaseStats->stdOut, - testCaseStats->stdErr ); + ( testCaseStats.testInfo, + testCaseStats.totals, + testCaseStats.stdOut, + testCaseStats.stdErr ); } - virtual void testGroupEnded( Ptr const& testGroupStats ) { - if( testGroupStats->aborting ) + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { + if( testGroupStats.aborting ) m_legacyReporter->Aborted(); - m_legacyReporter->EndGroup( testGroupStats->groupInfo.name, testGroupStats->totals ); + m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals ); } - virtual void testRunEnded( Ptr const& testRunStats ) { - m_legacyReporter->EndTesting( testRunStats->totals ); + virtual void testRunEnded( TestRunStats const& testRunStats ) { + m_legacyReporter->EndTesting( testRunStats.totals ); } private: @@ -2545,7 +2644,7 @@ 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 ); + return m_from+static_cast( index ); } virtual std::size_t size() const { @@ -3634,12 +3733,12 @@ namespace Catch { virtual std::string optionDescription() const { return "A reporter is an object that formats and structures the output of running " - "tests, and potentially summarises the results. By default a basic reporter " - "is used that writes IDE friendly results. CATCH comes bundled with some " + "tests, and potentially summarises the results. By default the console reporter " + "is used which writes IDE friendly results. CATCH comes bundled with some " "alternative reporters, but more can be added in client code.\n" "\n" "The bundled reporters are:\n" - " -r basic\n" + " -r console\n" " -r xml\n" " -r junit\n" "\n" @@ -4249,34 +4348,34 @@ namespace Catch { } virtual ~Runner() { - m_reporter->testRunEnded( new TestRunStats( m_runInfo, m_totals, aborting() ) ); + m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) ); m_context.setRunner( m_prevRunner ); m_context.setConfig( NULL ); m_context.setResultCapture( m_prevResultCapture ); m_context.setConfig( m_prevConfig ); } - void testGroupStarting( std::string const& testSpec ) { - m_reporter->testGroupStarting( GroupInfo( testSpec ) ); + void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { + m_reporter->testGroupStarting( GroupInfo( testSpec, groupIndex, groupsCount ) ); } - void testGroupEnded( std::string const& testSpec, Totals const& totals ) { - m_reporter->testGroupEnded( new TestGroupStats( GroupInfo( testSpec ), totals, aborting() ) ); + void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount ) { + m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, aborting() ) ); } - Totals runMatching( const std::string& testSpec ) { + Totals runMatching( const std::string& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { std::vector matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ); Totals totals; - testGroupStarting( testSpec ); + testGroupStarting( testSpec, groupIndex, groupsCount ); std::vector::const_iterator it = matchingTests.begin(); std::vector::const_iterator itEnd = matchingTests.end(); for(; it != itEnd; ++it ) totals += runTest( *it ); - testGroupEnded( testSpec, totals ); + testGroupEnded( testSpec, totals, groupIndex, groupsCount ); return totals; } @@ -4311,12 +4410,12 @@ namespace Catch { m_totals.testCases += deltaTotals.testCases; - m_reporter->testCaseEnded( new TestCaseStats( testInfo, - deltaTotals, - redirectedCout, - redirectedCerr, - missingAssertions, - aborting() ) ); + m_reporter->testCaseEnded( TestCaseStats( testInfo, + deltaTotals, + redirectedCout, + redirectedCerr, + missingAssertions, + aborting() ) ); delete m_runningTest; m_runningTest = NULL; @@ -4346,13 +4445,13 @@ namespace Catch { std::vector::const_iterator it = m_scopedInfos.begin(); std::vector::const_iterator itEnd = m_scopedInfos.end(); for(; it != itEnd; ++it ) - m_reporter->assertionEnded( new AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); + m_reporter->assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); } { std::vector::const_iterator it = m_assertionResults.begin(); std::vector::const_iterator itEnd = m_assertionResults.end(); for(; it != itEnd; ++it ) - m_reporter->assertionEnded( new AssertionStats( *it, m_totals ) ); + m_reporter->assertionEnded( AssertionStats( *it, m_totals ) ); } m_assertionResults.clear(); } @@ -4363,7 +4462,7 @@ namespace Catch { m_totals.assertions.info++; } else - m_reporter->assertionEnded( new AssertionStats( result, m_totals ) ); + m_reporter->assertionEnded( AssertionStats( result, m_totals ) ); // Reset AssertionInfo m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); @@ -4402,7 +4501,7 @@ namespace Catch { } m_runningTest->endSection( info.name ); - m_reporter->sectionEnded( new SectionStats( info, assertions, missingAssertions ) ); + m_reporter->sectionEnded( SectionStats( info, assertions, missingAssertions ) ); } virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { @@ -4522,6 +4621,18 @@ namespace Catch { extern Version libraryVersion; } +// #included from: internal/catch_line_wrap.h +#define TWOBLUECUBES_CATCH_LINE_WRAP_H_INCLUDED + +#include + +namespace Catch { + + void wrapLongStrings( std::ostream& stream, const std::string& str, std::size_t columns, std::size_t indent = 0 ); + std::string wrapLongStrings( const std::string& str, std::size_t columns, std::size_t indent = 0 ); + +} // end namespace Catch + #include #include #include @@ -4550,13 +4661,10 @@ namespace Catch { Runner context( m_configWrapper, m_reporter ); // This Runner will be renamed Context Totals totals; - std::vector::const_iterator it = filterGroups.begin(); - std::vector::const_iterator itEnd = filterGroups.end(); - - for(; it != itEnd && !context.aborting(); ++it ) { - context.testGroupStarting( it->getName() ); - totals += runTestsForGroup( context, *it ); - context.testGroupEnded( it->getName(), totals ); + for( std::size_t i=0; i < filterGroups.size() && !context.aborting(); ++i ) { + context.testGroupStarting( filterGroups[i].getName(), i, filterGroups.size() ); + totals += runTestsForGroup( context, filterGroups[i] ); + context.testGroupEnded( filterGroups[i].getName(), totals, i, filterGroups.size() ); } return totals; } @@ -4661,50 +4769,6 @@ namespace Catch { os << "\nFor more detail usage please see: https://github.com/philsquared/Catch/wiki/Command-line\n" << std::endl; } - inline void addIndent( std::ostream& os, std::size_t indent ) { - while( indent-- > 0 ) - os << ' '; - } - - inline void recursivelyWrapLine( std::ostream& os, std::string paragraph, std::size_t columns, std::size_t indent ) { - std::size_t width = columns-indent; - std::size_t tab = 0; - std::size_t wrapPoint = width; - for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) { - if( pos == width ) { - addIndent( os, indent ); - os << paragraph.substr( 0, wrapPoint ) << "\n"; - return recursivelyWrapLine( os, paragraph.substr( wrapPoint+1 ), columns, indent+tab ); - } - if( paragraph[pos] == '\t' ) { - tab = pos; - paragraph = paragraph.substr( 0, tab ) + paragraph.substr( tab+1 ); - pos--; - } - else if( paragraph[pos] == ' ' ) { - wrapPoint = pos; - } - } - addIndent( os, indent ); - os << paragraph << "\n"; - } - - inline std::string addLineBreaks( const std::string& str, std::size_t columns, std::size_t indent = 0 ) { - std::ostringstream oss; - std::string::size_type pos = 0; - std::string::size_type newline = str.find_first_of( '\n' ); - while( newline != std::string::npos ) { - std::string paragraph = str.substr( pos, newline-pos ); - recursivelyWrapLine( oss, paragraph, columns, indent ); - pos = newline+1; - newline = str.find_first_of( '\n', pos ); - } - if( pos != str.size() ) - recursivelyWrapLine( oss, str.substr( pos, str.size()-pos ), columns, indent ); - - return oss.str(); - } - inline void showHelp( const CommandParser& parser ) { AllOptions options; Options::HelpOptionParser helpOpt; @@ -4715,13 +4779,12 @@ namespace Catch { displayedSpecificOption = true; std::cout << "\n" << opt.optionNames() << " " << opt.argsSynopsis() << "\n\n" << opt.optionSummary() << "\n\n" - - << addLineBreaks( opt.optionDescription(), 80, 2 ) << "\n" << std::endl; + << wrapLongStrings( opt.optionDescription(), 80, 2 ) << "\n" << std::endl; } } if( !displayedSpecificOption ) { - std::cout << "\nCATCH v" << libraryVersion.majorVersion << "." + std::cout << "\nCATCH v" << libraryVersion.majorVersion << "." << libraryVersion.minorVersion << " build " << libraryVersion.buildNumber; if( libraryVersion.branchName != "master" ) @@ -5081,7 +5144,7 @@ namespace Catch { NotImplementedException::NotImplementedException( const SourceLineInfo& lineInfo ) : m_lineInfo( lineInfo ) { std::ostringstream oss; - oss << lineInfo << "function "; + oss << lineInfo << ": function "; oss << "not implemented"; m_what = oss.str(); } @@ -5714,9 +5777,66 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 12, "integration" ); + Version libraryVersion( 0, 9, 13, "integration" ); } +// #included from: catch_line_wrap.hpp +#define TWOBLUECUBES_CATCH_LINE_WRAP_HPP_INCLUDED + +namespace Catch { + + namespace { + inline void addIndent( std::ostream& os, std::size_t indent ) { + while( indent-- > 0 ) + os << ' '; + } + + inline void recursivelyWrapLine( std::ostream& os, std::string paragraph, std::size_t columns, std::size_t indent ) { + std::size_t width = columns-indent; + std::size_t tab = 0; + std::size_t wrapPoint = width; + for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) { + if( pos == width ) { + addIndent( os, indent ); + os << paragraph.substr( 0, wrapPoint ) << "\n"; + return recursivelyWrapLine( os, paragraph.substr( wrapPoint+1 ), columns, indent+tab ); + } + if( paragraph[pos] == '\t' ) { + tab = pos; + paragraph = paragraph.substr( 0, tab ) + paragraph.substr( tab+1 ); + pos--; + } + else if( paragraph[pos] == ' ' ) { + wrapPoint = pos; + } + } + addIndent( os, indent ); + os << paragraph; + } + } + + void wrapLongStrings( std::ostream& stream, const std::string& str, std::size_t columns, std::size_t indent ) { + std::string::size_type pos = 0; + std::string::size_type newline = str.find_first_of( '\n' ); + while( newline != std::string::npos ) { + std::string paragraph = str.substr( pos, newline-pos ); + recursivelyWrapLine( stream, paragraph, columns, indent ); + stream << "\n"; + pos = newline+1; + newline = str.find_first_of( '\n', pos ); + } + if( pos != str.size() ) + recursivelyWrapLine( stream, str.substr( pos, str.size()-pos ), columns, indent ); + } + + std::string wrapLongStrings( const std::string& str, std::size_t columns, std::size_t indent ) { + std::ostringstream oss; + wrapLongStrings( oss, str, columns, indent ); + return oss.str(); + } + +} // end namespace Catch + // #included from: ../reporters/catch_reporter_basic.hpp #define TWOBLUECUBES_CATCH_REPORTER_BASIC_HPP_INCLUDED @@ -5938,7 +6058,7 @@ namespace Catch { if( !assertionResult.getSourceInfo().empty() ) { TextColour colour( TextColour::FileName ); - m_config.stream() << assertionResult.getSourceInfo(); + m_config.stream() << assertionResult.getSourceInfo() << ": "; } if( assertionResult.hasExpression() ) { @@ -6696,9 +6816,9 @@ namespace Catch { namespace Catch { - struct ConsoleReporter : AccumulatingReporter { + struct ConsoleReporter : StreamingReporterBase { ConsoleReporter( ReporterConfig const& _config ) - : AccumulatingReporter( _config ), + : StreamingReporterBase( _config ), m_atLeastOneTestCasePrinted( false ) {} @@ -6712,74 +6832,12 @@ namespace Catch { return prefs; } - void lazyPrintRunInfo() { - printHeader( "Started testing", testRunInfo->name ); - testRunInfo.reset(); - } - void lazyPrintGroupInfo() { - if( !unusedGroupInfo->name.empty() ) - printHeader( "Group", unusedGroupInfo->name ); - unusedGroupInfo.reset(); - } - void lazyPrintTestCaseInfo() { - printHeader( "Test case", unusedTestCaseInfo->name ); - unusedTestCaseInfo.reset(); - } - void lazyPrintSectionInfo() { - std::vector sections; - for( ThreadedSectionInfo* section = unusedSectionInfo.get(); - section && !section->printed; - section = section->parent.get() ) - sections.push_back( section ); - - typedef std::vector::const_reverse_iterator It; - for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { - printHeader( "Section", (*it)->name ); - (*it)->printed = true; - } - unusedSectionInfo.reset(); - } - - static std::string const& getDashes() { - static const std::string dashes = "----------------------------------------------------------------"; - return dashes; - } - static std::string const& getDoubleDashes() { - static const std::string doubleDashes = "================================================================"; - return doubleDashes; - } - static std::string const& getSpaces() { - static const std::string spaces = " "; - return spaces; - } - static std::string getSpaces( int spaces ) { - return getSpaces().substr( 0, spaces > 0 ? static_cast( spaces ) : 0 ); - } - - void printHeader( std::string const& _type, std::string const& _name ) { - std::size_t labelLen = _type.size() + _name.size() + 8; - std::size_t dashLen = getDashes().size(); - stream << "-- " << _type << ": '" << _name << "' " - << getDashes().substr( 0, labelLen < dashLen ? dashLen - labelLen : 0 ) - << std::endl; - } - - void lazyPrint() { - if( testRunInfo ) - lazyPrintRunInfo(); - if( unusedGroupInfo ) - lazyPrintGroupInfo(); - if( unusedTestCaseInfo ) - lazyPrintTestCaseInfo(); - if( currentSectionInfo && !currentSectionInfo->printed ) - lazyPrintSectionInfo(); - } virtual void assertionStarting( AssertionInfo const& ) { } - virtual void assertionEnded( Ptr const& _assertionStats ) { - AssertionResult const& result = _assertionStats->assertionResult; + virtual void assertionEnded( AssertionStats const& _assertionStats ) { + AssertionResult const& result = _assertionStats.assertionResult; // Drop out if result was successful and we're not printing those if( !m_config.includeSuccessfulResults() && result.isOk() ) @@ -6787,111 +6845,277 @@ namespace Catch { lazyPrint(); - int inset = printLineInfo( result.getSourceInfo() ); - - if( result.hasExpression() ) { - TextColour colour( TextColour::OriginalExpression ); - stream << result.getExpression() << "\n"; - if( result.succeeded() ) { - TextColour successColour( TextColour::Success ); - stream << "succeeded"; - } - else { - TextColour errorColour( TextColour::Error ); - stream << "failed"; - if( result.isOk() ) { - TextColour okAnywayColour( TextColour::Success ); - stream << " - but was ok"; - } - } + { + TextColour colour( TextColour::FileName ); + stream << result.getSourceInfo() << ":\n"; } - switch( result.getResultType() ) { - case ResultWas::ThrewException: - { - TextColour colour( TextColour::Error ); - if( result.hasExpression() ) - stream << " with unexpected"; - else - stream << "Unexpected"; - stream << " exception with message: '" << result.getMessage() << "'"; - } - break; - case ResultWas::DidntThrowException: - { - TextColour colour( TextColour::Error ); - if( result.hasExpression() ) - stream << " because no exception was thrown where one was expected"; - else - stream << "No exception thrown where one was expected"; - } - break; - case ResultWas::Info: - { - TextColour colour( TextColour::ReconstructedExpression ); - streamVariableLengthText( "info", result.getMessage() ); - } - break; - case ResultWas::Warning: - { - TextColour colour( TextColour::ReconstructedExpression ); - streamVariableLengthText( "warning", result.getMessage() ); - } - break; - case ResultWas::ExplicitFailure: - { - TextColour colour( TextColour::Error ); - stream << "failed with message: '" << result.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( !result.hasExpression() ) { - if( result.succeeded() ) { - TextColour colour( TextColour::Success ); - stream << " succeeded"; + ResultComponents components( result ); + bool endsWithNewLine = false; + if( _assertionStats.totals.assertions.total() > 0 ) { + printOriginalExpression( result ); + printResultType( components ); + endsWithNewLine = printReconstructedExpression( result ); + } + endsWithNewLine |= printMessage( components ); + if( !endsWithNewLine ) + stream << "\n"; + stream << std::endl; + } + + struct ResultComponents { + ResultComponents( AssertionResult const& _result ) + : colour( TextColour::None ), + message( _result.getMessage() ) + { + switch( _result.getResultType() ) { + case ResultWas::Ok: + colour = TextColour::Success; + passOrFail = "passed"; + if( _result.hasMessage() ) + messageLabel = "with message"; + break; + case ResultWas::ExpressionFailed: + if( _result.isOk() ) { + colour = TextColour::Success; + passOrFail = "failed - but was ok"; } else { - TextColour colour( TextColour::Error ); - stream << " failed"; - if( result.isOk() ) { - TextColour okAnywayColour( TextColour::Success ); - stream << " - but was ok"; - } + colour = TextColour::Error; + passOrFail = "failed"; } - } - if( result.hasMessage() ) { - stream << "\n"; - TextColour colour( TextColour::ReconstructedExpression ); - streamVariableLengthText( "with message", result.getMessage() ); - } - break; + if( _result.hasMessage() ){ + messageLabel = "with message"; + } + break; + case ResultWas::ThrewException: + colour = TextColour::Error; + passOrFail = "failed"; + messageLabel = "due to unexpected exception with message"; + break; + case ResultWas::DidntThrowException: + colour = TextColour::Error; + passOrFail = "failed"; + messageLabel = "because no exception was thrown where one was expected"; + break; + case ResultWas::Info: + messageLabel = "info"; + break; + case ResultWas::Warning: + messageLabel = "warning"; + break; + case ResultWas::ExplicitFailure: + passOrFail = "failed"; + colour = TextColour::Error; + messageLabel = "explicitly with message"; + break; + case ResultWas::Exception: + passOrFail = "failed"; + colour = TextColour::Error; + if( _result.hasMessage() ) + messageLabel = "with message"; + break; + + // These cases are here to prevent compiler warnings + case ResultWas::Unknown: + case ResultWas::FailureBit: + passOrFail = "** internal error **"; + colour = TextColour::Error; + break; + } } - if( result.hasExpandedExpression() ) { - stream << "\nfor: "; + TextColour::Colours colour; + std::string passOrFail; + std::string messageLabel; + std::string message; + }; + + void printResultType( ResultComponents const& _components ) { + if( !_components.passOrFail.empty() ) { + TextColour colour( _components.colour ); + stream << _components.passOrFail << " "; + } + } + bool printOriginalExpression( AssertionResult const& _result ) { + if( _result.hasExpression() ) { + TextColour colour( TextColour::OriginalExpression ); + stream << " "; + if( !_result.getTestMacroName().empty() ) + stream << _result.getTestMacroName() << "( "; + stream << _result.getExpression(); + if( !_result.getTestMacroName().empty() ) + stream << " )"; + stream << "\n"; + return true; + } + return false; + } + bool printReconstructedExpression( AssertionResult const& _result ) { + if( _result.hasExpandedExpression() ) { + stream << "with expansion:\n"; TextColour colour( TextColour::ReconstructedExpression ); - stream << getSpaces( inset-5 ) << result.getExpandedExpression(); + stream << wrapLongStrings( _result.getExpandedExpression() ) << "\n"; + return true; } - - stream << "\n" << std::endl; + return false; + } + bool printMessage( ResultComponents const& _components ) { + bool endsWithNewLine = false; + if( !_components.messageLabel.empty() ) { + stream << _components.messageLabel << ":" << "\n"; + endsWithNewLine = true; + } + if( !_components.message.empty() ) { + stream << wrapLongStrings( _components.message ) << "\n"; + endsWithNewLine = true; + } + return endsWithNewLine; } - void streamVariableLengthText( std::string const& prefix, std::string const& text ) { - std::string trimmed = trim( text ); - if( trimmed.find_first_of( "\r\n" ) == std::string::npos ) { - stream << "[" << prefix << ": " << trimmed << "]"; + virtual void sectionEnded( SectionStats const& _sectionStats ) { + if( _sectionStats.missingAssertions ) { + lazyPrint(); + TextColour colour( TextColour::ResultError ); + stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; + } + StreamingReporterBase::sectionEnded( _sectionStats ); + } + + virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) { + + if( _testCaseStats.missingAssertions ) { + lazyPrint(); + TextColour colour( TextColour::ResultError ); + stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl; + } + StreamingReporterBase::testCaseEnded( _testCaseStats ); + } + virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { + if( !unusedGroupInfo ) { + printSummaryDivider(); + stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n"; + printTotals( _testGroupStats.totals ); + stream << "\n" << std::endl; + } + StreamingReporterBase::testGroupEnded( _testGroupStats ); + } + virtual void testRunEnded( TestRunStats const& _testRunStats ) { + if( m_atLeastOneTestCasePrinted ) + printTotalsDivider(); + printTotals( _testRunStats.totals ); + stream << "\n" << std::endl; + StreamingReporterBase::testRunEnded( _testRunStats ); + } + + private: + std::string wrapLongStrings( std::string const& _string ) { + return Catch::wrapLongStrings( _string, 70, 2 ); + } + + void lazyPrint() { + + if( testRunInfo ) + lazyPrintRunInfo(); + if( unusedGroupInfo ) + lazyPrintGroupInfo(); + if( unusedTestCaseInfo ) + lazyPrintTestCaseInfo(); + if( unusedSectionInfo) + lazyPrintSectionInfo(); + + m_atLeastOneTestCasePrinted = true; + } + void lazyPrintRunInfo() { + stream << "\n" << testRunInfo->name + << " is a CATCH v" << libraryVersion.majorVersion << "." + << libraryVersion.minorVersion << " b" + << libraryVersion.buildNumber; + if( libraryVersion.branchName != "master" ) + stream << " (" << libraryVersion.branchName << ")"; + stream << " host application.\n" + << "Run with -? for options\n\n"; + + testRunInfo.reset(); + } + void lazyPrintGroupInfo() { + if( !unusedGroupInfo->name.empty() && unusedGroupInfo->groupsCounts > 1 ) { + printHeader( "Group", unusedGroupInfo->name ); + unusedGroupInfo.reset(); + } + } + void lazyPrintTestCaseInfo() { + if( !currentSectionInfo ) { + printTestCaseHeader(); + stream << std::endl; + unusedTestCaseInfo.reset(); + } + } + void lazyPrintSectionInfo() { + + std::vector sections; + for( ThreadedSectionInfo* section = unusedSectionInfo.get(); + section; + section = section->parent.get() ) + sections.push_back( section ); + + // Sections + if( !sections.empty() ) { + printTestCaseHeader(); + + std::string firstInset; + std::string inset; + if( sections.size() > 1 ) { + firstInset = "Sections: "; + inset = " "; + } + else { + firstInset = "Section: "; + inset = " "; + } + typedef std::vector::const_reverse_iterator It; + for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { + if( it == sections.rbegin() ) + stream << firstInset; + else + stream << inset; + stream << (*it)->name << "\n"; + } + stream << getDashes() << "\n" << std::endl; + unusedSectionInfo.reset(); + } + } + + void printTestCaseHeader() { + printHeader( "Test case", unusedTestCaseInfo->name ); + } + void printHeader( std::string const& _type, std::string const& _name ) { + stream << getDashes() << "\n" + << _type << ": '" << _name << "'\n" + << getDashes() << "\n"; + } + + void printTotals( const Totals& totals ) { + if( totals.assertions.total() == 0 ) { + stream << "No tests ran"; + } + else if( totals.assertions.failed ) { + TextColour colour( TextColour::ResultError ); + printCounts( "test case", totals.testCases ); + if( totals.testCases.failed > 0 ) { + stream << " ("; + printCounts( "assertion", totals.assertions ); + stream << ")"; + } } else { - stream << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed - << "\n[end of " << prefix << "] <<<<<<<<<<<<<<<<<<<<<<<<\n"; + TextColour colour( TextColour::ResultSuccess ); + stream << "All tests passed (" + << pluralise( totals.assertions.passed, "assertion" ) << " in " + << pluralise( totals.testCases.passed, "test case" ) << ")"; } } - - void printAssertionCounts( std::string const& label, Counts const& counts ) { + void printCounts( std::string const& label, Counts const& counts ) { if( counts.total() == 1 ) { stream << "1 " << label << " - "; if( counts.failed ) @@ -6918,118 +7142,25 @@ namespace Catch { } } - void printTotals( const Totals& totals ) { - if( totals.assertions.total() == 0 ) { - stream << "No tests ran"; - } - else if( totals.assertions.failed ) { - TextColour colour( TextColour::ResultError ); - printAssertionCounts( "test case", totals.testCases ); - if( totals.testCases.failed > 0 ) { - stream << " ("; - printAssertionCounts( "assertion", totals.assertions ); - stream << ")"; - } - } - else { - TextColour colour( TextColour::ResultSuccess ); - stream << "All tests passed (" - << pluralise( totals.assertions.passed, "assertion" ) << " in " - << pluralise( totals.testCases.passed, "test case" ) << ")"; - } + void printTotalsDivider() { + stream << getDoubleDashes() << "\n"; } - - virtual void sectionEnded( Ptr const& _sectionStats ) { - resetLastPrintedLine(); - if( _sectionStats->missingAssertions ) { - lazyPrint(); - TextColour colour( TextColour::ResultError ); - stream << "\nNo assertions in section, '" << _sectionStats->sectionInfo.name << "'\n" << std::endl; - } - if( currentSectionInfo && currentSectionInfo->printed ) { - printSummarDivider(); - stream << "Summary for section '" << _sectionStats->sectionInfo.name << "':\n"; - Counts const& assertions = _sectionStats->assertions; - if( assertions.failed ) { - TextColour colour( TextColour::ResultError ); - printAssertionCounts( "assertion", assertions ); - } - else { - TextColour colour( TextColour::ResultSuccess ); - stream << ( assertions.passed > 1 ? "All " : "" ) - << pluralise( assertions.passed, "assertion" ) << " passed" ; - } - stream << "\n" << std::endl; - } - AccumulatingReporter::sectionEnded( _sectionStats ); + void printSummaryDivider() { + stream << getDashes() << "\n"; } - virtual void testCaseEnded( Ptr const& _testCaseStats ) { - resetLastPrintedLine(); - if( _testCaseStats->missingAssertions ) { - lazyPrint(); - TextColour colour( TextColour::ResultError ); - stream << "\nNo assertions in test case, '" << _testCaseStats->testInfo.name << "'\n" << std::endl; - } - if( !unusedTestCaseInfo ) { - m_atLeastOneTestCasePrinted = true; - printSummarDivider(); - stream << "Summary for test case '" << _testCaseStats->testInfo.name << "':\n"; - printTotals( _testCaseStats->totals ); - stream << "\n" << std::endl; - } - AccumulatingReporter::testCaseEnded( _testCaseStats ); + static std::string const& getDashes() { + static const std::string dashes + = "----------------------------------------------------------------"; + return dashes; } - virtual void testGroupEnded( Ptr const& _testGroupStats ) { - if( !unusedGroupInfo ) { - printSummarDivider(); - stream << "Summary for group '" << _testGroupStats->groupInfo.name << "':\n"; - printTotals( _testGroupStats->totals ); - stream << "\n" << std::endl; - } - AccumulatingReporter::testGroupEnded( _testGroupStats ); - } - virtual void testRunEnded( Ptr const& _testRunStats ) { - if( m_atLeastOneTestCasePrinted ) - printTotalsDivider(); - stream << "Summary for all tests in '" << _testRunStats->runInfo.name << "':\n"; - printTotals( _testRunStats->totals ); - stream << "\n" << std::endl; - AccumulatingReporter::testRunEnded( _testRunStats ); + static std::string const& getDoubleDashes() { + static const std::string doubleDashes + = "================================================================"; + return doubleDashes; } private: - void printTotalsDivider() { - stream << "================================================================\n"; - } - void printSummarDivider() { - stream << "----------------------------------------------------------------\n"; - } - static int countDigits( std::size_t number ) { - int digits = 1; - for( ; number != 0; digits++, number /= 10 ); - return digits; - } - - // Returns number of characters printed - int printLineInfo( SourceLineInfo const& lineInfo ) { - if( lineInfo.empty() ) - return 0; - if( m_lastPrintedLine.empty() || - m_lastPrintedLine.file != lineInfo.file || - abs( static_cast( m_lastPrintedLine.line ) - static_cast( lineInfo.line ) ) > 20 ) { - TextColour colour( TextColour::FileName ); - stream << lineInfo << "\n"; - } - TextColour colour( TextColour::FileName ); - stream << "[" << lineInfo.line << "] "; - m_lastPrintedLine = lineInfo; - return 3 + countDigits( lineInfo.line ); - } - void resetLastPrintedLine() { - m_lastPrintedLine = SourceLineInfo(); - } bool m_atLeastOneTestCasePrinted; - SourceLineInfo m_lastPrintedLine; }; @@ -7060,9 +7191,12 @@ namespace Catch { TestGroupStats::~TestGroupStats() {} TestRunStats::~TestRunStats() {} ThreadedSectionInfo::~ThreadedSectionInfo() {} + TestGroupNode::~TestGroupNode() {} + TestRunNode::~TestRunNode() {} BasicReporter::~BasicReporter() {} - AccumulatingReporter::~AccumulatingReporter() {} + StreamingReporterBase::~StreamingReporterBase() {} + CumulativeReporterBase::~CumulativeReporterBase() {} ConsoleReporter::~ConsoleReporter() {} IRunner::~IRunner() {} IMutableContext::~IMutableContext() {} From 10e891767febca73f6721010d2b8d86f51039a22 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 17 Jan 2013 11:47:23 +0000 Subject: [PATCH 117/296] Dropped "Test case" and "Section" prefixes in test report headers --- include/reporters/catch_reporter_console.hpp | 39 +- .../SelfTest/Baselines/approvedResults.txt | 1192 ++++++++--------- .../CatchSelfTest/CatchSelfTest/BDDTests.cpp | 6 +- 3 files changed, 581 insertions(+), 656 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 17292c9e..ac7030b9 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -238,13 +238,13 @@ namespace Catch { } void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() && unusedGroupInfo->groupsCounts > 1 ) { - printHeader( "Group", unusedGroupInfo->name ); + printHeader( "Group: " + unusedGroupInfo->name ); unusedGroupInfo.reset(); } } void lazyPrintTestCaseInfo() { if( !currentSectionInfo ) { - printTestCaseHeader(); + printHeader( unusedTestCaseInfo->name ); stream << std::endl; unusedTestCaseInfo.reset(); } @@ -259,38 +259,21 @@ namespace Catch { // Sections if( !sections.empty() ) { - printTestCaseHeader(); + printHeader( unusedTestCaseInfo->name, false ); - std::string firstInset; - std::string inset; - if( sections.size() > 1 ) { - firstInset = "Sections: "; - inset = " "; - } - else { - firstInset = "Section: "; - inset = " "; - } typedef std::vector::const_reverse_iterator It; - for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { - if( it == sections.rbegin() ) - stream << firstInset; - else - stream << inset; - stream << (*it)->name << "\n"; - } + for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) + stream << " " << (*it)->name << "\n"; stream << getDashes() << "\n" << std::endl; unusedSectionInfo.reset(); } } - void printTestCaseHeader() { - printHeader( "Test case", unusedTestCaseInfo->name ); - } - void printHeader( std::string const& _type, std::string const& _name ) { + void printHeader( std::string const& _name, bool closed = true ) { stream << getDashes() << "\n" - << _type << ": '" << _name << "'\n" - << getDashes() << "\n"; + << _name << "\n"; + if( closed ) + stream << getDashes() << "\n"; } void printTotals( const Totals& totals ) { @@ -348,12 +331,12 @@ namespace Catch { } static std::string const& getDashes() { static const std::string dashes - = "----------------------------------------------------------------"; + = "-----------------------------------------------------------------"; return dashes; } static std::string const& getDoubleDashes() { static const std::string doubleDashes - = "================================================================"; + = "================================================================="; return doubleDashes; } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index ec744ad7..02b36ade 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,10 +1,10 @@ -CatchSelfTest is a CATCH v0.9 b12 (integration) host application. +CatchSelfTest is a CATCH v0.9 b13 (integration) host application. Run with -? for options ----------------------------------------------------------------- -Test case: './succeeding/Approx/simple' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/simple +----------------------------------------------------------------- ApproxTests.cpp:20: REQUIRE( d == Approx( 1.23 ) ) @@ -36,9 +36,9 @@ ApproxTests.cpp:26: passed with expansion: Approx( 1.23 ) != 1.24 ----------------------------------------------------------------- -Test case: './succeeding/Approx/epsilon' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/epsilon +----------------------------------------------------------------- ApproxTests.cpp:38: REQUIRE( d != Approx( 1.231 ) ) @@ -50,9 +50,9 @@ ApproxTests.cpp:39: passed with expansion: 1.23 == Approx( 1.231 ) ----------------------------------------------------------------- -Test case: './succeeding/Approx/float' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/float +----------------------------------------------------------------- ApproxTests.cpp:49: REQUIRE( 1.23f == Approx( 1.23f ) ) @@ -64,9 +64,9 @@ ApproxTests.cpp:50: passed with expansion: 0 == Approx( 0 ) ----------------------------------------------------------------- -Test case: './succeeding/Approx/int' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/int +----------------------------------------------------------------- ApproxTests.cpp:60: REQUIRE( 1 == Approx( 1 ) ) @@ -76,9 +76,9 @@ ApproxTests.cpp:61: REQUIRE( 0 == Approx( 0 ) ) passed ----------------------------------------------------------------- -Test case: './succeeding/Approx/mixed' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/mixed +----------------------------------------------------------------- ApproxTests.cpp:75: REQUIRE( 1.0f == Approx( 1 ) ) @@ -105,9 +105,9 @@ ApproxTests.cpp:79: passed with expansion: 1.234 == Approx( 1.234 ) ----------------------------------------------------------------- -Test case: './succeeding/Approx/custom' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/custom +----------------------------------------------------------------- ApproxTests.cpp:93: REQUIRE( d == approx( 1.23 ) ) @@ -149,45 +149,45 @@ ApproxTests.cpp:101: passed with expansion: Approx( 1.23 ) != 1.25 ----------------------------------------------------------------- -Test case: './succeeding/TestClass/succeedingCase' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/TestClass/succeedingCase +----------------------------------------------------------------- ClassTests.cpp:24: REQUIRE( s == "hello" ) passed with expansion: "hello" == "hello" ----------------------------------------------------------------- -Test case: './failing/TestClass/failingCase' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/TestClass/failingCase +----------------------------------------------------------------- ClassTests.cpp:28: REQUIRE( s == "world" ) failed with expansion: "hello" == "world" ----------------------------------------------------------------- -Test case: './succeeding/Fixture/succeedingCase' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Fixture/succeedingCase +----------------------------------------------------------------- ClassTests.cpp:47: REQUIRE( m_a == 1 ) passed with expansion: 1 == 1 ----------------------------------------------------------------- -Test case: './failing/Fixture/failingCase' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/Fixture/failingCase +----------------------------------------------------------------- ClassTests.cpp:55: REQUIRE( m_a == 2 ) failed with expansion: 1 == 2 ----------------------------------------------------------------- -Test case: './succeeding/conditions/equality' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions/equality +----------------------------------------------------------------- ConditionTests.cpp:55: REQUIRE( data.int_seven == 7 ) @@ -224,9 +224,9 @@ ConditionTests.cpp:63: passed with expansion: 1.3 == Approx( 1.3 ) ----------------------------------------------------------------- -Test case: './failing/conditions/equality' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/conditions/equality +----------------------------------------------------------------- ConditionTests.cpp:71: CHECK( data.int_seven == 6 ) @@ -293,9 +293,9 @@ ConditionTests.cpp:85: failed with expansion: 1.3 == Approx( 1.301 ) ----------------------------------------------------------------- -Test case: './succeeding/conditions/inequality' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions/inequality +----------------------------------------------------------------- ConditionTests.cpp:93: REQUIRE( data.int_seven != 6 ) @@ -352,9 +352,9 @@ ConditionTests.cpp:103: passed with expansion: 5 != 6 ----------------------------------------------------------------- -Test case: './failing/conditions/inequality' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/conditions/inequality +----------------------------------------------------------------- ConditionTests.cpp:111: CHECK( data.int_seven != 7 ) @@ -381,9 +381,9 @@ ConditionTests.cpp:115: failed with expansion: 5 != 5 ----------------------------------------------------------------- -Test case: './succeeding/conditions/ordered' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions/ordered +----------------------------------------------------------------- ConditionTests.cpp:124: REQUIRE( data.int_seven < 8 ) @@ -470,9 +470,9 @@ ConditionTests.cpp:144: passed with expansion: "hello" > "a" ----------------------------------------------------------------- -Test case: './failing/conditions/ordered' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/conditions/ordered +----------------------------------------------------------------- ConditionTests.cpp:152: CHECK( data.int_seven > 7 ) @@ -569,9 +569,9 @@ ConditionTests.cpp:174: failed with expansion: "hello" <= "a" ----------------------------------------------------------------- -Test case: './succeeding/conditions/int literals' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions/int literals +----------------------------------------------------------------- ConditionTests.cpp:188: REQUIRE( i == 1 ) @@ -638,9 +638,9 @@ ConditionTests.cpp:202: passed with expansion: 0x > 4 ----------------------------------------------------------------- -Test case: './succeeding/conditions//long_to_unsigned_x' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions//long_to_unsigned_x +----------------------------------------------------------------- ConditionTests.cpp:223: REQUIRE( long_var == unsigned_char_var ) @@ -662,9 +662,9 @@ ConditionTests.cpp:226: passed with expansion: 1 == 1 ----------------------------------------------------------------- -Test case: './succeeding/conditions/const ints to int literal' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions/const ints to int literal +----------------------------------------------------------------- ConditionTests.cpp:237: REQUIRE( unsigned_char_var == 1 ) @@ -686,9 +686,9 @@ ConditionTests.cpp:240: passed with expansion: 1 == 1 ----------------------------------------------------------------- -Test case: './succeeding/conditions/negative ints' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions/negative ints +----------------------------------------------------------------- ConditionTests.cpp:246: CHECK( ( -1 > 2u ) ) @@ -720,18 +720,18 @@ ConditionTests.cpp:254: passed with expansion: -2147483648 > 2 ----------------------------------------------------------------- -Test case: './succeeding/conditions/computed ints' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions/computed ints +----------------------------------------------------------------- ConditionTests.cpp:269: CHECK( 54 == 6*9 ) passed with expansion: 54 == 54 ----------------------------------------------------------------- -Test case: './succeeding/conditions/ptr' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions/ptr +----------------------------------------------------------------- ConditionTests.cpp:285: REQUIRE( p == __null ) @@ -773,9 +773,9 @@ ConditionTests.cpp:302: passed with expansion: 0 != 0x ----------------------------------------------------------------- -Test case: './succeeding/conditions/not' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions/not +----------------------------------------------------------------- ConditionTests.cpp:317: REQUIRE( false == false ) @@ -814,9 +814,9 @@ ConditionTests.cpp:326: passed with expansion: !(1 == 2) ----------------------------------------------------------------- -Test case: './failing/conditions/not' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/conditions/not +----------------------------------------------------------------- ConditionTests.cpp:334: CHECK( false != false ) @@ -855,9 +855,9 @@ ConditionTests.cpp:343: failed with expansion: !(1 == 1) ----------------------------------------------------------------- -Test case: './succeeding/exceptions/explicit' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/exceptions/explicit +----------------------------------------------------------------- ExceptionTests.cpp:39: REQUIRE_THROWS_AS( thisThrows() ) @@ -871,9 +871,9 @@ ExceptionTests.cpp:41: REQUIRE_THROWS( thisThrows() ) passed ----------------------------------------------------------------- -Test case: './failing/exceptions/explicit' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/exceptions/explicit +----------------------------------------------------------------- ExceptionTests.cpp:47: CHECK_THROWS_AS( thisThrows() ) @@ -889,17 +889,17 @@ ExceptionTests.cpp:49: failed due to unexpected exception with message: expected exception ----------------------------------------------------------------- -Test case: './failing/exceptions/implicit' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/exceptions/implicit +----------------------------------------------------------------- ExceptionTests.cpp:52: failed due to unexpected exception with message: unexpected exception ----------------------------------------------------------------- -Test case: './failing/exceptions/implicit/2' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/exceptions/implicit/2 +----------------------------------------------------------------- ExceptionTests.cpp:60: CHECK( 1 == 1 ) @@ -910,58 +910,58 @@ ExceptionTests.cpp:60: failed due to unexpected exception with message: unexpected exception ----------------------------------------------------------------- -Test case: './succeeding/exceptions/implicit' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/exceptions/implicit +----------------------------------------------------------------- No assertions in test case, './succeeding/exceptions/implicit' ----------------------------------------------------------------- -Test case: './failing/exceptions/custom' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/exceptions/custom +----------------------------------------------------------------- ExceptionTests.cpp:102: failed due to unexpected exception with message: custom exception ----------------------------------------------------------------- -Test case: './failing/exceptions/custom/nothrow' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/exceptions/custom/nothrow +----------------------------------------------------------------- ExceptionTests.cpp:109: REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) failed due to unexpected exception with message: unexpected custom exception ----------------------------------------------------------------- -Test case: './failing/exceptions/custom/throw' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/exceptions/custom/throw +----------------------------------------------------------------- ExceptionTests.cpp:114: REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) failed due to unexpected exception with message: custom exception - not std ----------------------------------------------------------------- -Test case: './failing/exceptions/custom/double' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/exceptions/custom/double +----------------------------------------------------------------- ExceptionTests.cpp:118: failed due to unexpected exception with message: 3.14 ----------------------------------------------------------------- -Test case: './succeeding/exceptions/notimplemented' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/exceptions/notimplemented +----------------------------------------------------------------- ExceptionTests.cpp:129: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) passed ----------------------------------------------------------------- -Test case: './succeeding/generators/1' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/generators/1 +----------------------------------------------------------------- GeneratorTests.cpp:26: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) @@ -1683,9 +1683,9 @@ GeneratorTests.cpp:27: passed with expansion: 214 == 214 ----------------------------------------------------------------- -Test case: './succeeding/generators/2' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/generators/2 +----------------------------------------------------------------- GeneratorTests.cpp:40: CATCH_REQUIRE( i->first == i->second-1 ) @@ -1697,9 +1697,9 @@ GeneratorTests.cpp:40: passed with expansion: 2 == 2 ----------------------------------------------------------------- -Test case: './succeeding/message' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/message +----------------------------------------------------------------- MessageTests.cpp:14: warning: @@ -1708,17 +1708,17 @@ warning: No assertions in test case, './succeeding/message' ----------------------------------------------------------------- -Test case: './succeeding/succeed' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/succeed +----------------------------------------------------------------- MessageTests.cpp:18: passed with message: this is a success ----------------------------------------------------------------- -Test case: './failing/message/info/1' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/message/info/1 +----------------------------------------------------------------- MessageTests.cpp:23: info: @@ -1733,9 +1733,9 @@ MessageTests.cpp:26: failed with expansion: 2 == 1 ----------------------------------------------------------------- -Test case: './mixed/message/info/2' ----------------------------------------------------------------- +----------------------------------------------------------------- +./mixed/message/info/2 +----------------------------------------------------------------- MessageTests.cpp:33: CHECK( a == 2 ) @@ -1769,57 +1769,53 @@ MessageTests.cpp:45: passed with expansion: 2 == 2 ----------------------------------------------------------------- -Test case: './failing/message/fail' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/message/fail +----------------------------------------------------------------- MessageTests.cpp:51: failed explicitly with message: This is a failure ----------------------------------------------------------------- -Test case: './failing/message/sections' ----------------------------------------------------------------- -Section: one ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/message/sections + one +----------------------------------------------------------------- MessageTests.cpp:58: failed explicitly with message: Message from section one ----------------------------------------------------------------- -Test case: './failing/message/sections' ----------------------------------------------------------------- -Section: two ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/message/sections + two +----------------------------------------------------------------- MessageTests.cpp:63: failed explicitly with message: Message from section two Message from section one ----------------------------------------------------------------- -Test case: './succeeding/message/sections/stdout' ----------------------------------------------------------------- -Section: one ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/message/sections/stdout + one +----------------------------------------------------------------- No assertions in section, 'one' Message from section two ----------------------------------------------------------------- -Test case: './succeeding/message/sections/stdout' ----------------------------------------------------------------- -Section: two ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/message/sections/stdout + two +----------------------------------------------------------------- No assertions in section, 'two' ----------------------------------------------------------------- -Test case: './mixed/message/scoped' ----------------------------------------------------------------- +----------------------------------------------------------------- +./mixed/message/scoped +----------------------------------------------------------------- MessageTests.cpp:86: REQUIRE( i < 10 ) @@ -1886,9 +1882,9 @@ MessageTests.cpp:86: failed with expansion: 10 < 10 ----------------------------------------------------------------- -Test case: './succeeding/nofail' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/nofail +----------------------------------------------------------------- MessageTests.cpp:92: CHECK_NOFAIL( 1 == 2 ) @@ -1897,11 +1893,10 @@ failed - but was ok No assertions in test case, './succeeding/nofail' ----------------------------------------------------------------- -Test case: './succeeding/Misc/Sections' ----------------------------------------------------------------- -Section: s1 ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Misc/Sections + s1 +----------------------------------------------------------------- MiscTests.cpp:25: REQUIRE( a != b ) @@ -1913,22 +1908,20 @@ MiscTests.cpp:26: passed with expansion: 2 != 1 ----------------------------------------------------------------- -Test case: './succeeding/Misc/Sections' ----------------------------------------------------------------- -Section: s2 ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Misc/Sections + s2 +----------------------------------------------------------------- MiscTests.cpp:31: REQUIRE( a != b ) passed with expansion: 1 != 2 ----------------------------------------------------------------- -Test case: './succeeding/Misc/Sections/nested' ----------------------------------------------------------------- -Section: s1 ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Misc/Sections/nested + s1 +----------------------------------------------------------------- MiscTests.cpp:42: REQUIRE( a != b ) @@ -1940,97 +1933,89 @@ MiscTests.cpp:43: passed with expansion: 2 != 1 ----------------------------------------------------------------- -Test case: './succeeding/Misc/Sections/nested' ----------------------------------------------------------------- -Sections: s1 - s2 ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Misc/Sections/nested + s1 + s2 +----------------------------------------------------------------- MiscTests.cpp:47: REQUIRE( a != b ) passed with expansion: 1 != 2 ----------------------------------------------------------------- -Test case: './mixed/Misc/Sections/nested2' ----------------------------------------------------------------- -Sections: s1 - s2 ----------------------------------------------------------------- +----------------------------------------------------------------- +./mixed/Misc/Sections/nested2 + s1 + s2 +----------------------------------------------------------------- MiscTests.cpp:61: REQUIRE( a == b ) failed with expansion: 1 == 2 ----------------------------------------------------------------- -Test case: './mixed/Misc/Sections/nested2' ----------------------------------------------------------------- -Sections: s1 - s3 ----------------------------------------------------------------- +----------------------------------------------------------------- +./mixed/Misc/Sections/nested2 + s1 + s3 +----------------------------------------------------------------- MiscTests.cpp:66: REQUIRE( a != b ) passed with expansion: 1 != 2 ----------------------------------------------------------------- -Test case: './mixed/Misc/Sections/nested2' ----------------------------------------------------------------- -Sections: s1 - s4 ----------------------------------------------------------------- +----------------------------------------------------------------- +./mixed/Misc/Sections/nested2 + s1 + s4 +----------------------------------------------------------------- MiscTests.cpp:70: REQUIRE( a < b ) passed with expansion: 1 < 2 ----------------------------------------------------------------- -Test case: './Sections/nested/a/b' ----------------------------------------------------------------- -Sections: c - d (leaf) ----------------------------------------------------------------- +----------------------------------------------------------------- +./Sections/nested/a/b + c + d (leaf) +----------------------------------------------------------------- No assertions in section, 'd (leaf)' ----------------------------------------------------------------- -Test case: './Sections/nested/a/b' ----------------------------------------------------------------- -Sections: c - e (leaf) ----------------------------------------------------------------- +----------------------------------------------------------------- +./Sections/nested/a/b + c + e (leaf) +----------------------------------------------------------------- No assertions in section, 'e (leaf)' ----------------------------------------------------------------- -Test case: './Sections/nested/a/b' ----------------------------------------------------------------- -Section: f (leaf) ----------------------------------------------------------------- +----------------------------------------------------------------- +./Sections/nested/a/b + f (leaf) +----------------------------------------------------------------- No assertions in section, 'f (leaf)' ----------------------------------------------------------------- -Test case: './mixed/Misc/Sections/loops' ----------------------------------------------------------------- -Section: s1 ----------------------------------------------------------------- +----------------------------------------------------------------- +./mixed/Misc/Sections/loops + s1 +----------------------------------------------------------------- MiscTests.cpp:103: CHECK( b > a ) failed with expansion: 0 > 1 ----------------------------------------------------------------- -Test case: './mixed/Misc/loops' ----------------------------------------------------------------- +----------------------------------------------------------------- +./mixed/Misc/loops +----------------------------------------------------------------- MiscTests.cpp:114: info: @@ -2106,16 +2091,16 @@ failed with expansion: Some information An error ----------------------------------------------------------------- -Test case: './succeeding/Misc/stdout,stderr' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Misc/stdout,stderr +----------------------------------------------------------------- No assertions in test case, './succeeding/Misc/stdout,stderr' ----------------------------------------------------------------- -Test case: './succeeding/Misc/null strings' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Misc/null strings +----------------------------------------------------------------- MiscTests.cpp:133: REQUIRE( makeString( false ) != static_cast(__null) ) @@ -2127,9 +2112,9 @@ MiscTests.cpp:134: passed with expansion: {null string} == {null string} ----------------------------------------------------------------- -Test case: './failing/info' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/info +----------------------------------------------------------------- MiscTests.cpp:139: info: @@ -2143,9 +2128,9 @@ MiscTests.cpp:142: REQUIRE( false ) failed ----------------------------------------------------------------- -Test case: './succeeding/checkedif' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/checkedif +----------------------------------------------------------------- MiscTests.cpp:147: CHECKED_IF( flag ) @@ -2157,9 +2142,9 @@ MiscTests.cpp:155: passed with expansion: true ----------------------------------------------------------------- -Test case: './failing/checkedif' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/checkedif +----------------------------------------------------------------- MiscTests.cpp:147: CHECKED_IF( flag ) @@ -2171,9 +2156,9 @@ MiscTests.cpp:160: failed with expansion: false ----------------------------------------------------------------- -Test case: './succeeding/checkedelse' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/checkedelse +----------------------------------------------------------------- MiscTests.cpp:165: CHECKED_ELSE( flag ) @@ -2185,9 +2170,9 @@ MiscTests.cpp:173: passed with expansion: true ----------------------------------------------------------------- -Test case: './failing/checkedelse' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/checkedelse +----------------------------------------------------------------- MiscTests.cpp:165: CHECKED_ELSE( flag ) @@ -2199,27 +2184,25 @@ MiscTests.cpp:178: failed with expansion: false ----------------------------------------------------------------- -Test case: './misc/xmlentitycheck' ----------------------------------------------------------------- -Section: embedded xml ----------------------------------------------------------------- +----------------------------------------------------------------- +./misc/xmlentitycheck + embedded xml +----------------------------------------------------------------- No assertions in section, 'embedded xml' ----------------------------------------------------------------- -Test case: './misc/xmlentitycheck' ----------------------------------------------------------------- -Section: encoded chars ----------------------------------------------------------------- +----------------------------------------------------------------- +./misc/xmlentitycheck + encoded chars +----------------------------------------------------------------- No assertions in section, 'encoded chars' ----------------------------------------------------------------- -Test case: './manual/onechar' ----------------------------------------------------------------- +----------------------------------------------------------------- +./manual/onechar +----------------------------------------------------------------- MiscTests.cpp:195: info: @@ -2229,18 +2212,18 @@ MiscTests.cpp:196: REQUIRE( false ) failed ----------------------------------------------------------------- -Test case: './succeeding/atomic if' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/atomic if +----------------------------------------------------------------- MiscTests.cpp:206: REQUIRE( x == 0 ) passed with expansion: 0 == 0 ----------------------------------------------------------------- -Test case: './succeeding/matchers' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/matchers +----------------------------------------------------------------- MiscTests.cpp:216: REQUIRE_THAT( testStringForMatching() Contains( "string" ) ) @@ -2262,45 +2245,45 @@ MiscTests.cpp:220: passed with expansion: "this string contains 'abc' as a substring" ends with: "substring" ----------------------------------------------------------------- -Test case: './failing/matchers/Contains' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/matchers/Contains +----------------------------------------------------------------- MiscTests.cpp:225: CHECK_THAT( testStringForMatching() Contains( "not there" ) ) failed with expansion: "this string contains 'abc' as a substring" contains: "not there" ----------------------------------------------------------------- -Test case: './failing/matchers/StartsWith' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/matchers/StartsWith +----------------------------------------------------------------- MiscTests.cpp:230: CHECK_THAT( testStringForMatching() StartsWith( "string" ) ) failed with expansion: "this string contains 'abc' as a substring" starts with: "string" ----------------------------------------------------------------- -Test case: './failing/matchers/EndsWith' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/matchers/EndsWith +----------------------------------------------------------------- MiscTests.cpp:235: CHECK_THAT( testStringForMatching() EndsWith( "this" ) ) failed with expansion: "this string contains 'abc' as a substring" ends with: "this" ----------------------------------------------------------------- -Test case: './failing/matchers/Equals' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/matchers/Equals +----------------------------------------------------------------- MiscTests.cpp:240: CHECK_THAT( testStringForMatching() Equals( "something else" ) ) failed with expansion: "this string contains 'abc' as a substring" equals: "something else" ----------------------------------------------------------------- -Test case: '/succeeding/matchers/AllOf' ----------------------------------------------------------------- +----------------------------------------------------------------- +/succeeding/matchers/AllOf +----------------------------------------------------------------- MiscTests.cpp:248: CHECK_THAT( testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ) @@ -2308,9 +2291,9 @@ passed with expansion: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) ----------------------------------------------------------------- -Test case: '/succeeding/matchers/AnyOf' ----------------------------------------------------------------- +----------------------------------------------------------------- +/succeeding/matchers/AnyOf +----------------------------------------------------------------- MiscTests.cpp:252: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) ) @@ -2324,9 +2307,9 @@ passed with expansion: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) ----------------------------------------------------------------- -Test case: './succeeding/matchers/Equals' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/matchers/Equals +----------------------------------------------------------------- MiscTests.cpp:258: CHECK_THAT( testStringForMatching() Equals( "this string contains 'abc' as a substring" ) ) @@ -2334,9 +2317,9 @@ passed with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" ----------------------------------------------------------------- -Test case: 'example/factorial' ----------------------------------------------------------------- +----------------------------------------------------------------- +example/factorial +----------------------------------------------------------------- MiscTests.cpp:269: REQUIRE( Factorial(0) == 1 ) @@ -2363,16 +2346,16 @@ MiscTests.cpp:273: passed with expansion: 0x == 3628800 ----------------------------------------------------------------- -Test case: 'empty' ----------------------------------------------------------------- +----------------------------------------------------------------- +empty +----------------------------------------------------------------- No assertions in test case, 'empty' ----------------------------------------------------------------- -Test case: 'Nice descriptive name' ----------------------------------------------------------------- +----------------------------------------------------------------- +Nice descriptive name +----------------------------------------------------------------- MiscTests.cpp:282: warning: @@ -2381,26 +2364,25 @@ warning: No assertions in test case, 'Nice descriptive name' ----------------------------------------------------------------- -Test case: 'first tag' ----------------------------------------------------------------- +----------------------------------------------------------------- +first tag +----------------------------------------------------------------- No assertions in test case, 'first tag' ----------------------------------------------------------------- -Test case: 'second tag' ----------------------------------------------------------------- +----------------------------------------------------------------- +second tag +----------------------------------------------------------------- No assertions in test case, 'second tag' ----------------------------------------------------------------- -Test case: 'selftest/main' ----------------------------------------------------------------- -Sections: selftest/expected result - selftest/expected result/failing tests ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/main + selftest/expected result + selftest/expected result/failing tests +----------------------------------------------------------------- catch_self_test.hpp:114: passed with message: @@ -2502,12 +2484,11 @@ catch_self_test.hpp:114: passed with message: Tests failed, as expected ----------------------------------------------------------------- -Test case: 'selftest/main' ----------------------------------------------------------------- -Sections: selftest/expected result - selftest/expected result/succeeding tests ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/main + selftest/expected result + selftest/expected result/succeeding tests +----------------------------------------------------------------- catch_self_test.hpp:103: passed with message: @@ -2693,12 +2674,11 @@ Message from section one Message from section two Some information An error ----------------------------------------------------------------- -Test case: 'selftest/main' ----------------------------------------------------------------- -Sections: selftest/test counts - selftest/test counts/succeeding tests ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/main + selftest/test counts + selftest/test counts/succeeding tests +----------------------------------------------------------------- TestMain.cpp:40: CHECK( totals.assertions.passed == 291 ) @@ -2710,12 +2690,11 @@ TestMain.cpp:41: passed with expansion: 0 == 0 ----------------------------------------------------------------- -Test case: 'selftest/main' ----------------------------------------------------------------- -Sections: selftest/test counts - selftest/test counts/failing tests ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/main + selftest/test counts + selftest/test counts/failing tests +----------------------------------------------------------------- TestMain.cpp:47: CHECK( totals.assertions.passed == 1 ) @@ -2727,9 +2706,9 @@ TestMain.cpp:48: passed with expansion: 72 == 72 ----------------------------------------------------------------- -Test case: 'meta/Misc/Sections' ----------------------------------------------------------------- +----------------------------------------------------------------- +meta/Misc/Sections +----------------------------------------------------------------- TestMain.cpp:57: CHECK( totals.assertions.passed == 2 ) @@ -2741,11 +2720,10 @@ TestMain.cpp:58: passed with expansion: 1 == 1 ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Section: default ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + default +----------------------------------------------------------------- TestMain.cpp:97: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -2771,12 +2749,11 @@ TestMain.cpp:102: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: test lists - -t/1 ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + test lists + -t/1 +----------------------------------------------------------------- TestMain.cpp:108: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -2797,12 +2774,11 @@ TestMain.cpp:112: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: test lists - -t/exclude:1 ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + test lists + -t/exclude:1 +----------------------------------------------------------------- TestMain.cpp:116: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -2823,12 +2799,11 @@ TestMain.cpp:120: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: test lists - --test/1 ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + test lists + --test/1 +----------------------------------------------------------------- TestMain.cpp:125: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -2849,12 +2824,11 @@ TestMain.cpp:129: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: test lists - --test/exclude:1 ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + test lists + --test/exclude:1 +----------------------------------------------------------------- TestMain.cpp:134: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -2875,12 +2849,11 @@ TestMain.cpp:138: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: test lists - --test/exclude:2 ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + test lists + --test/exclude:2 +----------------------------------------------------------------- TestMain.cpp:143: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -2901,12 +2874,11 @@ TestMain.cpp:147: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: test lists - -t/2 ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + test lists + -t/2 +----------------------------------------------------------------- TestMain.cpp:152: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -2932,12 +2904,11 @@ TestMain.cpp:157: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: test lists - -t/0 ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + test lists + -t/0 +----------------------------------------------------------------- TestMain.cpp:162: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) ) @@ -2945,12 +2916,11 @@ passed with expansion: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: reporter - -r/console ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + reporter + -r/console +----------------------------------------------------------------- TestMain.cpp:169: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -2961,12 +2931,11 @@ TestMain.cpp:171: passed with expansion: "console" == "console" ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: reporter - -r/xml ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + reporter + -r/xml +----------------------------------------------------------------- TestMain.cpp:175: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -2977,12 +2946,11 @@ TestMain.cpp:177: passed with expansion: "xml" == "xml" ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: reporter - --reporter/junit ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + reporter + --reporter/junit +----------------------------------------------------------------- TestMain.cpp:181: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -2993,12 +2961,11 @@ TestMain.cpp:183: passed with expansion: "junit" == "junit" ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: reporter - -r/error ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + reporter + -r/error +----------------------------------------------------------------- TestMain.cpp:187: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) ) @@ -3006,12 +2973,11 @@ passed with expansion: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: debugger - -b ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + debugger + -b +----------------------------------------------------------------- TestMain.cpp:194: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3022,12 +2988,11 @@ TestMain.cpp:196: passed with expansion: true == true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: debugger - --break ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + debugger + --break +----------------------------------------------------------------- TestMain.cpp:200: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3038,12 +3003,11 @@ TestMain.cpp:202: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: debugger - -b ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + debugger + -b +----------------------------------------------------------------- TestMain.cpp:206: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) ) @@ -3051,12 +3015,11 @@ passed with expansion: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: abort - -a ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + abort + -a +----------------------------------------------------------------- TestMain.cpp:213: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3067,12 +3030,11 @@ TestMain.cpp:215: passed with expansion: 1 == 1 ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: abort - -a/2 ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + abort + -a/2 +----------------------------------------------------------------- TestMain.cpp:219: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3083,12 +3045,11 @@ TestMain.cpp:221: passed with expansion: 2 == 2 ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: abort - -a/error/0 ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + abort + -a/error/0 +----------------------------------------------------------------- TestMain.cpp:225: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) @@ -3096,12 +3057,11 @@ passed with expansion: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: abort - -a/error/non numeric ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + abort + -a/error/non numeric +----------------------------------------------------------------- TestMain.cpp:229: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) @@ -3109,12 +3069,11 @@ passed with expansion: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: abort - -a/error/two args ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + abort + -a/error/two args +----------------------------------------------------------------- TestMain.cpp:233: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) ) @@ -3122,12 +3081,11 @@ passed with expansion: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: nothrow - -nt ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + nothrow + -nt +----------------------------------------------------------------- TestMain.cpp:240: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3138,12 +3096,11 @@ TestMain.cpp:242: passed with expansion: false == false ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: nothrow - --nothrow ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + nothrow + --nothrow +----------------------------------------------------------------- TestMain.cpp:246: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3154,12 +3111,11 @@ TestMain.cpp:248: passed with expansion: false == false ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: streams - -o filename ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + streams + -o filename +----------------------------------------------------------------- TestMain.cpp:255: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3175,12 +3131,11 @@ TestMain.cpp:258: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: streams - -o %stdout ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + streams + -o %stdout +----------------------------------------------------------------- TestMain.cpp:262: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3196,12 +3151,11 @@ TestMain.cpp:265: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: streams - --out ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + streams + --out +----------------------------------------------------------------- TestMain.cpp:269: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3212,12 +3166,11 @@ TestMain.cpp:271: passed with expansion: "filename.ext" == "filename.ext" ----------------------------------------------------------------- -Test case: 'selftest/parser/2' ----------------------------------------------------------------- -Sections: combinations - -a -b ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/parser/2 + combinations + -a -b +----------------------------------------------------------------- TestMain.cpp:278: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3238,9 +3191,9 @@ TestMain.cpp:282: passed with expansion: false == false ----------------------------------------------------------------- -Test case: 'selftest/test filter' ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/test filter +----------------------------------------------------------------- TestMain.cpp:291: CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) @@ -3272,9 +3225,9 @@ TestMain.cpp:301: passed with expansion: false == false ----------------------------------------------------------------- -Test case: 'selftest/test filters' ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/test filters +----------------------------------------------------------------- TestMain.cpp:312: CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) @@ -3296,9 +3249,9 @@ TestMain.cpp:316: passed with expansion: false == false ----------------------------------------------------------------- -Test case: 'selftest/filter/prefix wildcard' ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/filter/prefix wildcard +----------------------------------------------------------------- TestMain.cpp:322: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) @@ -3310,9 +3263,9 @@ TestMain.cpp:323: passed with expansion: false == false ----------------------------------------------------------------- -Test case: 'selftest/filter/wildcard at both ends' ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/filter/wildcard at both ends +----------------------------------------------------------------- TestMain.cpp:328: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) @@ -3334,9 +3287,9 @@ TestMain.cpp:331: passed with expansion: false == false ----------------------------------------------------------------- -Test case: 'selftest/option parsers' ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/option parsers +----------------------------------------------------------------- TestMain.cpp:351: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) @@ -3357,11 +3310,10 @@ TestMain.cpp:355: passed with expansion: true ----------------------------------------------------------------- -Test case: 'selftest/tags' ----------------------------------------------------------------- -Section: one tag ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/tags + one tag +----------------------------------------------------------------- TestMain.cpp:369: CHECK( oneTag.getTestCaseInfo().description == "" ) @@ -3403,11 +3355,10 @@ TestMain.cpp:377: passed with expansion: false == false ----------------------------------------------------------------- -Test case: 'selftest/tags' ----------------------------------------------------------------- -Section: two tags ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/tags + two tags +----------------------------------------------------------------- TestMain.cpp:383: CHECK( twoTags.getTestCaseInfo().description == "" ) @@ -3459,11 +3410,10 @@ TestMain.cpp:393: passed with expansion: true == true ----------------------------------------------------------------- -Test case: 'selftest/tags' ----------------------------------------------------------------- -Section: one tag with characters either side ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/tags + one tag with characters either side +----------------------------------------------------------------- TestMain.cpp:399: CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) @@ -3485,11 +3435,10 @@ TestMain.cpp:402: passed with expansion: 1 == 1 ----------------------------------------------------------------- -Test case: 'selftest/tags' ----------------------------------------------------------------- -Section: start of a tag, but not closed ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/tags + start of a tag, but not closed +----------------------------------------------------------------- TestMain.cpp:409: CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) @@ -3506,11 +3455,10 @@ TestMain.cpp:411: passed with expansion: 0 == 0 ----------------------------------------------------------------- -Test case: 'selftest/tags' ----------------------------------------------------------------- -Section: hidden ----------------------------------------------------------------- +----------------------------------------------------------------- +selftest/tags + hidden +----------------------------------------------------------------- TestMain.cpp:417: CHECK( oneTag.getTestCaseInfo().description == "" ) @@ -3532,9 +3480,9 @@ TestMain.cpp:421: passed with expansion: false == false ----------------------------------------------------------------- -Test case: './succeeding/Tricky/std::pair' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Tricky/std::pair +----------------------------------------------------------------- TrickyTests.cpp:37: REQUIRE( (std::pair( 1, 2 )) == aNicePair ) @@ -3544,9 +3492,9 @@ passed with expansion: == std::pair( 1, 2 ) ----------------------------------------------------------------- -Test case: './inprogress/failing/Tricky/trailing expression' ----------------------------------------------------------------- +----------------------------------------------------------------- +./inprogress/failing/Tricky/trailing expression +----------------------------------------------------------------- TrickyTests.cpp:55: warning: @@ -3556,9 +3504,9 @@ warning: No assertions in test case, './inprogress/failing/Tricky/trailing expression' ----------------------------------------------------------------- -Test case: './inprogress/failing/Tricky/compound lhs' ----------------------------------------------------------------- +----------------------------------------------------------------- +./inprogress/failing/Tricky/compound lhs +----------------------------------------------------------------- TrickyTests.cpp:71: warning: @@ -3568,9 +3516,9 @@ warning: No assertions in test case, './inprogress/failing/Tricky/compound lhs' ----------------------------------------------------------------- -Test case: './failing/Tricky/non streamable type' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/Tricky/non streamable type +----------------------------------------------------------------- TrickyTests.cpp:95: CHECK( &o1 == &o2 ) @@ -3582,18 +3530,18 @@ TrickyTests.cpp:96: failed with expansion: {?} == {?} ----------------------------------------------------------------- -Test case: './failing/string literals' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/string literals +----------------------------------------------------------------- TrickyTests.cpp:106: REQUIRE( std::string( "first" ) == "second" ) failed with expansion: "first" == "second" ----------------------------------------------------------------- -Test case: './succeeding/side-effects' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/side-effects +----------------------------------------------------------------- TrickyTests.cpp:119: REQUIRE( i++ == 7 ) @@ -3605,47 +3553,46 @@ TrickyTests.cpp:120: passed with expansion: 8 == 8 ----------------------------------------------------------------- -Test case: './succeeding/koenig' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/koenig +----------------------------------------------------------------- TrickyTests.cpp:186: REQUIRE( 0x == o ) passed with expansion: 0x == {?} ----------------------------------------------------------------- -Test case: './succeeding/non-const==' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/non-const== +----------------------------------------------------------------- TrickyTests.cpp:212: REQUIRE( t == 1u ) passed with expansion: {?} == 1 ----------------------------------------------------------------- -Test case: './succeeding/enum/bits' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/enum/bits +----------------------------------------------------------------- TrickyTests.cpp:224: REQUIRE( 0x == bit30and31 ) passed with expansion: 0x == 3221225472 ----------------------------------------------------------------- -Test case: './succeeding/boolean member' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/boolean member +----------------------------------------------------------------- TrickyTests.cpp:239: REQUIRE( obj.prop != __null ) passed with expansion: 0x != 0 ----------------------------------------------------------------- -Test case: './succeeding/unimplemented static bool' ----------------------------------------------------------------- -Section: compare to true ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/unimplemented static bool + compare to true +----------------------------------------------------------------- TrickyTests.cpp:259: REQUIRE( is_true::value == true ) @@ -3657,11 +3604,10 @@ TrickyTests.cpp:260: passed with expansion: true == true ----------------------------------------------------------------- -Test case: './succeeding/unimplemented static bool' ----------------------------------------------------------------- -Section: compare to false ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/unimplemented static bool + compare to false +----------------------------------------------------------------- TrickyTests.cpp:264: REQUIRE( is_true::value == false ) @@ -3673,33 +3619,30 @@ TrickyTests.cpp:265: passed with expansion: false == false ----------------------------------------------------------------- -Test case: './succeeding/unimplemented static bool' ----------------------------------------------------------------- -Section: negation ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/unimplemented static bool + negation +----------------------------------------------------------------- TrickyTests.cpp:270: REQUIRE( !is_true::value ) passed with expansion: true ----------------------------------------------------------------- -Test case: './succeeding/unimplemented static bool' ----------------------------------------------------------------- -Section: double negation ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/unimplemented static bool + double negation +----------------------------------------------------------------- TrickyTests.cpp:275: REQUIRE( !!is_true::value ) passed with expansion: true ----------------------------------------------------------------- -Test case: './succeeding/unimplemented static bool' ----------------------------------------------------------------- -Section: direct ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/unimplemented static bool + direct +----------------------------------------------------------------- TrickyTests.cpp:280: REQUIRE( is_true::value ) @@ -3711,9 +3654,9 @@ TrickyTests.cpp:281: passed with expansion: !false ----------------------------------------------------------------- -Test case: './succeeding/SafeBool' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/SafeBool +----------------------------------------------------------------- TrickyTests.cpp:313: CHECK( True ) @@ -3730,29 +3673,28 @@ TrickyTests.cpp:315: passed with expansion: !false ----------------------------------------------------------------- -Test case: 'Scenario: Do that thing with the thing' ----------------------------------------------------------------- -Sections: Given: This stuff exists - When: I do this - Then: it should do this ----------------------------------------------------------------- +----------------------------------------------------------------- +Scenario: Do that thing with the thing + Given: This stuff exists + When: I do this + Then: it should do this +----------------------------------------------------------------- BDDTests.cpp:29: REQUIRE( itDoesThis() ) passed with expansion: true -================================================================ +================================================================= 96 test cases - 45 failed (610 assertions - 102 failed) -CatchSelfTest is a CATCH v0.9 b12 (integration) host application. +CatchSelfTest is a CATCH v0.9 b13 (integration) host application. Run with -? for options ----------------------------------------------------------------- -Test case: './succeeding/Approx/simple' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/simple +----------------------------------------------------------------- ApproxTests.cpp:20: REQUIRE( d == Approx( 1.23 ) ) @@ -3784,9 +3726,9 @@ ApproxTests.cpp:26: passed with expansion: Approx( 1.23 ) != 1.24 ----------------------------------------------------------------- -Test case: './succeeding/Approx/epsilon' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/epsilon +----------------------------------------------------------------- ApproxTests.cpp:38: REQUIRE( d != Approx( 1.231 ) ) @@ -3798,9 +3740,9 @@ ApproxTests.cpp:39: passed with expansion: 1.23 == Approx( 1.231 ) ----------------------------------------------------------------- -Test case: './succeeding/Approx/float' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/float +----------------------------------------------------------------- ApproxTests.cpp:49: REQUIRE( 1.23f == Approx( 1.23f ) ) @@ -3812,9 +3754,9 @@ ApproxTests.cpp:50: passed with expansion: 0 == Approx( 0 ) ----------------------------------------------------------------- -Test case: './succeeding/Approx/int' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/int +----------------------------------------------------------------- ApproxTests.cpp:60: REQUIRE( 1 == Approx( 1 ) ) @@ -3824,9 +3766,9 @@ ApproxTests.cpp:61: REQUIRE( 0 == Approx( 0 ) ) passed ----------------------------------------------------------------- -Test case: './succeeding/Approx/mixed' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/mixed +----------------------------------------------------------------- ApproxTests.cpp:75: REQUIRE( 1.0f == Approx( 1 ) ) @@ -3853,9 +3795,9 @@ ApproxTests.cpp:79: passed with expansion: 1.234 == Approx( 1.234 ) ----------------------------------------------------------------- -Test case: './succeeding/Approx/custom' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Approx/custom +----------------------------------------------------------------- ApproxTests.cpp:93: REQUIRE( d == approx( 1.23 ) ) @@ -3897,45 +3839,45 @@ ApproxTests.cpp:101: passed with expansion: Approx( 1.23 ) != 1.25 ----------------------------------------------------------------- -Test case: './succeeding/TestClass/succeedingCase' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/TestClass/succeedingCase +----------------------------------------------------------------- ClassTests.cpp:24: REQUIRE( s == "hello" ) passed with expansion: "hello" == "hello" ----------------------------------------------------------------- -Test case: './failing/TestClass/failingCase' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/TestClass/failingCase +----------------------------------------------------------------- ClassTests.cpp:28: REQUIRE( s == "world" ) failed with expansion: "hello" == "world" ----------------------------------------------------------------- -Test case: './succeeding/Fixture/succeedingCase' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/Fixture/succeedingCase +----------------------------------------------------------------- ClassTests.cpp:47: REQUIRE( m_a == 1 ) passed with expansion: 1 == 1 ----------------------------------------------------------------- -Test case: './failing/Fixture/failingCase' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/Fixture/failingCase +----------------------------------------------------------------- ClassTests.cpp:55: REQUIRE( m_a == 2 ) failed with expansion: 1 == 2 ----------------------------------------------------------------- -Test case: './succeeding/conditions/equality' ----------------------------------------------------------------- +----------------------------------------------------------------- +./succeeding/conditions/equality +----------------------------------------------------------------- ConditionTests.cpp:55: REQUIRE( data.int_seven == 7 ) @@ -3972,9 +3914,9 @@ ConditionTests.cpp:63: passed with expansion: 1.3 == Approx( 1.3 ) ----------------------------------------------------------------- -Test case: './failing/conditions/equality' ----------------------------------------------------------------- +----------------------------------------------------------------- +./failing/conditions/equality +----------------------------------------------------------------- ConditionTests.cpp:71: CHECK( data.int_seven == 6 ) @@ -3986,7 +3928,7 @@ ConditionTests.cpp:72: failed with expansion: 7 == 8 -================================================================ +================================================================= 12 test cases - 3 failed (38 assertions - 4 failed) @@ -9332,9 +9274,9 @@ TrickyTests.cpp" line="315"> -
-
-
+
+
+
BDDTests.cpp" line="29"> itDoesThis() @@ -10688,15 +10630,15 @@ TrickyTests.cpp:315: !False succeeded for: !false [Finished: './succeeding/SafeBool' All tests passed (3 assertions in 1 test case)] [Running: Scenario: Do that thing with the thing] -[Started section: 'Given: This stuff exists'] -[Started section: 'When: I do this'] -[Started section: 'Then: it should do this'] +[Started section: ' Given: This stuff exists'] +[Started section: ' When: I do this'] +[Started section: ' Then: it should do this'] BDDTests.cpp:29: itDoesThis() succeeded for: true -[End of section: 'Then: it should do this' 1 assertion passed] +[End of section: ' Then: it should do this' 1 assertion passed] -[End of section: 'When: I do this' 1 assertion passed] +[End of section: ' When: I do this' 1 assertion passed] -[End of section: 'Given: This stuff exists' 1 assertion passed] +[End of section: ' Given: This stuff exists' 1 assertion passed] [Finished: 'Scenario: Do that thing with the thing' All tests passed (1 assertion in 1 test case)] [End of group: '~dummy'. 45 of 96 test cases failed (102 of 610 assertions failed)] diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index dd43189e..1a8807f6 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -14,9 +14,9 @@ // !TBD: story scenarios map to class based tests #define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) -#define GIVEN( desc ) SECTION( "Given: " desc, "" ) -#define WHEN( desc ) SECTION( "When: " desc, "" ) -#define THEN( desc ) SECTION( "Then: " desc, "" ) +#define GIVEN( desc ) SECTION( " Given: " desc, "" ) +#define WHEN( desc ) SECTION( " When: " desc, "" ) +#define THEN( desc ) SECTION( " Then: " desc, "" ) inline bool itDoesThis(){ return true; } From b588755a9298389989fc376848ef62254980a7c6 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 17 Jan 2013 12:07:34 +0000 Subject: [PATCH 118/296] Tweaked console reporter some more --- README | 2 +- include/internal/catch_version.hpp | 2 +- include/reporters/catch_reporter_console.hpp | 34 +- .../SelfTest/Baselines/approvedResults.txt | 3181 ++++++++++------- .../CatchSelfTest/CatchSelfTest/BDDTests.cpp | 4 +- single_include/catch.hpp | 79 +- 6 files changed, 1941 insertions(+), 1361 deletions(-) diff --git a/README b/README index 24d5c31f..00d4728b 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 13 (integration branch) +CATCH v0.9 build 14 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 247f5afd..adc262b4 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 13, "integration" ); + Version libraryVersion( 0, 9, 14, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index ac7030b9..dbb3b023 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -43,23 +43,25 @@ namespace Catch { lazyPrint(); - { - TextColour colour( TextColour::FileName ); - stream << result.getSourceInfo() << ":\n"; - } - ResultComponents components( result ); bool endsWithNewLine = false; if( _assertionStats.totals.assertions.total() > 0 ) { - printOriginalExpression( result ); printResultType( components ); + printOriginalExpression( result ); +// printResultType( components ); endsWithNewLine = printReconstructedExpression( result ); } endsWithNewLine |= printMessage( components ); - if( !endsWithNewLine ) - stream << "\n"; +// if( !endsWithNewLine ) +// stream << "\n"; + + printSourceInfo( result ); stream << std::endl; } + void printSourceInfo( AssertionResult const& _result ) { + TextColour colour( TextColour::FileName ); + stream << _result.getSourceInfo() << "\n"; + } struct ResultComponents { ResultComponents( AssertionResult const& _result ) @@ -69,18 +71,18 @@ namespace Catch { switch( _result.getResultType() ) { case ResultWas::Ok: colour = TextColour::Success; - passOrFail = "passed"; + passOrFail = "PASSED"; if( _result.hasMessage() ) messageLabel = "with message"; break; case ResultWas::ExpressionFailed: if( _result.isOk() ) { colour = TextColour::Success; - passOrFail = "failed - but was ok"; + passOrFail = "FAILED - but was ok"; } else { colour = TextColour::Error; - passOrFail = "failed"; + passOrFail = "FAILED"; } if( _result.hasMessage() ){ messageLabel = "with message"; @@ -88,12 +90,12 @@ namespace Catch { break; case ResultWas::ThrewException: colour = TextColour::Error; - passOrFail = "failed"; + passOrFail = "FAILED"; messageLabel = "due to unexpected exception with message"; break; case ResultWas::DidntThrowException: colour = TextColour::Error; - passOrFail = "failed"; + passOrFail = "FAILED"; messageLabel = "because no exception was thrown where one was expected"; break; case ResultWas::Info: @@ -103,12 +105,12 @@ namespace Catch { messageLabel = "warning"; break; case ResultWas::ExplicitFailure: - passOrFail = "failed"; + passOrFail = "FAILED"; colour = TextColour::Error; messageLabel = "explicitly with message"; break; case ResultWas::Exception: - passOrFail = "failed"; + passOrFail = "FAILED"; colour = TextColour::Error; if( _result.hasMessage() ) messageLabel = "with message"; @@ -132,7 +134,7 @@ namespace Catch { void printResultType( ResultComponents const& _components ) { if( !_components.passOrFail.empty() ) { TextColour colour( _components.colour ); - stream << _components.passOrFail << " "; + stream << _components.passOrFail << ":\n"; } } bool printOriginalExpression( AssertionResult const& _result ) { diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 02b36ade..ecd718ea 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -6,909 +6,1059 @@ Run with -? for options ./succeeding/Approx/simple ----------------------------------------------------------------- -ApproxTests.cpp:20: +PASSED: REQUIRE( d == Approx( 1.23 ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:20 -ApproxTests.cpp:21: +PASSED: REQUIRE( d != Approx( 1.22 ) ) -passed with expansion: +with expansion: 1.23 != Approx( 1.22 ) +ApproxTests.cpp:21 -ApproxTests.cpp:22: +PASSED: REQUIRE( d != Approx( 1.24 ) ) -passed with expansion: +with expansion: 1.23 != Approx( 1.24 ) +ApproxTests.cpp:22 -ApproxTests.cpp:24: +PASSED: REQUIRE( Approx( d ) == 1.23 ) -passed with expansion: +with expansion: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:24 -ApproxTests.cpp:25: +PASSED: REQUIRE( Approx( d ) != 1.22 ) -passed with expansion: +with expansion: Approx( 1.23 ) != 1.22 +ApproxTests.cpp:25 -ApproxTests.cpp:26: +PASSED: REQUIRE( Approx( d ) != 1.24 ) -passed with expansion: +with expansion: Approx( 1.23 ) != 1.24 +ApproxTests.cpp:26 ----------------------------------------------------------------- ./succeeding/Approx/epsilon ----------------------------------------------------------------- -ApproxTests.cpp:38: +PASSED: REQUIRE( d != Approx( 1.231 ) ) -passed with expansion: +with expansion: 1.23 != Approx( 1.231 ) +ApproxTests.cpp:38 -ApproxTests.cpp:39: +PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.231 ) +ApproxTests.cpp:39 ----------------------------------------------------------------- ./succeeding/Approx/float ----------------------------------------------------------------- -ApproxTests.cpp:49: +PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:49 -ApproxTests.cpp:50: +PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) -passed with expansion: +with expansion: 0 == Approx( 0 ) +ApproxTests.cpp:50 ----------------------------------------------------------------- ./succeeding/Approx/int ----------------------------------------------------------------- -ApproxTests.cpp:60: +PASSED: REQUIRE( 1 == Approx( 1 ) ) -passed +ApproxTests.cpp:60 -ApproxTests.cpp:61: +PASSED: REQUIRE( 0 == Approx( 0 ) ) -passed +ApproxTests.cpp:61 ----------------------------------------------------------------- ./succeeding/Approx/mixed ----------------------------------------------------------------- -ApproxTests.cpp:75: +PASSED: REQUIRE( 1.0f == Approx( 1 ) ) -passed with expansion: +with expansion: 1 == Approx( 1 ) +ApproxTests.cpp:75 -ApproxTests.cpp:76: +PASSED: REQUIRE( 0 == Approx( dZero) ) -passed with expansion: +with expansion: 0 == Approx( 0 ) +ApproxTests.cpp:76 -ApproxTests.cpp:77: +PASSED: REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) -passed with expansion: +with expansion: 0 == Approx( 1e-05 ) +ApproxTests.cpp:77 -ApproxTests.cpp:78: +PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) -passed with expansion: +with expansion: 1.234 == Approx( 1.234 ) +ApproxTests.cpp:78 -ApproxTests.cpp:79: +PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) -passed with expansion: +with expansion: 1.234 == Approx( 1.234 ) +ApproxTests.cpp:79 ----------------------------------------------------------------- ./succeeding/Approx/custom ----------------------------------------------------------------- -ApproxTests.cpp:93: +PASSED: REQUIRE( d == approx( 1.23 ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:93 -ApproxTests.cpp:94: +PASSED: REQUIRE( d == approx( 1.22 ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.22 ) +ApproxTests.cpp:94 -ApproxTests.cpp:95: +PASSED: REQUIRE( d == approx( 1.24 ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.24 ) +ApproxTests.cpp:95 -ApproxTests.cpp:96: +PASSED: REQUIRE( d != approx( 1.25 ) ) -passed with expansion: +with expansion: 1.23 != Approx( 1.25 ) +ApproxTests.cpp:96 -ApproxTests.cpp:98: +PASSED: REQUIRE( approx( d ) == 1.23 ) -passed with expansion: +with expansion: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:98 -ApproxTests.cpp:99: +PASSED: REQUIRE( approx( d ) == 1.22 ) -passed with expansion: +with expansion: Approx( 1.23 ) == 1.22 +ApproxTests.cpp:99 -ApproxTests.cpp:100: +PASSED: REQUIRE( approx( d ) == 1.24 ) -passed with expansion: +with expansion: Approx( 1.23 ) == 1.24 +ApproxTests.cpp:100 -ApproxTests.cpp:101: +PASSED: REQUIRE( approx( d ) != 1.25 ) -passed with expansion: +with expansion: Approx( 1.23 ) != 1.25 +ApproxTests.cpp:101 ----------------------------------------------------------------- ./succeeding/TestClass/succeedingCase ----------------------------------------------------------------- -ClassTests.cpp:24: +PASSED: REQUIRE( s == "hello" ) -passed with expansion: +with expansion: "hello" == "hello" +ClassTests.cpp:24 ----------------------------------------------------------------- ./failing/TestClass/failingCase ----------------------------------------------------------------- -ClassTests.cpp:28: +FAILED: REQUIRE( s == "world" ) -failed with expansion: +with expansion: "hello" == "world" +ClassTests.cpp:28 ----------------------------------------------------------------- ./succeeding/Fixture/succeedingCase ----------------------------------------------------------------- -ClassTests.cpp:47: +PASSED: REQUIRE( m_a == 1 ) -passed with expansion: +with expansion: 1 == 1 +ClassTests.cpp:47 ----------------------------------------------------------------- ./failing/Fixture/failingCase ----------------------------------------------------------------- -ClassTests.cpp:55: +FAILED: REQUIRE( m_a == 2 ) -failed with expansion: +with expansion: 1 == 2 +ClassTests.cpp:55 ----------------------------------------------------------------- ./succeeding/conditions/equality ----------------------------------------------------------------- -ConditionTests.cpp:55: +PASSED: REQUIRE( data.int_seven == 7 ) -passed with expansion: +with expansion: 7 == 7 +ConditionTests.cpp:55 -ConditionTests.cpp:56: +PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) -passed with expansion: +with expansion: 9.1 == Approx( 9.1 ) +ConditionTests.cpp:56 -ConditionTests.cpp:57: +PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) -passed with expansion: +with expansion: 3.14159 == Approx( 3.14159 ) +ConditionTests.cpp:57 -ConditionTests.cpp:58: +PASSED: REQUIRE( data.str_hello == "hello" ) -passed with expansion: +with expansion: "hello" == "hello" +ConditionTests.cpp:58 -ConditionTests.cpp:59: +PASSED: REQUIRE( "hello" == data.str_hello ) -passed with expansion: +with expansion: "hello" == "hello" +ConditionTests.cpp:59 -ConditionTests.cpp:60: +PASSED: REQUIRE( data.str_hello.size() == 5 ) -passed with expansion: +with expansion: 5 == 5 +ConditionTests.cpp:60 -ConditionTests.cpp:63: +PASSED: REQUIRE( x == Approx( 1.3 ) ) -passed with expansion: +with expansion: 1.3 == Approx( 1.3 ) +ConditionTests.cpp:63 ----------------------------------------------------------------- ./failing/conditions/equality ----------------------------------------------------------------- -ConditionTests.cpp:71: +FAILED: CHECK( data.int_seven == 6 ) -failed with expansion: +with expansion: 7 == 6 +ConditionTests.cpp:71 -ConditionTests.cpp:72: +FAILED: CHECK( data.int_seven == 8 ) -failed with expansion: +with expansion: 7 == 8 +ConditionTests.cpp:72 -ConditionTests.cpp:73: +FAILED: CHECK( data.int_seven == 0 ) -failed with expansion: +with expansion: 7 == 0 +ConditionTests.cpp:73 -ConditionTests.cpp:74: +FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) -failed with expansion: +with expansion: 9.1 == Approx( 9.11 ) +ConditionTests.cpp:74 -ConditionTests.cpp:75: +FAILED: CHECK( data.float_nine_point_one == Approx( 9.0f ) ) -failed with expansion: +with expansion: 9.1 == Approx( 9 ) +ConditionTests.cpp:75 -ConditionTests.cpp:76: +FAILED: CHECK( data.float_nine_point_one == Approx( 1 ) ) -failed with expansion: +with expansion: 9.1 == Approx( 1 ) +ConditionTests.cpp:76 -ConditionTests.cpp:77: +FAILED: CHECK( data.float_nine_point_one == Approx( 0 ) ) -failed with expansion: +with expansion: 9.1 == Approx( 0 ) +ConditionTests.cpp:77 -ConditionTests.cpp:78: +FAILED: CHECK( data.double_pi == Approx( 3.1415 ) ) -failed with expansion: +with expansion: 3.14159 == Approx( 3.1415 ) +ConditionTests.cpp:78 -ConditionTests.cpp:79: +FAILED: CHECK( data.str_hello == "goodbye" ) -failed with expansion: +with expansion: "hello" == "goodbye" +ConditionTests.cpp:79 -ConditionTests.cpp:80: +FAILED: CHECK( data.str_hello == "hell" ) -failed with expansion: +with expansion: "hello" == "hell" +ConditionTests.cpp:80 -ConditionTests.cpp:81: +FAILED: CHECK( data.str_hello == "hello1" ) -failed with expansion: +with expansion: "hello" == "hello1" +ConditionTests.cpp:81 -ConditionTests.cpp:82: +FAILED: CHECK( data.str_hello.size() == 6 ) -failed with expansion: +with expansion: 5 == 6 +ConditionTests.cpp:82 -ConditionTests.cpp:85: +FAILED: CHECK( x == Approx( 1.301 ) ) -failed with expansion: +with expansion: 1.3 == Approx( 1.301 ) +ConditionTests.cpp:85 ----------------------------------------------------------------- ./succeeding/conditions/inequality ----------------------------------------------------------------- -ConditionTests.cpp:93: +PASSED: REQUIRE( data.int_seven != 6 ) -passed with expansion: +with expansion: 7 != 6 +ConditionTests.cpp:93 -ConditionTests.cpp:94: +PASSED: REQUIRE( data.int_seven != 8 ) -passed with expansion: +with expansion: 7 != 8 +ConditionTests.cpp:94 -ConditionTests.cpp:95: +PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.11f ) ) -passed with expansion: +with expansion: 9.1 != Approx( 9.11 ) +ConditionTests.cpp:95 -ConditionTests.cpp:96: +PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.0f ) ) -passed with expansion: +with expansion: 9.1 != Approx( 9 ) +ConditionTests.cpp:96 -ConditionTests.cpp:97: +PASSED: REQUIRE( data.float_nine_point_one != Approx( 1 ) ) -passed with expansion: +with expansion: 9.1 != Approx( 1 ) +ConditionTests.cpp:97 -ConditionTests.cpp:98: +PASSED: REQUIRE( data.float_nine_point_one != Approx( 0 ) ) -passed with expansion: +with expansion: 9.1 != Approx( 0 ) +ConditionTests.cpp:98 -ConditionTests.cpp:99: +PASSED: REQUIRE( data.double_pi != Approx( 3.1415 ) ) -passed with expansion: +with expansion: 3.14159 != Approx( 3.1415 ) +ConditionTests.cpp:99 -ConditionTests.cpp:100: +PASSED: REQUIRE( data.str_hello != "goodbye" ) -passed with expansion: +with expansion: "hello" != "goodbye" +ConditionTests.cpp:100 -ConditionTests.cpp:101: +PASSED: REQUIRE( data.str_hello != "hell" ) -passed with expansion: +with expansion: "hello" != "hell" +ConditionTests.cpp:101 -ConditionTests.cpp:102: +PASSED: REQUIRE( data.str_hello != "hello1" ) -passed with expansion: +with expansion: "hello" != "hello1" +ConditionTests.cpp:102 -ConditionTests.cpp:103: +PASSED: REQUIRE( data.str_hello.size() != 6 ) -passed with expansion: +with expansion: 5 != 6 +ConditionTests.cpp:103 ----------------------------------------------------------------- ./failing/conditions/inequality ----------------------------------------------------------------- -ConditionTests.cpp:111: +FAILED: CHECK( data.int_seven != 7 ) -failed with expansion: +with expansion: 7 != 7 +ConditionTests.cpp:111 -ConditionTests.cpp:112: +FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) -failed with expansion: +with expansion: 9.1 != Approx( 9.1 ) +ConditionTests.cpp:112 -ConditionTests.cpp:113: +FAILED: CHECK( data.double_pi != Approx( 3.1415926535 ) ) -failed with expansion: +with expansion: 3.14159 != Approx( 3.14159 ) +ConditionTests.cpp:113 -ConditionTests.cpp:114: +FAILED: CHECK( data.str_hello != "hello" ) -failed with expansion: +with expansion: "hello" != "hello" +ConditionTests.cpp:114 -ConditionTests.cpp:115: +FAILED: CHECK( data.str_hello.size() != 5 ) -failed with expansion: +with expansion: 5 != 5 +ConditionTests.cpp:115 ----------------------------------------------------------------- ./succeeding/conditions/ordered ----------------------------------------------------------------- -ConditionTests.cpp:124: +PASSED: REQUIRE( data.int_seven < 8 ) -passed with expansion: +with expansion: 7 < 8 +ConditionTests.cpp:124 -ConditionTests.cpp:125: +PASSED: REQUIRE( data.int_seven > 6 ) -passed with expansion: +with expansion: 7 > 6 +ConditionTests.cpp:125 -ConditionTests.cpp:126: +PASSED: REQUIRE( data.int_seven > 0 ) -passed with expansion: +with expansion: 7 > 0 +ConditionTests.cpp:126 -ConditionTests.cpp:127: +PASSED: REQUIRE( data.int_seven > -1 ) -passed with expansion: +with expansion: 7 > -1 +ConditionTests.cpp:127 -ConditionTests.cpp:129: +PASSED: REQUIRE( data.int_seven >= 7 ) -passed with expansion: +with expansion: 7 >= 7 +ConditionTests.cpp:129 -ConditionTests.cpp:130: +PASSED: REQUIRE( data.int_seven >= 6 ) -passed with expansion: +with expansion: 7 >= 6 +ConditionTests.cpp:130 -ConditionTests.cpp:131: +PASSED: REQUIRE( data.int_seven <= 7 ) -passed with expansion: +with expansion: 7 <= 7 +ConditionTests.cpp:131 -ConditionTests.cpp:132: +PASSED: REQUIRE( data.int_seven <= 8 ) -passed with expansion: +with expansion: 7 <= 8 +ConditionTests.cpp:132 -ConditionTests.cpp:134: +PASSED: REQUIRE( data.float_nine_point_one > 9 ) -passed with expansion: +with expansion: 9.1 > 9 +ConditionTests.cpp:134 -ConditionTests.cpp:135: +PASSED: REQUIRE( data.float_nine_point_one < 10 ) -passed with expansion: +with expansion: 9.1 < 10 +ConditionTests.cpp:135 -ConditionTests.cpp:136: +PASSED: REQUIRE( data.float_nine_point_one < 9.2 ) -passed with expansion: +with expansion: 9.1 < 9.2 +ConditionTests.cpp:136 -ConditionTests.cpp:138: +PASSED: REQUIRE( data.str_hello <= "hello" ) -passed with expansion: +with expansion: "hello" <= "hello" +ConditionTests.cpp:138 -ConditionTests.cpp:139: +PASSED: REQUIRE( data.str_hello >= "hello" ) -passed with expansion: +with expansion: "hello" >= "hello" +ConditionTests.cpp:139 -ConditionTests.cpp:141: +PASSED: REQUIRE( data.str_hello < "hellp" ) -passed with expansion: +with expansion: "hello" < "hellp" +ConditionTests.cpp:141 -ConditionTests.cpp:142: +PASSED: REQUIRE( data.str_hello < "zebra" ) -passed with expansion: +with expansion: "hello" < "zebra" +ConditionTests.cpp:142 -ConditionTests.cpp:143: +PASSED: REQUIRE( data.str_hello > "hellm" ) -passed with expansion: +with expansion: "hello" > "hellm" +ConditionTests.cpp:143 -ConditionTests.cpp:144: +PASSED: REQUIRE( data.str_hello > "a" ) -passed with expansion: +with expansion: "hello" > "a" +ConditionTests.cpp:144 ----------------------------------------------------------------- ./failing/conditions/ordered ----------------------------------------------------------------- -ConditionTests.cpp:152: +FAILED: CHECK( data.int_seven > 7 ) -failed with expansion: +with expansion: 7 > 7 +ConditionTests.cpp:152 -ConditionTests.cpp:153: +FAILED: CHECK( data.int_seven < 7 ) -failed with expansion: +with expansion: 7 < 7 +ConditionTests.cpp:153 -ConditionTests.cpp:154: +FAILED: CHECK( data.int_seven > 8 ) -failed with expansion: +with expansion: 7 > 8 +ConditionTests.cpp:154 -ConditionTests.cpp:155: +FAILED: CHECK( data.int_seven < 6 ) -failed with expansion: +with expansion: 7 < 6 +ConditionTests.cpp:155 -ConditionTests.cpp:156: +FAILED: CHECK( data.int_seven < 0 ) -failed with expansion: +with expansion: 7 < 0 +ConditionTests.cpp:156 -ConditionTests.cpp:157: +FAILED: CHECK( data.int_seven < -1 ) -failed with expansion: +with expansion: 7 < -1 +ConditionTests.cpp:157 -ConditionTests.cpp:159: +FAILED: CHECK( data.int_seven >= 8 ) -failed with expansion: +with expansion: 7 >= 8 +ConditionTests.cpp:159 -ConditionTests.cpp:160: +FAILED: CHECK( data.int_seven <= 6 ) -failed with expansion: +with expansion: 7 <= 6 +ConditionTests.cpp:160 -ConditionTests.cpp:162: +FAILED: CHECK( data.float_nine_point_one < 9 ) -failed with expansion: +with expansion: 9.1 < 9 +ConditionTests.cpp:162 -ConditionTests.cpp:163: +FAILED: CHECK( data.float_nine_point_one > 10 ) -failed with expansion: +with expansion: 9.1 > 10 +ConditionTests.cpp:163 -ConditionTests.cpp:164: +FAILED: CHECK( data.float_nine_point_one > 9.2 ) -failed with expansion: +with expansion: 9.1 > 9.2 +ConditionTests.cpp:164 -ConditionTests.cpp:166: +FAILED: CHECK( data.str_hello > "hello" ) -failed with expansion: +with expansion: "hello" > "hello" +ConditionTests.cpp:166 -ConditionTests.cpp:167: +FAILED: CHECK( data.str_hello < "hello" ) -failed with expansion: +with expansion: "hello" < "hello" +ConditionTests.cpp:167 -ConditionTests.cpp:168: +FAILED: CHECK( data.str_hello > "hellp" ) -failed with expansion: +with expansion: "hello" > "hellp" +ConditionTests.cpp:168 -ConditionTests.cpp:169: +FAILED: CHECK( data.str_hello > "z" ) -failed with expansion: +with expansion: "hello" > "z" +ConditionTests.cpp:169 -ConditionTests.cpp:170: +FAILED: CHECK( data.str_hello < "hellm" ) -failed with expansion: +with expansion: "hello" < "hellm" +ConditionTests.cpp:170 -ConditionTests.cpp:171: +FAILED: CHECK( data.str_hello < "a" ) -failed with expansion: +with expansion: "hello" < "a" +ConditionTests.cpp:171 -ConditionTests.cpp:173: +FAILED: CHECK( data.str_hello >= "z" ) -failed with expansion: +with expansion: "hello" >= "z" +ConditionTests.cpp:173 -ConditionTests.cpp:174: +FAILED: CHECK( data.str_hello <= "a" ) -failed with expansion: +with expansion: "hello" <= "a" +ConditionTests.cpp:174 ----------------------------------------------------------------- ./succeeding/conditions/int literals ----------------------------------------------------------------- -ConditionTests.cpp:188: +PASSED: REQUIRE( i == 1 ) -passed with expansion: +with expansion: 1 == 1 +ConditionTests.cpp:188 -ConditionTests.cpp:189: +PASSED: REQUIRE( ui == 2 ) -passed with expansion: +with expansion: 2 == 2 +ConditionTests.cpp:189 -ConditionTests.cpp:190: +PASSED: REQUIRE( l == 3 ) -passed with expansion: +with expansion: 3 == 3 +ConditionTests.cpp:190 -ConditionTests.cpp:191: +PASSED: REQUIRE( ul == 4 ) -passed with expansion: +with expansion: 4 == 4 +ConditionTests.cpp:191 -ConditionTests.cpp:192: +PASSED: REQUIRE( c == 5 ) -passed with expansion: +with expansion: 5 == 5 +ConditionTests.cpp:192 -ConditionTests.cpp:193: +PASSED: REQUIRE( uc == 6 ) -passed with expansion: +with expansion: 6 == 6 +ConditionTests.cpp:193 -ConditionTests.cpp:195: +PASSED: REQUIRE( 1 == i ) -passed with expansion: +with expansion: 1 == 1 +ConditionTests.cpp:195 -ConditionTests.cpp:196: +PASSED: REQUIRE( 2 == ui ) -passed with expansion: +with expansion: 2 == 2 +ConditionTests.cpp:196 -ConditionTests.cpp:197: +PASSED: REQUIRE( 3 == l ) -passed with expansion: +with expansion: 3 == 3 +ConditionTests.cpp:197 -ConditionTests.cpp:198: +PASSED: REQUIRE( 4 == ul ) -passed with expansion: +with expansion: 4 == 4 +ConditionTests.cpp:198 -ConditionTests.cpp:199: +PASSED: REQUIRE( 5 == c ) -passed with expansion: +with expansion: 5 == 5 +ConditionTests.cpp:199 -ConditionTests.cpp:200: +PASSED: REQUIRE( 6 == uc ) -passed with expansion: +with expansion: 6 == 6 +ConditionTests.cpp:200 -ConditionTests.cpp:202: +PASSED: REQUIRE( (std::numeric_limits::max)() > ul ) -passed with expansion: +with expansion: 0x > 4 +ConditionTests.cpp:202 ----------------------------------------------------------------- ./succeeding/conditions//long_to_unsigned_x ----------------------------------------------------------------- -ConditionTests.cpp:223: +PASSED: REQUIRE( long_var == unsigned_char_var ) -passed with expansion: +with expansion: 1 == 1 +ConditionTests.cpp:223 -ConditionTests.cpp:224: +PASSED: REQUIRE( long_var == unsigned_short_var ) -passed with expansion: +with expansion: 1 == 1 +ConditionTests.cpp:224 -ConditionTests.cpp:225: +PASSED: REQUIRE( long_var == unsigned_int_var ) -passed with expansion: +with expansion: 1 == 1 +ConditionTests.cpp:225 -ConditionTests.cpp:226: +PASSED: REQUIRE( long_var == unsigned_long_var ) -passed with expansion: +with expansion: 1 == 1 +ConditionTests.cpp:226 ----------------------------------------------------------------- ./succeeding/conditions/const ints to int literal ----------------------------------------------------------------- -ConditionTests.cpp:237: +PASSED: REQUIRE( unsigned_char_var == 1 ) -passed with expansion: +with expansion: 1 == 1 +ConditionTests.cpp:237 -ConditionTests.cpp:238: +PASSED: REQUIRE( unsigned_short_var == 1 ) -passed with expansion: +with expansion: 1 == 1 +ConditionTests.cpp:238 -ConditionTests.cpp:239: +PASSED: REQUIRE( unsigned_int_var == 1 ) -passed with expansion: +with expansion: 1 == 1 +ConditionTests.cpp:239 -ConditionTests.cpp:240: +PASSED: REQUIRE( unsigned_long_var == 1 ) -passed with expansion: +with expansion: 1 == 1 +ConditionTests.cpp:240 ----------------------------------------------------------------- ./succeeding/conditions/negative ints ----------------------------------------------------------------- -ConditionTests.cpp:246: +PASSED: CHECK( ( -1 > 2u ) ) -passed with expansion: +with expansion: true +ConditionTests.cpp:246 -ConditionTests.cpp:247: +PASSED: CHECK( -1 > 2u ) -passed with expansion: +with expansion: -1 > 2 +ConditionTests.cpp:247 -ConditionTests.cpp:249: +PASSED: CHECK( ( 2u < -1 ) ) -passed with expansion: +with expansion: true +ConditionTests.cpp:249 -ConditionTests.cpp:250: +PASSED: CHECK( 2u < -1 ) -passed with expansion: +with expansion: 2 < -1 +ConditionTests.cpp:250 -ConditionTests.cpp:253: +PASSED: CHECK( ( minInt > 2u ) ) -passed with expansion: +with expansion: true +ConditionTests.cpp:253 -ConditionTests.cpp:254: +PASSED: CHECK( minInt > 2u ) -passed with expansion: +with expansion: -2147483648 > 2 +ConditionTests.cpp:254 ----------------------------------------------------------------- ./succeeding/conditions/computed ints ----------------------------------------------------------------- -ConditionTests.cpp:269: +PASSED: CHECK( 54 == 6*9 ) -passed with expansion: +with expansion: 54 == 54 +ConditionTests.cpp:269 ----------------------------------------------------------------- ./succeeding/conditions/ptr ----------------------------------------------------------------- -ConditionTests.cpp:285: +PASSED: REQUIRE( p == __null ) -passed with expansion: +with expansion: __null == 0 +ConditionTests.cpp:285 -ConditionTests.cpp:286: +PASSED: REQUIRE( p == pNULL ) -passed with expansion: +with expansion: __null == __null +ConditionTests.cpp:286 -ConditionTests.cpp:291: +PASSED: REQUIRE( p != __null ) -passed with expansion: +with expansion: 0x != 0 +ConditionTests.cpp:291 -ConditionTests.cpp:294: +PASSED: REQUIRE( cp != __null ) -passed with expansion: +with expansion: 0x != 0 +ConditionTests.cpp:294 -ConditionTests.cpp:297: +PASSED: REQUIRE( cpc != __null ) -passed with expansion: +with expansion: 0x != 0 +ConditionTests.cpp:297 -ConditionTests.cpp:299: +PASSED: REQUIRE( returnsNull() == __null ) -passed with expansion: +with expansion: {null string} == 0 +ConditionTests.cpp:299 -ConditionTests.cpp:300: +PASSED: REQUIRE( returnsConstNull() == __null ) -passed with expansion: +with expansion: {null string} == 0 +ConditionTests.cpp:300 -ConditionTests.cpp:302: +PASSED: REQUIRE( __null != p ) -passed with expansion: +with expansion: 0 != 0x +ConditionTests.cpp:302 ----------------------------------------------------------------- ./succeeding/conditions/not ----------------------------------------------------------------- -ConditionTests.cpp:317: +PASSED: REQUIRE( false == false ) -passed +ConditionTests.cpp:317 -ConditionTests.cpp:318: +PASSED: REQUIRE( true == true ) -passed +ConditionTests.cpp:318 -ConditionTests.cpp:319: +PASSED: REQUIRE( !false ) -passed with expansion: +with expansion: true +ConditionTests.cpp:319 -ConditionTests.cpp:320: +PASSED: REQUIRE_FALSE( !false ) -passed +ConditionTests.cpp:320 -ConditionTests.cpp:322: +PASSED: REQUIRE( !falseValue ) -passed with expansion: +with expansion: true +ConditionTests.cpp:322 -ConditionTests.cpp:323: +PASSED: REQUIRE_FALSE( !falseValue ) -passed with expansion: +with expansion: !false +ConditionTests.cpp:323 -ConditionTests.cpp:325: +PASSED: REQUIRE( !(1 == 2) ) -passed with expansion: +with expansion: true +ConditionTests.cpp:325 -ConditionTests.cpp:326: +PASSED: REQUIRE_FALSE( !1 == 2 ) -passed with expansion: +with expansion: !(1 == 2) +ConditionTests.cpp:326 ----------------------------------------------------------------- ./failing/conditions/not ----------------------------------------------------------------- -ConditionTests.cpp:334: +FAILED: CHECK( false != false ) -failed +ConditionTests.cpp:334 -ConditionTests.cpp:335: +FAILED: CHECK( true != true ) -failed +ConditionTests.cpp:335 -ConditionTests.cpp:336: +FAILED: CHECK( !true ) -failed with expansion: +with expansion: false +ConditionTests.cpp:336 -ConditionTests.cpp:337: +FAILED: CHECK_FALSE( !true ) -failed +ConditionTests.cpp:337 -ConditionTests.cpp:339: +FAILED: CHECK( !trueValue ) -failed with expansion: +with expansion: false +ConditionTests.cpp:339 -ConditionTests.cpp:340: +FAILED: CHECK_FALSE( !trueValue ) -failed with expansion: +with expansion: !true +ConditionTests.cpp:340 -ConditionTests.cpp:342: +FAILED: CHECK( !(1 == 1) ) -failed with expansion: +with expansion: false +ConditionTests.cpp:342 -ConditionTests.cpp:343: +FAILED: CHECK_FALSE( !1 == 1 ) -failed with expansion: +with expansion: !(1 == 1) +ConditionTests.cpp:343 ----------------------------------------------------------------- ./succeeding/exceptions/explicit ----------------------------------------------------------------- -ExceptionTests.cpp:39: +PASSED: REQUIRE_THROWS_AS( thisThrows() ) -passed +ExceptionTests.cpp:39 -ExceptionTests.cpp:40: +PASSED: REQUIRE_NOTHROW( thisDoesntThrow() ) -passed +ExceptionTests.cpp:40 -ExceptionTests.cpp:41: +PASSED: REQUIRE_THROWS( thisThrows() ) -passed +ExceptionTests.cpp:41 ----------------------------------------------------------------- ./failing/exceptions/explicit ----------------------------------------------------------------- -ExceptionTests.cpp:47: +FAILED: CHECK_THROWS_AS( thisThrows() ) -failed due to unexpected exception with message: +due to unexpected exception with message: expected exception +ExceptionTests.cpp:47 -ExceptionTests.cpp:48: +FAILED: CHECK_THROWS_AS( thisDoesntThrow() ) -failed because no exception was thrown where one was expected: +because no exception was thrown where one was expected: +ExceptionTests.cpp:48 -ExceptionTests.cpp:49: +FAILED: CHECK_NOTHROW( thisThrows() ) -failed due to unexpected exception with message: +due to unexpected exception with message: expected exception +ExceptionTests.cpp:49 ----------------------------------------------------------------- ./failing/exceptions/implicit ----------------------------------------------------------------- -ExceptionTests.cpp:52: -failed due to unexpected exception with message: +FAILED: +due to unexpected exception with message: unexpected exception +ExceptionTests.cpp:52 ----------------------------------------------------------------- ./failing/exceptions/implicit/2 ----------------------------------------------------------------- -ExceptionTests.cpp:60: +PASSED: CHECK( 1 == 1 ) -passed +ExceptionTests.cpp:60 -ExceptionTests.cpp:60: +FAILED: {Unknown expression after this line} -failed due to unexpected exception with message: +due to unexpected exception with message: unexpected exception +ExceptionTests.cpp:60 ----------------------------------------------------------------- ./succeeding/exceptions/implicit @@ -921,789 +1071,939 @@ No assertions in test case, './succeeding/exceptions/implicit' ./failing/exceptions/custom ----------------------------------------------------------------- -ExceptionTests.cpp:102: -failed due to unexpected exception with message: +FAILED: +due to unexpected exception with message: custom exception +ExceptionTests.cpp:102 ----------------------------------------------------------------- ./failing/exceptions/custom/nothrow ----------------------------------------------------------------- -ExceptionTests.cpp:109: +FAILED: REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) -failed due to unexpected exception with message: +due to unexpected exception with message: unexpected custom exception +ExceptionTests.cpp:109 ----------------------------------------------------------------- ./failing/exceptions/custom/throw ----------------------------------------------------------------- -ExceptionTests.cpp:114: +FAILED: REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) -failed due to unexpected exception with message: +due to unexpected exception with message: custom exception - not std +ExceptionTests.cpp:114 ----------------------------------------------------------------- ./failing/exceptions/custom/double ----------------------------------------------------------------- -ExceptionTests.cpp:118: -failed due to unexpected exception with message: +FAILED: +due to unexpected exception with message: 3.14 +ExceptionTests.cpp:118 ----------------------------------------------------------------- ./succeeding/exceptions/notimplemented ----------------------------------------------------------------- -ExceptionTests.cpp:129: +PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) -passed +ExceptionTests.cpp:129 ----------------------------------------------------------------- ./succeeding/generators/1 ----------------------------------------------------------------- -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 2 == 2 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 200 == 200 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 4 == 4 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 200 == 200 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 6 == 6 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 200 == 200 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 8 == 8 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 200 == 200 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 10 == 10 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 200 == 200 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 30 == 30 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 200 == 200 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 40 == 40 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 200 == 200 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 42 == 42 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 200 == 200 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 72 == 72 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 200 == 200 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 2 == 2 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 202 == 202 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 4 == 4 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 202 == 202 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 6 == 6 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 202 == 202 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 8 == 8 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 202 == 202 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 10 == 10 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 202 == 202 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 30 == 30 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 202 == 202 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 40 == 40 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 202 == 202 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 42 == 42 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 202 == 202 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 72 == 72 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 202 == 202 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 2 == 2 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 204 == 204 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 4 == 4 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 204 == 204 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 6 == 6 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 204 == 204 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 8 == 8 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 204 == 204 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 10 == 10 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 204 == 204 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 30 == 30 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 204 == 204 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 40 == 40 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 204 == 204 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 42 == 42 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 204 == 204 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 72 == 72 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 204 == 204 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 2 == 2 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 206 == 206 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 4 == 4 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 206 == 206 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 6 == 6 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 206 == 206 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 8 == 8 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 206 == 206 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 10 == 10 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 206 == 206 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 30 == 30 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 206 == 206 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 40 == 40 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 206 == 206 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 42 == 42 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 206 == 206 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 72 == 72 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 206 == 206 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 2 == 2 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 208 == 208 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 4 == 4 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 208 == 208 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 6 == 6 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 208 == 208 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 8 == 8 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 208 == 208 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 10 == 10 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 208 == 208 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 30 == 30 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 208 == 208 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 40 == 40 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 208 == 208 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 42 == 42 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 208 == 208 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 72 == 72 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 208 == 208 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 2 == 2 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 210 == 210 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 4 == 4 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 210 == 210 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 6 == 6 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 210 == 210 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 8 == 8 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 210 == 210 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 10 == 10 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 210 == 210 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 30 == 30 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 210 == 210 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 40 == 40 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 210 == 210 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 42 == 42 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 210 == 210 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 72 == 72 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 210 == 210 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 2 == 2 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 212 == 212 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 4 == 4 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 212 == 212 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 6 == 6 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 212 == 212 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 8 == 8 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 212 == 212 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 10 == 10 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 212 == 212 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 30 == 30 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 212 == 212 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 40 == 40 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 212 == 212 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 42 == 42 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 212 == 212 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 72 == 72 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 212 == 212 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 2 == 2 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 214 == 214 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 4 == 4 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 214 == 214 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 6 == 6 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 214 == 214 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 8 == 8 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 214 == 214 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 10 == 10 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 214 == 214 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 30 == 30 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 214 == 214 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 40 == 40 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 214 == 214 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 42 == 42 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 214 == 214 +GeneratorTests.cpp:27 -GeneratorTests.cpp:26: +PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) -passed with expansion: +with expansion: 72 == 72 +GeneratorTests.cpp:26 -GeneratorTests.cpp:27: +PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) -passed with expansion: +with expansion: 214 == 214 +GeneratorTests.cpp:27 ----------------------------------------------------------------- ./succeeding/generators/2 ----------------------------------------------------------------- -GeneratorTests.cpp:40: +PASSED: CATCH_REQUIRE( i->first == i->second-1 ) -passed with expansion: +with expansion: 0 == 0 +GeneratorTests.cpp:40 -GeneratorTests.cpp:40: +PASSED: CATCH_REQUIRE( i->first == i->second-1 ) -passed with expansion: +with expansion: 2 == 2 +GeneratorTests.cpp:40 ----------------------------------------------------------------- ./succeeding/message ----------------------------------------------------------------- -MessageTests.cpp:14: warning: this is a warning +MessageTests.cpp:14 No assertions in test case, './succeeding/message' @@ -1712,88 +2012,97 @@ No assertions in test case, './succeeding/message' ./succeeding/succeed ----------------------------------------------------------------- -MessageTests.cpp:18: -passed with message: +PASSED: +with message: this is a success +MessageTests.cpp:18 ----------------------------------------------------------------- ./failing/message/info/1 ----------------------------------------------------------------- -MessageTests.cpp:23: info: this message should be logged +MessageTests.cpp:23 -MessageTests.cpp:24: info: so should this +MessageTests.cpp:24 -MessageTests.cpp:26: +FAILED: REQUIRE( a == 1 ) -failed with expansion: +with expansion: 2 == 1 +MessageTests.cpp:26 ----------------------------------------------------------------- ./mixed/message/info/2 ----------------------------------------------------------------- -MessageTests.cpp:33: +PASSED: CHECK( a == 2 ) -passed with expansion: +with expansion: 2 == 2 +MessageTests.cpp:33 -MessageTests.cpp:31: info: this message should be logged +MessageTests.cpp:31 -MessageTests.cpp:35: info: this message should be logged, too +MessageTests.cpp:35 -MessageTests.cpp:37: +FAILED: CHECK( a == 1 ) -failed with expansion: +with expansion: 2 == 1 +MessageTests.cpp:37 -MessageTests.cpp:39: info: and this, but later +MessageTests.cpp:39 -MessageTests.cpp:41: +FAILED: CHECK( a == 0 ) -failed with expansion: +with expansion: 2 == 0 +MessageTests.cpp:41 -MessageTests.cpp:45: +PASSED: CHECK( a == 2 ) -passed with expansion: +with expansion: 2 == 2 +MessageTests.cpp:45 ----------------------------------------------------------------- ./failing/message/fail ----------------------------------------------------------------- -MessageTests.cpp:51: -failed explicitly with message: +FAILED: +explicitly with message: This is a failure +MessageTests.cpp:51 ----------------------------------------------------------------- ./failing/message/sections one ----------------------------------------------------------------- -MessageTests.cpp:58: -failed explicitly with message: +FAILED: +explicitly with message: Message from section one +MessageTests.cpp:58 ----------------------------------------------------------------- ./failing/message/sections two ----------------------------------------------------------------- -MessageTests.cpp:63: -failed explicitly with message: +FAILED: +explicitly with message: Message from section two +MessageTests.cpp:63 Message from section one ----------------------------------------------------------------- @@ -1817,78 +2126,89 @@ No assertions in section, 'two' ./mixed/message/scoped ----------------------------------------------------------------- -MessageTests.cpp:86: +PASSED: REQUIRE( i < 10 ) -passed with expansion: +with expansion: 0 < 10 +MessageTests.cpp:86 -MessageTests.cpp:86: +PASSED: REQUIRE( i < 10 ) -passed with expansion: +with expansion: 1 < 10 +MessageTests.cpp:86 -MessageTests.cpp:86: +PASSED: REQUIRE( i < 10 ) -passed with expansion: +with expansion: 2 < 10 +MessageTests.cpp:86 -MessageTests.cpp:86: +PASSED: REQUIRE( i < 10 ) -passed with expansion: +with expansion: 3 < 10 +MessageTests.cpp:86 -MessageTests.cpp:86: +PASSED: REQUIRE( i < 10 ) -passed with expansion: +with expansion: 4 < 10 +MessageTests.cpp:86 -MessageTests.cpp:86: +PASSED: REQUIRE( i < 10 ) -passed with expansion: +with expansion: 5 < 10 +MessageTests.cpp:86 -MessageTests.cpp:86: +PASSED: REQUIRE( i < 10 ) -passed with expansion: +with expansion: 6 < 10 +MessageTests.cpp:86 -MessageTests.cpp:86: +PASSED: REQUIRE( i < 10 ) -passed with expansion: +with expansion: 7 < 10 +MessageTests.cpp:86 -MessageTests.cpp:86: +PASSED: REQUIRE( i < 10 ) -passed with expansion: +with expansion: 8 < 10 +MessageTests.cpp:86 -MessageTests.cpp:86: +PASSED: REQUIRE( i < 10 ) -passed with expansion: +with expansion: 9 < 10 +MessageTests.cpp:86 -MessageTests.cpp:86: REQUIRE( i < 10 ) info: current counter 10 +MessageTests.cpp:86 -MessageTests.cpp:86: REQUIRE( i < 10 ) info: i := 10 +MessageTests.cpp:86 -MessageTests.cpp:86: +FAILED: REQUIRE( i < 10 ) -failed with expansion: +with expansion: 10 < 10 +MessageTests.cpp:86 ----------------------------------------------------------------- ./succeeding/nofail ----------------------------------------------------------------- -MessageTests.cpp:92: +FAILED - but was ok: CHECK_NOFAIL( 1 == 2 ) -failed - but was ok +MessageTests.cpp:92 No assertions in test case, './succeeding/nofail' @@ -1898,40 +2218,45 @@ No assertions in test case, './succeeding/nofail' s1 ----------------------------------------------------------------- -MiscTests.cpp:25: +PASSED: REQUIRE( a != b ) -passed with expansion: +with expansion: 1 != 2 +MiscTests.cpp:25 -MiscTests.cpp:26: +PASSED: REQUIRE( b != a ) -passed with expansion: +with expansion: 2 != 1 +MiscTests.cpp:26 ----------------------------------------------------------------- ./succeeding/Misc/Sections s2 ----------------------------------------------------------------- -MiscTests.cpp:31: +PASSED: REQUIRE( a != b ) -passed with expansion: +with expansion: 1 != 2 +MiscTests.cpp:31 ----------------------------------------------------------------- ./succeeding/Misc/Sections/nested s1 ----------------------------------------------------------------- -MiscTests.cpp:42: +PASSED: REQUIRE( a != b ) -passed with expansion: +with expansion: 1 != 2 +MiscTests.cpp:42 -MiscTests.cpp:43: +PASSED: REQUIRE( b != a ) -passed with expansion: +with expansion: 2 != 1 +MiscTests.cpp:43 ----------------------------------------------------------------- ./succeeding/Misc/Sections/nested @@ -1939,10 +2264,11 @@ passed with expansion: s2 ----------------------------------------------------------------- -MiscTests.cpp:47: +PASSED: REQUIRE( a != b ) -passed with expansion: +with expansion: 1 != 2 +MiscTests.cpp:47 ----------------------------------------------------------------- ./mixed/Misc/Sections/nested2 @@ -1950,10 +2276,11 @@ passed with expansion: s2 ----------------------------------------------------------------- -MiscTests.cpp:61: +FAILED: REQUIRE( a == b ) -failed with expansion: +with expansion: 1 == 2 +MiscTests.cpp:61 ----------------------------------------------------------------- ./mixed/Misc/Sections/nested2 @@ -1961,10 +2288,11 @@ failed with expansion: s3 ----------------------------------------------------------------- -MiscTests.cpp:66: +PASSED: REQUIRE( a != b ) -passed with expansion: +with expansion: 1 != 2 +MiscTests.cpp:66 ----------------------------------------------------------------- ./mixed/Misc/Sections/nested2 @@ -1972,10 +2300,11 @@ passed with expansion: s4 ----------------------------------------------------------------- -MiscTests.cpp:70: +PASSED: REQUIRE( a < b ) -passed with expansion: +with expansion: 1 < 2 +MiscTests.cpp:70 ----------------------------------------------------------------- ./Sections/nested/a/b @@ -2008,86 +2337,95 @@ No assertions in section, 'f (leaf)' s1 ----------------------------------------------------------------- -MiscTests.cpp:103: +FAILED: CHECK( b > a ) -failed with expansion: +with expansion: 0 > 1 +MiscTests.cpp:103 ----------------------------------------------------------------- ./mixed/Misc/loops ----------------------------------------------------------------- -MiscTests.cpp:114: info: Testing if fib[0] (1) is even +MiscTests.cpp:114 -MiscTests.cpp:115: +FAILED: CHECK( ( fib[i] % 2 ) == 0 ) -failed with expansion: +with expansion: 1 == 0 +MiscTests.cpp:115 -MiscTests.cpp:114: info: Testing if fib[1] (1) is even +MiscTests.cpp:114 -MiscTests.cpp:115: +FAILED: CHECK( ( fib[i] % 2 ) == 0 ) -failed with expansion: +with expansion: 1 == 0 +MiscTests.cpp:115 -MiscTests.cpp:115: +PASSED: CHECK( ( fib[i] % 2 ) == 0 ) -passed with expansion: +with expansion: 0 == 0 +MiscTests.cpp:115 -MiscTests.cpp:114: info: Testing if fib[2] (2) is even +MiscTests.cpp:114 -MiscTests.cpp:114: info: Testing if fib[3] (3) is even +MiscTests.cpp:114 -MiscTests.cpp:115: +FAILED: CHECK( ( fib[i] % 2 ) == 0 ) -failed with expansion: +with expansion: 1 == 0 +MiscTests.cpp:115 -MiscTests.cpp:114: info: Testing if fib[4] (5) is even +MiscTests.cpp:114 -MiscTests.cpp:115: +FAILED: CHECK( ( fib[i] % 2 ) == 0 ) -failed with expansion: +with expansion: 1 == 0 +MiscTests.cpp:115 -MiscTests.cpp:115: +PASSED: CHECK( ( fib[i] % 2 ) == 0 ) -passed with expansion: +with expansion: 0 == 0 +MiscTests.cpp:115 -MiscTests.cpp:114: info: Testing if fib[5] (8) is even +MiscTests.cpp:114 -MiscTests.cpp:114: info: Testing if fib[6] (13) is even +MiscTests.cpp:114 -MiscTests.cpp:115: +FAILED: CHECK( ( fib[i] % 2 ) == 0 ) -failed with expansion: +with expansion: 1 == 0 +MiscTests.cpp:115 -MiscTests.cpp:114: info: Testing if fib[7] (21) is even +MiscTests.cpp:114 -MiscTests.cpp:115: +FAILED: CHECK( ( fib[i] % 2 ) == 0 ) -failed with expansion: +with expansion: 1 == 0 +MiscTests.cpp:115 Some information An error @@ -2102,87 +2440,97 @@ No assertions in test case, './succeeding/Misc/stdout,stderr' ./succeeding/Misc/null strings ----------------------------------------------------------------- -MiscTests.cpp:133: +PASSED: REQUIRE( makeString( false ) != static_cast(__null) ) -passed with expansion: +with expansion: "valid string" != {null string} +MiscTests.cpp:133 -MiscTests.cpp:134: +PASSED: REQUIRE( makeString( true ) == static_cast(__null) ) -passed with expansion: +with expansion: {null string} == {null string} +MiscTests.cpp:134 ----------------------------------------------------------------- ./failing/info ----------------------------------------------------------------- -MiscTests.cpp:139: info: hi +MiscTests.cpp:139 -MiscTests.cpp:141: info: i := 7 +MiscTests.cpp:141 -MiscTests.cpp:142: +FAILED: REQUIRE( false ) -failed +MiscTests.cpp:142 ----------------------------------------------------------------- ./succeeding/checkedif ----------------------------------------------------------------- -MiscTests.cpp:147: +PASSED: CHECKED_IF( flag ) -passed with expansion: +with expansion: true +MiscTests.cpp:147 -MiscTests.cpp:155: +PASSED: REQUIRE( testCheckedIf( true ) ) -passed with expansion: +with expansion: true +MiscTests.cpp:155 ----------------------------------------------------------------- ./failing/checkedif ----------------------------------------------------------------- -MiscTests.cpp:147: +FAILED: CHECKED_IF( flag ) -failed with expansion: +with expansion: false +MiscTests.cpp:147 -MiscTests.cpp:160: +FAILED: REQUIRE( testCheckedIf( false ) ) -failed with expansion: +with expansion: false +MiscTests.cpp:160 ----------------------------------------------------------------- ./succeeding/checkedelse ----------------------------------------------------------------- -MiscTests.cpp:165: +PASSED: CHECKED_ELSE( flag ) -passed with expansion: +with expansion: true +MiscTests.cpp:165 -MiscTests.cpp:173: +PASSED: REQUIRE( testCheckedElse( true ) ) -passed with expansion: +with expansion: true +MiscTests.cpp:173 ----------------------------------------------------------------- ./failing/checkedelse ----------------------------------------------------------------- -MiscTests.cpp:165: +FAILED: CHECKED_ELSE( flag ) -failed with expansion: +with expansion: false +MiscTests.cpp:165 -MiscTests.cpp:178: +FAILED: REQUIRE( testCheckedElse( false ) ) -failed with expansion: +with expansion: false +MiscTests.cpp:178 ----------------------------------------------------------------- ./misc/xmlentitycheck @@ -2204,147 +2552,165 @@ No assertions in section, 'encoded chars' ./manual/onechar ----------------------------------------------------------------- -MiscTests.cpp:195: info: 3 +MiscTests.cpp:195 -MiscTests.cpp:196: +FAILED: REQUIRE( false ) -failed +MiscTests.cpp:196 ----------------------------------------------------------------- ./succeeding/atomic if ----------------------------------------------------------------- -MiscTests.cpp:206: +PASSED: REQUIRE( x == 0 ) -passed with expansion: +with expansion: 0 == 0 +MiscTests.cpp:206 ----------------------------------------------------------------- ./succeeding/matchers ----------------------------------------------------------------- -MiscTests.cpp:216: +PASSED: REQUIRE_THAT( testStringForMatching() Contains( "string" ) ) -passed with expansion: +with expansion: "this string contains 'abc' as a substring" contains: "string" +MiscTests.cpp:216 -MiscTests.cpp:217: +PASSED: CHECK_THAT( testStringForMatching() Contains( "abc" ) ) -passed with expansion: +with expansion: "this string contains 'abc' as a substring" contains: "abc" +MiscTests.cpp:217 -MiscTests.cpp:219: +PASSED: CHECK_THAT( testStringForMatching() StartsWith( "this" ) ) -passed with expansion: +with expansion: "this string contains 'abc' as a substring" starts with: "this" +MiscTests.cpp:219 -MiscTests.cpp:220: +PASSED: CHECK_THAT( testStringForMatching() EndsWith( "substring" ) ) -passed with expansion: +with expansion: "this string contains 'abc' as a substring" ends with: "substring" +MiscTests.cpp:220 ----------------------------------------------------------------- ./failing/matchers/Contains ----------------------------------------------------------------- -MiscTests.cpp:225: +FAILED: CHECK_THAT( testStringForMatching() Contains( "not there" ) ) -failed with expansion: +with expansion: "this string contains 'abc' as a substring" contains: "not there" +MiscTests.cpp:225 ----------------------------------------------------------------- ./failing/matchers/StartsWith ----------------------------------------------------------------- -MiscTests.cpp:230: +FAILED: CHECK_THAT( testStringForMatching() StartsWith( "string" ) ) -failed with expansion: +with expansion: "this string contains 'abc' as a substring" starts with: "string" +MiscTests.cpp:230 ----------------------------------------------------------------- ./failing/matchers/EndsWith ----------------------------------------------------------------- -MiscTests.cpp:235: +FAILED: CHECK_THAT( testStringForMatching() EndsWith( "this" ) ) -failed with expansion: +with expansion: "this string contains 'abc' as a substring" ends with: "this" +MiscTests.cpp:235 ----------------------------------------------------------------- ./failing/matchers/Equals ----------------------------------------------------------------- -MiscTests.cpp:240: +FAILED: CHECK_THAT( testStringForMatching() Equals( "something else" ) ) -failed with expansion: +with expansion: "this string contains 'abc' as a substring" equals: "something else" +MiscTests.cpp:240 ----------------------------------------------------------------- /succeeding/matchers/AllOf ----------------------------------------------------------------- -MiscTests.cpp:248: +PASSED: CHECK_THAT( testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ) -passed with expansion: +with expansion: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) +MiscTests.cpp:248 ----------------------------------------------------------------- /succeeding/matchers/AnyOf ----------------------------------------------------------------- -MiscTests.cpp:252: +PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) ) -passed with expansion: +with expansion: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) +MiscTests.cpp:252 -MiscTests.cpp:253: +PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) ) -passed with expansion: +with expansion: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) +MiscTests.cpp:253 ----------------------------------------------------------------- ./succeeding/matchers/Equals ----------------------------------------------------------------- -MiscTests.cpp:258: +PASSED: CHECK_THAT( testStringForMatching() Equals( "this string contains 'abc' as a substring" ) ) -passed with expansion: +with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" +MiscTests.cpp:258 ----------------------------------------------------------------- example/factorial ----------------------------------------------------------------- -MiscTests.cpp:269: +PASSED: REQUIRE( Factorial(0) == 1 ) -passed with expansion: +with expansion: 1 == 1 +MiscTests.cpp:269 -MiscTests.cpp:270: +PASSED: REQUIRE( Factorial(1) == 1 ) -passed with expansion: +with expansion: 1 == 1 +MiscTests.cpp:270 -MiscTests.cpp:271: +PASSED: REQUIRE( Factorial(2) == 2 ) -passed with expansion: +with expansion: 2 == 2 +MiscTests.cpp:271 -MiscTests.cpp:272: +PASSED: REQUIRE( Factorial(3) == 6 ) -passed with expansion: +with expansion: 6 == 6 +MiscTests.cpp:272 -MiscTests.cpp:273: +PASSED: REQUIRE( Factorial(10) == 3628800 ) -passed with expansion: +with expansion: 0x == 3628800 +MiscTests.cpp:273 ----------------------------------------------------------------- empty @@ -2357,9 +2723,9 @@ No assertions in test case, 'empty' Nice descriptive name ----------------------------------------------------------------- -MiscTests.cpp:282: warning: This one ran +MiscTests.cpp:282 No assertions in test case, 'Nice descriptive name' @@ -2384,105 +2750,130 @@ selftest/main selftest/expected result/failing tests ----------------------------------------------------------------- -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 -catch_self_test.hpp:114: -passed with message: +PASSED: +with message: Tests failed, as expected +catch_self_test.hpp:114 ----------------------------------------------------------------- selftest/main @@ -2490,185 +2881,229 @@ selftest/main selftest/expected result/succeeding tests ----------------------------------------------------------------- -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 Message from section one Message from section two -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 Some information An error -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 -catch_self_test.hpp:103: -passed with message: +PASSED: +with message: Tests passed, as expected +catch_self_test.hpp:103 Message from section one Message from section two @@ -2680,15 +3115,17 @@ selftest/main selftest/test counts/succeeding tests ----------------------------------------------------------------- -TestMain.cpp:40: +FAILED: CHECK( totals.assertions.passed == 291 ) -failed with expansion: +with expansion: 293 == 291 +TestMain.cpp:40 -TestMain.cpp:41: +PASSED: CHECK( totals.assertions.failed == 0 ) -passed with expansion: +with expansion: 0 == 0 +TestMain.cpp:41 ----------------------------------------------------------------- selftest/main @@ -2696,58 +3133,66 @@ selftest/main selftest/test counts/failing tests ----------------------------------------------------------------- -TestMain.cpp:47: +PASSED: CHECK( totals.assertions.passed == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:47 -TestMain.cpp:48: +PASSED: CHECK( totals.assertions.failed == 72 ) -passed with expansion: +with expansion: 72 == 72 +TestMain.cpp:48 ----------------------------------------------------------------- meta/Misc/Sections ----------------------------------------------------------------- -TestMain.cpp:57: +PASSED: CHECK( totals.assertions.passed == 2 ) -passed with expansion: +with expansion: 2 == 2 +TestMain.cpp:57 -TestMain.cpp:58: +PASSED: CHECK( totals.assertions.failed == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:58 ----------------------------------------------------------------- selftest/parser/2 default ----------------------------------------------------------------- -TestMain.cpp:97: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:97 -TestMain.cpp:99: +PASSED: CHECK( config.shouldDebugBreak == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:99 -TestMain.cpp:100: +PASSED: CHECK( config.cutoff == -1 ) -passed with expansion: +with expansion: -1 == -1 +TestMain.cpp:100 -TestMain.cpp:101: +PASSED: CHECK( config.allowThrows == true ) -passed with expansion: +with expansion: true == true +TestMain.cpp:101 -TestMain.cpp:102: +PASSED: CHECK( config.reporter.empty() ) -passed with expansion: +with expansion: true +TestMain.cpp:102 ----------------------------------------------------------------- selftest/parser/2 @@ -2755,24 +3200,27 @@ selftest/parser/2 -t/1 ----------------------------------------------------------------- -TestMain.cpp:108: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:108 -TestMain.cpp:110: +PASSED: REQUIRE( config.filters.size() == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:110 -TestMain.cpp:111: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:111 -TestMain.cpp:112: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:112 ----------------------------------------------------------------- selftest/parser/2 @@ -2780,24 +3228,27 @@ selftest/parser/2 -t/exclude:1 ----------------------------------------------------------------- -TestMain.cpp:116: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:116 -TestMain.cpp:118: +PASSED: REQUIRE( config.filters.size() == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:118 -TestMain.cpp:119: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:119 -TestMain.cpp:120: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:120 ----------------------------------------------------------------- selftest/parser/2 @@ -2805,24 +3256,27 @@ selftest/parser/2 --test/1 ----------------------------------------------------------------- -TestMain.cpp:125: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:125 -TestMain.cpp:127: +PASSED: REQUIRE( config.filters.size() == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:127 -TestMain.cpp:128: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:128 -TestMain.cpp:129: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:129 ----------------------------------------------------------------- selftest/parser/2 @@ -2830,24 +3284,27 @@ selftest/parser/2 --test/exclude:1 ----------------------------------------------------------------- -TestMain.cpp:134: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:134 -TestMain.cpp:136: +PASSED: REQUIRE( config.filters.size() == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:136 -TestMain.cpp:137: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:137 -TestMain.cpp:138: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:138 ----------------------------------------------------------------- selftest/parser/2 @@ -2855,24 +3312,27 @@ selftest/parser/2 --test/exclude:2 ----------------------------------------------------------------- -TestMain.cpp:143: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:143 -TestMain.cpp:145: +PASSED: REQUIRE( config.filters.size() == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:145 -TestMain.cpp:146: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:146 -TestMain.cpp:147: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:147 ----------------------------------------------------------------- selftest/parser/2 @@ -2880,29 +3340,33 @@ selftest/parser/2 -t/2 ----------------------------------------------------------------- -TestMain.cpp:152: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:152 -TestMain.cpp:154: +PASSED: REQUIRE( config.filters.size() == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:154 -TestMain.cpp:155: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:155 -TestMain.cpp:156: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:156 -TestMain.cpp:157: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:157 ----------------------------------------------------------------- selftest/parser/2 @@ -2910,11 +3374,12 @@ selftest/parser/2 -t/0 ----------------------------------------------------------------- -TestMain.cpp:162: +PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) ) -passed with expansion: +with expansion: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" +TestMain.cpp:162 ----------------------------------------------------------------- selftest/parser/2 @@ -2922,14 +3387,15 @@ selftest/parser/2 -r/console ----------------------------------------------------------------- -TestMain.cpp:169: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:169 -TestMain.cpp:171: +PASSED: REQUIRE( config.reporter == "console" ) -passed with expansion: +with expansion: "console" == "console" +TestMain.cpp:171 ----------------------------------------------------------------- selftest/parser/2 @@ -2937,14 +3403,15 @@ selftest/parser/2 -r/xml ----------------------------------------------------------------- -TestMain.cpp:175: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:175 -TestMain.cpp:177: +PASSED: REQUIRE( config.reporter == "xml" ) -passed with expansion: +with expansion: "xml" == "xml" +TestMain.cpp:177 ----------------------------------------------------------------- selftest/parser/2 @@ -2952,14 +3419,15 @@ selftest/parser/2 --reporter/junit ----------------------------------------------------------------- -TestMain.cpp:181: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:181 -TestMain.cpp:183: +PASSED: REQUIRE( config.reporter == "junit" ) -passed with expansion: +with expansion: "junit" == "junit" +TestMain.cpp:183 ----------------------------------------------------------------- selftest/parser/2 @@ -2967,11 +3435,12 @@ selftest/parser/2 -r/error ----------------------------------------------------------------- -TestMain.cpp:187: +PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) ) -passed with expansion: +with expansion: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" +TestMain.cpp:187 ----------------------------------------------------------------- selftest/parser/2 @@ -2979,14 +3448,15 @@ selftest/parser/2 -b ----------------------------------------------------------------- -TestMain.cpp:194: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:194 -TestMain.cpp:196: +PASSED: REQUIRE( config.shouldDebugBreak == true ) -passed with expansion: +with expansion: true == true +TestMain.cpp:196 ----------------------------------------------------------------- selftest/parser/2 @@ -2994,14 +3464,15 @@ selftest/parser/2 --break ----------------------------------------------------------------- -TestMain.cpp:200: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:200 -TestMain.cpp:202: +PASSED: REQUIRE( config.shouldDebugBreak ) -passed with expansion: +with expansion: true +TestMain.cpp:202 ----------------------------------------------------------------- selftest/parser/2 @@ -3009,11 +3480,12 @@ selftest/parser/2 -b ----------------------------------------------------------------- -TestMain.cpp:206: +PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) ) -passed with expansion: +with expansion: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" +TestMain.cpp:206 ----------------------------------------------------------------- selftest/parser/2 @@ -3021,14 +3493,15 @@ selftest/parser/2 -a ----------------------------------------------------------------- -TestMain.cpp:213: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:213 -TestMain.cpp:215: +PASSED: REQUIRE( config.cutoff == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:215 ----------------------------------------------------------------- selftest/parser/2 @@ -3036,14 +3509,15 @@ selftest/parser/2 -a/2 ----------------------------------------------------------------- -TestMain.cpp:219: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:219 -TestMain.cpp:221: +PASSED: REQUIRE( config.cutoff == 2 ) -passed with expansion: +with expansion: 2 == 2 +TestMain.cpp:221 ----------------------------------------------------------------- selftest/parser/2 @@ -3051,11 +3525,12 @@ selftest/parser/2 -a/error/0 ----------------------------------------------------------------- -TestMain.cpp:225: +PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) -passed with expansion: +with expansion: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" +TestMain.cpp:225 ----------------------------------------------------------------- selftest/parser/2 @@ -3063,11 +3538,12 @@ selftest/parser/2 -a/error/non numeric ----------------------------------------------------------------- -TestMain.cpp:229: +PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) -passed with expansion: +with expansion: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" +TestMain.cpp:229 ----------------------------------------------------------------- selftest/parser/2 @@ -3075,11 +3551,12 @@ selftest/parser/2 -a/error/two args ----------------------------------------------------------------- -TestMain.cpp:233: +PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) ) -passed with expansion: +with expansion: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" +TestMain.cpp:233 ----------------------------------------------------------------- selftest/parser/2 @@ -3087,14 +3564,15 @@ selftest/parser/2 -nt ----------------------------------------------------------------- -TestMain.cpp:240: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:240 -TestMain.cpp:242: +PASSED: REQUIRE( config.allowThrows == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:242 ----------------------------------------------------------------- selftest/parser/2 @@ -3102,14 +3580,15 @@ selftest/parser/2 --nothrow ----------------------------------------------------------------- -TestMain.cpp:246: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:246 -TestMain.cpp:248: +PASSED: REQUIRE( config.allowThrows == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:248 ----------------------------------------------------------------- selftest/parser/2 @@ -3117,19 +3596,21 @@ selftest/parser/2 -o filename ----------------------------------------------------------------- -TestMain.cpp:255: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:255 -TestMain.cpp:257: +PASSED: REQUIRE( config.outputFilename == "filename.ext" ) -passed with expansion: +with expansion: "filename.ext" == "filename.ext" +TestMain.cpp:257 -TestMain.cpp:258: +PASSED: REQUIRE( config.stream.empty() ) -passed with expansion: +with expansion: true +TestMain.cpp:258 ----------------------------------------------------------------- selftest/parser/2 @@ -3137,19 +3618,21 @@ selftest/parser/2 -o %stdout ----------------------------------------------------------------- -TestMain.cpp:262: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:262 -TestMain.cpp:264: +PASSED: REQUIRE( config.stream == "stdout" ) -passed with expansion: +with expansion: "stdout" == "stdout" +TestMain.cpp:264 -TestMain.cpp:265: +PASSED: REQUIRE( config.outputFilename.empty() ) -passed with expansion: +with expansion: true +TestMain.cpp:265 ----------------------------------------------------------------- selftest/parser/2 @@ -3157,14 +3640,15 @@ selftest/parser/2 --out ----------------------------------------------------------------- -TestMain.cpp:269: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:269 -TestMain.cpp:271: +PASSED: REQUIRE( config.outputFilename == "filename.ext" ) -passed with expansion: +with expansion: "filename.ext" == "filename.ext" +TestMain.cpp:271 ----------------------------------------------------------------- selftest/parser/2 @@ -3172,334 +3656,386 @@ selftest/parser/2 -a -b ----------------------------------------------------------------- -TestMain.cpp:278: +PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -passed +TestMain.cpp:278 -TestMain.cpp:280: +PASSED: CHECK( config.cutoff == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:280 -TestMain.cpp:281: +PASSED: CHECK( config.shouldDebugBreak ) -passed with expansion: +with expansion: true +TestMain.cpp:281 -TestMain.cpp:282: +PASSED: CHECK( config.allowThrows == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:282 ----------------------------------------------------------------- selftest/test filter ----------------------------------------------------------------- -TestMain.cpp:291: +PASSED: CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:291 -TestMain.cpp:292: +PASSED: CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:292 -TestMain.cpp:297: +PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:297 -TestMain.cpp:298: +PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:298 -TestMain.cpp:300: +PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:300 -TestMain.cpp:301: +PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:301 ----------------------------------------------------------------- selftest/test filters ----------------------------------------------------------------- -TestMain.cpp:312: +PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:312 -TestMain.cpp:314: +PASSED: CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:314 -TestMain.cpp:315: +PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:315 -TestMain.cpp:316: +PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:316 ----------------------------------------------------------------- selftest/filter/prefix wildcard ----------------------------------------------------------------- -TestMain.cpp:322: +PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:322 -TestMain.cpp:323: +PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:323 ----------------------------------------------------------------- selftest/filter/wildcard at both ends ----------------------------------------------------------------- -TestMain.cpp:328: +PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:328 -TestMain.cpp:329: +PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:329 -TestMain.cpp:330: +PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:330 -TestMain.cpp:331: +PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:331 ----------------------------------------------------------------- selftest/option parsers ----------------------------------------------------------------- -TestMain.cpp:351: +PASSED: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) -passed +TestMain.cpp:351 -TestMain.cpp:353: +PASSED: REQUIRE( config.filters.size() == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:353 -TestMain.cpp:354: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:354 -TestMain.cpp:355: +PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) -passed with expansion: +with expansion: true +TestMain.cpp:355 ----------------------------------------------------------------- selftest/tags one tag ----------------------------------------------------------------- -TestMain.cpp:369: +PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) -passed with expansion: +with expansion: "" == "" +TestMain.cpp:369 -TestMain.cpp:370: +PASSED: CHECK( oneTag.hasTag( "one" ) ) -passed with expansion: +with expansion: true +TestMain.cpp:370 -TestMain.cpp:371: +PASSED: CHECK( oneTag.getTags().size() == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:371 -TestMain.cpp:373: +PASSED: CHECK( oneTag.matchesTags( p1 ) == true ) -passed with expansion: +with expansion: true == true +TestMain.cpp:373 -TestMain.cpp:374: +PASSED: CHECK( oneTag.matchesTags( p2 ) == true ) -passed with expansion: +with expansion: true == true +TestMain.cpp:374 -TestMain.cpp:375: +PASSED: CHECK( oneTag.matchesTags( p3 ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:375 -TestMain.cpp:376: +PASSED: CHECK( oneTag.matchesTags( p4 ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:376 -TestMain.cpp:377: +PASSED: CHECK( oneTag.matchesTags( p5 ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:377 ----------------------------------------------------------------- selftest/tags two tags ----------------------------------------------------------------- -TestMain.cpp:383: +PASSED: CHECK( twoTags.getTestCaseInfo().description == "" ) -passed with expansion: +with expansion: "" == "" +TestMain.cpp:383 -TestMain.cpp:384: +PASSED: CHECK( twoTags.hasTag( "one" ) ) -passed with expansion: +with expansion: true +TestMain.cpp:384 -TestMain.cpp:385: +PASSED: CHECK( twoTags.hasTag( "two" ) ) -passed with expansion: +with expansion: true +TestMain.cpp:385 -TestMain.cpp:386: +PASSED: CHECK( twoTags.hasTag( "three" ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:386 -TestMain.cpp:387: +PASSED: CHECK( twoTags.getTags().size() == 2 ) -passed with expansion: +with expansion: 2 == 2 +TestMain.cpp:387 -TestMain.cpp:389: +PASSED: CHECK( twoTags.matchesTags( p1 ) == true ) -passed with expansion: +with expansion: true == true +TestMain.cpp:389 -TestMain.cpp:390: +PASSED: CHECK( twoTags.matchesTags( p2 ) == true ) -passed with expansion: +with expansion: true == true +TestMain.cpp:390 -TestMain.cpp:391: +PASSED: CHECK( twoTags.matchesTags( p3 ) == true ) -passed with expansion: +with expansion: true == true +TestMain.cpp:391 -TestMain.cpp:392: +PASSED: CHECK( twoTags.matchesTags( p4 ) == true ) -passed with expansion: +with expansion: true == true +TestMain.cpp:392 -TestMain.cpp:393: +PASSED: CHECK( twoTags.matchesTags( p5 ) == true ) -passed with expansion: +with expansion: true == true +TestMain.cpp:393 ----------------------------------------------------------------- selftest/tags one tag with characters either side ----------------------------------------------------------------- -TestMain.cpp:399: +PASSED: CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) -passed with expansion: +with expansion: "1234" == "1234" +TestMain.cpp:399 -TestMain.cpp:400: +PASSED: CHECK( oneTagWithExtras.hasTag( "one" ) ) -passed with expansion: +with expansion: true +TestMain.cpp:400 -TestMain.cpp:401: +PASSED: CHECK( oneTagWithExtras.hasTag( "two" ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:401 -TestMain.cpp:402: +PASSED: CHECK( oneTagWithExtras.getTags().size() == 1 ) -passed with expansion: +with expansion: 1 == 1 +TestMain.cpp:402 ----------------------------------------------------------------- selftest/tags start of a tag, but not closed ----------------------------------------------------------------- -TestMain.cpp:409: +PASSED: CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) -passed with expansion: +with expansion: "[one" == "[one" +TestMain.cpp:409 -TestMain.cpp:410: +PASSED: CHECK( oneTagOpen.hasTag( "one" ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:410 -TestMain.cpp:411: +PASSED: CHECK( oneTagOpen.getTags().size() == 0 ) -passed with expansion: +with expansion: 0 == 0 +TestMain.cpp:411 ----------------------------------------------------------------- selftest/tags hidden ----------------------------------------------------------------- -TestMain.cpp:417: +PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) -passed with expansion: +with expansion: "" == "" +TestMain.cpp:417 -TestMain.cpp:418: +PASSED: CHECK( oneTag.hasTag( "hide" ) ) -passed with expansion: +with expansion: true +TestMain.cpp:418 -TestMain.cpp:419: +PASSED: CHECK( oneTag.isHidden() ) -passed with expansion: +with expansion: true +TestMain.cpp:419 -TestMain.cpp:421: +PASSED: CHECK( oneTag.matchesTags( "~[hide]" ) == false ) -passed with expansion: +with expansion: false == false +TestMain.cpp:421 ----------------------------------------------------------------- ./succeeding/Tricky/std::pair ----------------------------------------------------------------- -TrickyTests.cpp:37: +PASSED: REQUIRE( (std::pair( 1, 2 )) == aNicePair ) -passed with expansion: +with expansion: std::pair( 1, 2 ) == std::pair( 1, 2 ) +TrickyTests.cpp:37 ----------------------------------------------------------------- ./inprogress/failing/Tricky/trailing expression ----------------------------------------------------------------- -TrickyTests.cpp:55: warning: Uncomment the code in this test to check that it gives a sensible compiler error +TrickyTests.cpp:55 No assertions in test case, './inprogress/failing/Tricky/trailing expression' @@ -3508,10 +4044,10 @@ No assertions in test case, './inprogress/failing/Tricky/trailing expression' ./inprogress/failing/Tricky/compound lhs ----------------------------------------------------------------- -TrickyTests.cpp:71: warning: Uncomment the code in this test to check that it gives a sensible compiler error +TrickyTests.cpp:71 No assertions in test case, './inprogress/failing/Tricky/compound lhs' @@ -3520,170 +4056,191 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' ./failing/Tricky/non streamable type ----------------------------------------------------------------- -TrickyTests.cpp:95: +FAILED: CHECK( &o1 == &o2 ) -failed with expansion: +with expansion: 0x == 0x +TrickyTests.cpp:95 -TrickyTests.cpp:96: +FAILED: CHECK( o1 == o2 ) -failed with expansion: +with expansion: {?} == {?} +TrickyTests.cpp:96 ----------------------------------------------------------------- ./failing/string literals ----------------------------------------------------------------- -TrickyTests.cpp:106: +FAILED: REQUIRE( std::string( "first" ) == "second" ) -failed with expansion: +with expansion: "first" == "second" +TrickyTests.cpp:106 ----------------------------------------------------------------- ./succeeding/side-effects ----------------------------------------------------------------- -TrickyTests.cpp:119: +PASSED: REQUIRE( i++ == 7 ) -passed with expansion: +with expansion: 7 == 7 +TrickyTests.cpp:119 -TrickyTests.cpp:120: +PASSED: REQUIRE( i++ == 8 ) -passed with expansion: +with expansion: 8 == 8 +TrickyTests.cpp:120 ----------------------------------------------------------------- ./succeeding/koenig ----------------------------------------------------------------- -TrickyTests.cpp:186: +PASSED: REQUIRE( 0x == o ) -passed with expansion: +with expansion: 0x == {?} +TrickyTests.cpp:186 ----------------------------------------------------------------- ./succeeding/non-const== ----------------------------------------------------------------- -TrickyTests.cpp:212: +PASSED: REQUIRE( t == 1u ) -passed with expansion: +with expansion: {?} == 1 +TrickyTests.cpp:212 ----------------------------------------------------------------- ./succeeding/enum/bits ----------------------------------------------------------------- -TrickyTests.cpp:224: +PASSED: REQUIRE( 0x == bit30and31 ) -passed with expansion: +with expansion: 0x == 3221225472 +TrickyTests.cpp:224 ----------------------------------------------------------------- ./succeeding/boolean member ----------------------------------------------------------------- -TrickyTests.cpp:239: +PASSED: REQUIRE( obj.prop != __null ) -passed with expansion: +with expansion: 0x != 0 +TrickyTests.cpp:239 ----------------------------------------------------------------- ./succeeding/unimplemented static bool compare to true ----------------------------------------------------------------- -TrickyTests.cpp:259: +PASSED: REQUIRE( is_true::value == true ) -passed with expansion: +with expansion: true == true +TrickyTests.cpp:259 -TrickyTests.cpp:260: +PASSED: REQUIRE( true == is_true::value ) -passed with expansion: +with expansion: true == true +TrickyTests.cpp:260 ----------------------------------------------------------------- ./succeeding/unimplemented static bool compare to false ----------------------------------------------------------------- -TrickyTests.cpp:264: +PASSED: REQUIRE( is_true::value == false ) -passed with expansion: +with expansion: false == false +TrickyTests.cpp:264 -TrickyTests.cpp:265: +PASSED: REQUIRE( false == is_true::value ) -passed with expansion: +with expansion: false == false +TrickyTests.cpp:265 ----------------------------------------------------------------- ./succeeding/unimplemented static bool negation ----------------------------------------------------------------- -TrickyTests.cpp:270: +PASSED: REQUIRE( !is_true::value ) -passed with expansion: +with expansion: true +TrickyTests.cpp:270 ----------------------------------------------------------------- ./succeeding/unimplemented static bool double negation ----------------------------------------------------------------- -TrickyTests.cpp:275: +PASSED: REQUIRE( !!is_true::value ) -passed with expansion: +with expansion: true +TrickyTests.cpp:275 ----------------------------------------------------------------- ./succeeding/unimplemented static bool direct ----------------------------------------------------------------- -TrickyTests.cpp:280: +PASSED: REQUIRE( is_true::value ) -passed with expansion: +with expansion: true +TrickyTests.cpp:280 -TrickyTests.cpp:281: +PASSED: REQUIRE_FALSE( !is_true::value ) -passed with expansion: +with expansion: !false +TrickyTests.cpp:281 ----------------------------------------------------------------- ./succeeding/SafeBool ----------------------------------------------------------------- -TrickyTests.cpp:313: +PASSED: CHECK( True ) -passed with expansion: +with expansion: true +TrickyTests.cpp:313 -TrickyTests.cpp:314: +PASSED: CHECK( !False ) -passed with expansion: +with expansion: true +TrickyTests.cpp:314 -TrickyTests.cpp:315: +PASSED: CHECK_FALSE( !False ) -passed with expansion: +with expansion: !false +TrickyTests.cpp:315 ----------------------------------------------------------------- Scenario: Do that thing with the thing Given: This stuff exists - When: I do this - Then: it should do this + When: I do this + Then: it should do this ----------------------------------------------------------------- -BDDTests.cpp:29: +PASSED: REQUIRE( itDoesThis() ) -passed with expansion: +with expansion: true +BDDTests.cpp:29 ================================================================= 96 test cases - 45 failed (610 assertions - 102 failed) @@ -3696,237 +4253,273 @@ Run with -? for options ./succeeding/Approx/simple ----------------------------------------------------------------- -ApproxTests.cpp:20: +PASSED: REQUIRE( d == Approx( 1.23 ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:20 -ApproxTests.cpp:21: +PASSED: REQUIRE( d != Approx( 1.22 ) ) -passed with expansion: +with expansion: 1.23 != Approx( 1.22 ) +ApproxTests.cpp:21 -ApproxTests.cpp:22: +PASSED: REQUIRE( d != Approx( 1.24 ) ) -passed with expansion: +with expansion: 1.23 != Approx( 1.24 ) +ApproxTests.cpp:22 -ApproxTests.cpp:24: +PASSED: REQUIRE( Approx( d ) == 1.23 ) -passed with expansion: +with expansion: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:24 -ApproxTests.cpp:25: +PASSED: REQUIRE( Approx( d ) != 1.22 ) -passed with expansion: +with expansion: Approx( 1.23 ) != 1.22 +ApproxTests.cpp:25 -ApproxTests.cpp:26: +PASSED: REQUIRE( Approx( d ) != 1.24 ) -passed with expansion: +with expansion: Approx( 1.23 ) != 1.24 +ApproxTests.cpp:26 ----------------------------------------------------------------- ./succeeding/Approx/epsilon ----------------------------------------------------------------- -ApproxTests.cpp:38: +PASSED: REQUIRE( d != Approx( 1.231 ) ) -passed with expansion: +with expansion: 1.23 != Approx( 1.231 ) +ApproxTests.cpp:38 -ApproxTests.cpp:39: +PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.231 ) +ApproxTests.cpp:39 ----------------------------------------------------------------- ./succeeding/Approx/float ----------------------------------------------------------------- -ApproxTests.cpp:49: +PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:49 -ApproxTests.cpp:50: +PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) -passed with expansion: +with expansion: 0 == Approx( 0 ) +ApproxTests.cpp:50 ----------------------------------------------------------------- ./succeeding/Approx/int ----------------------------------------------------------------- -ApproxTests.cpp:60: +PASSED: REQUIRE( 1 == Approx( 1 ) ) -passed +ApproxTests.cpp:60 -ApproxTests.cpp:61: +PASSED: REQUIRE( 0 == Approx( 0 ) ) -passed +ApproxTests.cpp:61 ----------------------------------------------------------------- ./succeeding/Approx/mixed ----------------------------------------------------------------- -ApproxTests.cpp:75: +PASSED: REQUIRE( 1.0f == Approx( 1 ) ) -passed with expansion: +with expansion: 1 == Approx( 1 ) +ApproxTests.cpp:75 -ApproxTests.cpp:76: +PASSED: REQUIRE( 0 == Approx( dZero) ) -passed with expansion: +with expansion: 0 == Approx( 0 ) +ApproxTests.cpp:76 -ApproxTests.cpp:77: +PASSED: REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) -passed with expansion: +with expansion: 0 == Approx( 1e-05 ) +ApproxTests.cpp:77 -ApproxTests.cpp:78: +PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) -passed with expansion: +with expansion: 1.234 == Approx( 1.234 ) +ApproxTests.cpp:78 -ApproxTests.cpp:79: +PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) -passed with expansion: +with expansion: 1.234 == Approx( 1.234 ) +ApproxTests.cpp:79 ----------------------------------------------------------------- ./succeeding/Approx/custom ----------------------------------------------------------------- -ApproxTests.cpp:93: +PASSED: REQUIRE( d == approx( 1.23 ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.23 ) +ApproxTests.cpp:93 -ApproxTests.cpp:94: +PASSED: REQUIRE( d == approx( 1.22 ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.22 ) +ApproxTests.cpp:94 -ApproxTests.cpp:95: +PASSED: REQUIRE( d == approx( 1.24 ) ) -passed with expansion: +with expansion: 1.23 == Approx( 1.24 ) +ApproxTests.cpp:95 -ApproxTests.cpp:96: +PASSED: REQUIRE( d != approx( 1.25 ) ) -passed with expansion: +with expansion: 1.23 != Approx( 1.25 ) +ApproxTests.cpp:96 -ApproxTests.cpp:98: +PASSED: REQUIRE( approx( d ) == 1.23 ) -passed with expansion: +with expansion: Approx( 1.23 ) == 1.23 +ApproxTests.cpp:98 -ApproxTests.cpp:99: +PASSED: REQUIRE( approx( d ) == 1.22 ) -passed with expansion: +with expansion: Approx( 1.23 ) == 1.22 +ApproxTests.cpp:99 -ApproxTests.cpp:100: +PASSED: REQUIRE( approx( d ) == 1.24 ) -passed with expansion: +with expansion: Approx( 1.23 ) == 1.24 +ApproxTests.cpp:100 -ApproxTests.cpp:101: +PASSED: REQUIRE( approx( d ) != 1.25 ) -passed with expansion: +with expansion: Approx( 1.23 ) != 1.25 +ApproxTests.cpp:101 ----------------------------------------------------------------- ./succeeding/TestClass/succeedingCase ----------------------------------------------------------------- -ClassTests.cpp:24: +PASSED: REQUIRE( s == "hello" ) -passed with expansion: +with expansion: "hello" == "hello" +ClassTests.cpp:24 ----------------------------------------------------------------- ./failing/TestClass/failingCase ----------------------------------------------------------------- -ClassTests.cpp:28: +FAILED: REQUIRE( s == "world" ) -failed with expansion: +with expansion: "hello" == "world" +ClassTests.cpp:28 ----------------------------------------------------------------- ./succeeding/Fixture/succeedingCase ----------------------------------------------------------------- -ClassTests.cpp:47: +PASSED: REQUIRE( m_a == 1 ) -passed with expansion: +with expansion: 1 == 1 +ClassTests.cpp:47 ----------------------------------------------------------------- ./failing/Fixture/failingCase ----------------------------------------------------------------- -ClassTests.cpp:55: +FAILED: REQUIRE( m_a == 2 ) -failed with expansion: +with expansion: 1 == 2 +ClassTests.cpp:55 ----------------------------------------------------------------- ./succeeding/conditions/equality ----------------------------------------------------------------- -ConditionTests.cpp:55: +PASSED: REQUIRE( data.int_seven == 7 ) -passed with expansion: +with expansion: 7 == 7 +ConditionTests.cpp:55 -ConditionTests.cpp:56: +PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) -passed with expansion: +with expansion: 9.1 == Approx( 9.1 ) +ConditionTests.cpp:56 -ConditionTests.cpp:57: +PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) -passed with expansion: +with expansion: 3.14159 == Approx( 3.14159 ) +ConditionTests.cpp:57 -ConditionTests.cpp:58: +PASSED: REQUIRE( data.str_hello == "hello" ) -passed with expansion: +with expansion: "hello" == "hello" +ConditionTests.cpp:58 -ConditionTests.cpp:59: +PASSED: REQUIRE( "hello" == data.str_hello ) -passed with expansion: +with expansion: "hello" == "hello" +ConditionTests.cpp:59 -ConditionTests.cpp:60: +PASSED: REQUIRE( data.str_hello.size() == 5 ) -passed with expansion: +with expansion: 5 == 5 +ConditionTests.cpp:60 -ConditionTests.cpp:63: +PASSED: REQUIRE( x == Approx( 1.3 ) ) -passed with expansion: +with expansion: 1.3 == Approx( 1.3 ) +ConditionTests.cpp:63 ----------------------------------------------------------------- ./failing/conditions/equality ----------------------------------------------------------------- -ConditionTests.cpp:71: +FAILED: CHECK( data.int_seven == 6 ) -failed with expansion: +with expansion: 7 == 6 +ConditionTests.cpp:71 -ConditionTests.cpp:72: +FAILED: CHECK( data.int_seven == 8 ) -failed with expansion: +with expansion: 7 == 8 +ConditionTests.cpp:72 ================================================================= 12 test cases - 3 failed (38 assertions - 4 failed) @@ -9275,8 +9868,8 @@ TrickyTests.cpp" line="315">
-
-
+
+
BDDTests.cpp" line="29"> itDoesThis() @@ -10631,12 +11224,12 @@ TrickyTests.cpp:315: !False succeeded for: !false [Running: Scenario: Do that thing with the thing] [Started section: ' Given: This stuff exists'] -[Started section: ' When: I do this'] -[Started section: ' Then: it should do this'] +[Started section: ' When: I do this'] +[Started section: ' Then: it should do this'] BDDTests.cpp:29: itDoesThis() succeeded for: true -[End of section: ' Then: it should do this' 1 assertion passed] +[End of section: ' Then: it should do this' 1 assertion passed] -[End of section: ' When: I do this' 1 assertion passed] +[End of section: ' When: I do this' 1 assertion passed] [End of section: ' Given: This stuff exists' 1 assertion passed] diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index 1a8807f6..43d40068 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -15,8 +15,8 @@ // !TBD: story scenarios map to class based tests #define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) #define GIVEN( desc ) SECTION( " Given: " desc, "" ) -#define WHEN( desc ) SECTION( " When: " desc, "" ) -#define THEN( desc ) SECTION( " Then: " desc, "" ) +#define WHEN( desc ) SECTION( " When: " desc, "" ) +#define THEN( desc ) SECTION( " Then: " desc, "" ) inline bool itDoesThis(){ return true; } diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 51dff101..cd017674 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 13 (integration branch) - * Generated: 2013-01-16 09:43:42.849422 + * CATCH v0.9 build 14 (integration branch) + * Generated: 2013-01-17 12:06:33.338396 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -5777,7 +5777,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 13, "integration" ); + Version libraryVersion( 0, 9, 14, "integration" ); } // #included from: catch_line_wrap.hpp @@ -6845,23 +6845,25 @@ namespace Catch { lazyPrint(); - { - TextColour colour( TextColour::FileName ); - stream << result.getSourceInfo() << ":\n"; - } - ResultComponents components( result ); bool endsWithNewLine = false; if( _assertionStats.totals.assertions.total() > 0 ) { - printOriginalExpression( result ); printResultType( components ); + printOriginalExpression( result ); +// printResultType( components ); endsWithNewLine = printReconstructedExpression( result ); } endsWithNewLine |= printMessage( components ); - if( !endsWithNewLine ) - stream << "\n"; +// if( !endsWithNewLine ) +// stream << "\n"; + + printSourceInfo( result ); stream << std::endl; } + void printSourceInfo( AssertionResult const& _result ) { + TextColour colour( TextColour::FileName ); + stream << _result.getSourceInfo() << "\n"; + } struct ResultComponents { ResultComponents( AssertionResult const& _result ) @@ -6871,18 +6873,18 @@ namespace Catch { switch( _result.getResultType() ) { case ResultWas::Ok: colour = TextColour::Success; - passOrFail = "passed"; + passOrFail = "PASSED"; if( _result.hasMessage() ) messageLabel = "with message"; break; case ResultWas::ExpressionFailed: if( _result.isOk() ) { colour = TextColour::Success; - passOrFail = "failed - but was ok"; + passOrFail = "FAILED - but was ok"; } else { colour = TextColour::Error; - passOrFail = "failed"; + passOrFail = "FAILED"; } if( _result.hasMessage() ){ messageLabel = "with message"; @@ -6890,12 +6892,12 @@ namespace Catch { break; case ResultWas::ThrewException: colour = TextColour::Error; - passOrFail = "failed"; + passOrFail = "FAILED"; messageLabel = "due to unexpected exception with message"; break; case ResultWas::DidntThrowException: colour = TextColour::Error; - passOrFail = "failed"; + passOrFail = "FAILED"; messageLabel = "because no exception was thrown where one was expected"; break; case ResultWas::Info: @@ -6905,12 +6907,12 @@ namespace Catch { messageLabel = "warning"; break; case ResultWas::ExplicitFailure: - passOrFail = "failed"; + passOrFail = "FAILED"; colour = TextColour::Error; messageLabel = "explicitly with message"; break; case ResultWas::Exception: - passOrFail = "failed"; + passOrFail = "FAILED"; colour = TextColour::Error; if( _result.hasMessage() ) messageLabel = "with message"; @@ -6934,7 +6936,7 @@ namespace Catch { void printResultType( ResultComponents const& _components ) { if( !_components.passOrFail.empty() ) { TextColour colour( _components.colour ); - stream << _components.passOrFail << " "; + stream << _components.passOrFail << ":\n"; } } bool printOriginalExpression( AssertionResult const& _result ) { @@ -7040,13 +7042,13 @@ namespace Catch { } void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() && unusedGroupInfo->groupsCounts > 1 ) { - printHeader( "Group", unusedGroupInfo->name ); + printHeader( "Group: " + unusedGroupInfo->name ); unusedGroupInfo.reset(); } } void lazyPrintTestCaseInfo() { if( !currentSectionInfo ) { - printTestCaseHeader(); + printHeader( unusedTestCaseInfo->name ); stream << std::endl; unusedTestCaseInfo.reset(); } @@ -7061,38 +7063,21 @@ namespace Catch { // Sections if( !sections.empty() ) { - printTestCaseHeader(); + printHeader( unusedTestCaseInfo->name, false ); - std::string firstInset; - std::string inset; - if( sections.size() > 1 ) { - firstInset = "Sections: "; - inset = " "; - } - else { - firstInset = "Section: "; - inset = " "; - } typedef std::vector::const_reverse_iterator It; - for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) { - if( it == sections.rbegin() ) - stream << firstInset; - else - stream << inset; - stream << (*it)->name << "\n"; - } + for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) + stream << " " << (*it)->name << "\n"; stream << getDashes() << "\n" << std::endl; unusedSectionInfo.reset(); } } - void printTestCaseHeader() { - printHeader( "Test case", unusedTestCaseInfo->name ); - } - void printHeader( std::string const& _type, std::string const& _name ) { + void printHeader( std::string const& _name, bool closed = true ) { stream << getDashes() << "\n" - << _type << ": '" << _name << "'\n" - << getDashes() << "\n"; + << _name << "\n"; + if( closed ) + stream << getDashes() << "\n"; } void printTotals( const Totals& totals ) { @@ -7150,12 +7135,12 @@ namespace Catch { } static std::string const& getDashes() { static const std::string dashes - = "----------------------------------------------------------------"; + = "-----------------------------------------------------------------"; return dashes; } static std::string const& getDoubleDashes() { static const std::string doubleDashes - = "================================================================"; + = "================================================================="; return doubleDashes; } From 3ce320db4f7943f48737be3fb304419e136a4275 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 18 Jan 2013 08:09:28 +0000 Subject: [PATCH 119/296] More console reporter tweaks --- README | 2 +- include/internal/catch_version.hpp | 2 +- include/reporters/catch_reporter_console.hpp | 14 +- .../SelfTest/Baselines/approvedResults.txt | 1618 ++++++++--------- single_include/catch.hpp | 20 +- 5 files changed, 830 insertions(+), 826 deletions(-) diff --git a/README b/README index 00d4728b..fba4de53 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 14 (integration branch) +CATCH v0.9 build 15 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index adc262b4..1d5eac22 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 14, "integration" ); + Version libraryVersion( 0, 9, 15, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index dbb3b023..292b354b 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -48,19 +48,16 @@ namespace Catch { if( _assertionStats.totals.assertions.total() > 0 ) { printResultType( components ); printOriginalExpression( result ); -// printResultType( components ); endsWithNewLine = printReconstructedExpression( result ); } endsWithNewLine |= printMessage( components ); -// if( !endsWithNewLine ) -// stream << "\n"; printSourceInfo( result ); stream << std::endl; } void printSourceInfo( AssertionResult const& _result ) { TextColour colour( TextColour::FileName ); - stream << _result.getSourceInfo() << "\n"; + stream << _result.getSourceInfo() << ":\n"; } struct ResultComponents { @@ -266,7 +263,7 @@ namespace Catch { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) stream << " " << (*it)->name << "\n"; - stream << getDashes() << "\n" << std::endl; + stream << getDots() << "\n" << std::endl; unusedSectionInfo.reset(); } } @@ -275,7 +272,7 @@ namespace Catch { stream << getDashes() << "\n" << _name << "\n"; if( closed ) - stream << getDashes() << "\n"; + stream << getDots() << "\n"; } void printTotals( const Totals& totals ) { @@ -336,6 +333,11 @@ namespace Catch { = "-----------------------------------------------------------------"; return dashes; } + static std::string const& getDots() { + static const std::string dots + = "................................................................."; + return dots; + } static std::string const& getDoubleDashes() { static const std::string doubleDashes = "================================================================="; diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index ecd718ea..10d03a66 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,2114 +1,2114 @@ -CatchSelfTest is a CATCH v0.9 b13 (integration) host application. +CatchSelfTest is a CATCH v0.9 b15 (integration) host application. Run with -? for options ----------------------------------------------------------------- ./succeeding/Approx/simple ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( d == Approx( 1.23 ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:20 +ApproxTests.cpp:20: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: 1.23 != Approx( 1.22 ) -ApproxTests.cpp:21 +ApproxTests.cpp:21: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: 1.23 != Approx( 1.24 ) -ApproxTests.cpp:22 +ApproxTests.cpp:22: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:24 +ApproxTests.cpp:24: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: Approx( 1.23 ) != 1.22 -ApproxTests.cpp:25 +ApproxTests.cpp:25: PASSED: REQUIRE( Approx( d ) != 1.24 ) with expansion: Approx( 1.23 ) != 1.24 -ApproxTests.cpp:26 +ApproxTests.cpp:26: ----------------------------------------------------------------- ./succeeding/Approx/epsilon ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( d != Approx( 1.231 ) ) with expansion: 1.23 != Approx( 1.231 ) -ApproxTests.cpp:38 +ApproxTests.cpp:38: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) with expansion: 1.23 == Approx( 1.231 ) -ApproxTests.cpp:39 +ApproxTests.cpp:39: ----------------------------------------------------------------- ./succeeding/Approx/float ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:49 +ApproxTests.cpp:49: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) with expansion: 0 == Approx( 0 ) -ApproxTests.cpp:50 +ApproxTests.cpp:50: ----------------------------------------------------------------- ./succeeding/Approx/int ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( 1 == Approx( 1 ) ) -ApproxTests.cpp:60 +ApproxTests.cpp:60: PASSED: REQUIRE( 0 == Approx( 0 ) ) -ApproxTests.cpp:61 +ApproxTests.cpp:61: ----------------------------------------------------------------- ./succeeding/Approx/mixed ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( 1.0f == Approx( 1 ) ) with expansion: 1 == Approx( 1 ) -ApproxTests.cpp:75 +ApproxTests.cpp:75: PASSED: REQUIRE( 0 == Approx( dZero) ) with expansion: 0 == Approx( 0 ) -ApproxTests.cpp:76 +ApproxTests.cpp:76: PASSED: REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) with expansion: 0 == Approx( 1e-05 ) -ApproxTests.cpp:77 +ApproxTests.cpp:77: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: 1.234 == Approx( 1.234 ) -ApproxTests.cpp:78 +ApproxTests.cpp:78: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) with expansion: 1.234 == Approx( 1.234 ) -ApproxTests.cpp:79 +ApproxTests.cpp:79: ----------------------------------------------------------------- ./succeeding/Approx/custom ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( d == approx( 1.23 ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:93 +ApproxTests.cpp:93: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: 1.23 == Approx( 1.22 ) -ApproxTests.cpp:94 +ApproxTests.cpp:94: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: 1.23 == Approx( 1.24 ) -ApproxTests.cpp:95 +ApproxTests.cpp:95: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: 1.23 != Approx( 1.25 ) -ApproxTests.cpp:96 +ApproxTests.cpp:96: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:98 +ApproxTests.cpp:98: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: Approx( 1.23 ) == 1.22 -ApproxTests.cpp:99 +ApproxTests.cpp:99: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: Approx( 1.23 ) == 1.24 -ApproxTests.cpp:100 +ApproxTests.cpp:100: PASSED: REQUIRE( approx( d ) != 1.25 ) with expansion: Approx( 1.23 ) != 1.25 -ApproxTests.cpp:101 +ApproxTests.cpp:101: ----------------------------------------------------------------- ./succeeding/TestClass/succeedingCase ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( s == "hello" ) with expansion: "hello" == "hello" -ClassTests.cpp:24 +ClassTests.cpp:24: ----------------------------------------------------------------- ./failing/TestClass/failingCase ------------------------------------------------------------------ +................................................................. FAILED: REQUIRE( s == "world" ) with expansion: "hello" == "world" -ClassTests.cpp:28 +ClassTests.cpp:28: ----------------------------------------------------------------- ./succeeding/Fixture/succeedingCase ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( m_a == 1 ) with expansion: 1 == 1 -ClassTests.cpp:47 +ClassTests.cpp:47: ----------------------------------------------------------------- ./failing/Fixture/failingCase ------------------------------------------------------------------ +................................................................. FAILED: REQUIRE( m_a == 2 ) with expansion: 1 == 2 -ClassTests.cpp:55 +ClassTests.cpp:55: ----------------------------------------------------------------- ./succeeding/conditions/equality ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( data.int_seven == 7 ) with expansion: 7 == 7 -ConditionTests.cpp:55 +ConditionTests.cpp:55: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: 9.1 == Approx( 9.1 ) -ConditionTests.cpp:56 +ConditionTests.cpp:56: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: 3.14159 == Approx( 3.14159 ) -ConditionTests.cpp:57 +ConditionTests.cpp:57: PASSED: REQUIRE( data.str_hello == "hello" ) with expansion: "hello" == "hello" -ConditionTests.cpp:58 +ConditionTests.cpp:58: PASSED: REQUIRE( "hello" == data.str_hello ) with expansion: "hello" == "hello" -ConditionTests.cpp:59 +ConditionTests.cpp:59: PASSED: REQUIRE( data.str_hello.size() == 5 ) with expansion: 5 == 5 -ConditionTests.cpp:60 +ConditionTests.cpp:60: PASSED: REQUIRE( x == Approx( 1.3 ) ) with expansion: 1.3 == Approx( 1.3 ) -ConditionTests.cpp:63 +ConditionTests.cpp:63: ----------------------------------------------------------------- ./failing/conditions/equality ------------------------------------------------------------------ +................................................................. FAILED: CHECK( data.int_seven == 6 ) with expansion: 7 == 6 -ConditionTests.cpp:71 +ConditionTests.cpp:71: FAILED: CHECK( data.int_seven == 8 ) with expansion: 7 == 8 -ConditionTests.cpp:72 +ConditionTests.cpp:72: FAILED: CHECK( data.int_seven == 0 ) with expansion: 7 == 0 -ConditionTests.cpp:73 +ConditionTests.cpp:73: FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: 9.1 == Approx( 9.11 ) -ConditionTests.cpp:74 +ConditionTests.cpp:74: FAILED: CHECK( data.float_nine_point_one == Approx( 9.0f ) ) with expansion: 9.1 == Approx( 9 ) -ConditionTests.cpp:75 +ConditionTests.cpp:75: FAILED: CHECK( data.float_nine_point_one == Approx( 1 ) ) with expansion: 9.1 == Approx( 1 ) -ConditionTests.cpp:76 +ConditionTests.cpp:76: FAILED: CHECK( data.float_nine_point_one == Approx( 0 ) ) with expansion: 9.1 == Approx( 0 ) -ConditionTests.cpp:77 +ConditionTests.cpp:77: FAILED: CHECK( data.double_pi == Approx( 3.1415 ) ) with expansion: 3.14159 == Approx( 3.1415 ) -ConditionTests.cpp:78 +ConditionTests.cpp:78: FAILED: CHECK( data.str_hello == "goodbye" ) with expansion: "hello" == "goodbye" -ConditionTests.cpp:79 +ConditionTests.cpp:79: FAILED: CHECK( data.str_hello == "hell" ) with expansion: "hello" == "hell" -ConditionTests.cpp:80 +ConditionTests.cpp:80: FAILED: CHECK( data.str_hello == "hello1" ) with expansion: "hello" == "hello1" -ConditionTests.cpp:81 +ConditionTests.cpp:81: FAILED: CHECK( data.str_hello.size() == 6 ) with expansion: 5 == 6 -ConditionTests.cpp:82 +ConditionTests.cpp:82: FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: 1.3 == Approx( 1.301 ) -ConditionTests.cpp:85 +ConditionTests.cpp:85: ----------------------------------------------------------------- ./succeeding/conditions/inequality ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( data.int_seven != 6 ) with expansion: 7 != 6 -ConditionTests.cpp:93 +ConditionTests.cpp:93: PASSED: REQUIRE( data.int_seven != 8 ) with expansion: 7 != 8 -ConditionTests.cpp:94 +ConditionTests.cpp:94: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.11f ) ) with expansion: 9.1 != Approx( 9.11 ) -ConditionTests.cpp:95 +ConditionTests.cpp:95: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.0f ) ) with expansion: 9.1 != Approx( 9 ) -ConditionTests.cpp:96 +ConditionTests.cpp:96: PASSED: REQUIRE( data.float_nine_point_one != Approx( 1 ) ) with expansion: 9.1 != Approx( 1 ) -ConditionTests.cpp:97 +ConditionTests.cpp:97: PASSED: REQUIRE( data.float_nine_point_one != Approx( 0 ) ) with expansion: 9.1 != Approx( 0 ) -ConditionTests.cpp:98 +ConditionTests.cpp:98: PASSED: REQUIRE( data.double_pi != Approx( 3.1415 ) ) with expansion: 3.14159 != Approx( 3.1415 ) -ConditionTests.cpp:99 +ConditionTests.cpp:99: PASSED: REQUIRE( data.str_hello != "goodbye" ) with expansion: "hello" != "goodbye" -ConditionTests.cpp:100 +ConditionTests.cpp:100: PASSED: REQUIRE( data.str_hello != "hell" ) with expansion: "hello" != "hell" -ConditionTests.cpp:101 +ConditionTests.cpp:101: PASSED: REQUIRE( data.str_hello != "hello1" ) with expansion: "hello" != "hello1" -ConditionTests.cpp:102 +ConditionTests.cpp:102: PASSED: REQUIRE( data.str_hello.size() != 6 ) with expansion: 5 != 6 -ConditionTests.cpp:103 +ConditionTests.cpp:103: ----------------------------------------------------------------- ./failing/conditions/inequality ------------------------------------------------------------------ +................................................................. FAILED: CHECK( data.int_seven != 7 ) with expansion: 7 != 7 -ConditionTests.cpp:111 +ConditionTests.cpp:111: FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: 9.1 != Approx( 9.1 ) -ConditionTests.cpp:112 +ConditionTests.cpp:112: FAILED: CHECK( data.double_pi != Approx( 3.1415926535 ) ) with expansion: 3.14159 != Approx( 3.14159 ) -ConditionTests.cpp:113 +ConditionTests.cpp:113: FAILED: CHECK( data.str_hello != "hello" ) with expansion: "hello" != "hello" -ConditionTests.cpp:114 +ConditionTests.cpp:114: FAILED: CHECK( data.str_hello.size() != 5 ) with expansion: 5 != 5 -ConditionTests.cpp:115 +ConditionTests.cpp:115: ----------------------------------------------------------------- ./succeeding/conditions/ordered ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( data.int_seven < 8 ) with expansion: 7 < 8 -ConditionTests.cpp:124 +ConditionTests.cpp:124: PASSED: REQUIRE( data.int_seven > 6 ) with expansion: 7 > 6 -ConditionTests.cpp:125 +ConditionTests.cpp:125: PASSED: REQUIRE( data.int_seven > 0 ) with expansion: 7 > 0 -ConditionTests.cpp:126 +ConditionTests.cpp:126: PASSED: REQUIRE( data.int_seven > -1 ) with expansion: 7 > -1 -ConditionTests.cpp:127 +ConditionTests.cpp:127: PASSED: REQUIRE( data.int_seven >= 7 ) with expansion: 7 >= 7 -ConditionTests.cpp:129 +ConditionTests.cpp:129: PASSED: REQUIRE( data.int_seven >= 6 ) with expansion: 7 >= 6 -ConditionTests.cpp:130 +ConditionTests.cpp:130: PASSED: REQUIRE( data.int_seven <= 7 ) with expansion: 7 <= 7 -ConditionTests.cpp:131 +ConditionTests.cpp:131: PASSED: REQUIRE( data.int_seven <= 8 ) with expansion: 7 <= 8 -ConditionTests.cpp:132 +ConditionTests.cpp:132: PASSED: REQUIRE( data.float_nine_point_one > 9 ) with expansion: 9.1 > 9 -ConditionTests.cpp:134 +ConditionTests.cpp:134: PASSED: REQUIRE( data.float_nine_point_one < 10 ) with expansion: 9.1 < 10 -ConditionTests.cpp:135 +ConditionTests.cpp:135: PASSED: REQUIRE( data.float_nine_point_one < 9.2 ) with expansion: 9.1 < 9.2 -ConditionTests.cpp:136 +ConditionTests.cpp:136: PASSED: REQUIRE( data.str_hello <= "hello" ) with expansion: "hello" <= "hello" -ConditionTests.cpp:138 +ConditionTests.cpp:138: PASSED: REQUIRE( data.str_hello >= "hello" ) with expansion: "hello" >= "hello" -ConditionTests.cpp:139 +ConditionTests.cpp:139: PASSED: REQUIRE( data.str_hello < "hellp" ) with expansion: "hello" < "hellp" -ConditionTests.cpp:141 +ConditionTests.cpp:141: PASSED: REQUIRE( data.str_hello < "zebra" ) with expansion: "hello" < "zebra" -ConditionTests.cpp:142 +ConditionTests.cpp:142: PASSED: REQUIRE( data.str_hello > "hellm" ) with expansion: "hello" > "hellm" -ConditionTests.cpp:143 +ConditionTests.cpp:143: PASSED: REQUIRE( data.str_hello > "a" ) with expansion: "hello" > "a" -ConditionTests.cpp:144 +ConditionTests.cpp:144: ----------------------------------------------------------------- ./failing/conditions/ordered ------------------------------------------------------------------ +................................................................. FAILED: CHECK( data.int_seven > 7 ) with expansion: 7 > 7 -ConditionTests.cpp:152 +ConditionTests.cpp:152: FAILED: CHECK( data.int_seven < 7 ) with expansion: 7 < 7 -ConditionTests.cpp:153 +ConditionTests.cpp:153: FAILED: CHECK( data.int_seven > 8 ) with expansion: 7 > 8 -ConditionTests.cpp:154 +ConditionTests.cpp:154: FAILED: CHECK( data.int_seven < 6 ) with expansion: 7 < 6 -ConditionTests.cpp:155 +ConditionTests.cpp:155: FAILED: CHECK( data.int_seven < 0 ) with expansion: 7 < 0 -ConditionTests.cpp:156 +ConditionTests.cpp:156: FAILED: CHECK( data.int_seven < -1 ) with expansion: 7 < -1 -ConditionTests.cpp:157 +ConditionTests.cpp:157: FAILED: CHECK( data.int_seven >= 8 ) with expansion: 7 >= 8 -ConditionTests.cpp:159 +ConditionTests.cpp:159: FAILED: CHECK( data.int_seven <= 6 ) with expansion: 7 <= 6 -ConditionTests.cpp:160 +ConditionTests.cpp:160: FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: 9.1 < 9 -ConditionTests.cpp:162 +ConditionTests.cpp:162: FAILED: CHECK( data.float_nine_point_one > 10 ) with expansion: 9.1 > 10 -ConditionTests.cpp:163 +ConditionTests.cpp:163: FAILED: CHECK( data.float_nine_point_one > 9.2 ) with expansion: 9.1 > 9.2 -ConditionTests.cpp:164 +ConditionTests.cpp:164: FAILED: CHECK( data.str_hello > "hello" ) with expansion: "hello" > "hello" -ConditionTests.cpp:166 +ConditionTests.cpp:166: FAILED: CHECK( data.str_hello < "hello" ) with expansion: "hello" < "hello" -ConditionTests.cpp:167 +ConditionTests.cpp:167: FAILED: CHECK( data.str_hello > "hellp" ) with expansion: "hello" > "hellp" -ConditionTests.cpp:168 +ConditionTests.cpp:168: FAILED: CHECK( data.str_hello > "z" ) with expansion: "hello" > "z" -ConditionTests.cpp:169 +ConditionTests.cpp:169: FAILED: CHECK( data.str_hello < "hellm" ) with expansion: "hello" < "hellm" -ConditionTests.cpp:170 +ConditionTests.cpp:170: FAILED: CHECK( data.str_hello < "a" ) with expansion: "hello" < "a" -ConditionTests.cpp:171 +ConditionTests.cpp:171: FAILED: CHECK( data.str_hello >= "z" ) with expansion: "hello" >= "z" -ConditionTests.cpp:173 +ConditionTests.cpp:173: FAILED: CHECK( data.str_hello <= "a" ) with expansion: "hello" <= "a" -ConditionTests.cpp:174 +ConditionTests.cpp:174: ----------------------------------------------------------------- ./succeeding/conditions/int literals ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( i == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:188 +ConditionTests.cpp:188: PASSED: REQUIRE( ui == 2 ) with expansion: 2 == 2 -ConditionTests.cpp:189 +ConditionTests.cpp:189: PASSED: REQUIRE( l == 3 ) with expansion: 3 == 3 -ConditionTests.cpp:190 +ConditionTests.cpp:190: PASSED: REQUIRE( ul == 4 ) with expansion: 4 == 4 -ConditionTests.cpp:191 +ConditionTests.cpp:191: PASSED: REQUIRE( c == 5 ) with expansion: 5 == 5 -ConditionTests.cpp:192 +ConditionTests.cpp:192: PASSED: REQUIRE( uc == 6 ) with expansion: 6 == 6 -ConditionTests.cpp:193 +ConditionTests.cpp:193: PASSED: REQUIRE( 1 == i ) with expansion: 1 == 1 -ConditionTests.cpp:195 +ConditionTests.cpp:195: PASSED: REQUIRE( 2 == ui ) with expansion: 2 == 2 -ConditionTests.cpp:196 +ConditionTests.cpp:196: PASSED: REQUIRE( 3 == l ) with expansion: 3 == 3 -ConditionTests.cpp:197 +ConditionTests.cpp:197: PASSED: REQUIRE( 4 == ul ) with expansion: 4 == 4 -ConditionTests.cpp:198 +ConditionTests.cpp:198: PASSED: REQUIRE( 5 == c ) with expansion: 5 == 5 -ConditionTests.cpp:199 +ConditionTests.cpp:199: PASSED: REQUIRE( 6 == uc ) with expansion: 6 == 6 -ConditionTests.cpp:200 +ConditionTests.cpp:200: PASSED: REQUIRE( (std::numeric_limits::max)() > ul ) with expansion: 0x > 4 -ConditionTests.cpp:202 +ConditionTests.cpp:202: ----------------------------------------------------------------- ./succeeding/conditions//long_to_unsigned_x ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( long_var == unsigned_char_var ) with expansion: 1 == 1 -ConditionTests.cpp:223 +ConditionTests.cpp:223: PASSED: REQUIRE( long_var == unsigned_short_var ) with expansion: 1 == 1 -ConditionTests.cpp:224 +ConditionTests.cpp:224: PASSED: REQUIRE( long_var == unsigned_int_var ) with expansion: 1 == 1 -ConditionTests.cpp:225 +ConditionTests.cpp:225: PASSED: REQUIRE( long_var == unsigned_long_var ) with expansion: 1 == 1 -ConditionTests.cpp:226 +ConditionTests.cpp:226: ----------------------------------------------------------------- ./succeeding/conditions/const ints to int literal ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( unsigned_char_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:237 +ConditionTests.cpp:237: PASSED: REQUIRE( unsigned_short_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:238 +ConditionTests.cpp:238: PASSED: REQUIRE( unsigned_int_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:239 +ConditionTests.cpp:239: PASSED: REQUIRE( unsigned_long_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:240 +ConditionTests.cpp:240: ----------------------------------------------------------------- ./succeeding/conditions/negative ints ------------------------------------------------------------------ +................................................................. PASSED: CHECK( ( -1 > 2u ) ) with expansion: true -ConditionTests.cpp:246 +ConditionTests.cpp:246: PASSED: CHECK( -1 > 2u ) with expansion: -1 > 2 -ConditionTests.cpp:247 +ConditionTests.cpp:247: PASSED: CHECK( ( 2u < -1 ) ) with expansion: true -ConditionTests.cpp:249 +ConditionTests.cpp:249: PASSED: CHECK( 2u < -1 ) with expansion: 2 < -1 -ConditionTests.cpp:250 +ConditionTests.cpp:250: PASSED: CHECK( ( minInt > 2u ) ) with expansion: true -ConditionTests.cpp:253 +ConditionTests.cpp:253: PASSED: CHECK( minInt > 2u ) with expansion: -2147483648 > 2 -ConditionTests.cpp:254 +ConditionTests.cpp:254: ----------------------------------------------------------------- ./succeeding/conditions/computed ints ------------------------------------------------------------------ +................................................................. PASSED: CHECK( 54 == 6*9 ) with expansion: 54 == 54 -ConditionTests.cpp:269 +ConditionTests.cpp:269: ----------------------------------------------------------------- ./succeeding/conditions/ptr ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( p == __null ) with expansion: __null == 0 -ConditionTests.cpp:285 +ConditionTests.cpp:285: PASSED: REQUIRE( p == pNULL ) with expansion: __null == __null -ConditionTests.cpp:286 +ConditionTests.cpp:286: PASSED: REQUIRE( p != __null ) with expansion: 0x != 0 -ConditionTests.cpp:291 +ConditionTests.cpp:291: PASSED: REQUIRE( cp != __null ) with expansion: 0x != 0 -ConditionTests.cpp:294 +ConditionTests.cpp:294: PASSED: REQUIRE( cpc != __null ) with expansion: 0x != 0 -ConditionTests.cpp:297 +ConditionTests.cpp:297: PASSED: REQUIRE( returnsNull() == __null ) with expansion: {null string} == 0 -ConditionTests.cpp:299 +ConditionTests.cpp:299: PASSED: REQUIRE( returnsConstNull() == __null ) with expansion: {null string} == 0 -ConditionTests.cpp:300 +ConditionTests.cpp:300: PASSED: REQUIRE( __null != p ) with expansion: 0 != 0x -ConditionTests.cpp:302 +ConditionTests.cpp:302: ----------------------------------------------------------------- ./succeeding/conditions/not ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( false == false ) -ConditionTests.cpp:317 +ConditionTests.cpp:317: PASSED: REQUIRE( true == true ) -ConditionTests.cpp:318 +ConditionTests.cpp:318: PASSED: REQUIRE( !false ) with expansion: true -ConditionTests.cpp:319 +ConditionTests.cpp:319: PASSED: REQUIRE_FALSE( !false ) -ConditionTests.cpp:320 +ConditionTests.cpp:320: PASSED: REQUIRE( !falseValue ) with expansion: true -ConditionTests.cpp:322 +ConditionTests.cpp:322: PASSED: REQUIRE_FALSE( !falseValue ) with expansion: !false -ConditionTests.cpp:323 +ConditionTests.cpp:323: PASSED: REQUIRE( !(1 == 2) ) with expansion: true -ConditionTests.cpp:325 +ConditionTests.cpp:325: PASSED: REQUIRE_FALSE( !1 == 2 ) with expansion: !(1 == 2) -ConditionTests.cpp:326 +ConditionTests.cpp:326: ----------------------------------------------------------------- ./failing/conditions/not ------------------------------------------------------------------ +................................................................. FAILED: CHECK( false != false ) -ConditionTests.cpp:334 +ConditionTests.cpp:334: FAILED: CHECK( true != true ) -ConditionTests.cpp:335 +ConditionTests.cpp:335: FAILED: CHECK( !true ) with expansion: false -ConditionTests.cpp:336 +ConditionTests.cpp:336: FAILED: CHECK_FALSE( !true ) -ConditionTests.cpp:337 +ConditionTests.cpp:337: FAILED: CHECK( !trueValue ) with expansion: false -ConditionTests.cpp:339 +ConditionTests.cpp:339: FAILED: CHECK_FALSE( !trueValue ) with expansion: !true -ConditionTests.cpp:340 +ConditionTests.cpp:340: FAILED: CHECK( !(1 == 1) ) with expansion: false -ConditionTests.cpp:342 +ConditionTests.cpp:342: FAILED: CHECK_FALSE( !1 == 1 ) with expansion: !(1 == 1) -ConditionTests.cpp:343 +ConditionTests.cpp:343: ----------------------------------------------------------------- ./succeeding/exceptions/explicit ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE_THROWS_AS( thisThrows() ) -ExceptionTests.cpp:39 +ExceptionTests.cpp:39: PASSED: REQUIRE_NOTHROW( thisDoesntThrow() ) -ExceptionTests.cpp:40 +ExceptionTests.cpp:40: PASSED: REQUIRE_THROWS( thisThrows() ) -ExceptionTests.cpp:41 +ExceptionTests.cpp:41: ----------------------------------------------------------------- ./failing/exceptions/explicit ------------------------------------------------------------------ +................................................................. FAILED: CHECK_THROWS_AS( thisThrows() ) due to unexpected exception with message: expected exception -ExceptionTests.cpp:47 +ExceptionTests.cpp:47: FAILED: CHECK_THROWS_AS( thisDoesntThrow() ) because no exception was thrown where one was expected: -ExceptionTests.cpp:48 +ExceptionTests.cpp:48: FAILED: CHECK_NOTHROW( thisThrows() ) due to unexpected exception with message: expected exception -ExceptionTests.cpp:49 +ExceptionTests.cpp:49: ----------------------------------------------------------------- ./failing/exceptions/implicit ------------------------------------------------------------------ +................................................................. FAILED: due to unexpected exception with message: unexpected exception -ExceptionTests.cpp:52 +ExceptionTests.cpp:52: ----------------------------------------------------------------- ./failing/exceptions/implicit/2 ------------------------------------------------------------------ +................................................................. PASSED: CHECK( 1 == 1 ) -ExceptionTests.cpp:60 +ExceptionTests.cpp:60: FAILED: {Unknown expression after this line} due to unexpected exception with message: unexpected exception -ExceptionTests.cpp:60 +ExceptionTests.cpp:60: ----------------------------------------------------------------- ./succeeding/exceptions/implicit ------------------------------------------------------------------ +................................................................. No assertions in test case, './succeeding/exceptions/implicit' ----------------------------------------------------------------- ./failing/exceptions/custom ------------------------------------------------------------------ +................................................................. FAILED: due to unexpected exception with message: custom exception -ExceptionTests.cpp:102 +ExceptionTests.cpp:102: ----------------------------------------------------------------- ./failing/exceptions/custom/nothrow ------------------------------------------------------------------ +................................................................. FAILED: REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) due to unexpected exception with message: unexpected custom exception -ExceptionTests.cpp:109 +ExceptionTests.cpp:109: ----------------------------------------------------------------- ./failing/exceptions/custom/throw ------------------------------------------------------------------ +................................................................. FAILED: REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) due to unexpected exception with message: custom exception - not std -ExceptionTests.cpp:114 +ExceptionTests.cpp:114: ----------------------------------------------------------------- ./failing/exceptions/custom/double ------------------------------------------------------------------ +................................................................. FAILED: due to unexpected exception with message: 3.14 -ExceptionTests.cpp:118 +ExceptionTests.cpp:118: ----------------------------------------------------------------- ./succeeding/exceptions/notimplemented ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) -ExceptionTests.cpp:129 +ExceptionTests.cpp:129: ----------------------------------------------------------------- ./succeeding/generators/1 ------------------------------------------------------------------ +................................................................. PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26 +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27 +GeneratorTests.cpp:27: ----------------------------------------------------------------- ./succeeding/generators/2 ------------------------------------------------------------------ +................................................................. PASSED: CATCH_REQUIRE( i->first == i->second-1 ) with expansion: 0 == 0 -GeneratorTests.cpp:40 +GeneratorTests.cpp:40: PASSED: CATCH_REQUIRE( i->first == i->second-1 ) with expansion: 2 == 2 -GeneratorTests.cpp:40 +GeneratorTests.cpp:40: ----------------------------------------------------------------- ./succeeding/message ------------------------------------------------------------------ +................................................................. warning: this is a warning -MessageTests.cpp:14 +MessageTests.cpp:14: No assertions in test case, './succeeding/message' ----------------------------------------------------------------- ./succeeding/succeed ------------------------------------------------------------------ +................................................................. PASSED: with message: this is a success -MessageTests.cpp:18 +MessageTests.cpp:18: ----------------------------------------------------------------- ./failing/message/info/1 ------------------------------------------------------------------ +................................................................. info: this message should be logged -MessageTests.cpp:23 +MessageTests.cpp:23: info: so should this -MessageTests.cpp:24 +MessageTests.cpp:24: FAILED: REQUIRE( a == 1 ) with expansion: 2 == 1 -MessageTests.cpp:26 +MessageTests.cpp:26: ----------------------------------------------------------------- ./mixed/message/info/2 ------------------------------------------------------------------ +................................................................. PASSED: CHECK( a == 2 ) with expansion: 2 == 2 -MessageTests.cpp:33 +MessageTests.cpp:33: info: this message should be logged -MessageTests.cpp:31 +MessageTests.cpp:31: info: this message should be logged, too -MessageTests.cpp:35 +MessageTests.cpp:35: FAILED: CHECK( a == 1 ) with expansion: 2 == 1 -MessageTests.cpp:37 +MessageTests.cpp:37: info: and this, but later -MessageTests.cpp:39 +MessageTests.cpp:39: FAILED: CHECK( a == 0 ) with expansion: 2 == 0 -MessageTests.cpp:41 +MessageTests.cpp:41: PASSED: CHECK( a == 2 ) with expansion: 2 == 2 -MessageTests.cpp:45 +MessageTests.cpp:45: ----------------------------------------------------------------- ./failing/message/fail ------------------------------------------------------------------ +................................................................. FAILED: explicitly with message: This is a failure -MessageTests.cpp:51 +MessageTests.cpp:51: ----------------------------------------------------------------- ./failing/message/sections one ------------------------------------------------------------------ +................................................................. FAILED: explicitly with message: Message from section one -MessageTests.cpp:58 +MessageTests.cpp:58: ----------------------------------------------------------------- ./failing/message/sections two ------------------------------------------------------------------ +................................................................. FAILED: explicitly with message: Message from section two -MessageTests.cpp:63 +MessageTests.cpp:63: Message from section one ----------------------------------------------------------------- ./succeeding/message/sections/stdout one ------------------------------------------------------------------ +................................................................. No assertions in section, 'one' @@ -2117,98 +2117,98 @@ Message from section two ----------------------------------------------------------------- ./succeeding/message/sections/stdout two ------------------------------------------------------------------ +................................................................. No assertions in section, 'two' ----------------------------------------------------------------- ./mixed/message/scoped ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( i < 10 ) with expansion: 0 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 1 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 2 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 3 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 4 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 5 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 6 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 7 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 8 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 9 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: REQUIRE( i < 10 ) info: current counter 10 -MessageTests.cpp:86 +MessageTests.cpp:86: REQUIRE( i < 10 ) info: i := 10 -MessageTests.cpp:86 +MessageTests.cpp:86: FAILED: REQUIRE( i < 10 ) with expansion: 10 < 10 -MessageTests.cpp:86 +MessageTests.cpp:86: ----------------------------------------------------------------- ./succeeding/nofail ------------------------------------------------------------------ +................................................................. FAILED - but was ok: CHECK_NOFAIL( 1 == 2 ) -MessageTests.cpp:92 +MessageTests.cpp:92: No assertions in test case, './succeeding/nofail' @@ -2216,101 +2216,101 @@ No assertions in test case, './succeeding/nofail' ----------------------------------------------------------------- ./succeeding/Misc/Sections s1 ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:25 +MiscTests.cpp:25: PASSED: REQUIRE( b != a ) with expansion: 2 != 1 -MiscTests.cpp:26 +MiscTests.cpp:26: ----------------------------------------------------------------- ./succeeding/Misc/Sections s2 ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:31 +MiscTests.cpp:31: ----------------------------------------------------------------- ./succeeding/Misc/Sections/nested s1 ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:42 +MiscTests.cpp:42: PASSED: REQUIRE( b != a ) with expansion: 2 != 1 -MiscTests.cpp:43 +MiscTests.cpp:43: ----------------------------------------------------------------- ./succeeding/Misc/Sections/nested s1 s2 ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:47 +MiscTests.cpp:47: ----------------------------------------------------------------- ./mixed/Misc/Sections/nested2 s1 s2 ------------------------------------------------------------------ +................................................................. FAILED: REQUIRE( a == b ) with expansion: 1 == 2 -MiscTests.cpp:61 +MiscTests.cpp:61: ----------------------------------------------------------------- ./mixed/Misc/Sections/nested2 s1 s3 ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:66 +MiscTests.cpp:66: ----------------------------------------------------------------- ./mixed/Misc/Sections/nested2 s1 s4 ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( a < b ) with expansion: 1 < 2 -MiscTests.cpp:70 +MiscTests.cpp:70: ----------------------------------------------------------------- ./Sections/nested/a/b c d (leaf) ------------------------------------------------------------------ +................................................................. No assertions in section, 'd (leaf)' @@ -2319,7 +2319,7 @@ No assertions in section, 'd (leaf)' ./Sections/nested/a/b c e (leaf) ------------------------------------------------------------------ +................................................................. No assertions in section, 'e (leaf)' @@ -2327,7 +2327,7 @@ No assertions in section, 'e (leaf)' ----------------------------------------------------------------- ./Sections/nested/a/b f (leaf) ------------------------------------------------------------------ +................................................................. No assertions in section, 'f (leaf)' @@ -2335,207 +2335,207 @@ No assertions in section, 'f (leaf)' ----------------------------------------------------------------- ./mixed/Misc/Sections/loops s1 ------------------------------------------------------------------ +................................................................. FAILED: CHECK( b > a ) with expansion: 0 > 1 -MiscTests.cpp:103 +MiscTests.cpp:103: ----------------------------------------------------------------- ./mixed/Misc/loops ------------------------------------------------------------------ +................................................................. info: Testing if fib[0] (1) is even -MiscTests.cpp:114 +MiscTests.cpp:114: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 -MiscTests.cpp:115 +MiscTests.cpp:115: info: Testing if fib[1] (1) is even -MiscTests.cpp:114 +MiscTests.cpp:114: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 -MiscTests.cpp:115 +MiscTests.cpp:115: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 0 == 0 -MiscTests.cpp:115 +MiscTests.cpp:115: info: Testing if fib[2] (2) is even -MiscTests.cpp:114 +MiscTests.cpp:114: info: Testing if fib[3] (3) is even -MiscTests.cpp:114 +MiscTests.cpp:114: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 -MiscTests.cpp:115 +MiscTests.cpp:115: info: Testing if fib[4] (5) is even -MiscTests.cpp:114 +MiscTests.cpp:114: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 -MiscTests.cpp:115 +MiscTests.cpp:115: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 0 == 0 -MiscTests.cpp:115 +MiscTests.cpp:115: info: Testing if fib[5] (8) is even -MiscTests.cpp:114 +MiscTests.cpp:114: info: Testing if fib[6] (13) is even -MiscTests.cpp:114 +MiscTests.cpp:114: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 -MiscTests.cpp:115 +MiscTests.cpp:115: info: Testing if fib[7] (21) is even -MiscTests.cpp:114 +MiscTests.cpp:114: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 -MiscTests.cpp:115 +MiscTests.cpp:115: Some information An error ----------------------------------------------------------------- ./succeeding/Misc/stdout,stderr ------------------------------------------------------------------ +................................................................. No assertions in test case, './succeeding/Misc/stdout,stderr' ----------------------------------------------------------------- ./succeeding/Misc/null strings ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( makeString( false ) != static_cast(__null) ) with expansion: "valid string" != {null string} -MiscTests.cpp:133 +MiscTests.cpp:133: PASSED: REQUIRE( makeString( true ) == static_cast(__null) ) with expansion: {null string} == {null string} -MiscTests.cpp:134 +MiscTests.cpp:134: ----------------------------------------------------------------- ./failing/info ------------------------------------------------------------------ +................................................................. info: hi -MiscTests.cpp:139 +MiscTests.cpp:139: info: i := 7 -MiscTests.cpp:141 +MiscTests.cpp:141: FAILED: REQUIRE( false ) -MiscTests.cpp:142 +MiscTests.cpp:142: ----------------------------------------------------------------- ./succeeding/checkedif ------------------------------------------------------------------ +................................................................. PASSED: CHECKED_IF( flag ) with expansion: true -MiscTests.cpp:147 +MiscTests.cpp:147: PASSED: REQUIRE( testCheckedIf( true ) ) with expansion: true -MiscTests.cpp:155 +MiscTests.cpp:155: ----------------------------------------------------------------- ./failing/checkedif ------------------------------------------------------------------ +................................................................. FAILED: CHECKED_IF( flag ) with expansion: false -MiscTests.cpp:147 +MiscTests.cpp:147: FAILED: REQUIRE( testCheckedIf( false ) ) with expansion: false -MiscTests.cpp:160 +MiscTests.cpp:160: ----------------------------------------------------------------- ./succeeding/checkedelse ------------------------------------------------------------------ +................................................................. PASSED: CHECKED_ELSE( flag ) with expansion: true -MiscTests.cpp:165 +MiscTests.cpp:165: PASSED: REQUIRE( testCheckedElse( true ) ) with expansion: true -MiscTests.cpp:173 +MiscTests.cpp:173: ----------------------------------------------------------------- ./failing/checkedelse ------------------------------------------------------------------ +................................................................. FAILED: CHECKED_ELSE( flag ) with expansion: false -MiscTests.cpp:165 +MiscTests.cpp:165: FAILED: REQUIRE( testCheckedElse( false ) ) with expansion: false -MiscTests.cpp:178 +MiscTests.cpp:178: ----------------------------------------------------------------- ./misc/xmlentitycheck embedded xml ------------------------------------------------------------------ +................................................................. No assertions in section, 'embedded xml' @@ -2543,203 +2543,203 @@ No assertions in section, 'embedded xml' ----------------------------------------------------------------- ./misc/xmlentitycheck encoded chars ------------------------------------------------------------------ +................................................................. No assertions in section, 'encoded chars' ----------------------------------------------------------------- ./manual/onechar ------------------------------------------------------------------ +................................................................. info: 3 -MiscTests.cpp:195 +MiscTests.cpp:195: FAILED: REQUIRE( false ) -MiscTests.cpp:196 +MiscTests.cpp:196: ----------------------------------------------------------------- ./succeeding/atomic if ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( x == 0 ) with expansion: 0 == 0 -MiscTests.cpp:206 +MiscTests.cpp:206: ----------------------------------------------------------------- ./succeeding/matchers ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE_THAT( testStringForMatching() Contains( "string" ) ) with expansion: "this string contains 'abc' as a substring" contains: "string" -MiscTests.cpp:216 +MiscTests.cpp:216: PASSED: CHECK_THAT( testStringForMatching() Contains( "abc" ) ) with expansion: "this string contains 'abc' as a substring" contains: "abc" -MiscTests.cpp:217 +MiscTests.cpp:217: PASSED: CHECK_THAT( testStringForMatching() StartsWith( "this" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "this" -MiscTests.cpp:219 +MiscTests.cpp:219: PASSED: CHECK_THAT( testStringForMatching() EndsWith( "substring" ) ) with expansion: "this string contains 'abc' as a substring" ends with: "substring" -MiscTests.cpp:220 +MiscTests.cpp:220: ----------------------------------------------------------------- ./failing/matchers/Contains ------------------------------------------------------------------ +................................................................. FAILED: CHECK_THAT( testStringForMatching() Contains( "not there" ) ) with expansion: "this string contains 'abc' as a substring" contains: "not there" -MiscTests.cpp:225 +MiscTests.cpp:225: ----------------------------------------------------------------- ./failing/matchers/StartsWith ------------------------------------------------------------------ +................................................................. FAILED: CHECK_THAT( testStringForMatching() StartsWith( "string" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "string" -MiscTests.cpp:230 +MiscTests.cpp:230: ----------------------------------------------------------------- ./failing/matchers/EndsWith ------------------------------------------------------------------ +................................................................. FAILED: CHECK_THAT( testStringForMatching() EndsWith( "this" ) ) with expansion: "this string contains 'abc' as a substring" ends with: "this" -MiscTests.cpp:235 +MiscTests.cpp:235: ----------------------------------------------------------------- ./failing/matchers/Equals ------------------------------------------------------------------ +................................................................. FAILED: CHECK_THAT( testStringForMatching() Equals( "something else" ) ) with expansion: "this string contains 'abc' as a substring" equals: "something else" -MiscTests.cpp:240 +MiscTests.cpp:240: ----------------------------------------------------------------- /succeeding/matchers/AllOf ------------------------------------------------------------------ +................................................................. PASSED: CHECK_THAT( testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) -MiscTests.cpp:248 +MiscTests.cpp:248: ----------------------------------------------------------------- /succeeding/matchers/AnyOf ------------------------------------------------------------------ +................................................................. PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -MiscTests.cpp:252 +MiscTests.cpp:252: PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) -MiscTests.cpp:253 +MiscTests.cpp:253: ----------------------------------------------------------------- ./succeeding/matchers/Equals ------------------------------------------------------------------ +................................................................. PASSED: CHECK_THAT( testStringForMatching() Equals( "this string contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" -MiscTests.cpp:258 +MiscTests.cpp:258: ----------------------------------------------------------------- example/factorial ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( Factorial(0) == 1 ) with expansion: 1 == 1 -MiscTests.cpp:269 +MiscTests.cpp:269: PASSED: REQUIRE( Factorial(1) == 1 ) with expansion: 1 == 1 -MiscTests.cpp:270 +MiscTests.cpp:270: PASSED: REQUIRE( Factorial(2) == 2 ) with expansion: 2 == 2 -MiscTests.cpp:271 +MiscTests.cpp:271: PASSED: REQUIRE( Factorial(3) == 6 ) with expansion: 6 == 6 -MiscTests.cpp:272 +MiscTests.cpp:272: PASSED: REQUIRE( Factorial(10) == 3628800 ) with expansion: 0x == 3628800 -MiscTests.cpp:273 +MiscTests.cpp:273: ----------------------------------------------------------------- empty ------------------------------------------------------------------ +................................................................. No assertions in test case, 'empty' ----------------------------------------------------------------- Nice descriptive name ------------------------------------------------------------------ +................................................................. warning: This one ran -MiscTests.cpp:282 +MiscTests.cpp:282: No assertions in test case, 'Nice descriptive name' ----------------------------------------------------------------- first tag ------------------------------------------------------------------ +................................................................. No assertions in test case, 'first tag' ----------------------------------------------------------------- second tag ------------------------------------------------------------------ +................................................................. No assertions in test case, 'second tag' @@ -2748,362 +2748,362 @@ No assertions in test case, 'second tag' selftest/main selftest/expected result selftest/expected result/failing tests ------------------------------------------------------------------ +................................................................. PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114 +catch_self_test.hpp:114: ----------------------------------------------------------------- selftest/main selftest/expected result selftest/expected result/succeeding tests ------------------------------------------------------------------ +................................................................. PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: Message from section one Message from section two PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: Some information An error PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103 +catch_self_test.hpp:103: Message from section one Message from section two @@ -3113,911 +3113,911 @@ An error selftest/main selftest/test counts selftest/test counts/succeeding tests ------------------------------------------------------------------ +................................................................. FAILED: CHECK( totals.assertions.passed == 291 ) with expansion: 293 == 291 -TestMain.cpp:40 +TestMain.cpp:40: PASSED: CHECK( totals.assertions.failed == 0 ) with expansion: 0 == 0 -TestMain.cpp:41 +TestMain.cpp:41: ----------------------------------------------------------------- selftest/main selftest/test counts selftest/test counts/failing tests ------------------------------------------------------------------ +................................................................. PASSED: CHECK( totals.assertions.passed == 1 ) with expansion: 1 == 1 -TestMain.cpp:47 +TestMain.cpp:47: PASSED: CHECK( totals.assertions.failed == 72 ) with expansion: 72 == 72 -TestMain.cpp:48 +TestMain.cpp:48: ----------------------------------------------------------------- meta/Misc/Sections ------------------------------------------------------------------ +................................................................. PASSED: CHECK( totals.assertions.passed == 2 ) with expansion: 2 == 2 -TestMain.cpp:57 +TestMain.cpp:57: PASSED: CHECK( totals.assertions.failed == 1 ) with expansion: 1 == 1 -TestMain.cpp:58 +TestMain.cpp:58: ----------------------------------------------------------------- selftest/parser/2 default ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:97 +TestMain.cpp:97: PASSED: CHECK( config.shouldDebugBreak == false ) with expansion: false == false -TestMain.cpp:99 +TestMain.cpp:99: PASSED: CHECK( config.cutoff == -1 ) with expansion: -1 == -1 -TestMain.cpp:100 +TestMain.cpp:100: PASSED: CHECK( config.allowThrows == true ) with expansion: true == true -TestMain.cpp:101 +TestMain.cpp:101: PASSED: CHECK( config.reporter.empty() ) with expansion: true -TestMain.cpp:102 +TestMain.cpp:102: ----------------------------------------------------------------- selftest/parser/2 test lists -t/1 ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:108 +TestMain.cpp:108: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:110 +TestMain.cpp:110: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:111 +TestMain.cpp:111: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true -TestMain.cpp:112 +TestMain.cpp:112: ----------------------------------------------------------------- selftest/parser/2 test lists -t/exclude:1 ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:116 +TestMain.cpp:116: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:118 +TestMain.cpp:118: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:119 +TestMain.cpp:119: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true -TestMain.cpp:120 +TestMain.cpp:120: ----------------------------------------------------------------- selftest/parser/2 test lists --test/1 ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:125 +TestMain.cpp:125: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:127 +TestMain.cpp:127: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:128 +TestMain.cpp:128: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true -TestMain.cpp:129 +TestMain.cpp:129: ----------------------------------------------------------------- selftest/parser/2 test lists --test/exclude:1 ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:134 +TestMain.cpp:134: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:136 +TestMain.cpp:136: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:137 +TestMain.cpp:137: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true -TestMain.cpp:138 +TestMain.cpp:138: ----------------------------------------------------------------- selftest/parser/2 test lists --test/exclude:2 ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:143 +TestMain.cpp:143: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:145 +TestMain.cpp:145: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:146 +TestMain.cpp:146: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true -TestMain.cpp:147 +TestMain.cpp:147: ----------------------------------------------------------------- selftest/parser/2 test lists -t/2 ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:152 +TestMain.cpp:152: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:154 +TestMain.cpp:154: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:155 +TestMain.cpp:155: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true -TestMain.cpp:156 +TestMain.cpp:156: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ) with expansion: true -TestMain.cpp:157 +TestMain.cpp:157: ----------------------------------------------------------------- selftest/parser/2 test lists -t/0 ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) ) with expansion: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" -TestMain.cpp:162 +TestMain.cpp:162: ----------------------------------------------------------------- selftest/parser/2 reporter -r/console ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:169 +TestMain.cpp:169: PASSED: REQUIRE( config.reporter == "console" ) with expansion: "console" == "console" -TestMain.cpp:171 +TestMain.cpp:171: ----------------------------------------------------------------- selftest/parser/2 reporter -r/xml ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:175 +TestMain.cpp:175: PASSED: REQUIRE( config.reporter == "xml" ) with expansion: "xml" == "xml" -TestMain.cpp:177 +TestMain.cpp:177: ----------------------------------------------------------------- selftest/parser/2 reporter --reporter/junit ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:181 +TestMain.cpp:181: PASSED: REQUIRE( config.reporter == "junit" ) with expansion: "junit" == "junit" -TestMain.cpp:183 +TestMain.cpp:183: ----------------------------------------------------------------- selftest/parser/2 reporter -r/error ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) ) with expansion: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" -TestMain.cpp:187 +TestMain.cpp:187: ----------------------------------------------------------------- selftest/parser/2 debugger -b ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:194 +TestMain.cpp:194: PASSED: REQUIRE( config.shouldDebugBreak == true ) with expansion: true == true -TestMain.cpp:196 +TestMain.cpp:196: ----------------------------------------------------------------- selftest/parser/2 debugger --break ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:200 +TestMain.cpp:200: PASSED: REQUIRE( config.shouldDebugBreak ) with expansion: true -TestMain.cpp:202 +TestMain.cpp:202: ----------------------------------------------------------------- selftest/parser/2 debugger -b ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) ) with expansion: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" -TestMain.cpp:206 +TestMain.cpp:206: ----------------------------------------------------------------- selftest/parser/2 abort -a ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:213 +TestMain.cpp:213: PASSED: REQUIRE( config.cutoff == 1 ) with expansion: 1 == 1 -TestMain.cpp:215 +TestMain.cpp:215: ----------------------------------------------------------------- selftest/parser/2 abort -a/2 ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:219 +TestMain.cpp:219: PASSED: REQUIRE( config.cutoff == 2 ) with expansion: 2 == 2 -TestMain.cpp:221 +TestMain.cpp:221: ----------------------------------------------------------------- selftest/parser/2 abort -a/error/0 ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" -TestMain.cpp:225 +TestMain.cpp:225: ----------------------------------------------------------------- selftest/parser/2 abort -a/error/non numeric ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" -TestMain.cpp:229 +TestMain.cpp:229: ----------------------------------------------------------------- selftest/parser/2 abort -a/error/two args ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) ) with expansion: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" -TestMain.cpp:233 +TestMain.cpp:233: ----------------------------------------------------------------- selftest/parser/2 nothrow -nt ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:240 +TestMain.cpp:240: PASSED: REQUIRE( config.allowThrows == false ) with expansion: false == false -TestMain.cpp:242 +TestMain.cpp:242: ----------------------------------------------------------------- selftest/parser/2 nothrow --nothrow ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:246 +TestMain.cpp:246: PASSED: REQUIRE( config.allowThrows == false ) with expansion: false == false -TestMain.cpp:248 +TestMain.cpp:248: ----------------------------------------------------------------- selftest/parser/2 streams -o filename ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:255 +TestMain.cpp:255: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: "filename.ext" == "filename.ext" -TestMain.cpp:257 +TestMain.cpp:257: PASSED: REQUIRE( config.stream.empty() ) with expansion: true -TestMain.cpp:258 +TestMain.cpp:258: ----------------------------------------------------------------- selftest/parser/2 streams -o %stdout ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:262 +TestMain.cpp:262: PASSED: REQUIRE( config.stream == "stdout" ) with expansion: "stdout" == "stdout" -TestMain.cpp:264 +TestMain.cpp:264: PASSED: REQUIRE( config.outputFilename.empty() ) with expansion: true -TestMain.cpp:265 +TestMain.cpp:265: ----------------------------------------------------------------- selftest/parser/2 streams --out ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:269 +TestMain.cpp:269: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: "filename.ext" == "filename.ext" -TestMain.cpp:271 +TestMain.cpp:271: ----------------------------------------------------------------- selftest/parser/2 combinations -a -b ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:278 +TestMain.cpp:278: PASSED: CHECK( config.cutoff == 1 ) with expansion: 1 == 1 -TestMain.cpp:280 +TestMain.cpp:280: PASSED: CHECK( config.shouldDebugBreak ) with expansion: true -TestMain.cpp:281 +TestMain.cpp:281: PASSED: CHECK( config.allowThrows == false ) with expansion: false == false -TestMain.cpp:282 +TestMain.cpp:282: ----------------------------------------------------------------- selftest/test filter ------------------------------------------------------------------ +................................................................. PASSED: CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -TestMain.cpp:291 +TestMain.cpp:291: PASSED: CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:292 +TestMain.cpp:292: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:297 +TestMain.cpp:297: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -TestMain.cpp:298 +TestMain.cpp:298: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ) with expansion: true -TestMain.cpp:300 +TestMain.cpp:300: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ) with expansion: false == false -TestMain.cpp:301 +TestMain.cpp:301: ----------------------------------------------------------------- selftest/test filters ------------------------------------------------------------------ +................................................................. PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -TestMain.cpp:312 +TestMain.cpp:312: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:314 +TestMain.cpp:314: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -TestMain.cpp:315 +TestMain.cpp:315: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ) with expansion: false == false -TestMain.cpp:316 +TestMain.cpp:316: ----------------------------------------------------------------- selftest/filter/prefix wildcard ------------------------------------------------------------------ +................................................................. PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) with expansion: true -TestMain.cpp:322 +TestMain.cpp:322: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) with expansion: false == false -TestMain.cpp:323 +TestMain.cpp:323: ----------------------------------------------------------------- selftest/filter/wildcard at both ends ------------------------------------------------------------------ +................................................................. PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) with expansion: true -TestMain.cpp:328 +TestMain.cpp:328: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ) with expansion: true -TestMain.cpp:329 +TestMain.cpp:329: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ) with expansion: true -TestMain.cpp:330 +TestMain.cpp:330: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ) with expansion: false == false -TestMain.cpp:331 +TestMain.cpp:331: ----------------------------------------------------------------- selftest/option parsers ------------------------------------------------------------------ +................................................................. PASSED: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) -TestMain.cpp:351 +TestMain.cpp:351: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:353 +TestMain.cpp:353: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:354 +TestMain.cpp:354: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true -TestMain.cpp:355 +TestMain.cpp:355: ----------------------------------------------------------------- selftest/tags one tag ------------------------------------------------------------------ +................................................................. PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:369 +TestMain.cpp:369: PASSED: CHECK( oneTag.hasTag( "one" ) ) with expansion: true -TestMain.cpp:370 +TestMain.cpp:370: PASSED: CHECK( oneTag.getTags().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:371 +TestMain.cpp:371: PASSED: CHECK( oneTag.matchesTags( p1 ) == true ) with expansion: true == true -TestMain.cpp:373 +TestMain.cpp:373: PASSED: CHECK( oneTag.matchesTags( p2 ) == true ) with expansion: true == true -TestMain.cpp:374 +TestMain.cpp:374: PASSED: CHECK( oneTag.matchesTags( p3 ) == false ) with expansion: false == false -TestMain.cpp:375 +TestMain.cpp:375: PASSED: CHECK( oneTag.matchesTags( p4 ) == false ) with expansion: false == false -TestMain.cpp:376 +TestMain.cpp:376: PASSED: CHECK( oneTag.matchesTags( p5 ) == false ) with expansion: false == false -TestMain.cpp:377 +TestMain.cpp:377: ----------------------------------------------------------------- selftest/tags two tags ------------------------------------------------------------------ +................................................................. PASSED: CHECK( twoTags.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:383 +TestMain.cpp:383: PASSED: CHECK( twoTags.hasTag( "one" ) ) with expansion: true -TestMain.cpp:384 +TestMain.cpp:384: PASSED: CHECK( twoTags.hasTag( "two" ) ) with expansion: true -TestMain.cpp:385 +TestMain.cpp:385: PASSED: CHECK( twoTags.hasTag( "three" ) == false ) with expansion: false == false -TestMain.cpp:386 +TestMain.cpp:386: PASSED: CHECK( twoTags.getTags().size() == 2 ) with expansion: 2 == 2 -TestMain.cpp:387 +TestMain.cpp:387: PASSED: CHECK( twoTags.matchesTags( p1 ) == true ) with expansion: true == true -TestMain.cpp:389 +TestMain.cpp:389: PASSED: CHECK( twoTags.matchesTags( p2 ) == true ) with expansion: true == true -TestMain.cpp:390 +TestMain.cpp:390: PASSED: CHECK( twoTags.matchesTags( p3 ) == true ) with expansion: true == true -TestMain.cpp:391 +TestMain.cpp:391: PASSED: CHECK( twoTags.matchesTags( p4 ) == true ) with expansion: true == true -TestMain.cpp:392 +TestMain.cpp:392: PASSED: CHECK( twoTags.matchesTags( p5 ) == true ) with expansion: true == true -TestMain.cpp:393 +TestMain.cpp:393: ----------------------------------------------------------------- selftest/tags one tag with characters either side ------------------------------------------------------------------ +................................................................. PASSED: CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) with expansion: "1234" == "1234" -TestMain.cpp:399 +TestMain.cpp:399: PASSED: CHECK( oneTagWithExtras.hasTag( "one" ) ) with expansion: true -TestMain.cpp:400 +TestMain.cpp:400: PASSED: CHECK( oneTagWithExtras.hasTag( "two" ) == false ) with expansion: false == false -TestMain.cpp:401 +TestMain.cpp:401: PASSED: CHECK( oneTagWithExtras.getTags().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:402 +TestMain.cpp:402: ----------------------------------------------------------------- selftest/tags start of a tag, but not closed ------------------------------------------------------------------ +................................................................. PASSED: CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) with expansion: "[one" == "[one" -TestMain.cpp:409 +TestMain.cpp:409: PASSED: CHECK( oneTagOpen.hasTag( "one" ) == false ) with expansion: false == false -TestMain.cpp:410 +TestMain.cpp:410: PASSED: CHECK( oneTagOpen.getTags().size() == 0 ) with expansion: 0 == 0 -TestMain.cpp:411 +TestMain.cpp:411: ----------------------------------------------------------------- selftest/tags hidden ------------------------------------------------------------------ +................................................................. PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:417 +TestMain.cpp:417: PASSED: CHECK( oneTag.hasTag( "hide" ) ) with expansion: true -TestMain.cpp:418 +TestMain.cpp:418: PASSED: CHECK( oneTag.isHidden() ) with expansion: true -TestMain.cpp:419 +TestMain.cpp:419: PASSED: CHECK( oneTag.matchesTags( "~[hide]" ) == false ) with expansion: false == false -TestMain.cpp:421 +TestMain.cpp:421: ----------------------------------------------------------------- ./succeeding/Tricky/std::pair ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( (std::pair( 1, 2 )) == aNicePair ) @@ -4026,500 +4026,500 @@ with expansion: std::pair( 1, 2 ) == std::pair( 1, 2 ) -TrickyTests.cpp:37 +TrickyTests.cpp:37: ----------------------------------------------------------------- ./inprogress/failing/Tricky/trailing expression ------------------------------------------------------------------ +................................................................. warning: Uncomment the code in this test to check that it gives a sensible compiler error -TrickyTests.cpp:55 +TrickyTests.cpp:55: No assertions in test case, './inprogress/failing/Tricky/trailing expression' ----------------------------------------------------------------- ./inprogress/failing/Tricky/compound lhs ------------------------------------------------------------------ +................................................................. warning: Uncomment the code in this test to check that it gives a sensible compiler error -TrickyTests.cpp:71 +TrickyTests.cpp:71: No assertions in test case, './inprogress/failing/Tricky/compound lhs' ----------------------------------------------------------------- ./failing/Tricky/non streamable type ------------------------------------------------------------------ +................................................................. FAILED: CHECK( &o1 == &o2 ) with expansion: 0x == 0x -TrickyTests.cpp:95 +TrickyTests.cpp:95: FAILED: CHECK( o1 == o2 ) with expansion: {?} == {?} -TrickyTests.cpp:96 +TrickyTests.cpp:96: ----------------------------------------------------------------- ./failing/string literals ------------------------------------------------------------------ +................................................................. FAILED: REQUIRE( std::string( "first" ) == "second" ) with expansion: "first" == "second" -TrickyTests.cpp:106 +TrickyTests.cpp:106: ----------------------------------------------------------------- ./succeeding/side-effects ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( i++ == 7 ) with expansion: 7 == 7 -TrickyTests.cpp:119 +TrickyTests.cpp:119: PASSED: REQUIRE( i++ == 8 ) with expansion: 8 == 8 -TrickyTests.cpp:120 +TrickyTests.cpp:120: ----------------------------------------------------------------- ./succeeding/koenig ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( 0x == o ) with expansion: 0x == {?} -TrickyTests.cpp:186 +TrickyTests.cpp:186: ----------------------------------------------------------------- ./succeeding/non-const== ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( t == 1u ) with expansion: {?} == 1 -TrickyTests.cpp:212 +TrickyTests.cpp:212: ----------------------------------------------------------------- ./succeeding/enum/bits ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( 0x == bit30and31 ) with expansion: 0x == 3221225472 -TrickyTests.cpp:224 +TrickyTests.cpp:224: ----------------------------------------------------------------- ./succeeding/boolean member ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( obj.prop != __null ) with expansion: 0x != 0 -TrickyTests.cpp:239 +TrickyTests.cpp:239: ----------------------------------------------------------------- ./succeeding/unimplemented static bool compare to true ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( is_true::value == true ) with expansion: true == true -TrickyTests.cpp:259 +TrickyTests.cpp:259: PASSED: REQUIRE( true == is_true::value ) with expansion: true == true -TrickyTests.cpp:260 +TrickyTests.cpp:260: ----------------------------------------------------------------- ./succeeding/unimplemented static bool compare to false ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( is_true::value == false ) with expansion: false == false -TrickyTests.cpp:264 +TrickyTests.cpp:264: PASSED: REQUIRE( false == is_true::value ) with expansion: false == false -TrickyTests.cpp:265 +TrickyTests.cpp:265: ----------------------------------------------------------------- ./succeeding/unimplemented static bool negation ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( !is_true::value ) with expansion: true -TrickyTests.cpp:270 +TrickyTests.cpp:270: ----------------------------------------------------------------- ./succeeding/unimplemented static bool double negation ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( !!is_true::value ) with expansion: true -TrickyTests.cpp:275 +TrickyTests.cpp:275: ----------------------------------------------------------------- ./succeeding/unimplemented static bool direct ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( is_true::value ) with expansion: true -TrickyTests.cpp:280 +TrickyTests.cpp:280: PASSED: REQUIRE_FALSE( !is_true::value ) with expansion: !false -TrickyTests.cpp:281 +TrickyTests.cpp:281: ----------------------------------------------------------------- ./succeeding/SafeBool ------------------------------------------------------------------ +................................................................. PASSED: CHECK( True ) with expansion: true -TrickyTests.cpp:313 +TrickyTests.cpp:313: PASSED: CHECK( !False ) with expansion: true -TrickyTests.cpp:314 +TrickyTests.cpp:314: PASSED: CHECK_FALSE( !False ) with expansion: !false -TrickyTests.cpp:315 +TrickyTests.cpp:315: ----------------------------------------------------------------- Scenario: Do that thing with the thing Given: This stuff exists When: I do this Then: it should do this ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( itDoesThis() ) with expansion: true -BDDTests.cpp:29 +BDDTests.cpp:29: ================================================================= 96 test cases - 45 failed (610 assertions - 102 failed) -CatchSelfTest is a CATCH v0.9 b13 (integration) host application. +CatchSelfTest is a CATCH v0.9 b15 (integration) host application. Run with -? for options ----------------------------------------------------------------- ./succeeding/Approx/simple ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( d == Approx( 1.23 ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:20 +ApproxTests.cpp:20: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: 1.23 != Approx( 1.22 ) -ApproxTests.cpp:21 +ApproxTests.cpp:21: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: 1.23 != Approx( 1.24 ) -ApproxTests.cpp:22 +ApproxTests.cpp:22: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:24 +ApproxTests.cpp:24: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: Approx( 1.23 ) != 1.22 -ApproxTests.cpp:25 +ApproxTests.cpp:25: PASSED: REQUIRE( Approx( d ) != 1.24 ) with expansion: Approx( 1.23 ) != 1.24 -ApproxTests.cpp:26 +ApproxTests.cpp:26: ----------------------------------------------------------------- ./succeeding/Approx/epsilon ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( d != Approx( 1.231 ) ) with expansion: 1.23 != Approx( 1.231 ) -ApproxTests.cpp:38 +ApproxTests.cpp:38: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) with expansion: 1.23 == Approx( 1.231 ) -ApproxTests.cpp:39 +ApproxTests.cpp:39: ----------------------------------------------------------------- ./succeeding/Approx/float ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:49 +ApproxTests.cpp:49: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) with expansion: 0 == Approx( 0 ) -ApproxTests.cpp:50 +ApproxTests.cpp:50: ----------------------------------------------------------------- ./succeeding/Approx/int ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( 1 == Approx( 1 ) ) -ApproxTests.cpp:60 +ApproxTests.cpp:60: PASSED: REQUIRE( 0 == Approx( 0 ) ) -ApproxTests.cpp:61 +ApproxTests.cpp:61: ----------------------------------------------------------------- ./succeeding/Approx/mixed ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( 1.0f == Approx( 1 ) ) with expansion: 1 == Approx( 1 ) -ApproxTests.cpp:75 +ApproxTests.cpp:75: PASSED: REQUIRE( 0 == Approx( dZero) ) with expansion: 0 == Approx( 0 ) -ApproxTests.cpp:76 +ApproxTests.cpp:76: PASSED: REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) with expansion: 0 == Approx( 1e-05 ) -ApproxTests.cpp:77 +ApproxTests.cpp:77: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: 1.234 == Approx( 1.234 ) -ApproxTests.cpp:78 +ApproxTests.cpp:78: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) with expansion: 1.234 == Approx( 1.234 ) -ApproxTests.cpp:79 +ApproxTests.cpp:79: ----------------------------------------------------------------- ./succeeding/Approx/custom ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( d == approx( 1.23 ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:93 +ApproxTests.cpp:93: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: 1.23 == Approx( 1.22 ) -ApproxTests.cpp:94 +ApproxTests.cpp:94: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: 1.23 == Approx( 1.24 ) -ApproxTests.cpp:95 +ApproxTests.cpp:95: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: 1.23 != Approx( 1.25 ) -ApproxTests.cpp:96 +ApproxTests.cpp:96: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:98 +ApproxTests.cpp:98: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: Approx( 1.23 ) == 1.22 -ApproxTests.cpp:99 +ApproxTests.cpp:99: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: Approx( 1.23 ) == 1.24 -ApproxTests.cpp:100 +ApproxTests.cpp:100: PASSED: REQUIRE( approx( d ) != 1.25 ) with expansion: Approx( 1.23 ) != 1.25 -ApproxTests.cpp:101 +ApproxTests.cpp:101: ----------------------------------------------------------------- ./succeeding/TestClass/succeedingCase ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( s == "hello" ) with expansion: "hello" == "hello" -ClassTests.cpp:24 +ClassTests.cpp:24: ----------------------------------------------------------------- ./failing/TestClass/failingCase ------------------------------------------------------------------ +................................................................. FAILED: REQUIRE( s == "world" ) with expansion: "hello" == "world" -ClassTests.cpp:28 +ClassTests.cpp:28: ----------------------------------------------------------------- ./succeeding/Fixture/succeedingCase ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( m_a == 1 ) with expansion: 1 == 1 -ClassTests.cpp:47 +ClassTests.cpp:47: ----------------------------------------------------------------- ./failing/Fixture/failingCase ------------------------------------------------------------------ +................................................................. FAILED: REQUIRE( m_a == 2 ) with expansion: 1 == 2 -ClassTests.cpp:55 +ClassTests.cpp:55: ----------------------------------------------------------------- ./succeeding/conditions/equality ------------------------------------------------------------------ +................................................................. PASSED: REQUIRE( data.int_seven == 7 ) with expansion: 7 == 7 -ConditionTests.cpp:55 +ConditionTests.cpp:55: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: 9.1 == Approx( 9.1 ) -ConditionTests.cpp:56 +ConditionTests.cpp:56: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: 3.14159 == Approx( 3.14159 ) -ConditionTests.cpp:57 +ConditionTests.cpp:57: PASSED: REQUIRE( data.str_hello == "hello" ) with expansion: "hello" == "hello" -ConditionTests.cpp:58 +ConditionTests.cpp:58: PASSED: REQUIRE( "hello" == data.str_hello ) with expansion: "hello" == "hello" -ConditionTests.cpp:59 +ConditionTests.cpp:59: PASSED: REQUIRE( data.str_hello.size() == 5 ) with expansion: 5 == 5 -ConditionTests.cpp:60 +ConditionTests.cpp:60: PASSED: REQUIRE( x == Approx( 1.3 ) ) with expansion: 1.3 == Approx( 1.3 ) -ConditionTests.cpp:63 +ConditionTests.cpp:63: ----------------------------------------------------------------- ./failing/conditions/equality ------------------------------------------------------------------ +................................................................. FAILED: CHECK( data.int_seven == 6 ) with expansion: 7 == 6 -ConditionTests.cpp:71 +ConditionTests.cpp:71: FAILED: CHECK( data.int_seven == 8 ) with expansion: 7 == 8 -ConditionTests.cpp:72 +ConditionTests.cpp:72: ================================================================= 12 test cases - 3 failed (38 assertions - 4 failed) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index cd017674..a5fce59d 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 14 (integration branch) - * Generated: 2013-01-17 12:06:33.338396 + * CATCH v0.9 build 15 (integration branch) + * Generated: 2013-01-18 08:08:03.925034 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -5777,7 +5777,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 14, "integration" ); + Version libraryVersion( 0, 9, 15, "integration" ); } // #included from: catch_line_wrap.hpp @@ -6850,19 +6850,16 @@ namespace Catch { if( _assertionStats.totals.assertions.total() > 0 ) { printResultType( components ); printOriginalExpression( result ); -// printResultType( components ); endsWithNewLine = printReconstructedExpression( result ); } endsWithNewLine |= printMessage( components ); -// if( !endsWithNewLine ) -// stream << "\n"; printSourceInfo( result ); stream << std::endl; } void printSourceInfo( AssertionResult const& _result ) { TextColour colour( TextColour::FileName ); - stream << _result.getSourceInfo() << "\n"; + stream << _result.getSourceInfo() << ":\n"; } struct ResultComponents { @@ -7068,7 +7065,7 @@ namespace Catch { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) stream << " " << (*it)->name << "\n"; - stream << getDashes() << "\n" << std::endl; + stream << getDots() << "\n" << std::endl; unusedSectionInfo.reset(); } } @@ -7077,7 +7074,7 @@ namespace Catch { stream << getDashes() << "\n" << _name << "\n"; if( closed ) - stream << getDashes() << "\n"; + stream << getDots() << "\n"; } void printTotals( const Totals& totals ) { @@ -7138,6 +7135,11 @@ namespace Catch { = "-----------------------------------------------------------------"; return dashes; } + static std::string const& getDots() { + static const std::string dots + = "................................................................."; + return dots; + } static std::string const& getDoubleDashes() { static const std::string doubleDashes = "================================================================="; From 3682433c2ff9266c4ed53dcc41ddcc31be2967dc Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 18 Jan 2013 17:50:21 +0000 Subject: [PATCH 120/296] console_reporter refactoring --- include/internal/catch_common.h | 2 +- include/reporters/catch_reporter_console.hpp | 255 ++++++++++--------- 2 files changed, 129 insertions(+), 128 deletions(-) diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index a575b4fa..2eeb572a 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -119,7 +119,7 @@ namespace Catch { inline std::ostream& operator << ( std::ostream& os, const SourceLineInfo& info ) { #ifndef __GNUG__ - os << info.file << "(" << info.line << ")"; + os << info.file << "(" << info.line << "):"; #else os << info.file << ":" << info.line; #endif diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 292b354b..e6c58ceb 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -43,133 +43,11 @@ namespace Catch { lazyPrint(); - ResultComponents components( result ); - bool endsWithNewLine = false; - if( _assertionStats.totals.assertions.total() > 0 ) { - printResultType( components ); - printOriginalExpression( result ); - endsWithNewLine = printReconstructedExpression( result ); - } - endsWithNewLine |= printMessage( components ); - - printSourceInfo( result ); + AssertionPrinter printer( stream, _assertionStats ); + printer.print(); stream << std::endl; } - void printSourceInfo( AssertionResult const& _result ) { - TextColour colour( TextColour::FileName ); - stream << _result.getSourceInfo() << ":\n"; - } - - struct ResultComponents { - ResultComponents( AssertionResult const& _result ) - : colour( TextColour::None ), - message( _result.getMessage() ) - { - switch( _result.getResultType() ) { - case ResultWas::Ok: - colour = TextColour::Success; - passOrFail = "PASSED"; - if( _result.hasMessage() ) - messageLabel = "with message"; - break; - case ResultWas::ExpressionFailed: - if( _result.isOk() ) { - colour = TextColour::Success; - passOrFail = "FAILED - but was ok"; - } - else { - colour = TextColour::Error; - passOrFail = "FAILED"; - } - if( _result.hasMessage() ){ - messageLabel = "with message"; - } - break; - case ResultWas::ThrewException: - colour = TextColour::Error; - passOrFail = "FAILED"; - messageLabel = "due to unexpected exception with message"; - break; - case ResultWas::DidntThrowException: - colour = TextColour::Error; - passOrFail = "FAILED"; - messageLabel = "because no exception was thrown where one was expected"; - break; - case ResultWas::Info: - messageLabel = "info"; - break; - case ResultWas::Warning: - messageLabel = "warning"; - break; - case ResultWas::ExplicitFailure: - passOrFail = "FAILED"; - colour = TextColour::Error; - messageLabel = "explicitly with message"; - break; - case ResultWas::Exception: - passOrFail = "FAILED"; - colour = TextColour::Error; - if( _result.hasMessage() ) - messageLabel = "with message"; - break; - // These cases are here to prevent compiler warnings - case ResultWas::Unknown: - case ResultWas::FailureBit: - passOrFail = "** internal error **"; - colour = TextColour::Error; - break; - } - } - - TextColour::Colours colour; - std::string passOrFail; - std::string messageLabel; - std::string message; - }; - - void printResultType( ResultComponents const& _components ) { - if( !_components.passOrFail.empty() ) { - TextColour colour( _components.colour ); - stream << _components.passOrFail << ":\n"; - } - } - bool printOriginalExpression( AssertionResult const& _result ) { - if( _result.hasExpression() ) { - TextColour colour( TextColour::OriginalExpression ); - stream << " "; - if( !_result.getTestMacroName().empty() ) - stream << _result.getTestMacroName() << "( "; - stream << _result.getExpression(); - if( !_result.getTestMacroName().empty() ) - stream << " )"; - stream << "\n"; - return true; - } - return false; - } - bool printReconstructedExpression( AssertionResult const& _result ) { - if( _result.hasExpandedExpression() ) { - stream << "with expansion:\n"; - TextColour colour( TextColour::ReconstructedExpression ); - stream << wrapLongStrings( _result.getExpandedExpression() ) << "\n"; - return true; - } - return false; - } - bool printMessage( ResultComponents const& _components ) { - bool endsWithNewLine = false; - if( !_components.messageLabel.empty() ) { - stream << _components.messageLabel << ":" << "\n"; - endsWithNewLine = true; - } - if( !_components.message.empty() ) { - stream << wrapLongStrings( _components.message ) << "\n"; - endsWithNewLine = true; - } - return endsWithNewLine; - } - virtual void sectionEnded( SectionStats const& _sectionStats ) { if( _sectionStats.missingAssertions ) { lazyPrint(); @@ -206,9 +84,132 @@ namespace Catch { } private: - std::string wrapLongStrings( std::string const& _string ) { - return Catch::wrapLongStrings( _string, 70, 2 ); - } + + class AssertionPrinter { + public: + AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats ) + : stream( _stream ), + stats( _stats ), + result( _stats.assertionResult ), + colour( TextColour::None ), + message( result.getMessage() ) + { + switch( result.getResultType() ) { + case ResultWas::Ok: + colour = TextColour::Success; + passOrFail = "PASSED"; + if( result.hasMessage() ) + messageLabel = "with message"; + break; + case ResultWas::ExpressionFailed: + if( result.isOk() ) { + colour = TextColour::Success; + passOrFail = "FAILED - but was ok"; + } + else { + colour = TextColour::Error; + passOrFail = "FAILED"; + } + if( result.hasMessage() ){ + messageLabel = "with message"; + } + break; + case ResultWas::ThrewException: + colour = TextColour::Error; + passOrFail = "FAILED"; + messageLabel = "due to unexpected exception with message"; + break; + case ResultWas::DidntThrowException: + colour = TextColour::Error; + passOrFail = "FAILED"; + messageLabel = "because no exception was thrown where one was expected"; + break; + case ResultWas::Info: + messageLabel = "info"; + break; + case ResultWas::Warning: + messageLabel = "warning"; + break; + case ResultWas::ExplicitFailure: + passOrFail = "FAILED"; + colour = TextColour::Error; + messageLabel = "explicitly with message"; + break; + case ResultWas::Exception: + passOrFail = "FAILED"; + colour = TextColour::Error; + if( result.hasMessage() ) + messageLabel = "with message"; + break; + + // These cases are here to prevent compiler warnings + case ResultWas::Unknown: + case ResultWas::FailureBit: + passOrFail = "** internal error **"; + colour = TextColour::Error; + break; + } + } + + void print() const { + if( stats.totals.assertions.total() > 0 ) { + printResultType(); + printOriginalExpression(); + printReconstructedExpression(); + } + printMessage(); + printSourceInfo(); + } + + private: + void printResultType() const { + if( !passOrFail.empty() ) { + TextColour colourGuard( colour ); + stream << passOrFail << ":\n"; + } + } + void printOriginalExpression() const { + if( result.hasExpression() ) { + TextColour colourGuard( TextColour::OriginalExpression ); + stream << " "; + if( !result.getTestMacroName().empty() ) + stream << result.getTestMacroName() << "( "; + stream << result.getExpression(); + if( !result.getTestMacroName().empty() ) + stream << " )"; + stream << "\n"; + } + } + void printReconstructedExpression() const { + if( result.hasExpandedExpression() ) { + stream << "with expansion:\n"; + TextColour colourGuard( TextColour::ReconstructedExpression ); + stream << wrapLongStrings( result.getExpandedExpression() ) << "\n"; + } + } + void printMessage() const { + if( !messageLabel.empty() ) + stream << messageLabel << ":" << "\n"; + if( !message.empty() ) + stream << wrapLongStrings( message ) << "\n"; + } + void printSourceInfo() const { + TextColour colourGuard( TextColour::FileName ); + stream << result.getSourceInfo() << ":\n"; + } + + static std::string wrapLongStrings( std::string const& _string ){ + return Catch::wrapLongStrings( _string, 70, 2 ); + } + + std::ostream& stream; + AssertionStats const& stats; + AssertionResult const& result; + TextColour::Colours colour; + std::string passOrFail; + std::string messageLabel; + std::string message; + }; void lazyPrint() { From 67ccd8d74ab395fb196840c6f292a74c06507567 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 26 Jan 2013 20:06:55 +0000 Subject: [PATCH 121/296] Allows console line width to be configured (and defaults to 80). Line wrap is at console width-1 --- include/internal/catch_config.hpp | 4 + include/reporters/catch_reporter_console.hpp | 11 +- .../SelfTest/Baselines/approvedResults.txt | 660 +++++++++--------- 3 files changed, 338 insertions(+), 337 deletions(-) diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 72059f1f..1ef3fff6 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -18,6 +18,10 @@ #include #include +#ifndef CATCH_CONFIG_CONSOLE_WIDTH +#define CATCH_CONFIG_CONSOLE_WIDTH 80 +#endif + namespace Catch { struct Include { enum WhichResults { diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index e6c58ceb..8deefd33 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -199,7 +199,7 @@ namespace Catch { } static std::string wrapLongStrings( std::string const& _string ){ - return Catch::wrapLongStrings( _string, 70, 2 ); + return Catch::wrapLongStrings( _string, CATCH_CONFIG_CONSOLE_WIDTH-1, 2 ); } std::ostream& stream; @@ -330,18 +330,15 @@ namespace Catch { stream << getDashes() << "\n"; } static std::string const& getDashes() { - static const std::string dashes - = "-----------------------------------------------------------------"; + static const std::string dashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '-' ); return dashes; } static std::string const& getDots() { - static const std::string dots - = "................................................................."; + static const std::string dots( CATCH_CONFIG_CONSOLE_WIDTH-1, '.' ); return dots; } static std::string const& getDoubleDashes() { - static const std::string doubleDashes - = "================================================================="; + static const std::string doubleDashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' ); return doubleDashes; } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 10d03a66..78475fcb 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -2,9 +2,9 @@ CatchSelfTest is a CATCH v0.9 b15 (integration) host application. Run with -? for options ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/simple -................................................................. +............................................................................... PASSED: REQUIRE( d == Approx( 1.23 ) ) @@ -42,9 +42,9 @@ with expansion: Approx( 1.23 ) != 1.24 ApproxTests.cpp:26: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/epsilon -................................................................. +............................................................................... PASSED: REQUIRE( d != Approx( 1.231 ) ) @@ -58,9 +58,9 @@ with expansion: 1.23 == Approx( 1.231 ) ApproxTests.cpp:39: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/float -................................................................. +............................................................................... PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) @@ -74,9 +74,9 @@ with expansion: 0 == Approx( 0 ) ApproxTests.cpp:50: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/int -................................................................. +............................................................................... PASSED: REQUIRE( 1 == Approx( 1 ) ) @@ -86,9 +86,9 @@ PASSED: REQUIRE( 0 == Approx( 0 ) ) ApproxTests.cpp:61: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/mixed -................................................................. +............................................................................... PASSED: REQUIRE( 1.0f == Approx( 1 ) ) @@ -120,9 +120,9 @@ with expansion: 1.234 == Approx( 1.234 ) ApproxTests.cpp:79: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/custom -................................................................. +............................................................................... PASSED: REQUIRE( d == approx( 1.23 ) ) @@ -172,9 +172,9 @@ with expansion: Approx( 1.23 ) != 1.25 ApproxTests.cpp:101: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/TestClass/succeedingCase -................................................................. +............................................................................... PASSED: REQUIRE( s == "hello" ) @@ -182,9 +182,9 @@ with expansion: "hello" == "hello" ClassTests.cpp:24: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/TestClass/failingCase -................................................................. +............................................................................... FAILED: REQUIRE( s == "world" ) @@ -192,9 +192,9 @@ with expansion: "hello" == "world" ClassTests.cpp:28: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Fixture/succeedingCase -................................................................. +............................................................................... PASSED: REQUIRE( m_a == 1 ) @@ -202,9 +202,9 @@ with expansion: 1 == 1 ClassTests.cpp:47: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/Fixture/failingCase -................................................................. +............................................................................... FAILED: REQUIRE( m_a == 2 ) @@ -212,9 +212,9 @@ with expansion: 1 == 2 ClassTests.cpp:55: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/equality -................................................................. +............................................................................... PASSED: REQUIRE( data.int_seven == 7 ) @@ -258,9 +258,9 @@ with expansion: 1.3 == Approx( 1.3 ) ConditionTests.cpp:63: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/conditions/equality -................................................................. +............................................................................... FAILED: CHECK( data.int_seven == 6 ) @@ -340,9 +340,9 @@ with expansion: 1.3 == Approx( 1.301 ) ConditionTests.cpp:85: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/inequality -................................................................. +............................................................................... PASSED: REQUIRE( data.int_seven != 6 ) @@ -410,9 +410,9 @@ with expansion: 5 != 6 ConditionTests.cpp:103: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/conditions/inequality -................................................................. +............................................................................... FAILED: CHECK( data.int_seven != 7 ) @@ -444,9 +444,9 @@ with expansion: 5 != 5 ConditionTests.cpp:115: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/ordered -................................................................. +............................................................................... PASSED: REQUIRE( data.int_seven < 8 ) @@ -550,9 +550,9 @@ with expansion: "hello" > "a" ConditionTests.cpp:144: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/conditions/ordered -................................................................. +............................................................................... FAILED: CHECK( data.int_seven > 7 ) @@ -668,9 +668,9 @@ with expansion: "hello" <= "a" ConditionTests.cpp:174: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/int literals -................................................................. +............................................................................... PASSED: REQUIRE( i == 1 ) @@ -750,9 +750,9 @@ with expansion: 0x > 4 ConditionTests.cpp:202: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions//long_to_unsigned_x -................................................................. +............................................................................... PASSED: REQUIRE( long_var == unsigned_char_var ) @@ -778,9 +778,9 @@ with expansion: 1 == 1 ConditionTests.cpp:226: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/const ints to int literal -................................................................. +............................................................................... PASSED: REQUIRE( unsigned_char_var == 1 ) @@ -806,9 +806,9 @@ with expansion: 1 == 1 ConditionTests.cpp:240: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/negative ints -................................................................. +............................................................................... PASSED: CHECK( ( -1 > 2u ) ) @@ -846,9 +846,9 @@ with expansion: -2147483648 > 2 ConditionTests.cpp:254: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/computed ints -................................................................. +............................................................................... PASSED: CHECK( 54 == 6*9 ) @@ -856,9 +856,9 @@ with expansion: 54 == 54 ConditionTests.cpp:269: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/ptr -................................................................. +............................................................................... PASSED: REQUIRE( p == __null ) @@ -908,9 +908,9 @@ with expansion: 0 != 0x ConditionTests.cpp:302: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/not -................................................................. +............................................................................... PASSED: REQUIRE( false == false ) @@ -954,9 +954,9 @@ with expansion: !(1 == 2) ConditionTests.cpp:326: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/conditions/not -................................................................. +............................................................................... FAILED: CHECK( false != false ) @@ -1000,9 +1000,9 @@ with expansion: !(1 == 1) ConditionTests.cpp:343: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/exceptions/explicit -................................................................. +............................................................................... PASSED: REQUIRE_THROWS_AS( thisThrows() ) @@ -1016,9 +1016,9 @@ PASSED: REQUIRE_THROWS( thisThrows() ) ExceptionTests.cpp:41: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/explicit -................................................................. +............................................................................... FAILED: CHECK_THROWS_AS( thisThrows() ) @@ -1037,18 +1037,18 @@ due to unexpected exception with message: expected exception ExceptionTests.cpp:49: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/implicit -................................................................. +............................................................................... FAILED: due to unexpected exception with message: unexpected exception ExceptionTests.cpp:52: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/implicit/2 -................................................................. +............................................................................... PASSED: CHECK( 1 == 1 ) @@ -1060,25 +1060,25 @@ due to unexpected exception with message: unexpected exception ExceptionTests.cpp:60: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/exceptions/implicit -................................................................. +............................................................................... No assertions in test case, './succeeding/exceptions/implicit' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/custom -................................................................. +............................................................................... FAILED: due to unexpected exception with message: custom exception ExceptionTests.cpp:102: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/custom/nothrow -................................................................. +............................................................................... FAILED: REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) @@ -1086,9 +1086,9 @@ due to unexpected exception with message: unexpected custom exception ExceptionTests.cpp:109: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/custom/throw -................................................................. +............................................................................... FAILED: REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) @@ -1096,26 +1096,26 @@ due to unexpected exception with message: custom exception - not std ExceptionTests.cpp:114: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/custom/double -................................................................. +............................................................................... FAILED: due to unexpected exception with message: 3.14 ExceptionTests.cpp:118: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/exceptions/notimplemented -................................................................. +............................................................................... PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) ExceptionTests.cpp:129: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/generators/1 -................................................................. +............................................................................... PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) @@ -1981,9 +1981,9 @@ with expansion: 214 == 214 GeneratorTests.cpp:27: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/generators/2 -................................................................. +............................................................................... PASSED: CATCH_REQUIRE( i->first == i->second-1 ) @@ -1997,9 +1997,9 @@ with expansion: 2 == 2 GeneratorTests.cpp:40: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/message -................................................................. +............................................................................... warning: this is a warning @@ -2008,18 +2008,18 @@ MessageTests.cpp:14: No assertions in test case, './succeeding/message' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/succeed -................................................................. +............................................................................... PASSED: with message: this is a success MessageTests.cpp:18: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/message/info/1 -................................................................. +............................................................................... info: this message should be logged @@ -2035,9 +2035,9 @@ with expansion: 2 == 1 MessageTests.cpp:26: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/message/info/2 -................................................................. +............................................................................... PASSED: CHECK( a == 2 ) @@ -2075,29 +2075,29 @@ with expansion: 2 == 2 MessageTests.cpp:45: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/message/fail -................................................................. +............................................................................... FAILED: explicitly with message: This is a failure MessageTests.cpp:51: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/message/sections one -................................................................. +............................................................................... FAILED: explicitly with message: Message from section one MessageTests.cpp:58: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/message/sections two -................................................................. +............................................................................... FAILED: explicitly with message: @@ -2105,26 +2105,26 @@ explicitly with message: MessageTests.cpp:63: Message from section one ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/message/sections/stdout one -................................................................. +............................................................................... No assertions in section, 'one' Message from section two ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/message/sections/stdout two -................................................................. +............................................................................... No assertions in section, 'two' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/message/scoped -................................................................. +............................................................................... PASSED: REQUIRE( i < 10 ) @@ -2202,9 +2202,9 @@ with expansion: 10 < 10 MessageTests.cpp:86: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/nofail -................................................................. +............................................................................... FAILED - but was ok: CHECK_NOFAIL( 1 == 2 ) @@ -2213,10 +2213,10 @@ MessageTests.cpp:92: No assertions in test case, './succeeding/nofail' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/Sections s1 -................................................................. +............................................................................... PASSED: REQUIRE( a != b ) @@ -2230,10 +2230,10 @@ with expansion: 2 != 1 MiscTests.cpp:26: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/Sections s2 -................................................................. +............................................................................... PASSED: REQUIRE( a != b ) @@ -2241,10 +2241,10 @@ with expansion: 1 != 2 MiscTests.cpp:31: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/Sections/nested s1 -................................................................. +............................................................................... PASSED: REQUIRE( a != b ) @@ -2258,11 +2258,11 @@ with expansion: 2 != 1 MiscTests.cpp:43: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/Sections/nested s1 s2 -................................................................. +............................................................................... PASSED: REQUIRE( a != b ) @@ -2270,11 +2270,11 @@ with expansion: 1 != 2 MiscTests.cpp:47: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/Misc/Sections/nested2 s1 s2 -................................................................. +............................................................................... FAILED: REQUIRE( a == b ) @@ -2282,11 +2282,11 @@ with expansion: 1 == 2 MiscTests.cpp:61: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/Misc/Sections/nested2 s1 s3 -................................................................. +............................................................................... PASSED: REQUIRE( a != b ) @@ -2294,11 +2294,11 @@ with expansion: 1 != 2 MiscTests.cpp:66: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/Misc/Sections/nested2 s1 s4 -................................................................. +............................................................................... PASSED: REQUIRE( a < b ) @@ -2306,36 +2306,36 @@ with expansion: 1 < 2 MiscTests.cpp:70: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./Sections/nested/a/b c d (leaf) -................................................................. +............................................................................... No assertions in section, 'd (leaf)' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./Sections/nested/a/b c e (leaf) -................................................................. +............................................................................... No assertions in section, 'e (leaf)' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./Sections/nested/a/b f (leaf) -................................................................. +............................................................................... No assertions in section, 'f (leaf)' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/Misc/Sections/loops s1 -................................................................. +............................................................................... FAILED: CHECK( b > a ) @@ -2343,9 +2343,9 @@ with expansion: 0 > 1 MiscTests.cpp:103: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/Misc/loops -................................................................. +............................................................................... info: Testing if fib[0] (1) is even @@ -2429,16 +2429,16 @@ MiscTests.cpp:115: Some information An error ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/stdout,stderr -................................................................. +............................................................................... No assertions in test case, './succeeding/Misc/stdout,stderr' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/null strings -................................................................. +............................................................................... PASSED: REQUIRE( makeString( false ) != static_cast(__null) ) @@ -2452,9 +2452,9 @@ with expansion: {null string} == {null string} MiscTests.cpp:134: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/info -................................................................. +............................................................................... info: hi @@ -2468,9 +2468,9 @@ FAILED: REQUIRE( false ) MiscTests.cpp:142: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/checkedif -................................................................. +............................................................................... PASSED: CHECKED_IF( flag ) @@ -2484,9 +2484,9 @@ with expansion: true MiscTests.cpp:155: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/checkedif -................................................................. +............................................................................... FAILED: CHECKED_IF( flag ) @@ -2500,9 +2500,9 @@ with expansion: false MiscTests.cpp:160: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/checkedelse -................................................................. +............................................................................... PASSED: CHECKED_ELSE( flag ) @@ -2516,9 +2516,9 @@ with expansion: true MiscTests.cpp:173: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/checkedelse -................................................................. +............................................................................... FAILED: CHECKED_ELSE( flag ) @@ -2532,25 +2532,25 @@ with expansion: false MiscTests.cpp:178: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./misc/xmlentitycheck embedded xml -................................................................. +............................................................................... No assertions in section, 'embedded xml' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./misc/xmlentitycheck encoded chars -................................................................. +............................................................................... No assertions in section, 'encoded chars' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./manual/onechar -................................................................. +............................................................................... info: 3 @@ -2560,9 +2560,9 @@ FAILED: REQUIRE( false ) MiscTests.cpp:196: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/atomic if -................................................................. +............................................................................... PASSED: REQUIRE( x == 0 ) @@ -2570,9 +2570,9 @@ with expansion: 0 == 0 MiscTests.cpp:206: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/matchers -................................................................. +............................................................................... PASSED: REQUIRE_THAT( testStringForMatching() Contains( "string" ) ) @@ -2598,9 +2598,9 @@ with expansion: "this string contains 'abc' as a substring" ends with: "substring" MiscTests.cpp:220: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/matchers/Contains -................................................................. +............................................................................... FAILED: CHECK_THAT( testStringForMatching() Contains( "not there" ) ) @@ -2608,9 +2608,9 @@ with expansion: "this string contains 'abc' as a substring" contains: "not there" MiscTests.cpp:225: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/matchers/StartsWith -................................................................. +............................................................................... FAILED: CHECK_THAT( testStringForMatching() StartsWith( "string" ) ) @@ -2618,9 +2618,9 @@ with expansion: "this string contains 'abc' as a substring" starts with: "string" MiscTests.cpp:230: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/matchers/EndsWith -................................................................. +............................................................................... FAILED: CHECK_THAT( testStringForMatching() EndsWith( "this" ) ) @@ -2628,9 +2628,9 @@ with expansion: "this string contains 'abc' as a substring" ends with: "this" MiscTests.cpp:235: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/matchers/Equals -................................................................. +............................................................................... FAILED: CHECK_THAT( testStringForMatching() Equals( "something else" ) ) @@ -2638,20 +2638,20 @@ with expansion: "this string contains 'abc' as a substring" equals: "something else" MiscTests.cpp:240: ------------------------------------------------------------------ +------------------------------------------------------------------------------- /succeeding/matchers/AllOf -................................................................. +............................................................................... PASSED: CHECK_THAT( testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ) with expansion: - "this string contains 'abc' as a substring" ( contains: "string" - and contains: "abc" ) + "this string contains 'abc' as a substring" ( contains: "string" and + contains: "abc" ) MiscTests.cpp:248: ------------------------------------------------------------------ +------------------------------------------------------------------------------- /succeeding/matchers/AnyOf -................................................................. +............................................................................... PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) ) @@ -2663,24 +2663,24 @@ MiscTests.cpp:252: PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) ) with expansion: - "this string contains 'abc' as a substring" ( contains: "not there" - or contains: "string" ) + "this string contains 'abc' as a substring" ( contains: "not there" or + contains: "string" ) MiscTests.cpp:253: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/matchers/Equals -................................................................. +............................................................................... PASSED: CHECK_THAT( testStringForMatching() Equals( "this string contains 'abc' as a substring" ) ) with expansion: - "this string contains 'abc' as a substring" equals: "this string - contains 'abc' as a substring" + "this string contains 'abc' as a substring" equals: "this string contains + 'abc' as a substring" MiscTests.cpp:258: ------------------------------------------------------------------ +------------------------------------------------------------------------------- example/factorial -................................................................. +............................................................................... PASSED: REQUIRE( Factorial(0) == 1 ) @@ -2712,16 +2712,16 @@ with expansion: 0x == 3628800 MiscTests.cpp:273: ------------------------------------------------------------------ +------------------------------------------------------------------------------- empty -................................................................. +............................................................................... No assertions in test case, 'empty' ------------------------------------------------------------------ +------------------------------------------------------------------------------- Nice descriptive name -................................................................. +............................................................................... warning: This one ran @@ -2730,25 +2730,25 @@ MiscTests.cpp:282: No assertions in test case, 'Nice descriptive name' ------------------------------------------------------------------ +------------------------------------------------------------------------------- first tag -................................................................. +............................................................................... No assertions in test case, 'first tag' ------------------------------------------------------------------ +------------------------------------------------------------------------------- second tag -................................................................. +............................................................................... No assertions in test case, 'second tag' ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/main selftest/expected result selftest/expected result/failing tests -................................................................. +............................................................................... PASSED: with message: @@ -2875,11 +2875,11 @@ with message: Tests failed, as expected catch_self_test.hpp:114: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/main selftest/expected result selftest/expected result/succeeding tests -................................................................. +............................................................................... PASSED: with message: @@ -3109,11 +3109,11 @@ Message from section one Message from section two Some information An error ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/main selftest/test counts selftest/test counts/succeeding tests -................................................................. +............................................................................... FAILED: CHECK( totals.assertions.passed == 291 ) @@ -3127,11 +3127,11 @@ with expansion: 0 == 0 TestMain.cpp:41: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/main selftest/test counts selftest/test counts/failing tests -................................................................. +............................................................................... PASSED: CHECK( totals.assertions.passed == 1 ) @@ -3145,9 +3145,9 @@ with expansion: 72 == 72 TestMain.cpp:48: ------------------------------------------------------------------ +------------------------------------------------------------------------------- meta/Misc/Sections -................................................................. +............................................................................... PASSED: CHECK( totals.assertions.passed == 2 ) @@ -3161,10 +3161,10 @@ with expansion: 1 == 1 TestMain.cpp:58: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 default -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3194,11 +3194,11 @@ with expansion: true TestMain.cpp:102: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists -t/1 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3222,11 +3222,11 @@ with expansion: true TestMain.cpp:112: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists -t/exclude:1 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3250,11 +3250,11 @@ with expansion: true TestMain.cpp:120: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists --test/1 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3278,11 +3278,11 @@ with expansion: true TestMain.cpp:129: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists --test/exclude:1 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3306,11 +3306,11 @@ with expansion: true TestMain.cpp:138: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists --test/exclude:2 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3334,11 +3334,11 @@ with expansion: true TestMain.cpp:147: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists -t/2 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3368,24 +3368,24 @@ with expansion: true TestMain.cpp:157: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists -t/0 -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) ) with expansion: - "Error while parsing arguments. Expected at least 1 argument." - contains: "at least 1" + "Error while parsing arguments. Expected at least 1 argument." contains: "at + least 1" TestMain.cpp:162: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 reporter -r/console -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3397,11 +3397,11 @@ with expansion: "console" == "console" TestMain.cpp:171: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 reporter -r/xml -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3413,11 +3413,11 @@ with expansion: "xml" == "xml" TestMain.cpp:177: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 reporter --reporter/junit -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3429,24 +3429,24 @@ with expansion: "junit" == "junit" TestMain.cpp:183: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 reporter -r/error -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) ) with expansion: - "Error while parsing arguments. Expected 1 argument. Arguments - were: one two" contains: "1 argument" + "Error while parsing arguments. Expected 1 argument. Arguments were: one + two" contains: "1 argument" TestMain.cpp:187: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 debugger -b -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3458,11 +3458,11 @@ with expansion: true == true TestMain.cpp:196: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 debugger --break -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3474,24 +3474,24 @@ with expansion: true TestMain.cpp:202: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 debugger -b -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) ) with expansion: - "Error while parsing arguments. Expected 0 arguments. Arguments - were: unexpected" contains: "0 arguments" + "Error while parsing arguments. Expected 0 arguments. Arguments were: + unexpected" contains: "0 arguments" TestMain.cpp:206: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 abort -a -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3503,11 +3503,11 @@ with expansion: 1 == 1 TestMain.cpp:215: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 abort -a/2 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3519,50 +3519,50 @@ with expansion: 2 == 2 TestMain.cpp:221: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 abort -a/error/0 -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: - "Error while parsing arguments. threshold must be a number greater - than zero. Arguments were: 0" contains: "greater than zero" + "Error while parsing arguments. threshold must be a number greater than + zero. Arguments were: 0" contains: "greater than zero" TestMain.cpp:225: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 abort -a/error/non numeric -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: - "Error while parsing arguments. threshold must be a number greater - than zero. Arguments were: oops" contains: "greater than zero" + "Error while parsing arguments. threshold must be a number greater than + zero. Arguments were: oops" contains: "greater than zero" TestMain.cpp:229: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 abort -a/error/two args -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) ) with expansion: - "Error while parsing arguments. Expected between 0 and 1 argument. - Arguments were: 1 2" contains: "0 and 1 argument" + "Error while parsing arguments. Expected between 0 and 1 argument. Arguments + were: 1 2" contains: "0 and 1 argument" TestMain.cpp:233: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 nothrow -nt -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3574,11 +3574,11 @@ with expansion: false == false TestMain.cpp:242: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 nothrow --nothrow -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3590,11 +3590,11 @@ with expansion: false == false TestMain.cpp:248: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 streams -o filename -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3612,11 +3612,11 @@ with expansion: true TestMain.cpp:258: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 streams -o %stdout -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3634,11 +3634,11 @@ with expansion: true TestMain.cpp:265: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 streams --out -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3650,11 +3650,11 @@ with expansion: "filename.ext" == "filename.ext" TestMain.cpp:271: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 combinations -a -b -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3678,9 +3678,9 @@ with expansion: false == false TestMain.cpp:282: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/test filter -................................................................. +............................................................................... PASSED: CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) @@ -3718,9 +3718,9 @@ with expansion: false == false TestMain.cpp:301: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/test filters -................................................................. +............................................................................... PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) @@ -3746,9 +3746,9 @@ with expansion: false == false TestMain.cpp:316: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/filter/prefix wildcard -................................................................. +............................................................................... PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) @@ -3762,9 +3762,9 @@ with expansion: false == false TestMain.cpp:323: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/filter/wildcard at both ends -................................................................. +............................................................................... PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) @@ -3790,9 +3790,9 @@ with expansion: false == false TestMain.cpp:331: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/option parsers -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) @@ -3816,10 +3816,10 @@ with expansion: true TestMain.cpp:355: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/tags one tag -................................................................. +............................................................................... PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) @@ -3869,10 +3869,10 @@ with expansion: false == false TestMain.cpp:377: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/tags two tags -................................................................. +............................................................................... PASSED: CHECK( twoTags.getTestCaseInfo().description == "" ) @@ -3934,10 +3934,10 @@ with expansion: true == true TestMain.cpp:393: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/tags one tag with characters either side -................................................................. +............................................................................... PASSED: CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) @@ -3963,10 +3963,10 @@ with expansion: 1 == 1 TestMain.cpp:402: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/tags start of a tag, but not closed -................................................................. +............................................................................... PASSED: CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) @@ -3986,10 +3986,10 @@ with expansion: 0 == 0 TestMain.cpp:411: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/tags hidden -................................................................. +............................................................................... PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) @@ -4015,9 +4015,9 @@ with expansion: false == false TestMain.cpp:421: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Tricky/std::pair -................................................................. +............................................................................... PASSED: REQUIRE( (std::pair( 1, 2 )) == aNicePair ) @@ -4028,33 +4028,33 @@ with expansion: std::pair( 1, 2 ) TrickyTests.cpp:37: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./inprogress/failing/Tricky/trailing expression -................................................................. +............................................................................... warning: - Uncomment the code in this test to check that it gives a sensible - compiler error + Uncomment the code in this test to check that it gives a sensible compiler + error TrickyTests.cpp:55: No assertions in test case, './inprogress/failing/Tricky/trailing expression' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./inprogress/failing/Tricky/compound lhs -................................................................. +............................................................................... warning: - Uncomment the code in this test to check that it gives a sensible - compiler error + Uncomment the code in this test to check that it gives a sensible compiler + error TrickyTests.cpp:71: No assertions in test case, './inprogress/failing/Tricky/compound lhs' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/Tricky/non streamable type -................................................................. +............................................................................... FAILED: CHECK( &o1 == &o2 ) @@ -4068,9 +4068,9 @@ with expansion: {?} == {?} TrickyTests.cpp:96: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/string literals -................................................................. +............................................................................... FAILED: REQUIRE( std::string( "first" ) == "second" ) @@ -4078,9 +4078,9 @@ with expansion: "first" == "second" TrickyTests.cpp:106: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/side-effects -................................................................. +............................................................................... PASSED: REQUIRE( i++ == 7 ) @@ -4094,9 +4094,9 @@ with expansion: 8 == 8 TrickyTests.cpp:120: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/koenig -................................................................. +............................................................................... PASSED: REQUIRE( 0x == o ) @@ -4104,9 +4104,9 @@ with expansion: 0x == {?} TrickyTests.cpp:186: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/non-const== -................................................................. +............................................................................... PASSED: REQUIRE( t == 1u ) @@ -4114,9 +4114,9 @@ with expansion: {?} == 1 TrickyTests.cpp:212: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/enum/bits -................................................................. +............................................................................... PASSED: REQUIRE( 0x == bit30and31 ) @@ -4124,9 +4124,9 @@ with expansion: 0x == 3221225472 TrickyTests.cpp:224: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/boolean member -................................................................. +............................................................................... PASSED: REQUIRE( obj.prop != __null ) @@ -4134,10 +4134,10 @@ with expansion: 0x != 0 TrickyTests.cpp:239: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/unimplemented static bool compare to true -................................................................. +............................................................................... PASSED: REQUIRE( is_true::value == true ) @@ -4151,10 +4151,10 @@ with expansion: true == true TrickyTests.cpp:260: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/unimplemented static bool compare to false -................................................................. +............................................................................... PASSED: REQUIRE( is_true::value == false ) @@ -4168,10 +4168,10 @@ with expansion: false == false TrickyTests.cpp:265: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/unimplemented static bool negation -................................................................. +............................................................................... PASSED: REQUIRE( !is_true::value ) @@ -4179,10 +4179,10 @@ with expansion: true TrickyTests.cpp:270: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/unimplemented static bool double negation -................................................................. +............................................................................... PASSED: REQUIRE( !!is_true::value ) @@ -4190,10 +4190,10 @@ with expansion: true TrickyTests.cpp:275: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/unimplemented static bool direct -................................................................. +............................................................................... PASSED: REQUIRE( is_true::value ) @@ -4207,9 +4207,9 @@ with expansion: !false TrickyTests.cpp:281: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/SafeBool -................................................................. +............................................................................... PASSED: CHECK( True ) @@ -4229,12 +4229,12 @@ with expansion: !false TrickyTests.cpp:315: ------------------------------------------------------------------ +------------------------------------------------------------------------------- Scenario: Do that thing with the thing Given: This stuff exists When: I do this Then: it should do this -................................................................. +............................................................................... PASSED: REQUIRE( itDoesThis() ) @@ -4242,16 +4242,16 @@ with expansion: true BDDTests.cpp:29: -================================================================= +=============================================================================== 96 test cases - 45 failed (610 assertions - 102 failed) CatchSelfTest is a CATCH v0.9 b15 (integration) host application. Run with -? for options ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/simple -................................................................. +............................................................................... PASSED: REQUIRE( d == Approx( 1.23 ) ) @@ -4289,9 +4289,9 @@ with expansion: Approx( 1.23 ) != 1.24 ApproxTests.cpp:26: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/epsilon -................................................................. +............................................................................... PASSED: REQUIRE( d != Approx( 1.231 ) ) @@ -4305,9 +4305,9 @@ with expansion: 1.23 == Approx( 1.231 ) ApproxTests.cpp:39: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/float -................................................................. +............................................................................... PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) @@ -4321,9 +4321,9 @@ with expansion: 0 == Approx( 0 ) ApproxTests.cpp:50: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/int -................................................................. +............................................................................... PASSED: REQUIRE( 1 == Approx( 1 ) ) @@ -4333,9 +4333,9 @@ PASSED: REQUIRE( 0 == Approx( 0 ) ) ApproxTests.cpp:61: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/mixed -................................................................. +............................................................................... PASSED: REQUIRE( 1.0f == Approx( 1 ) ) @@ -4367,9 +4367,9 @@ with expansion: 1.234 == Approx( 1.234 ) ApproxTests.cpp:79: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/custom -................................................................. +............................................................................... PASSED: REQUIRE( d == approx( 1.23 ) ) @@ -4419,9 +4419,9 @@ with expansion: Approx( 1.23 ) != 1.25 ApproxTests.cpp:101: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/TestClass/succeedingCase -................................................................. +............................................................................... PASSED: REQUIRE( s == "hello" ) @@ -4429,9 +4429,9 @@ with expansion: "hello" == "hello" ClassTests.cpp:24: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/TestClass/failingCase -................................................................. +............................................................................... FAILED: REQUIRE( s == "world" ) @@ -4439,9 +4439,9 @@ with expansion: "hello" == "world" ClassTests.cpp:28: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Fixture/succeedingCase -................................................................. +............................................................................... PASSED: REQUIRE( m_a == 1 ) @@ -4449,9 +4449,9 @@ with expansion: 1 == 1 ClassTests.cpp:47: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/Fixture/failingCase -................................................................. +............................................................................... FAILED: REQUIRE( m_a == 2 ) @@ -4459,9 +4459,9 @@ with expansion: 1 == 2 ClassTests.cpp:55: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/equality -................................................................. +............................................................................... PASSED: REQUIRE( data.int_seven == 7 ) @@ -4505,9 +4505,9 @@ with expansion: 1.3 == Approx( 1.3 ) ConditionTests.cpp:63: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/conditions/equality -................................................................. +............................................................................... FAILED: CHECK( data.int_seven == 6 ) @@ -4521,7 +4521,7 @@ with expansion: 7 == 8 ConditionTests.cpp:72: -================================================================= +=============================================================================== 12 test cases - 3 failed (38 assertions - 4 failed) From 603002c644196f175efbc9c96c9adfaab28e1b25 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 26 Jan 2013 20:17:52 +0000 Subject: [PATCH 122/296] Removed circular dependency between SectionInfo and its parent --- include/internal/catch_interfaces_reporter.h | 18 +++++++----------- include/reporters/catch_reporter_console.hpp | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 85b82d1f..e6743f06 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -77,14 +77,14 @@ namespace Catch }; struct ThreadedSectionInfo : SectionInfo, SharedImpl<> { - ThreadedSectionInfo( SectionInfo const& _sectionInfo, Ptr const& _parent = Ptr() ) + ThreadedSectionInfo( SectionInfo const& _sectionInfo, ThreadedSectionInfo* _parent = NULL ) : SectionInfo( _sectionInfo ), parent( _parent ) {} virtual ~ThreadedSectionInfo(); std::vector > children; - Ptr parent; + ThreadedSectionInfo* parent; }; struct AssertionStats { @@ -222,20 +222,19 @@ namespace Catch } virtual void sectionStarting( SectionInfo const& _sectionInfo ) { Ptr sectionInfo = new ThreadedSectionInfo( _sectionInfo ); - unusedSectionInfo = sectionInfo; if( !currentSectionInfo ) { currentSectionInfo = sectionInfo; + m_rootSections.push_back( currentSectionInfo ); } else { currentSectionInfo->children.push_back( sectionInfo ); - sectionInfo->parent = currentSectionInfo; + sectionInfo->parent = currentSectionInfo.get(); currentSectionInfo = sectionInfo; } } virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { currentSectionInfo = currentSectionInfo->parent; - unusedSectionInfo = currentSectionInfo; } virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { unusedTestCaseInfo.reset(); @@ -245,7 +244,6 @@ namespace Catch } virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { currentSectionInfo.reset(); - unusedSectionInfo.reset(); unusedTestCaseInfo.reset(); unusedGroupInfo.reset(); testRunInfo.reset(); @@ -255,9 +253,11 @@ namespace Catch Option testRunInfo; Option unusedGroupInfo; Option unusedTestCaseInfo; - Ptr unusedSectionInfo; Ptr currentSectionInfo; std::ostream& stream; + + // !TBD: This should really go in the TestCaseStats class + std::vector > m_rootSections; }; struct TestGroupNode : TestGroupStats { @@ -303,7 +303,6 @@ namespace Catch } virtual void sectionStarting( SectionInfo const& _sectionInfo ) { // Ptr sectionInfo = new ThreadedSectionInfo( _sectionInfo ); -// unusedSectionInfo = sectionInfo; // if( !currentSectionInfo ) { // currentSectionInfo = sectionInfo; // } @@ -316,7 +315,6 @@ namespace Catch virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { // currentSectionInfo = currentSectionInfo->parent; -// unusedSectionInfo = currentSectionInfo; } virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { // unusedTestCaseInfo.reset(); @@ -328,7 +326,6 @@ namespace Catch } virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { // currentSectionInfo.reset(); -// unusedSectionInfo.reset(); // unusedTestCaseInfo.reset(); // unusedGroupInfo.reset(); // testRunInfo.reset(); @@ -338,7 +335,6 @@ namespace Catch // Option testRunInfo; // Option unusedGroupInfo; // Option unusedTestCaseInfo; -// Ptr unusedSectionInfo; // Ptr currentSectionInfo; // Ptr testGroupNode; Option testGroupNode; diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 8deefd33..3101dab9 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -17,6 +17,7 @@ namespace Catch { struct ConsoleReporter : StreamingReporterBase { ConsoleReporter( ReporterConfig const& _config ) : StreamingReporterBase( _config ), + m_printedCurrentSection( false ), m_atLeastOneTestCasePrinted( false ) {} @@ -47,13 +48,18 @@ namespace Catch { printer.print(); stream << std::endl; } - + + virtual void sectionStarting( SectionInfo const& _sectionInfo ) { + m_printedCurrentSection = false; + StreamingReporterBase::sectionStarting( _sectionInfo ); + } virtual void sectionEnded( SectionStats const& _sectionStats ) { if( _sectionStats.missingAssertions ) { lazyPrint(); TextColour colour( TextColour::ResultError ); stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; } + m_printedCurrentSection = false; StreamingReporterBase::sectionEnded( _sectionStats ); } @@ -219,7 +225,7 @@ namespace Catch { lazyPrintGroupInfo(); if( unusedTestCaseInfo ) lazyPrintTestCaseInfo(); - if( unusedSectionInfo) + if( currentSectionInfo && !m_printedCurrentSection ) lazyPrintSectionInfo(); m_atLeastOneTestCasePrinted = true; @@ -252,9 +258,9 @@ namespace Catch { void lazyPrintSectionInfo() { std::vector sections; - for( ThreadedSectionInfo* section = unusedSectionInfo.get(); + for( ThreadedSectionInfo* section = currentSectionInfo.get(); section; - section = section->parent.get() ) + section = section->parent ) sections.push_back( section ); // Sections @@ -265,8 +271,8 @@ namespace Catch { for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) stream << " " << (*it)->name << "\n"; stream << getDots() << "\n" << std::endl; - unusedSectionInfo.reset(); } + m_printedCurrentSection = true; } void printHeader( std::string const& _name, bool closed = true ) { @@ -343,8 +349,8 @@ namespace Catch { } private: + bool m_printedCurrentSection; bool m_atLeastOneTestCasePrinted; - }; INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) From e475645731d420abfcf8558dec35d4d30023bfec Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 26 Jan 2013 20:18:30 +0000 Subject: [PATCH 123/296] Build 16 --- README | 2 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 308 +++++++++++++++-------------- 3 files changed, 158 insertions(+), 154 deletions(-) diff --git a/README b/README index fba4de53..5118f912 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 15 (integration branch) +CATCH v0.9 build 16 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 1d5eac22..6989a932 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 15, "integration" ); + Version libraryVersion( 0, 9, 16, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index a5fce59d..bac4dd72 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 15 (integration branch) - * Generated: 2013-01-18 08:08:03.925034 + * CATCH v0.9 build 16 (integration branch) + * Generated: 2013-01-26 20:18:07.076275 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -137,7 +137,7 @@ namespace Catch { inline std::ostream& operator << ( std::ostream& os, const SourceLineInfo& info ) { #ifndef __GNUG__ - os << info.file << "(" << info.line << ")"; + os << info.file << "(" << info.line << "):"; #else os << info.file << ":" << info.line; #endif @@ -1735,6 +1735,10 @@ namespace Catch { #include #include +#ifndef CATCH_CONFIG_CONSOLE_WIDTH +#define CATCH_CONFIG_CONSOLE_WIDTH 80 +#endif + namespace Catch { struct Include { enum WhichResults { @@ -2001,14 +2005,14 @@ namespace Catch }; struct ThreadedSectionInfo : SectionInfo, SharedImpl<> { - ThreadedSectionInfo( SectionInfo const& _sectionInfo, Ptr const& _parent = Ptr() ) + ThreadedSectionInfo( SectionInfo const& _sectionInfo, ThreadedSectionInfo* _parent = NULL ) : SectionInfo( _sectionInfo ), parent( _parent ) {} virtual ~ThreadedSectionInfo(); std::vector > children; - Ptr parent; + ThreadedSectionInfo* parent; }; struct AssertionStats { @@ -2146,20 +2150,19 @@ namespace Catch } virtual void sectionStarting( SectionInfo const& _sectionInfo ) { Ptr sectionInfo = new ThreadedSectionInfo( _sectionInfo ); - unusedSectionInfo = sectionInfo; if( !currentSectionInfo ) { currentSectionInfo = sectionInfo; + m_rootSections.push_back( currentSectionInfo ); } else { currentSectionInfo->children.push_back( sectionInfo ); - sectionInfo->parent = currentSectionInfo; + sectionInfo->parent = currentSectionInfo.get(); currentSectionInfo = sectionInfo; } } virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { currentSectionInfo = currentSectionInfo->parent; - unusedSectionInfo = currentSectionInfo; } virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { unusedTestCaseInfo.reset(); @@ -2169,7 +2172,6 @@ namespace Catch } virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { currentSectionInfo.reset(); - unusedSectionInfo.reset(); unusedTestCaseInfo.reset(); unusedGroupInfo.reset(); testRunInfo.reset(); @@ -2179,9 +2181,11 @@ namespace Catch Option testRunInfo; Option unusedGroupInfo; Option unusedTestCaseInfo; - Ptr unusedSectionInfo; Ptr currentSectionInfo; std::ostream& stream; + + // !TBD: This should really go in the TestCaseStats class + std::vector > m_rootSections; }; struct TestGroupNode : TestGroupStats { @@ -2225,7 +2229,6 @@ namespace Catch } virtual void sectionStarting( SectionInfo const& _sectionInfo ) { // Ptr sectionInfo = new ThreadedSectionInfo( _sectionInfo ); -// unusedSectionInfo = sectionInfo; // if( !currentSectionInfo ) { // currentSectionInfo = sectionInfo; // } @@ -2238,7 +2241,6 @@ namespace Catch virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { // currentSectionInfo = currentSectionInfo->parent; -// unusedSectionInfo = currentSectionInfo; } virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { // unusedTestCaseInfo.reset(); @@ -2250,7 +2252,6 @@ namespace Catch } virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { // currentSectionInfo.reset(); -// unusedSectionInfo.reset(); // unusedTestCaseInfo.reset(); // unusedGroupInfo.reset(); // testRunInfo.reset(); @@ -2260,7 +2261,6 @@ namespace Catch // Option testRunInfo; // Option unusedGroupInfo; // Option unusedTestCaseInfo; -// Ptr unusedSectionInfo; // Ptr currentSectionInfo; // Ptr testGroupNode; Option testGroupNode; @@ -5777,7 +5777,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 15, "integration" ); + Version libraryVersion( 0, 9, 16, "integration" ); } // #included from: catch_line_wrap.hpp @@ -6819,6 +6819,7 @@ namespace Catch { struct ConsoleReporter : StreamingReporterBase { ConsoleReporter( ReporterConfig const& _config ) : StreamingReporterBase( _config ), + m_printedCurrentSection( false ), m_atLeastOneTestCasePrinted( false ) {} @@ -6845,139 +6846,22 @@ namespace Catch { lazyPrint(); - ResultComponents components( result ); - bool endsWithNewLine = false; - if( _assertionStats.totals.assertions.total() > 0 ) { - printResultType( components ); - printOriginalExpression( result ); - endsWithNewLine = printReconstructedExpression( result ); - } - endsWithNewLine |= printMessage( components ); - - printSourceInfo( result ); + AssertionPrinter printer( stream, _assertionStats ); + printer.print(); stream << std::endl; } - void printSourceInfo( AssertionResult const& _result ) { - TextColour colour( TextColour::FileName ); - stream << _result.getSourceInfo() << ":\n"; - } - struct ResultComponents { - ResultComponents( AssertionResult const& _result ) - : colour( TextColour::None ), - message( _result.getMessage() ) - { - switch( _result.getResultType() ) { - case ResultWas::Ok: - colour = TextColour::Success; - passOrFail = "PASSED"; - if( _result.hasMessage() ) - messageLabel = "with message"; - break; - case ResultWas::ExpressionFailed: - if( _result.isOk() ) { - colour = TextColour::Success; - passOrFail = "FAILED - but was ok"; - } - else { - colour = TextColour::Error; - passOrFail = "FAILED"; - } - if( _result.hasMessage() ){ - messageLabel = "with message"; - } - break; - case ResultWas::ThrewException: - colour = TextColour::Error; - passOrFail = "FAILED"; - messageLabel = "due to unexpected exception with message"; - break; - case ResultWas::DidntThrowException: - colour = TextColour::Error; - passOrFail = "FAILED"; - messageLabel = "because no exception was thrown where one was expected"; - break; - case ResultWas::Info: - messageLabel = "info"; - break; - case ResultWas::Warning: - messageLabel = "warning"; - break; - case ResultWas::ExplicitFailure: - passOrFail = "FAILED"; - colour = TextColour::Error; - messageLabel = "explicitly with message"; - break; - case ResultWas::Exception: - passOrFail = "FAILED"; - colour = TextColour::Error; - if( _result.hasMessage() ) - messageLabel = "with message"; - break; - - // These cases are here to prevent compiler warnings - case ResultWas::Unknown: - case ResultWas::FailureBit: - passOrFail = "** internal error **"; - colour = TextColour::Error; - break; - } - } - - TextColour::Colours colour; - std::string passOrFail; - std::string messageLabel; - std::string message; - }; - - void printResultType( ResultComponents const& _components ) { - if( !_components.passOrFail.empty() ) { - TextColour colour( _components.colour ); - stream << _components.passOrFail << ":\n"; - } + virtual void sectionStarting( SectionInfo const& _sectionInfo ) { + m_printedCurrentSection = false; + StreamingReporterBase::sectionStarting( _sectionInfo ); } - bool printOriginalExpression( AssertionResult const& _result ) { - if( _result.hasExpression() ) { - TextColour colour( TextColour::OriginalExpression ); - stream << " "; - if( !_result.getTestMacroName().empty() ) - stream << _result.getTestMacroName() << "( "; - stream << _result.getExpression(); - if( !_result.getTestMacroName().empty() ) - stream << " )"; - stream << "\n"; - return true; - } - return false; - } - bool printReconstructedExpression( AssertionResult const& _result ) { - if( _result.hasExpandedExpression() ) { - stream << "with expansion:\n"; - TextColour colour( TextColour::ReconstructedExpression ); - stream << wrapLongStrings( _result.getExpandedExpression() ) << "\n"; - return true; - } - return false; - } - bool printMessage( ResultComponents const& _components ) { - bool endsWithNewLine = false; - if( !_components.messageLabel.empty() ) { - stream << _components.messageLabel << ":" << "\n"; - endsWithNewLine = true; - } - if( !_components.message.empty() ) { - stream << wrapLongStrings( _components.message ) << "\n"; - endsWithNewLine = true; - } - return endsWithNewLine; - } - virtual void sectionEnded( SectionStats const& _sectionStats ) { if( _sectionStats.missingAssertions ) { lazyPrint(); TextColour colour( TextColour::ResultError ); stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; } + m_printedCurrentSection = false; StreamingReporterBase::sectionEnded( _sectionStats ); } @@ -7008,9 +6892,132 @@ namespace Catch { } private: - std::string wrapLongStrings( std::string const& _string ) { - return Catch::wrapLongStrings( _string, 70, 2 ); - } + + class AssertionPrinter { + public: + AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats ) + : stream( _stream ), + stats( _stats ), + result( _stats.assertionResult ), + colour( TextColour::None ), + message( result.getMessage() ) + { + switch( result.getResultType() ) { + case ResultWas::Ok: + colour = TextColour::Success; + passOrFail = "PASSED"; + if( result.hasMessage() ) + messageLabel = "with message"; + break; + case ResultWas::ExpressionFailed: + if( result.isOk() ) { + colour = TextColour::Success; + passOrFail = "FAILED - but was ok"; + } + else { + colour = TextColour::Error; + passOrFail = "FAILED"; + } + if( result.hasMessage() ){ + messageLabel = "with message"; + } + break; + case ResultWas::ThrewException: + colour = TextColour::Error; + passOrFail = "FAILED"; + messageLabel = "due to unexpected exception with message"; + break; + case ResultWas::DidntThrowException: + colour = TextColour::Error; + passOrFail = "FAILED"; + messageLabel = "because no exception was thrown where one was expected"; + break; + case ResultWas::Info: + messageLabel = "info"; + break; + case ResultWas::Warning: + messageLabel = "warning"; + break; + case ResultWas::ExplicitFailure: + passOrFail = "FAILED"; + colour = TextColour::Error; + messageLabel = "explicitly with message"; + break; + case ResultWas::Exception: + passOrFail = "FAILED"; + colour = TextColour::Error; + if( result.hasMessage() ) + messageLabel = "with message"; + break; + + // These cases are here to prevent compiler warnings + case ResultWas::Unknown: + case ResultWas::FailureBit: + passOrFail = "** internal error **"; + colour = TextColour::Error; + break; + } + } + + void print() const { + if( stats.totals.assertions.total() > 0 ) { + printResultType(); + printOriginalExpression(); + printReconstructedExpression(); + } + printMessage(); + printSourceInfo(); + } + + private: + void printResultType() const { + if( !passOrFail.empty() ) { + TextColour colourGuard( colour ); + stream << passOrFail << ":\n"; + } + } + void printOriginalExpression() const { + if( result.hasExpression() ) { + TextColour colourGuard( TextColour::OriginalExpression ); + stream << " "; + if( !result.getTestMacroName().empty() ) + stream << result.getTestMacroName() << "( "; + stream << result.getExpression(); + if( !result.getTestMacroName().empty() ) + stream << " )"; + stream << "\n"; + } + } + void printReconstructedExpression() const { + if( result.hasExpandedExpression() ) { + stream << "with expansion:\n"; + TextColour colourGuard( TextColour::ReconstructedExpression ); + stream << wrapLongStrings( result.getExpandedExpression() ) << "\n"; + } + } + void printMessage() const { + if( !messageLabel.empty() ) + stream << messageLabel << ":" << "\n"; + if( !message.empty() ) + stream << wrapLongStrings( message ) << "\n"; + } + void printSourceInfo() const { + TextColour colourGuard( TextColour::FileName ); + stream << result.getSourceInfo() << ":\n"; + } + + static std::string wrapLongStrings( std::string const& _string ){ + return Catch::wrapLongStrings( _string, CATCH_CONFIG_CONSOLE_WIDTH-1, 2 ); + } + + std::ostream& stream; + AssertionStats const& stats; + AssertionResult const& result; + TextColour::Colours colour; + std::string passOrFail; + std::string messageLabel; + std::string message; + }; void lazyPrint() { @@ -7020,7 +7027,7 @@ namespace Catch { lazyPrintGroupInfo(); if( unusedTestCaseInfo ) lazyPrintTestCaseInfo(); - if( unusedSectionInfo) + if( currentSectionInfo && !m_printedCurrentSection ) lazyPrintSectionInfo(); m_atLeastOneTestCasePrinted = true; @@ -7053,9 +7060,9 @@ namespace Catch { void lazyPrintSectionInfo() { std::vector sections; - for( ThreadedSectionInfo* section = unusedSectionInfo.get(); + for( ThreadedSectionInfo* section = currentSectionInfo.get(); section; - section = section->parent.get() ) + section = section->parent ) sections.push_back( section ); // Sections @@ -7066,8 +7073,8 @@ namespace Catch { for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) stream << " " << (*it)->name << "\n"; stream << getDots() << "\n" << std::endl; - unusedSectionInfo.reset(); } + m_printedCurrentSection = true; } void printHeader( std::string const& _name, bool closed = true ) { @@ -7131,24 +7138,21 @@ namespace Catch { stream << getDashes() << "\n"; } static std::string const& getDashes() { - static const std::string dashes - = "-----------------------------------------------------------------"; + static const std::string dashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '-' ); return dashes; } static std::string const& getDots() { - static const std::string dots - = "................................................................."; + static const std::string dots( CATCH_CONFIG_CONSOLE_WIDTH-1, '.' ); return dots; } static std::string const& getDoubleDashes() { - static const std::string doubleDashes - = "================================================================="; + static const std::string doubleDashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' ); return doubleDashes; } private: + bool m_printedCurrentSection; bool m_atLeastOneTestCasePrinted; - }; INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) From d658dea1dde0ac5cf1a426f3246056f2326e204a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 28 Jan 2013 07:57:27 +0000 Subject: [PATCH 124/296] Added google group to README --- README | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README b/README index 5118f912..b7a90aa4 100644 --- a/README +++ b/README @@ -4,7 +4,11 @@ CATCH v0.9 build 16 (integration branch) CATCH is an automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. +The latest stable version can be found on the Master branch. -The latest stable version can be found on the Master branch - or, better still, as a single header in the Downloads section. - -For documentation see the wiki at: https://github.com/philsquared/Catch/wiki +For documentation see the wiki at: + https://github.com/philsquared/Catch/wiki +Issues and bugs can be raised at: + https://github.com/philsquared/Catch/issues +For discussion or questions please use: + https://groups.google.com/forum/?fromgroups#!forum/catch-forum \ No newline at end of file From 207b27b3c5ff52782c9af651b29bfb73f35d9a51 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 2 Feb 2013 19:58:04 +0000 Subject: [PATCH 125/296] Changed the way info messages are handled. This fixes issue with SCOPED_INFO and makes output more readable. Needs some refactoring. --- approvalTests.py | 5 +- include/catch.hpp | 8 +- include/internal/catch_capture.hpp | 38 +-- include/internal/catch_commandline.hpp | 2 +- include/internal/catch_impl.hpp | 1 + include/internal/catch_interfaces_capture.h | 12 +- include/internal/catch_interfaces_reporter.h | 14 +- include/internal/catch_message.h | 66 ++++ include/internal/catch_message.hpp | 57 ++++ include/internal/catch_result_type.h | 3 + include/internal/catch_runner_impl.hpp | 61 ++-- include/reporters/catch_reporter_console.hpp | 38 ++- .../SelfTest/Baselines/approvedResults.txt | 318 +++++------------- .../SelfTest/SurrogateCpps/catch_message.cpp | 2 + projects/SelfTest/catch_self_test.hpp | 2 +- .../CatchSelfTest.xcodeproj/project.pbxproj | 8 + 16 files changed, 334 insertions(+), 301 deletions(-) create mode 100644 include/internal/catch_message.h create mode 100644 include/internal/catch_message.hpp create mode 100644 projects/SelfTest/SurrogateCpps/catch_message.cpp diff --git a/approvalTests.py b/approvalTests.py index b0bf4845..c6ede479 100644 --- a/approvalTests.py +++ b/approvalTests.py @@ -11,7 +11,10 @@ baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedRe rawResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/_rawResults.tmp' ) filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) -cmdPath = sys.argv[1] +if len(sys.argv) == 2: + cmdPath = sys.argv[1] +else: + cmdPath = "projects/XCode4/CatchSelfTest/DerivedData/CatchSelfTest/Build/Products/Debug/CatchSelfTest" f = open( rawResultsPath, 'w' ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console" ], stdout=f, stderr=f ) diff --git a/include/catch.hpp b/include/catch.hpp index 6fb0fd10..2519ebf6 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -68,12 +68,12 @@ #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, Catch::ResultDisposition::ContinueOnFailure, "CATCH_INFO" ) +#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( msg, "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, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CAPTURE" ) +#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "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 ) @@ -111,12 +111,12 @@ #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, Catch::ResultDisposition::ContinueOnFailure, "INFO" ) +#define INFO( msg ) INTERNAL_CATCH_INFO( msg, "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, Catch::ResultDisposition::ContinueOnFailure, "CAPTURE" ) +#define CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "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_capture.hpp b/include/internal/catch_capture.hpp index e2919848..a32528a9 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -10,6 +10,7 @@ #include "catch_expression_decomposer.hpp" #include "catch_expressionresult_builder.h" +#include "catch_message.h" #include "catch_interfaces_capture.h" #include "catch_debugger.hpp" #include "catch_context.h" @@ -54,26 +55,6 @@ namespace Catch { 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; } @@ -168,17 +149,24 @@ inline bool isTrue( bool value ){ return value; } } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_MSG( reason, resultType, resultDisposition, macroName ) \ +#define INTERNAL_CATCH_INFO( log, macroName ) \ + do { \ + Catch::getResultCapture().acceptMessage( Catch::MessageBuilder( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log ); \ + } while( Catch::isTrue( false ) ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_MSG( log, messageType, resultDisposition, macroName ) \ do { \ INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, resultDisposition, true ) \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << log, resultDisposition, true ) \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \ - INTERNAL_CATCH_ACCEPT_INFO( "", macroName, Catch::ResultDisposition::Normal ); \ - Catch::ScopedInfo INTERNAL_CATCH_UNIQUE_NAME( info ); \ - INTERNAL_CATCH_UNIQUE_NAME( info ) << log + Catch::ScopedMessageBuilder INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ); \ + INTERNAL_CATCH_UNIQUE_NAME( scopedMessage ) << log; \ + Catch::getResultCapture().pushScopedMessage( INTERNAL_CATCH_UNIQUE_NAME( scopedMessage ) ) + /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CHECK_THAT( arg, matcher, resultDisposition, macroName ) \ diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 660cbffe..f95eaca8 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -148,7 +148,7 @@ namespace Catch { virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) = 0; virtual std::string argsSynopsis() const = 0; virtual std::string optionSummary() const = 0; - virtual std::string optionDescription() const { return ""; }; + virtual std::string optionDescription() const { return ""; } std::string optionNames() const { std::string names; diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index f8f2baa4..fc610748 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -28,6 +28,7 @@ #include "catch_tags.hpp" #include "catch_version.hpp" #include "catch_line_wrap.hpp" +#include "catch_message.hpp" #include "../reporters/catch_reporter_basic.hpp" #include "../reporters/catch_reporter_xml.hpp" diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index 08147055..2c52e90f 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -21,19 +21,25 @@ namespace Catch { class AssertionResult; struct AssertionInfo; struct SectionInfo; + class MessageBuilder; + class ScopedMessageBuilder; struct IResultCapture { virtual ~IResultCapture(); - virtual void testEnded( AssertionResult const& result ) = 0; + virtual void assertionEnded( AssertionResult const& result ) = 0; virtual bool sectionStarted( SectionInfo const& sectionInfo, Counts& assertions ) = 0; virtual void sectionEnded( SectionInfo const& name, Counts const& assertions ) = 0; - virtual void pushScopedInfo( ScopedInfo* scopedInfo ) = 0; - virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; + virtual void pushScopedInfo( ScopedInfo* scopedInfo ) = 0; // !TBD Deprecated + virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; // !TBD Deprecated + virtual void pushScopedMessage( ScopedMessageBuilder const& _builder ) = 0; + virtual void popScopedMessage( ScopedMessageBuilder const& _builder ) = 0; + virtual bool shouldDebugBreak() const = 0; + virtual void acceptMessage( const MessageBuilder& messageBuilder ) = 0; virtual ResultAction::Value acceptExpression( ExpressionResultBuilder const& assertionResult, AssertionInfo const& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index e6743f06..8fa7cf1a 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -14,6 +14,7 @@ #include "catch_config.hpp" #include "catch_test_case_info.h" #include "catch_assertionresult.h" +#include "catch_message.h" #include "catch_option.hpp" #include @@ -89,13 +90,24 @@ namespace Catch struct AssertionStats { AssertionStats( AssertionResult const& _assertionResult, + std::vector const& _infoMessages, Totals const& _totals ) : assertionResult( _assertionResult ), + infoMessages( _infoMessages ), totals( _totals ) - {} + { + if( assertionResult.hasMessage() ) { + // Copy message into messages list. + // !TBD This should have been done earlier, somewhere + MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() ); + builder << assertionResult.getMessage(); + infoMessages.push_back( builder.build() ); + } + } virtual ~AssertionStats(); AssertionResult assertionResult; + std::vector infoMessages; Totals totals; }; diff --git a/include/internal/catch_message.h b/include/internal/catch_message.h new file mode 100644 index 00000000..b3d4af1e --- /dev/null +++ b/include/internal/catch_message.h @@ -0,0 +1,66 @@ +/* + * Created by Phil Nash on 1/2/2013. + * Copyright 2013 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_MESSAGE_H_INCLUDED +#define TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED + +#include +#include "catch_result_type.h" +#include "catch_common.h" + +namespace Catch { + + struct MessageInfo { + MessageInfo( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ); + + std::string macroName; + SourceLineInfo lineInfo; + ResultWas::OfType type; + std::string message; + unsigned int sequence; + + bool operator == ( MessageInfo const& other ) const { + return sequence == other.sequence; + } + bool operator < ( MessageInfo const& other ) const { + return sequence < other.sequence; + } + private: + static unsigned int globalCount; + }; + + + class MessageBuilder : public MessageInfo { + public: + MessageBuilder( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ); + + MessageInfo build() const; + + template + MessageBuilder& operator << ( T const& _value ) { + stream << _value; + return *this; + } + private: + std::ostringstream stream; + }; + + class ScopedMessageBuilder : public MessageBuilder { + public: + ScopedMessageBuilder( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ); + ~ScopedMessageBuilder(); + }; + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED diff --git a/include/internal/catch_message.hpp b/include/internal/catch_message.hpp new file mode 100644 index 00000000..c6996aa9 --- /dev/null +++ b/include/internal/catch_message.hpp @@ -0,0 +1,57 @@ +/* + * Created by Phil Nash on 1/2/2013. + * Copyright 2013 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_MESSAGE_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED + +#include "catch_message.h" + +namespace Catch { + + MessageInfo::MessageInfo( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + type( _type ), + sequence( ++globalCount ) + {} + + // This may need protecting if threading support is added + unsigned int MessageInfo::globalCount = 0; + + //////////////////////////////////////////////////////////////////////////// + + MessageBuilder::MessageBuilder( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : MessageInfo( _macroName, _lineInfo, _type ) + {} + + MessageInfo MessageBuilder::build() const { + MessageInfo message = *this; + message.message = stream.str(); + return message; + } + + //////////////////////////////////////////////////////////////////////////// + + ScopedMessageBuilder::ScopedMessageBuilder + ( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : MessageBuilder( _macroName, _lineInfo, _type ) + {} + + ScopedMessageBuilder::~ScopedMessageBuilder() { + getResultCapture().popScopedMessage( *this ); + } + + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED diff --git a/include/internal/catch_result_type.h b/include/internal/catch_result_type.h index 5492531e..36aab4c9 100644 --- a/include/internal/catch_result_type.h +++ b/include/internal/catch_result_type.h @@ -32,6 +32,9 @@ namespace Catch { inline bool isOk( ResultWas::OfType resultType ) { return ( resultType & ResultWas::FailureBit ) == 0; } + inline bool isJustInfo( int flags ) { + return flags == ResultWas::Info; + } // ResultAction::Value enum struct ResultAction { enum Value { diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 03f1fcde..eceb92cf 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -155,43 +155,49 @@ namespace Catch { private: // IResultCapture + virtual void acceptMessage( const MessageBuilder& messageBuilder ) { + m_messages.push_back( messageBuilder.build() ); + } + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) { m_lastAssertionInfo = assertionInfo; return actOnCurrentResult( assertionResult.buildResult( assertionInfo ) ); } - virtual void testEnded( const AssertionResult& result ) { + virtual void assertionEnded( const AssertionResult& result ) { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } 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->assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); - } - { - std::vector::const_iterator it = m_assertionResults.begin(); - std::vector::const_iterator itEnd = m_assertionResults.end(); - for(; it != itEnd; ++it ) - m_reporter->assertionEnded( AssertionStats( *it, m_totals ) ); - } - m_assertionResults.clear(); +// { +// std::vector::const_iterator it = m_scopedInfos.begin(); +// std::vector::const_iterator itEnd = m_scopedInfos.end(); +// for(; it != itEnd; ++it ) +// m_reporter->assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); +// } +// { +// std::vector::const_iterator it = m_assertionResults.begin(); +// std::vector::const_iterator itEnd = m_assertionResults.end(); +// for(; it != itEnd; ++it ) +// m_reporter->assertionEnded( AssertionStats( *it, m_totals ) ); +// } +// m_assertionResults.clear(); } - if( result.getResultType() == ResultWas::Info ) - { + if( result.getResultType() == ResultWas::Info ) { + // !TBD: deprecated? - what does this even do? m_assertionResults.push_back( result ); m_totals.assertions.info++; } - else - m_reporter->assertionEnded( AssertionStats( result, m_totals ) ); + else { + m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ); + } // Reset AssertionInfo - m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); + m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition ); + m_messages.clear(); } virtual bool sectionStarted ( @@ -229,6 +235,7 @@ namespace Catch { m_runningTest->endSection( info.name ); m_reporter->sectionEnded( SectionStats( info, assertions, missingAssertions ) ); + m_messages.clear(); } virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { @@ -239,8 +246,15 @@ namespace Catch { if( m_scopedInfos.back() == scopedInfo ) m_scopedInfos.pop_back(); } + virtual void pushScopedMessage( ScopedMessageBuilder const& _builder ) { + m_messages.push_back( _builder.build() ); + } + + virtual void popScopedMessage( ScopedMessageBuilder const& _builder ) { + m_messages.erase( std::remove( m_messages.begin(), m_messages.end(), _builder ), m_messages.end() ); + } - virtual bool shouldDebugBreak() const { + virtual bool shouldDebugBreak() const { return m_config.shouldDebugBreak(); } @@ -264,7 +278,7 @@ namespace Catch { ResultAction::Value actOnCurrentResult( const AssertionResult& result ) { m_lastResult = result; - testEnded( m_lastResult ); + assertionEnded( m_lastResult ); ResultAction::Value action = ResultAction::None; @@ -312,8 +326,9 @@ namespace Catch { const Config& m_config; Totals m_totals; Ptr m_reporter; - std::vector m_scopedInfos; - std::vector m_assertionResults; + std::vector m_scopedInfos; // !TBD: deprecated + std::vector m_assertionResults; // !TBD: deprecated + std::vector m_messages; IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 3101dab9..3acfb8e9 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -98,14 +98,18 @@ namespace Catch { stats( _stats ), result( _stats.assertionResult ), colour( TextColour::None ), - message( result.getMessage() ) + message( result.getMessage() ), + messages( _stats.infoMessages ) { switch( result.getResultType() ) { case ResultWas::Ok: colour = TextColour::Success; passOrFail = "PASSED"; - if( result.hasMessage() ) + //if( result.hasMessage() ) + if( _stats.infoMessages.size() == 1 ) messageLabel = "with message"; + if( _stats.infoMessages.size() > 1 ) + messageLabel = "with messages"; break; case ResultWas::ExpressionFailed: if( result.isOk() ) { @@ -116,9 +120,13 @@ namespace Catch { colour = TextColour::Error; passOrFail = "FAILED"; } - if( result.hasMessage() ){ + if( _stats.infoMessages.size() == 1 ) messageLabel = "with message"; - } + if( _stats.infoMessages.size() > 1 ) + messageLabel = "with messages"; +// if( result.hasMessage() ){ +// messageLabel = "with message"; +// } break; case ResultWas::ThrewException: colour = TextColour::Error; @@ -139,13 +147,21 @@ namespace Catch { case ResultWas::ExplicitFailure: passOrFail = "FAILED"; colour = TextColour::Error; - messageLabel = "explicitly with message"; +// messageLabel = "explicitly with message"; + if( _stats.infoMessages.size() == 1 ) + messageLabel = "explicitly with message"; + if( _stats.infoMessages.size() > 1 ) + messageLabel = "explicitly with messages"; break; case ResultWas::Exception: passOrFail = "FAILED"; colour = TextColour::Error; - if( result.hasMessage() ) + if( _stats.infoMessages.size() == 1 ) messageLabel = "with message"; + if( _stats.infoMessages.size() > 1 ) + messageLabel = "with messages"; +// if( result.hasMessage() ) +// messageLabel = "with message"; break; // These cases are here to prevent compiler warnings @@ -196,8 +212,13 @@ namespace Catch { void printMessage() const { if( !messageLabel.empty() ) stream << messageLabel << ":" << "\n"; - if( !message.empty() ) - stream << wrapLongStrings( message ) << "\n"; + for( std::vector::const_iterator it = messages.begin(), itEnd = messages.end(); + it != itEnd; + ++it ) { + stream << wrapLongStrings( it->message ) << "\n"; + } +// if( !message.empty() ) +// stream << wrapLongStrings( message ) << "\n"; } void printSourceInfo() const { TextColour colourGuard( TextColour::FileName ); @@ -215,6 +236,7 @@ namespace Catch { std::string passOrFail; std::string messageLabel; std::string message; + std::vector messages; }; void lazyPrint() { diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 78475fcb..9f20d66e 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,5 +1,5 @@ -CatchSelfTest is a CATCH v0.9 b15 (integration) host application. +CatchSelfTest is a CATCH v0.9 b16 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -1055,7 +1055,7 @@ PASSED: ExceptionTests.cpp:60: FAILED: - {Unknown expression after this line} + {Unknown expression after the reported line} due to unexpected exception with message: unexpected exception ExceptionTests.cpp:60: @@ -2002,6 +2002,7 @@ GeneratorTests.cpp:40: ............................................................................... warning: + this is a message this is a warning MessageTests.cpp:14: @@ -2021,18 +2022,13 @@ MessageTests.cpp:18: ./failing/message/info/1 ............................................................................... -info: - this message should be logged -MessageTests.cpp:23: - -info: - so should this -MessageTests.cpp:24: - FAILED: REQUIRE( a == 1 ) with expansion: 2 == 1 +with messages: + this message should be logged + so should this MessageTests.cpp:26: ------------------------------------------------------------------------------- @@ -2043,36 +2039,32 @@ PASSED: CHECK( a == 2 ) with expansion: 2 == 2 -MessageTests.cpp:33: - -info: +with message: this message should be logged -MessageTests.cpp:31: - -info: - this message should be logged, too -MessageTests.cpp:35: +MessageTests.cpp:33: FAILED: CHECK( a == 1 ) with expansion: 2 == 1 +with message: + this message should be logged, too MessageTests.cpp:37: -info: - and this, but later -MessageTests.cpp:39: - FAILED: CHECK( a == 0 ) with expansion: 2 == 0 +with message: + and this, but later MessageTests.cpp:41: PASSED: CHECK( a == 2 ) with expansion: 2 == 2 +with message: + but not this MessageTests.cpp:45: ------------------------------------------------------------------------------- @@ -2130,76 +2122,99 @@ PASSED: REQUIRE( i < 10 ) with expansion: 0 < 10 +with messages: + current counter 0 + i := 0 MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 1 < 10 +with messages: + current counter 1 + i := 1 MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 2 < 10 +with messages: + current counter 2 + i := 2 MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 3 < 10 +with messages: + current counter 3 + i := 3 MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 4 < 10 +with messages: + current counter 4 + i := 4 MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 5 < 10 +with messages: + current counter 5 + i := 5 MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 6 < 10 +with messages: + current counter 6 + i := 6 MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 7 < 10 +with messages: + current counter 7 + i := 7 MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 8 < 10 +with messages: + current counter 8 + i := 8 MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: 9 < 10 -MessageTests.cpp:86: - - REQUIRE( i < 10 ) -info: - current counter 10 -MessageTests.cpp:86: - - REQUIRE( i < 10 ) -info: - i := 10 +with messages: + current counter 9 + i := 9 MessageTests.cpp:86: FAILED: REQUIRE( i < 10 ) with expansion: 10 < 10 +with messages: + current counter 10 + i := 10 MessageTests.cpp:86: ------------------------------------------------------------------------------- @@ -2347,84 +2362,68 @@ MiscTests.cpp:103: ./mixed/Misc/loops ............................................................................... -info: +FAILED: + CHECK( ( fib[i] % 2 ) == 0 ) +with expansion: + 1 == 0 +with message: Testing if fib[0] (1) is even -MiscTests.cpp:114: +MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 -MiscTests.cpp:115: - -info: +with message: Testing if fib[1] (1) is even -MiscTests.cpp:114: - -FAILED: - CHECK( ( fib[i] % 2 ) == 0 ) -with expansion: - 1 == 0 MiscTests.cpp:115: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 0 == 0 -MiscTests.cpp:115: - -info: +with message: Testing if fib[2] (2) is even -MiscTests.cpp:114: - -info: - Testing if fib[3] (3) is even -MiscTests.cpp:114: - -FAILED: - CHECK( ( fib[i] % 2 ) == 0 ) -with expansion: - 1 == 0 MiscTests.cpp:115: -info: - Testing if fib[4] (5) is even -MiscTests.cpp:114: +FAILED: + CHECK( ( fib[i] % 2 ) == 0 ) +with expansion: + 1 == 0 +with message: + Testing if fib[3] (3) is even +MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 +with message: + Testing if fib[4] (5) is even MiscTests.cpp:115: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 0 == 0 -MiscTests.cpp:115: - -info: +with message: Testing if fib[5] (8) is even -MiscTests.cpp:114: - -info: - Testing if fib[6] (13) is even -MiscTests.cpp:114: - -FAILED: - CHECK( ( fib[i] % 2 ) == 0 ) -with expansion: - 1 == 0 MiscTests.cpp:115: -info: - Testing if fib[7] (21) is even -MiscTests.cpp:114: +FAILED: + CHECK( ( fib[i] % 2 ) == 0 ) +with expansion: + 1 == 0 +with message: + Testing if fib[6] (13) is even +MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 +with message: + Testing if fib[7] (21) is even MiscTests.cpp:115: Some information @@ -2456,16 +2455,11 @@ MiscTests.cpp:134: ./failing/info ............................................................................... -info: - hi -MiscTests.cpp:139: - -info: - i := 7 -MiscTests.cpp:141: - FAILED: REQUIRE( false ) +with messages: + hi + i := 7 MiscTests.cpp:142: ------------------------------------------------------------------------------- @@ -2552,12 +2546,10 @@ No assertions in section, 'encoded chars' ./manual/onechar ............................................................................... -info: - 3 -MiscTests.cpp:195: - FAILED: REQUIRE( false ) +with message: + 3 MiscTests.cpp:196: ------------------------------------------------------------------------------- @@ -4246,7 +4238,7 @@ BDDTests.cpp:29: 96 test cases - 45 failed (610 assertions - 102 failed) -CatchSelfTest is a CATCH v0.9 b15 (integration) host application. +CatchSelfTest is a CATCH v0.9 b16 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4715,7 +4707,7 @@ ExceptionTests.cpp:52 - + ExceptionTests.cpp:60 @@ -4750,29 +4742,14 @@ MessageTests.cpp:14 - -MessageTests.cpp:23 - - -MessageTests.cpp:24 - MessageTests.cpp:26 - -MessageTests.cpp:31 - - -MessageTests.cpp:35 - MessageTests.cpp:37 - -MessageTests.cpp:39 - MessageTests.cpp:41 @@ -4797,12 +4774,6 @@ Message from section two - -MessageTests.cpp:86 - - -MessageTests.cpp:86 - MessageTests.cpp:86 @@ -4826,45 +4797,21 @@ MiscTests.cpp:103 - -MiscTests.cpp:114 - MiscTests.cpp:115 - -MiscTests.cpp:114 - MiscTests.cpp:115 - -MiscTests.cpp:114 - - -MiscTests.cpp:114 - MiscTests.cpp:115 - -MiscTests.cpp:114 - MiscTests.cpp:115 - -MiscTests.cpp:114 - - -MiscTests.cpp:114 - MiscTests.cpp:115 - -MiscTests.cpp:114 - MiscTests.cpp:115 @@ -4879,12 +4826,6 @@ An error - -MiscTests.cpp:139 - - -MiscTests.cpp:141 - MiscTests.cpp:142 @@ -4909,9 +4850,6 @@ MiscTests.cpp:178 - -MiscTests.cpp:195 - MiscTests.cpp:196 @@ -6403,10 +6341,10 @@ ExceptionTests.cpp" line="60"> ExceptionTests.cpp" line="60"> - {Unknown expression after this line} + {Unknown expression after the reported line} - {Unknown expression after this line} + {Unknown expression after the reported line} ExceptionTests.cpp" line="60"> unexpected exception @@ -7652,12 +7590,6 @@ GeneratorTests.cpp" line="40"> - - this message should be logged - - - so should this - MessageTests.cpp" line="26"> a == 1 @@ -7677,12 +7609,6 @@ MessageTests.cpp" line="33"> 2 == 2 - - this message should be logged - - - this message should be logged, too - MessageTests.cpp" line="37"> a == 1 @@ -7691,9 +7617,6 @@ MessageTests.cpp" line="37"> 2 == 1 - - and this, but later - MessageTests.cpp" line="41"> a == 0 @@ -7823,28 +7746,6 @@ MessageTests.cpp" line="86"> 9 < 10 -MessageTests.cpp" line="86"> - - i < 10 - - - i < 10 - - - current counter 10 - - -MessageTests.cpp" line="86"> - - i < 10 - - - i < 10 - - - i := 10 - - MessageTests.cpp" line="86"> i < 10 @@ -8013,9 +7914,6 @@ MiscTests.cpp" line="103"> - - Testing if fib[0] (1) is even - MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -8024,9 +7922,6 @@ MiscTests.cpp" line="115"> 1 == 0 - - Testing if fib[1] (1) is even - MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -8043,12 +7938,6 @@ MiscTests.cpp" line="115"> 0 == 0 - - Testing if fib[2] (2) is even - - - Testing if fib[3] (3) is even - MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -8057,9 +7946,6 @@ MiscTests.cpp" line="115"> 1 == 0 - - Testing if fib[4] (5) is even - MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -8076,12 +7962,6 @@ MiscTests.cpp" line="115"> 0 == 0 - - Testing if fib[5] (8) is even - - - Testing if fib[6] (13) is even - MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -8090,9 +7970,6 @@ MiscTests.cpp" line="115"> 1 == 0 - - Testing if fib[7] (21) is even - MiscTests.cpp" line="115"> ( fib[i] % 2 ) == 0 @@ -8126,12 +8003,6 @@ MiscTests.cpp" line="134"> - - hi - - - i := 7 - MiscTests.cpp" line="142"> false @@ -8228,9 +8099,6 @@ MiscTests.cpp" line="178"> - - 3 - MiscTests.cpp" line="196"> false @@ -10136,7 +10004,7 @@ ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' [Running: ./failing/exceptions/implicit/2] ExceptionTests.cpp:60: 1 == 1 succeeded -ExceptionTests.cpp:60: {Unknown expression after this line} failed with unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:60: {Unknown expression after the reported line} failed with unexpected exception with message: 'unexpected exception' [Finished: './failing/exceptions/implicit/2' 1 test case failed (1 of 2 assertions failed)] [Running: ./succeeding/exceptions/implicit] @@ -10330,17 +10198,12 @@ MessageTests.cpp:18: succeeded [Finished: './succeeding/succeed' All tests passed (1 assertion in 1 test case)] [Running: ./failing/message/info/1] -MessageTests.cpp:23: [info: this message should be logged] -MessageTests.cpp:24: [info: so should this] MessageTests.cpp:26: a == 1 failed for: 2 == 1 [Finished: './failing/message/info/1' 1 test case failed (1 assertion failed)] [Running: ./mixed/message/info/2] MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 -MessageTests.cpp:31: [info: this message should be logged] -MessageTests.cpp:35: [info: this message should be logged, too] MessageTests.cpp:37: a == 1 failed for: 2 == 1 -MessageTests.cpp:39: [info: and this, but later] MessageTests.cpp:41: a == 0 failed for: 2 == 0 MessageTests.cpp:45: a == 2 succeeded for: 2 == 2 [Finished: './mixed/message/info/2' 1 test case failed (2 of 4 assertions failed)] @@ -10389,8 +10252,6 @@ MessageTests.cpp:86: i < 10 succeeded for: 6 < 10 MessageTests.cpp:86: i < 10 succeeded for: 7 < 10 MessageTests.cpp:86: i < 10 succeeded for: 8 < 10 MessageTests.cpp:86: i < 10 succeeded for: 9 < 10 -MessageTests.cpp:86: i < 10 succeeded[info: current counter 10] -MessageTests.cpp:86: i < 10 succeeded[info: i := 10] MessageTests.cpp:86: i < 10 failed for: 10 < 10 [Finished: './mixed/message/scoped' 1 test case failed (1 of 11 assertions failed)] @@ -10484,21 +10345,13 @@ MiscTests.cpp:103: b > a failed for: 0 > 1 [Finished: './mixed/Misc/Sections/loops' 1 test case failed (1 assertion failed)] [Running: ./mixed/Misc/loops] -MiscTests.cpp:114: [info: Testing if fib[0] (1) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:114: [info: Testing if fib[1] (1) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 MiscTests.cpp:115: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -MiscTests.cpp:114: [info: Testing if fib[2] (2) is even] -MiscTests.cpp:114: [info: Testing if fib[3] (3) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:114: [info: Testing if fib[4] (5) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 MiscTests.cpp:115: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -MiscTests.cpp:114: [info: Testing if fib[5] (8) is even] -MiscTests.cpp:114: [info: Testing if fib[6] (13) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:114: [info: Testing if fib[7] (21) is even] MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 [Finished: './mixed/Misc/loops' 1 test case failed (6 of 8 assertions failed)] Some information @@ -10516,8 +10369,6 @@ MiscTests.cpp:134: makeString( true ) == static_cast(__null) succeeded fo [Finished: './succeeding/Misc/null strings' All tests passed (2 assertions in 1 test case)] [Running: ./failing/info] -MiscTests.cpp:139: [info: hi] -MiscTests.cpp:141: [info: i := 7] MiscTests.cpp:142: false failed [Finished: './failing/info' 1 test case failed (1 assertion failed)] @@ -10557,7 +10408,6 @@ No assertions in section, 'encoded chars' [Finished: './misc/xmlentitycheck' 1 test case failed (All 2 assertions failed)] [Running: ./manual/onechar] -MiscTests.cpp:195: [info: 3] MiscTests.cpp:196: false failed [Finished: './manual/onechar' 1 test case failed (1 assertion failed)] diff --git a/projects/SelfTest/SurrogateCpps/catch_message.cpp b/projects/SelfTest/SurrogateCpps/catch_message.cpp new file mode 100644 index 00000000..257c8b06 --- /dev/null +++ b/projects/SelfTest/SurrogateCpps/catch_message.cpp @@ -0,0 +1,2 @@ +// This file is only here to verify (to the extent possible) the self sufficiency of the header +#include "catch_message.h" diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index cb62187f..44293e0c 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -115,7 +115,7 @@ namespace Catch { } break; } - }; + } private: Expected::Result m_expectedResult; diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index a8d139bb..f2777cb7 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26847E5D16BBADB40043B9C1 /* catch_message.cpp */; }; 2694A1FD16A0000E004816E3 /* catch_line_wrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */; }; 4A45DA2416161EF9004F8D6B /* catch_console_colour.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA2316161EF9004F8D6B /* catch_console_colour.cpp */; }; 4A45DA2716161F1F004F8D6B /* catch_ptr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA2616161F1F004F8D6B /* catch_ptr.cpp */; }; @@ -53,6 +54,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 26847E5B16BBAB790043B9C1 /* catch_message.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_message.h; sourceTree = ""; }; + 26847E5C16BBACB60043B9C1 /* catch_message.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_message.hpp; sourceTree = ""; }; + 26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = ""; }; 2694A1F8169FFF9B004816E3 /* catch_line_wrap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_line_wrap.h; sourceTree = ""; }; 2694A1FA169FFFEC004816E3 /* catch_line_wrap.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_line_wrap.hpp; sourceTree = ""; }; 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = catch_line_wrap.cpp; sourceTree = ""; }; @@ -275,6 +279,7 @@ 4AB3D9A1161621B500C9A0F8 /* catch_interfaces_generators.cpp */, 4ACE21CA166CA1B300FB5509 /* catch_option.cpp */, 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */, + 26847E5D16BBADB40043B9C1 /* catch_message.cpp */, ); name = SurrogateCpps; sourceTree = ""; @@ -294,6 +299,7 @@ 4A90B59E15D2521E00EF71BC /* catch_expressionresult_builder.hpp */, 4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */, 2694A1FA169FFFEC004816E3 /* catch_line_wrap.hpp */, + 26847E5C16BBACB60043B9C1 /* catch_message.hpp */, ); name = impl; sourceTree = ""; @@ -314,6 +320,7 @@ 4AC91CCE155CF02800DC5117 /* catch_expression_lhs.hpp */, 4AC91CD0155D8DA600DC5117 /* catch_expression_decomposer.hpp */, 4A4B0F9A15CEF84800AE2392 /* catch_notimplemented_exception.h */, + 26847E5B16BBAB790043B9C1 /* catch_message.h */, ); name = Assertions; sourceTree = ""; @@ -473,6 +480,7 @@ 4AB3D9A2161621B500C9A0F8 /* catch_interfaces_generators.cpp in Sources */, 4ACE21CC166CA1B300FB5509 /* catch_option.cpp in Sources */, 2694A1FD16A0000E004816E3 /* catch_line_wrap.cpp in Sources */, + 26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From ad654867f1c5a78b4d9f892e7ac68352bbc2ffda Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 2 Feb 2013 20:36:36 +0000 Subject: [PATCH 126/296] Removed deprecated message code --- include/internal/catch_interfaces_capture.h | 3 -- include/internal/catch_runner_impl.hpp | 36 ++------------------- include/internal/catch_totals.hpp | 5 +-- 3 files changed, 3 insertions(+), 41 deletions(-) diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index 2c52e90f..c6c327a6 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -16,7 +16,6 @@ namespace Catch { class TestCase; - class ScopedInfo; class ExpressionResultBuilder; class AssertionResult; struct AssertionInfo; @@ -32,8 +31,6 @@ namespace Catch { virtual bool sectionStarted( SectionInfo const& sectionInfo, Counts& assertions ) = 0; virtual void sectionEnded( SectionInfo const& name, Counts const& assertions ) = 0; - virtual void pushScopedInfo( ScopedInfo* scopedInfo ) = 0; // !TBD Deprecated - virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; // !TBD Deprecated virtual void pushScopedMessage( ScopedMessageBuilder const& _builder ) = 0; virtual void popScopedMessage( ScopedMessageBuilder const& _builder ) = 0; diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index eceb92cf..7ff442c2 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -170,32 +170,11 @@ namespace Catch { } 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->assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); -// } -// { -// std::vector::const_iterator it = m_assertionResults.begin(); -// std::vector::const_iterator itEnd = m_assertionResults.end(); -// for(; it != itEnd; ++it ) -// m_reporter->assertionEnded( AssertionStats( *it, m_totals ) ); -// } -// m_assertionResults.clear(); } - if( result.getResultType() == ResultWas::Info ) { - // !TBD: deprecated? - what does this even do? - m_assertionResults.push_back( result ); - m_totals.assertions.info++; - } - else { - m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ); - } + m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ); - // Reset AssertionInfo + // Reset working state m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition ); m_messages.clear(); } @@ -238,14 +217,6 @@ namespace Catch { m_messages.clear(); } - virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { - m_scopedInfos.push_back( scopedInfo ); - } - - virtual void popScopedInfo( ScopedInfo* scopedInfo ) { - if( m_scopedInfos.back() == scopedInfo ) - m_scopedInfos.pop_back(); - } virtual void pushScopedMessage( ScopedMessageBuilder const& _builder ) { m_messages.push_back( _builder.build() ); } @@ -314,7 +285,6 @@ namespace Catch { exResult << translateActiveException(); actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) ); } - m_assertionResults.clear(); } private: @@ -326,8 +296,6 @@ namespace Catch { const Config& m_config; Totals m_totals; Ptr m_reporter; - std::vector m_scopedInfos; // !TBD: deprecated - std::vector m_assertionResults; // !TBD: deprecated std::vector m_messages; IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; diff --git a/include/internal/catch_totals.hpp b/include/internal/catch_totals.hpp index 9f854580..03832a2e 100644 --- a/include/internal/catch_totals.hpp +++ b/include/internal/catch_totals.hpp @@ -13,19 +13,17 @@ namespace Catch { struct Counts { - Counts() : passed( 0 ), failed( 0 ), info( 0 ) {} + Counts() : passed( 0 ), failed( 0 ) {} Counts operator - ( const Counts& other ) const { Counts diff; diff.passed = passed - other.passed; diff.failed = failed - other.failed; - diff.info = info - other.info; return diff; } Counts& operator += ( const Counts& other ) { passed += other.passed; failed += other.failed; - info += other.info; return *this; } @@ -35,7 +33,6 @@ namespace Catch { std::size_t passed; std::size_t failed; - std::size_t info; }; struct Totals { From a2773810db4ec00ca1846a80a1d6f2ef351db9eb Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 2 Feb 2013 20:37:58 +0000 Subject: [PATCH 127/296] Build 17 - includes reworking of message/ info handling --- README | 10 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 273 ++++++++++++++++++++--------- 3 files changed, 195 insertions(+), 90 deletions(-) diff --git a/README b/README index b7a90aa4..5c8f882e 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 16 (integration branch) +CATCH v0.9 build 17 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. @@ -6,9 +6,9 @@ CATCH is an automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. The latest stable version can be found on the Master branch. -For documentation see the wiki at: +For documentation see the wiki at: https://github.com/philsquared/Catch/wiki -Issues and bugs can be raised at: +Issues and bugs can be raised at: https://github.com/philsquared/Catch/issues -For discussion or questions please use: - https://groups.google.com/forum/?fromgroups#!forum/catch-forum \ No newline at end of file +For discussion or questions please use: + https://groups.google.com/forum/?fromgroups#!forum/catch-forum diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 6989a932..42bf18ff 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 16, "integration" ); + Version libraryVersion( 0, 9, 17, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index bac4dd72..0700af82 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 16 (integration branch) - * Generated: 2013-01-26 20:18:07.076275 + * CATCH v0.9 build 17 (integration branch) + * Generated: 2013-02-02 20:37:06.007152 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -656,6 +656,9 @@ namespace Catch { inline bool isOk( ResultWas::OfType resultType ) { return ( resultType & ResultWas::FailureBit ) == 0; } + inline bool isJustInfo( int flags ) { + return flags == ResultWas::Info; + } // ResultAction::Value enum struct ResultAction { enum Value { @@ -1019,6 +1022,61 @@ public: } // end namespace Catch +// #included from: catch_message.h +#define TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED + +#include + +namespace Catch { + + struct MessageInfo { + MessageInfo( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ); + + std::string macroName; + SourceLineInfo lineInfo; + ResultWas::OfType type; + std::string message; + unsigned int sequence; + + bool operator == ( MessageInfo const& other ) const { + return sequence == other.sequence; + } + bool operator < ( MessageInfo const& other ) const { + return sequence < other.sequence; + } + private: + static unsigned int globalCount; + }; + + class MessageBuilder : public MessageInfo { + public: + MessageBuilder( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ); + + MessageInfo build() const; + + template + MessageBuilder& operator << ( T const& _value ) { + stream << _value; + return *this; + } + private: + std::ostringstream stream; + }; + + class ScopedMessageBuilder : public MessageBuilder { + public: + ScopedMessageBuilder( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ); + ~ScopedMessageBuilder(); + }; + +} // end namespace Catch + // #included from: catch_interfaces_capture.h #define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED @@ -1031,19 +1089,17 @@ public: namespace Catch { struct Counts { - Counts() : passed( 0 ), failed( 0 ), info( 0 ) {} + Counts() : passed( 0 ), failed( 0 ) {} Counts operator - ( const Counts& other ) const { Counts diff; diff.passed = passed - other.passed; diff.failed = failed - other.failed; - diff.info = info - other.info; return diff; } Counts& operator += ( const Counts& other ) { passed += other.passed; failed += other.failed; - info += other.info; return *this; } @@ -1053,7 +1109,6 @@ namespace Catch { std::size_t passed; std::size_t failed; - std::size_t info; }; struct Totals { @@ -1089,24 +1144,27 @@ namespace Catch { namespace Catch { class TestCase; - class ScopedInfo; class ExpressionResultBuilder; class AssertionResult; struct AssertionInfo; struct SectionInfo; + class MessageBuilder; + class ScopedMessageBuilder; struct IResultCapture { virtual ~IResultCapture(); - virtual void testEnded( AssertionResult const& result ) = 0; + virtual void assertionEnded( AssertionResult const& result ) = 0; virtual bool sectionStarted( SectionInfo const& sectionInfo, Counts& assertions ) = 0; virtual void sectionEnded( SectionInfo const& name, Counts const& assertions ) = 0; - virtual void pushScopedInfo( ScopedInfo* scopedInfo ) = 0; - virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; + virtual void pushScopedMessage( ScopedMessageBuilder const& _builder ) = 0; + virtual void popScopedMessage( ScopedMessageBuilder const& _builder ) = 0; + virtual bool shouldDebugBreak() const = 0; + virtual void acceptMessage( const MessageBuilder& messageBuilder ) = 0; virtual ResultAction::Value acceptExpression( ExpressionResultBuilder const& assertionResult, AssertionInfo const& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; @@ -2017,13 +2075,24 @@ namespace Catch struct AssertionStats { AssertionStats( AssertionResult const& _assertionResult, + std::vector const& _infoMessages, Totals const& _totals ) : assertionResult( _assertionResult ), + infoMessages( _infoMessages ), totals( _totals ) - {} + { + if( assertionResult.hasMessage() ) { + // Copy message into messages list. + // !TBD This should have been done earlier, somewhere + MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() ); + builder << assertionResult.getMessage(); + infoMessages.push_back( builder.build() ); + } + } virtual ~AssertionStats(); AssertionResult assertionResult; + std::vector infoMessages; Totals totals; }; @@ -2441,27 +2510,6 @@ namespace Catch { 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; } @@ -2555,17 +2603,23 @@ inline bool isTrue( bool value ){ return value; } } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_MSG( reason, resultType, resultDisposition, macroName ) \ +#define INTERNAL_CATCH_INFO( log, macroName ) \ + do { \ + Catch::getResultCapture().acceptMessage( Catch::MessageBuilder( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log ); \ + } while( Catch::isTrue( false ) ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_MSG( log, messageType, resultDisposition, macroName ) \ do { \ INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, resultDisposition, true ) \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << log, resultDisposition, true ) \ } while( Catch::isTrue( false ) ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \ - INTERNAL_CATCH_ACCEPT_INFO( "", macroName, Catch::ResultDisposition::Normal ); \ - Catch::ScopedInfo INTERNAL_CATCH_UNIQUE_NAME( info ); \ - INTERNAL_CATCH_UNIQUE_NAME( info ) << log + Catch::ScopedMessageBuilder INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ); \ + INTERNAL_CATCH_UNIQUE_NAME( scopedMessage ) << log; \ + Catch::getResultCapture().pushScopedMessage( INTERNAL_CATCH_UNIQUE_NAME( scopedMessage ) ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CHECK_THAT( arg, matcher, resultDisposition, macroName ) \ @@ -3505,7 +3559,7 @@ namespace Catch { virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) = 0; virtual std::string argsSynopsis() const = 0; virtual std::string optionSummary() const = 0; - virtual std::string optionDescription() const { return ""; }; + virtual std::string optionDescription() const { return ""; } std::string optionNames() const { std::string names; @@ -4429,43 +4483,28 @@ namespace Catch { private: // IResultCapture + virtual void acceptMessage( const MessageBuilder& messageBuilder ) { + m_messages.push_back( messageBuilder.build() ); + } + virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) { m_lastAssertionInfo = assertionInfo; return actOnCurrentResult( assertionResult.buildResult( assertionInfo ) ); } - virtual void testEnded( const AssertionResult& result ) { + virtual void assertionEnded( const AssertionResult& result ) { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } 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->assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) ); - } - { - std::vector::const_iterator it = m_assertionResults.begin(); - std::vector::const_iterator itEnd = m_assertionResults.end(); - for(; it != itEnd; ++it ) - m_reporter->assertionEnded( AssertionStats( *it, m_totals ) ); - } - m_assertionResults.clear(); } - if( result.getResultType() == ResultWas::Info ) - { - m_assertionResults.push_back( result ); - m_totals.assertions.info++; - } - else - m_reporter->assertionEnded( AssertionStats( result, m_totals ) ); + m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ); - // Reset AssertionInfo - m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition ); + // Reset working state + m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition ); + m_messages.clear(); } virtual bool sectionStarted ( @@ -4502,15 +4541,15 @@ namespace Catch { m_runningTest->endSection( info.name ); m_reporter->sectionEnded( SectionStats( info, assertions, missingAssertions ) ); + m_messages.clear(); } - virtual void pushScopedInfo( ScopedInfo* scopedInfo ) { - m_scopedInfos.push_back( scopedInfo ); + virtual void pushScopedMessage( ScopedMessageBuilder const& _builder ) { + m_messages.push_back( _builder.build() ); } - virtual void popScopedInfo( ScopedInfo* scopedInfo ) { - if( m_scopedInfos.back() == scopedInfo ) - m_scopedInfos.pop_back(); + virtual void popScopedMessage( ScopedMessageBuilder const& _builder ) { + m_messages.erase( std::remove( m_messages.begin(), m_messages.end(), _builder ), m_messages.end() ); } virtual bool shouldDebugBreak() const { @@ -4537,7 +4576,7 @@ namespace Catch { ResultAction::Value actOnCurrentResult( const AssertionResult& result ) { m_lastResult = result; - testEnded( m_lastResult ); + assertionEnded( m_lastResult ); ResultAction::Value action = ResultAction::None; @@ -4573,7 +4612,6 @@ namespace Catch { exResult << translateActiveException(); actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) ); } - m_assertionResults.clear(); } private: @@ -4585,8 +4623,7 @@ namespace Catch { const Config& m_config; Totals m_totals; Ptr m_reporter; - std::vector m_scopedInfos; - std::vector m_assertionResults; + std::vector m_messages; IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; @@ -5777,7 +5814,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 16, "integration" ); + Version libraryVersion( 0, 9, 17, "integration" ); } // #included from: catch_line_wrap.hpp @@ -5837,6 +5874,52 @@ namespace Catch { } // end namespace Catch +// #included from: catch_message.hpp +#define TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED + +namespace Catch { + + MessageInfo::MessageInfo( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + type( _type ), + sequence( ++globalCount ) + {} + + // This may need protecting if threading support is added + unsigned int MessageInfo::globalCount = 0; + + //////////////////////////////////////////////////////////////////////////// + + MessageBuilder::MessageBuilder( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : MessageInfo( _macroName, _lineInfo, _type ) + {} + + MessageInfo MessageBuilder::build() const { + MessageInfo message = *this; + message.message = stream.str(); + return message; + } + + //////////////////////////////////////////////////////////////////////////// + + ScopedMessageBuilder::ScopedMessageBuilder + ( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : MessageBuilder( _macroName, _lineInfo, _type ) + {} + + ScopedMessageBuilder::~ScopedMessageBuilder() { + getResultCapture().popScopedMessage( *this ); + } + +} // end namespace Catch + // #included from: ../reporters/catch_reporter_basic.hpp #define TWOBLUECUBES_CATCH_REPORTER_BASIC_HPP_INCLUDED @@ -6900,14 +6983,18 @@ namespace Catch { stats( _stats ), result( _stats.assertionResult ), colour( TextColour::None ), - message( result.getMessage() ) + message( result.getMessage() ), + messages( _stats.infoMessages ) { switch( result.getResultType() ) { case ResultWas::Ok: colour = TextColour::Success; passOrFail = "PASSED"; - if( result.hasMessage() ) + //if( result.hasMessage() ) + if( _stats.infoMessages.size() == 1 ) messageLabel = "with message"; + if( _stats.infoMessages.size() > 1 ) + messageLabel = "with messages"; break; case ResultWas::ExpressionFailed: if( result.isOk() ) { @@ -6918,9 +7005,13 @@ namespace Catch { colour = TextColour::Error; passOrFail = "FAILED"; } - if( result.hasMessage() ){ + if( _stats.infoMessages.size() == 1 ) messageLabel = "with message"; - } + if( _stats.infoMessages.size() > 1 ) + messageLabel = "with messages"; +// if( result.hasMessage() ){ +// messageLabel = "with message"; +// } break; case ResultWas::ThrewException: colour = TextColour::Error; @@ -6941,13 +7032,21 @@ namespace Catch { case ResultWas::ExplicitFailure: passOrFail = "FAILED"; colour = TextColour::Error; - messageLabel = "explicitly with message"; +// messageLabel = "explicitly with message"; + if( _stats.infoMessages.size() == 1 ) + messageLabel = "explicitly with message"; + if( _stats.infoMessages.size() > 1 ) + messageLabel = "explicitly with messages"; break; case ResultWas::Exception: passOrFail = "FAILED"; colour = TextColour::Error; - if( result.hasMessage() ) + if( _stats.infoMessages.size() == 1 ) messageLabel = "with message"; + if( _stats.infoMessages.size() > 1 ) + messageLabel = "with messages"; +// if( result.hasMessage() ) +// messageLabel = "with message"; break; // These cases are here to prevent compiler warnings @@ -6998,8 +7097,13 @@ namespace Catch { void printMessage() const { if( !messageLabel.empty() ) stream << messageLabel << ":" << "\n"; - if( !message.empty() ) - stream << wrapLongStrings( message ) << "\n"; + for( std::vector::const_iterator it = messages.begin(), itEnd = messages.end(); + it != itEnd; + ++it ) { + stream << wrapLongStrings( it->message ) << "\n"; + } +// if( !message.empty() ) +// stream << wrapLongStrings( message ) << "\n"; } void printSourceInfo() const { TextColour colourGuard( TextColour::FileName ); @@ -7017,6 +7121,7 @@ namespace Catch { std::string passOrFail; std::string messageLabel; std::string message; + std::vector messages; }; void lazyPrint() { @@ -7279,12 +7384,12 @@ int main (int argc, char * const argv[]) { #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, Catch::ResultDisposition::ContinueOnFailure, "CATCH_INFO" ) +#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( msg, "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, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CAPTURE" ) +#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "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 ) @@ -7322,12 +7427,12 @@ int main (int argc, char * const argv[]) { #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, Catch::ResultDisposition::ContinueOnFailure, "INFO" ) +#define INFO( msg ) INTERNAL_CATCH_INFO( msg, "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, Catch::ResultDisposition::ContinueOnFailure, "CAPTURE" ) +#define CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) #define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "SCOPED_CAPTURE" ) #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) From fb944f2b6b1d7c1904f4d53645445ff9302f9e5b Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 2 Feb 2013 20:46:55 +0000 Subject: [PATCH 128/296] Updated message tests to reflect slightly changed semantics --- projects/SelfTest/Baselines/approvedResults.txt | 8 ++++---- projects/SelfTest/MessageTests.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 9f20d66e..cdce6d3a 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,5 +1,5 @@ -CatchSelfTest is a CATCH v0.9 b16 (integration) host application. +CatchSelfTest is a CATCH v0.9 b17 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -2040,7 +2040,7 @@ PASSED: with expansion: 2 == 2 with message: - this message should be logged + this message should not be logged MessageTests.cpp:33: FAILED: @@ -2048,7 +2048,7 @@ FAILED: with expansion: 2 == 1 with message: - this message should be logged, too + this message should be logged MessageTests.cpp:37: FAILED: @@ -4238,7 +4238,7 @@ BDDTests.cpp:29: 96 test cases - 45 failed (610 assertions - 102 failed) -CatchSelfTest is a CATCH v0.9 b16 (integration) host application. +CatchSelfTest is a CATCH v0.9 b17 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index f7cfea35..bdfa88d3 100644 --- a/projects/SelfTest/MessageTests.cpp +++ b/projects/SelfTest/MessageTests.cpp @@ -28,11 +28,11 @@ TEST_CASE( "./failing/message/info/1", "INFO gets logged on failure" ) TEST_CASE( "./mixed/message/info/2", "INFO gets logged on failure" ) { - INFO( "this message should be logged" ); + INFO( "this message should not be logged" ); int a = 2; CHECK( a == 2 ); - INFO( "this message should be logged, too" ); + INFO( "this message should be logged" ); CHECK( a == 1 ); From d768b1b7f93a87a869bd6ce816d02d460788f100 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 4 Feb 2013 00:05:16 +0000 Subject: [PATCH 129/296] Fixed sticky INFO (which persisted across TEST_CASEs) from #152 and generated build 18 --- README | 2 +- include/internal/catch_runner_impl.hpp | 2 + include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 53 ++++++++++++++++--- projects/SelfTest/MessageTests.cpp | 9 ++++ single_include/catch.hpp | 8 +-- 6 files changed, 65 insertions(+), 11 deletions(-) diff --git a/README b/README index 5c8f882e..42812e92 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 17 (integration branch) +CATCH v0.9 build 18 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 7ff442c2..b51a3828 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -267,6 +267,7 @@ namespace Catch { try { m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getTestCaseInfo().lineInfo, "", ResultDisposition::Normal ); m_runningTest->reset(); + if( m_reporter->getPreferences().shouldRedirectStdOut ) { StreamRedirect coutRedir( std::cout, redirectedCout ); StreamRedirect cerrRedir( std::cerr, redirectedCerr ); @@ -285,6 +286,7 @@ namespace Catch { exResult << translateActiveException(); actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) ); } + m_messages.clear(); } private: diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 42bf18ff..380ffcb4 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 17, "integration" ); + Version libraryVersion( 0, 9, 18, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index cdce6d3a..eaaa6139 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -2228,6 +2228,22 @@ MessageTests.cpp:92: No assertions in test case, './succeeding/nofail' +------------------------------------------------------------------------------- +just info +............................................................................... + + +No assertions in test case, 'just info' + +------------------------------------------------------------------------------- +just failure +............................................................................... + +FAILED: +explicitly with message: + Previous info should not be seen +MessageTests.cpp:101: + ------------------------------------------------------------------------------- ./succeeding/Misc/Sections s1 @@ -4235,7 +4251,7 @@ with expansion: BDDTests.cpp:29: =============================================================================== -96 test cases - 45 failed (610 assertions - 102 failed) +98 test cases - 47 failed (612 assertions - 104 failed) CatchSelfTest is a CATCH v0.9 b17 (integration) host application. @@ -4517,7 +4533,7 @@ ConditionTests.cpp:72: 12 test cases - 3 failed (38 assertions - 4 failed) - + @@ -4783,6 +4799,12 @@ MessageTests.cpp:86 MessageTests.cpp:92 + + + +MessageTests.cpp:101 + + @@ -7767,6 +7789,15 @@ MessageTests.cpp" line="92"> + + + + + + Previous info should not be seen + + +
MiscTests.cpp" line="25"> @@ -9754,9 +9785,9 @@ BDDTests.cpp" line="29">
- +
- + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -10262,6 +10293,16 @@ No assertions in test case, './succeeding/nofail' [Finished: './succeeding/nofail' 1 test case failed (1 assertion failed)] +[Running: just info] + +No assertions in test case, 'just info' + +[Finished: 'just info' 1 test case failed (1 assertion failed)] + +[Running: just failure] +MessageTests.cpp:101: failed with message: 'Previous info should not be seen' +[Finished: 'just failure' 1 test case failed (1 assertion failed)] + [Running: ./succeeding/Misc/Sections] [Started section: 's1'] MiscTests.cpp:25: a != b succeeded for: 1 != 2 @@ -11084,10 +11125,10 @@ BDDTests.cpp:29: itDoesThis() succeeded for: true [End of section: ' Given: This stuff exists' 1 assertion passed] [Finished: 'Scenario: Do that thing with the thing' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 45 of 96 test cases failed (102 of 610 assertions failed)] +[End of group: '~dummy'. 47 of 98 test cases failed (104 of 612 assertions failed)] -[Testing completed. 45 of 96 test cases failed (102 of 610 assertions failed)] +[Testing completed. 47 of 98 test cases failed (104 of 612 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index bdfa88d3..0e010f6c 100644 --- a/projects/SelfTest/MessageTests.cpp +++ b/projects/SelfTest/MessageTests.cpp @@ -91,3 +91,12 @@ TEST_CASE( "./succeeding/nofail", "The NO_FAIL macro reports a failure but does { CHECK_NOFAIL( 1 == 2 ); } + +TEST_CASE( "just info", "[info][isolated info]" ) +{ + INFO( "this should never be seen" ); +} +TEST_CASE( "just failure", "[fail][isolated info]" ) +{ + FAIL( "Previous info should not be seen" ); +} diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 0700af82..025f3c46 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 17 (integration branch) - * Generated: 2013-02-02 20:37:06.007152 + * CATCH v0.9 build 18 (integration branch) + * Generated: 2013-02-04 00:03:53.198397 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -4594,6 +4594,7 @@ namespace Catch { try { m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getTestCaseInfo().lineInfo, "", ResultDisposition::Normal ); m_runningTest->reset(); + if( m_reporter->getPreferences().shouldRedirectStdOut ) { StreamRedirect coutRedir( std::cout, redirectedCout ); StreamRedirect cerrRedir( std::cerr, redirectedCerr ); @@ -4612,6 +4613,7 @@ namespace Catch { exResult << translateActiveException(); actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) ); } + m_messages.clear(); } private: @@ -5814,7 +5816,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 17, "integration" ); + Version libraryVersion( 0, 9, 18, "integration" ); } // #included from: catch_line_wrap.hpp From 707c97ed3e7fb77c0731ce46272c789930d6afe8 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 18 Feb 2013 13:02:23 +0000 Subject: [PATCH 130/296] Ignore OCTest DerivedData --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2072c5dd..76fc19e1 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ projects/XCode4/iOSTest/Build/Intermediates/PrecompiledHeaders projects/XCode4/iOSTest/Build/Products/Debug-iphonesimulator/iOSTest.app.dSYM/Contents/Resources/DWARF projects/XCode4/iOSTest/Build projects/XCode4/CatchSelfTest/DerivedData +projects/XCode4/OCTest/DerivedData From dbcd833c724dee84b70154e3d55213042dd639ff Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 18 Feb 2013 13:02:49 +0000 Subject: [PATCH 131/296] Don't use ANSI colour codes when debugging --- include/internal/catch_console_colour_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index c05fd07f..340628d6 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -32,7 +32,7 @@ namespace Catch { namespace { const char colourEscape = '\033'; } void TextColour::set( Colours colour ) { - if( isatty( fileno(stdout) ) ) { + if( isatty( fileno(stdout) ) && !isDebuggerActive() ) { switch( colour ) { case TextColour::FileName: std::cout << colourEscape << "[0m"; // white/ normal From f45e09a41697952aea5ef2594cd50c60c198d9b0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 19 Feb 2013 08:19:00 +0000 Subject: [PATCH 132/296] Default to using colour in unix based terminals --- include/internal/catch_console_colour_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 340628d6..a274be47 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -10,7 +10,7 @@ #include "catch_console_colour.hpp" -#if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) +#if !defined( CATCH_CONFIG_NO_COLOUR ) #include From 429699e7975a4aab2b836571ebc511c03e98a902 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 19 Feb 2013 08:39:28 +0000 Subject: [PATCH 133/296] Added className to TestCase in Obj-C --- include/internal/catch_objc.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/internal/catch_objc.hpp b/include/internal/catch_objc.hpp index eb8c5264..1769e55b 100644 --- a/include/internal/catch_objc.hpp +++ b/include/internal/catch_objc.hpp @@ -92,8 +92,9 @@ namespace Catch { std::string testCaseName = methodName.substr( 15 ); std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); + const char* className = class_getName( cls ); - getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), "", name.c_str(), desc.c_str(), SourceLineInfo() ) ); + getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, name.c_str(), desc.c_str(), SourceLineInfo() ) ); noTestMethods++; } } From ca79d19325e9a901d4d50f70304f276856d7f17a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 19 Feb 2013 18:41:57 +0000 Subject: [PATCH 134/296] Suppress "no test cases matched" message if there was no test spec string --- include/catch_runner.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 95c466b9..0b2fad79 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -69,7 +69,7 @@ namespace Catch { } } } - if( testsRunForGroup == 0 ) + if( testsRunForGroup == 0 && !filterGroup.getName().empty() ) std::cerr << "\n[No test cases matched with: " << filterGroup.getName() << "]" << std::endl; return totals; From 35cb97f5e28179ba7b3ee7b345659355321bf846 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 19 Feb 2013 18:45:06 +0000 Subject: [PATCH 135/296] Cleaned up some stray tests --- projects/SelfTest/MessageTests.cpp | 4 ++-- projects/SelfTest/MiscTests.cpp | 4 ++-- projects/SelfTest/TestMain.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index 0e010f6c..c36b1060 100644 --- a/projects/SelfTest/MessageTests.cpp +++ b/projects/SelfTest/MessageTests.cpp @@ -92,11 +92,11 @@ TEST_CASE( "./succeeding/nofail", "The NO_FAIL macro reports a failure but does CHECK_NOFAIL( 1 == 2 ); } -TEST_CASE( "just info", "[info][isolated info]" ) +TEST_CASE( "just info", "[info][isolated info][hide]" ) { INFO( "this should never be seen" ); } -TEST_CASE( "just failure", "[fail][isolated info]" ) +TEST_CASE( "just failure", "[fail][isolated info][hide]" ) { FAIL( "Previous info should not be seen" ); } diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index 1e68fc75..97734927 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -243,11 +243,11 @@ TEST_CASE("./failing/matchers/Equals", "") //{ // REQUIRE_THAT("", Equals(NULL)); //} -TEST_CASE("/succeeding/matchers/AllOf", "") +TEST_CASE("./succeeding/matchers/AllOf", "") { CHECK_THAT( testStringForMatching(), AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ); } -TEST_CASE("/succeeding/matchers/AnyOf", "") +TEST_CASE("./succeeding/matchers/AnyOf", "") { CHECK_THAT( testStringForMatching(), AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) ); CHECK_THAT( testStringForMatching(), AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) ); diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 4085c670..fa6f3bc8 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/*", 0, 2 ); - CHECK( totals.assertions.passed == 291 ); + CHECK( totals.assertions.passed == 296 ); CHECK( totals.assertions.failed == 0 ); } From 3f503851d7150b88ea6a40cec7902882850094d9 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 19 Feb 2013 18:51:46 +0000 Subject: [PATCH 136/296] Updated approval file --- .../SelfTest/Baselines/approvedResults.txt | 85 +++++++++++-------- 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index eaaa6139..57fbe618 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,5 +1,5 @@ -CatchSelfTest is a CATCH v0.9 b17 (integration) host application. +CatchSelfTest is a CATCH v0.9 b18 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -2647,7 +2647,7 @@ with expansion: MiscTests.cpp:240: ------------------------------------------------------------------------------- -/succeeding/matchers/AllOf +./succeeding/matchers/AllOf ............................................................................... PASSED: @@ -2658,7 +2658,7 @@ with expansion: MiscTests.cpp:248: ------------------------------------------------------------------------------- -/succeeding/matchers/AnyOf +./succeeding/matchers/AnyOf ............................................................................... PASSED: @@ -3113,6 +3113,16 @@ with message: Tests passed, as expected catch_self_test.hpp:103: +PASSED: +with message: + Tests passed, as expected +catch_self_test.hpp:103: + +PASSED: +with message: + Tests passed, as expected +catch_self_test.hpp:103: + Message from section one Message from section two Some information @@ -3123,10 +3133,10 @@ selftest/main selftest/test counts/succeeding tests ............................................................................... -FAILED: - CHECK( totals.assertions.passed == 291 ) +PASSED: + CHECK( totals.assertions.passed == 296 ) with expansion: - 293 == 291 + 296 == 296 TestMain.cpp:40: PASSED: @@ -4251,10 +4261,10 @@ with expansion: BDDTests.cpp:29: =============================================================================== -98 test cases - 47 failed (612 assertions - 104 failed) +98 test cases - 46 failed (614 assertions - 103 failed) -CatchSelfTest is a CATCH v0.9 b17 (integration) host application. +CatchSelfTest is a CATCH v0.9 b18 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4533,7 +4543,7 @@ ConditionTests.cpp:72: 12 test cases - 3 failed (38 assertions - 4 failed) - + @@ -4898,8 +4908,8 @@ MiscTests.cpp:235 MiscTests.cpp:240 - - + + @@ -4911,9 +4921,6 @@ MiscTests.cpp:282 - -TestMain.cpp:40 - Message from section one Message from section two @@ -8230,7 +8237,7 @@ MiscTests.cpp" line="240"> - + MiscTests.cpp" line="248"> testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) @@ -8241,7 +8248,7 @@ MiscTests.cpp" line="248"> - + MiscTests.cpp" line="252"> testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) @@ -8338,9 +8345,9 @@ MiscTests.cpp" line="273">
- +
- +
@@ -8349,10 +8356,10 @@ MiscTests.cpp" line="273">
TestMain.cpp" line="40"> - totals.assertions.passed == 291 + totals.assertions.passed == 296 - 293 == 291 + 296 == 296 TestMain.cpp" line="41"> @@ -8363,9 +8370,9 @@ TestMain.cpp" line="41"> 0 == 0 - +
- +
@@ -8389,7 +8396,7 @@ TestMain.cpp" line="48">
- + TestMain.cpp" line="57"> @@ -9785,9 +9792,9 @@ BDDTests.cpp" line="29">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -10487,17 +10494,17 @@ MiscTests.cpp:240: 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/AllOf] +[Running: ./succeeding/matchers/AllOf] MiscTests.cpp:248: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) -[Finished: '/succeeding/matchers/AllOf' All tests passed (1 assertion in 1 test case)] +[Finished: './succeeding/matchers/AllOf' All tests passed (1 assertion in 1 test case)] -[Running: /succeeding/matchers/AnyOf] +[Running: ./succeeding/matchers/AnyOf] MiscTests.cpp:252: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) MiscTests.cpp:253: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) -[Finished: '/succeeding/matchers/AnyOf' All tests passed (2 assertions in 1 test case)] +[Finished: './succeeding/matchers/AnyOf' All tests passed (2 assertions in 1 test case)] [Running: ./succeeding/matchers/Equals] MiscTests.cpp:258: testStringForMatching() Equals( "this string contains 'abc' as a substring" ) succeeded for: @@ -10688,9 +10695,13 @@ catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] catch_self_test.hpp:103: succeeded [with message: Tests passed, as expected] -[End of section: 'selftest/expected result/succeeding tests' All 44 assertions passed] +catch_self_test.hpp:103: succeeded +[with message: Tests passed, as expected] +catch_self_test.hpp:103: succeeded +[with message: Tests passed, as expected] +[End of section: 'selftest/expected result/succeeding tests' All 46 assertions passed] -[End of section: 'selftest/expected result' All 44 assertions passed] +[End of section: 'selftest/expected result' All 46 assertions passed] Message from section one Message from section two @@ -10698,11 +10709,11 @@ Some information An error [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/succeeding tests'] -TestMain.cpp:40: totals.assertions.passed == 291 failed for: 293 == 291 +TestMain.cpp:40: totals.assertions.passed == 296 succeeded for: 296 == 296 TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 -[End of section: 'selftest/test counts/succeeding tests' 1 of 2 assertions failed] +[End of section: 'selftest/test counts/succeeding tests' All 2 assertions passed] -[End of section: 'selftest/test counts' 1 of 2 assertions failed] +[End of section: 'selftest/test counts' All 2 assertions passed] [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/failing tests'] @@ -10712,7 +10723,7 @@ TestMain.cpp:48: totals.assertions.failed == 72 succeeded for: 72 == 72 [End of section: 'selftest/test counts' All 2 assertions passed] -[Finished: 'selftest/main' 1 test case failed (1 of 73 assertions failed)] +[Finished: 'selftest/main' All tests passed (75 assertions in 1 test case)] [Running: meta/Misc/Sections] TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 @@ -11125,10 +11136,10 @@ BDDTests.cpp:29: itDoesThis() succeeded for: true [End of section: ' Given: This stuff exists' 1 assertion passed] [Finished: 'Scenario: Do that thing with the thing' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 47 of 98 test cases failed (104 of 612 assertions failed)] +[End of group: '~dummy'. 46 of 98 test cases failed (103 of 614 assertions failed)] -[Testing completed. 47 of 98 test cases failed (104 of 612 assertions failed)] +[Testing completed. 46 of 98 test cases failed (103 of 614 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] From 10ed1e0e34c6842b91ee1a38821e4fc8b871267c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 19 Feb 2013 19:45:09 +0000 Subject: [PATCH 137/296] Handle section ends in the event of unexpected exceptions --- include/internal/catch_runner_impl.hpp | 21 ++++ .../SelfTest/Baselines/approvedResults.txt | 114 ++++++++++++------ projects/SelfTest/ExceptionTests.cpp | 8 ++ projects/SelfTest/TestMain.cpp | 2 +- 4 files changed, 106 insertions(+), 39 deletions(-) diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index b51a3828..a699057f 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -201,6 +201,11 @@ namespace Catch { } virtual void sectionEnded( SectionInfo const& info, Counts const& prevAssertions ) { + if( std::uncaught_exception() ) { + m_unfinishedSections.push_back( UnfinishedSections( info, prevAssertions ) ); + return; + } + Counts assertions = m_totals.assertions - prevAssertions; bool missingAssertions = false; if( assertions.total() == 0 && @@ -286,10 +291,25 @@ namespace Catch { exResult << translateActiveException(); actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) ); } + for( std::vector::const_iterator it = m_unfinishedSections.begin(), + itEnd = m_unfinishedSections.end(); + it != itEnd; + ++it ) + sectionEnded( it->info, it->prevAssertions ); + m_unfinishedSections.clear(); m_messages.clear(); } private: + struct UnfinishedSections { + UnfinishedSections( SectionInfo const& _info, Counts const& _prevAssertions ) + : info( _info ), prevAssertions( _prevAssertions ) + {} + + SectionInfo info; + Counts prevAssertions; + }; + TestRunInfo m_runInfo; IMutableContext& m_context; RunningTest* m_runningTest; @@ -303,6 +323,7 @@ namespace Catch { IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; AssertionInfo m_lastAssertionInfo; + std::vector m_unfinishedSections; }; } // end namespace Catch diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 57fbe618..058b47bb 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1060,6 +1060,16 @@ due to unexpected exception with message: unexpected exception ExceptionTests.cpp:60: +------------------------------------------------------------------------------- +./failing/exceptions/implicit/3 + section name +............................................................................... + +FAILED: +due to unexpected exception with message: + unexpected exception +ExceptionTests.cpp:66: + ------------------------------------------------------------------------------- ./succeeding/exceptions/implicit ............................................................................... @@ -1074,7 +1084,7 @@ No assertions in test case, './succeeding/exceptions/implicit' FAILED: due to unexpected exception with message: custom exception -ExceptionTests.cpp:102: +ExceptionTests.cpp:110: ------------------------------------------------------------------------------- ./failing/exceptions/custom/nothrow @@ -1084,7 +1094,7 @@ FAILED: REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) due to unexpected exception with message: unexpected custom exception -ExceptionTests.cpp:109: +ExceptionTests.cpp:117: ------------------------------------------------------------------------------- ./failing/exceptions/custom/throw @@ -1094,7 +1104,7 @@ FAILED: REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) due to unexpected exception with message: custom exception - not std -ExceptionTests.cpp:114: +ExceptionTests.cpp:122: ------------------------------------------------------------------------------- ./failing/exceptions/custom/double @@ -1103,7 +1113,7 @@ ExceptionTests.cpp:114: FAILED: due to unexpected exception with message: 3.14 -ExceptionTests.cpp:118: +ExceptionTests.cpp:126: ------------------------------------------------------------------------------- ./succeeding/exceptions/notimplemented @@ -1111,7 +1121,7 @@ ExceptionTests.cpp:118: PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) -ExceptionTests.cpp:129: +ExceptionTests.cpp:137: ------------------------------------------------------------------------------- ./succeeding/generators/1 @@ -2883,6 +2893,11 @@ with message: Tests failed, as expected catch_self_test.hpp:114: +PASSED: +with message: + Tests failed, as expected +catch_self_test.hpp:114: + ------------------------------------------------------------------------------- selftest/main selftest/expected result @@ -3158,9 +3173,9 @@ with expansion: TestMain.cpp:47: PASSED: - CHECK( totals.assertions.failed == 72 ) + CHECK( totals.assertions.failed == 73 ) with expansion: - 72 == 72 + 73 == 73 TestMain.cpp:48: ------------------------------------------------------------------------------- @@ -4261,7 +4276,7 @@ with expansion: BDDTests.cpp:29: =============================================================================== -98 test cases - 46 failed (614 assertions - 103 failed) +99 test cases - 47 failed (616 assertions - 104 failed) CatchSelfTest is a CATCH v0.9 b18 (integration) host application. @@ -4543,7 +4558,7 @@ ConditionTests.cpp:72: 12 test cases - 3 failed (38 assertions - 4 failed) - + @@ -4737,25 +4752,30 @@ ExceptionTests.cpp:52 ExceptionTests.cpp:60 + + +ExceptionTests.cpp:66 + + -ExceptionTests.cpp:102 +ExceptionTests.cpp:110 -ExceptionTests.cpp:109 +ExceptionTests.cpp:117 -ExceptionTests.cpp:114 +ExceptionTests.cpp:122 -ExceptionTests.cpp:118 +ExceptionTests.cpp:126 @@ -6381,51 +6401,60 @@ ExceptionTests.cpp" line="60"> + +
+ExceptionTests.cpp" line="66"> + unexpected exception + + +
+ +
-ExceptionTests.cpp" line="102"> +ExceptionTests.cpp" line="110"> custom exception -ExceptionTests.cpp" line="109"> +ExceptionTests.cpp" line="117"> throw CustomException( "unexpected custom exception" ) throw CustomException( "unexpected custom exception" ) -ExceptionTests.cpp" line="109"> +ExceptionTests.cpp" line="117"> unexpected custom exception -ExceptionTests.cpp" line="114"> +ExceptionTests.cpp" line="122"> throw CustomException( "custom exception - not std" ) throw CustomException( "custom exception - not std" ) -ExceptionTests.cpp" line="114"> +ExceptionTests.cpp" line="122"> custom exception - not std -ExceptionTests.cpp" line="118"> +ExceptionTests.cpp" line="126"> 3.14 -ExceptionTests.cpp" line="129"> +ExceptionTests.cpp" line="137"> thisFunctionNotImplemented( 7 ) @@ -8339,9 +8368,9 @@ MiscTests.cpp" line="273">
- +
- +
@@ -8386,10 +8415,10 @@ TestMain.cpp" line="47"> TestMain.cpp" line="48"> - totals.assertions.failed == 72 + totals.assertions.failed == 73 - 72 == 72 + 73 == 73 @@ -9792,9 +9821,9 @@ BDDTests.cpp" line="29">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -10045,6 +10074,14 @@ ExceptionTests.cpp:60: 1 == 1 succeeded ExceptionTests.cpp:60: {Unknown expression after the reported line} failed with unexpected exception with message: 'unexpected exception' [Finished: './failing/exceptions/implicit/2' 1 test case failed (1 of 2 assertions failed)] +[Running: ./failing/exceptions/implicit/3] + +[Started section: 'section name'] +ExceptionTests.cpp:66: Unexpected exception with message: 'unexpected exception' +[End of section: 'section name' 1 assertion failed] + +[Finished: './failing/exceptions/implicit/3' 1 test case failed (1 assertion failed)] + [Running: ./succeeding/exceptions/implicit] No assertions in test case, './succeeding/exceptions/implicit' @@ -10052,23 +10089,23 @@ No assertions in test case, './succeeding/exceptions/implicit' [Finished: './succeeding/exceptions/implicit' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/custom] -ExceptionTests.cpp:102: Unexpected exception with message: 'custom exception' +ExceptionTests.cpp:110: Unexpected exception with message: 'custom exception' [Finished: './failing/exceptions/custom' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/custom/nothrow] -ExceptionTests.cpp:109: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' +ExceptionTests.cpp:117: 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] -ExceptionTests.cpp:114: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' +ExceptionTests.cpp:122: 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] -ExceptionTests.cpp:118: Unexpected exception with message: '3.14' +ExceptionTests.cpp:126: Unexpected exception with message: '3.14' [Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] [Running: ./succeeding/exceptions/notimplemented] -ExceptionTests.cpp:129: thisFunctionNotImplemented( 7 ) succeeded +ExceptionTests.cpp:137: thisFunctionNotImplemented( 7 ) succeeded [Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/generators/1] @@ -10251,7 +10288,6 @@ MessageTests.cpp:51: 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'] MessageTests.cpp:58: failed with message: 'Message from section one' [End of section: 'one' 1 assertion failed] @@ -10597,9 +10633,11 @@ catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] catch_self_test.hpp:114: succeeded [with message: Tests failed, as expected] -[End of section: 'selftest/expected result/failing tests' All 25 assertions passed] +catch_self_test.hpp:114: succeeded +[with message: Tests failed, as expected] +[End of section: 'selftest/expected result/failing tests' All 26 assertions passed] -[End of section: 'selftest/expected result' All 25 assertions passed] +[End of section: 'selftest/expected result' All 26 assertions passed] [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/succeeding tests'] @@ -10718,12 +10756,12 @@ TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/failing tests'] TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 -TestMain.cpp:48: totals.assertions.failed == 72 succeeded for: 72 == 72 +TestMain.cpp:48: totals.assertions.failed == 73 succeeded for: 73 == 73 [End of section: 'selftest/test counts/failing tests' All 2 assertions passed] [End of section: 'selftest/test counts' All 2 assertions passed] -[Finished: 'selftest/main' All tests passed (75 assertions in 1 test case)] +[Finished: 'selftest/main' All tests passed (76 assertions in 1 test case)] [Running: meta/Misc/Sections] TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 @@ -11136,10 +11174,10 @@ BDDTests.cpp:29: itDoesThis() succeeded for: true [End of section: ' Given: This stuff exists' 1 assertion passed] [Finished: 'Scenario: Do that thing with the thing' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 46 of 98 test cases failed (103 of 614 assertions failed)] +[End of group: '~dummy'. 47 of 99 test cases failed (104 of 616 assertions failed)] -[Testing completed. 46 of 98 test cases failed (103 of 614 assertions failed)] +[Testing completed. 47 of 99 test cases failed (104 of 616 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp index fc20bde9..5787c6be 100644 --- a/projects/SelfTest/ExceptionTests.cpp +++ b/projects/SelfTest/ExceptionTests.cpp @@ -61,6 +61,14 @@ TEST_CASE_NORETURN( "./failing/exceptions/implicit/2", "An unchecked exception r throw std::domain_error( "unexpected exception" ); /*NOTREACHED*/ } +TEST_CASE( "./failing/exceptions/implicit/3", "When unchecked exceptions are thrown they are always failures" ) +{ + SECTION( "section name", "" ) + { + throw std::domain_error( "unexpected exception" ); + /*NOTREACHED*/ + } +} TEST_CASE( "./succeeding/exceptions/implicit", "When unchecked exceptions are thrown, but caught, they do not affect the test" ) { diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index fa6f3bc8..2b0a9bf7 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -45,7 +45,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" "Number of 'failing' tests is fixed" ) { Totals totals = runner.runMatching( "./failing/*", 1, 2 ); CHECK( totals.assertions.passed == 1 ); - CHECK( totals.assertions.failed == 72 ); + CHECK( totals.assertions.failed == 73 ); } } } From 5bdae8456cde84d2abd0b03fc7f567630ee449d5 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 19 Feb 2013 19:47:18 +0000 Subject: [PATCH 138/296] build 19 --- README | 2 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 36 ++++++++++++++++++++++++------ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/README b/README index 42812e92..4f9d35de 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 18 (integration branch) +CATCH v0.9 build 19 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 380ffcb4..bc4611da 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 18, "integration" ); + Version libraryVersion( 0, 9, 19, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 025f3c46..0df3c9b3 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 18 (integration branch) - * Generated: 2013-02-04 00:03:53.198397 + * CATCH v0.9 build 19 (integration branch) + * Generated: 2013-02-19 19:46:31.030694 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -3296,8 +3296,9 @@ namespace Catch { std::string testCaseName = methodName.substr( 15 ); std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); + const char* className = class_getName( cls ); - getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), "", name.c_str(), desc.c_str(), SourceLineInfo() ) ); + getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, name.c_str(), desc.c_str(), SourceLineInfo() ) ); noTestMethods++; } } @@ -4528,6 +4529,11 @@ namespace Catch { } virtual void sectionEnded( SectionInfo const& info, Counts const& prevAssertions ) { + if( std::uncaught_exception() ) { + m_unfinishedSections.push_back( UnfinishedSections( info, prevAssertions ) ); + return; + } + Counts assertions = m_totals.assertions - prevAssertions; bool missingAssertions = false; if( assertions.total() == 0 && @@ -4613,10 +4619,25 @@ namespace Catch { exResult << translateActiveException(); actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) ); } + for( std::vector::const_iterator it = m_unfinishedSections.begin(), + itEnd = m_unfinishedSections.end(); + it != itEnd; + ++it ) + sectionEnded( it->info, it->prevAssertions ); + m_unfinishedSections.clear(); m_messages.clear(); } private: + struct UnfinishedSections { + UnfinishedSections( SectionInfo const& _info, Counts const& _prevAssertions ) + : info( _info ), prevAssertions( _prevAssertions ) + {} + + SectionInfo info; + Counts prevAssertions; + }; + TestRunInfo m_runInfo; IMutableContext& m_context; RunningTest* m_runningTest; @@ -4630,6 +4651,7 @@ namespace Catch { IResultCapture* m_prevResultCapture; const IConfig* m_prevConfig; AssertionInfo m_lastAssertionInfo; + std::vector m_unfinishedSections; }; } // end namespace Catch @@ -4726,7 +4748,7 @@ namespace Catch { } } } - if( testsRunForGroup == 0 ) + if( testsRunForGroup == 0 && !filterGroup.getName().empty() ) std::cerr << "\n[No test cases matched with: " << filterGroup.getName() << "]" << std::endl; return totals; @@ -5330,7 +5352,7 @@ namespace Catch { } // end namespace Catch -#if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) +#if !defined( CATCH_CONFIG_NO_COLOUR ) #include @@ -5352,7 +5374,7 @@ namespace Catch { namespace { const char colourEscape = '\033'; } void TextColour::set( Colours colour ) { - if( isatty( fileno(stdout) ) ) { + if( isatty( fileno(stdout) ) && !isDebuggerActive() ) { switch( colour ) { case TextColour::FileName: std::cout << colourEscape << "[0m"; // white/ normal @@ -5816,7 +5838,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 18, "integration" ); + Version libraryVersion( 0, 9, 19, "integration" ); } // #included from: catch_line_wrap.hpp From ead139e094c795479da73a8ac99c891da6bf001a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 19 Feb 2013 19:59:04 +0000 Subject: [PATCH 139/296] Reverted ANSI colour change (it was failing for Windows) Produced build 20 --- README | 2 +- include/internal/catch_console_colour_impl.hpp | 2 +- include/internal/catch_version.hpp | 2 +- projects/SelfTest/Baselines/approvedResults.txt | 4 ++-- single_include/catch.hpp | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README b/README index 4f9d35de..be0d2fa0 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 19 (integration branch) +CATCH v0.9 build 20 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index a274be47..340628d6 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -10,7 +10,7 @@ #include "catch_console_colour.hpp" -#if !defined( CATCH_CONFIG_NO_COLOUR ) +#if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) #include diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index bc4611da..b272246c 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 19, "integration" ); + Version libraryVersion( 0, 9, 20, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 058b47bb..96f71267 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,5 +1,5 @@ -CatchSelfTest is a CATCH v0.9 b18 (integration) host application. +CatchSelfTest is a CATCH v0.9 b19 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4279,7 +4279,7 @@ BDDTests.cpp:29: 99 test cases - 47 failed (616 assertions - 104 failed) -CatchSelfTest is a CATCH v0.9 b18 (integration) host application. +CatchSelfTest is a CATCH v0.9 b19 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 0df3c9b3..f0fa4193 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 19 (integration branch) - * Generated: 2013-02-19 19:46:31.030694 + * CATCH v0.9 build 20 (integration branch) + * Generated: 2013-02-19 19:57:51.967870 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -5352,7 +5352,7 @@ namespace Catch { } // end namespace Catch -#if !defined( CATCH_CONFIG_NO_COLOUR ) +#if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) #include @@ -5838,7 +5838,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 19, "integration" ); + Version libraryVersion( 0, 9, 20, "integration" ); } // #included from: catch_line_wrap.hpp From 767f1588dc208ef6b22b83e18e645786770ce204 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 4 Mar 2013 12:19:15 +0100 Subject: [PATCH 140/296] Added StringMaker (for partially specialising string conversions), extended BDD macros and moved file/line info to top of message. Re-enable ANSI colour by default - hopefully properly excluding Windows this time --- README | 2 +- generateSingleHeader.py | 9 +- .../internal/catch_console_colour_impl.hpp | 13 +- .../catch_expressionresult_builder.hpp | 6 +- include/internal/catch_runner_impl.hpp | 2 +- include/internal/catch_running_test.hpp | 8 +- include/internal/catch_tostring.hpp | 62 +- include/internal/catch_version.hpp | 2 +- include/reporters/catch_reporter_console.hpp | 9 +- projects/SelfTest/ApproxTests.cpp | 9 + .../SelfTest/Baselines/approvedResults.txt | 1589 ++++++++--------- .../CatchSelfTest.xcodeproj/project.pbxproj | 2 - .../CatchSelfTest/CatchSelfTest/BDDTests.cpp | 13 +- single_include/catch.hpp | 98 +- 14 files changed, 952 insertions(+), 872 deletions(-) diff --git a/README b/README index be0d2fa0..b3cb66b9 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 20 (integration branch) +CATCH v0.9 build 21 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/generateSingleHeader.py b/generateSingleHeader.py index caec29bd..ea16a1b7 100644 --- a/generateSingleHeader.py +++ b/generateSingleHeader.py @@ -17,6 +17,8 @@ versionPath = os.path.join( rootPath, "internal/catch_version.hpp" ) readmePath = os.path.join( catchPath, "README" ) #outputPath = os.path.join( catchPath, 'single_include/catch.hpp' ) +bumpVersion = len(sys.argv) < 2 or sys.argv[1] <> "nobump" + def parseFile( path, filename ): f = open( path + filename, 'r' ) blanks = 0 @@ -86,9 +88,10 @@ class Version: def generateSingleInclude(): v = Version() - v.incrementBuildNumber() - v.updateVersionFile() - v.updateReadmeFile() + if bumpVersion: + v.incrementBuildNumber() + v.updateVersionFile() + v.updateReadmeFile() print "/*" print " * CATCH v{0}.{1} build {2} ({3} branch)".format( v.majorVersion, v.minorVersion, v.buildNumber, v.branchName ) print " * Generated: " + str( datetime.datetime.now() ) diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 340628d6..d3b1c12c 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -10,6 +10,10 @@ #include "catch_console_colour.hpp" +#if !defined(CATCH_CONFIG_USE_ANSI_COLOUR_CODES) && !defined(CATCH_PLATFORM_WINDOWS) +#define CATCH_CONFIG_USE_ANSI_COLOUR_CODES 1 +#endif + #if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) #include @@ -31,8 +35,15 @@ namespace Catch { namespace { const char colourEscape = '\033'; } + inline bool shouldUseColour() { + static bool s_shouldUseColour + = CATCH_CONFIG_USE_ANSI_COLOUR_CODES != 0 && + isatty( fileno(stdout) ) && + !isDebuggerActive(); + return s_shouldUseColour; + } void TextColour::set( Colours colour ) { - if( isatty( fileno(stdout) ) && !isDebuggerActive() ) { + if( shouldUseColour() ) { switch( colour ) { case TextColour::FileName: std::cout << colourEscape << "[0m"; // white/ normal diff --git a/include/internal/catch_expressionresult_builder.hpp b/include/internal/catch_expressionresult_builder.hpp index f0a8cccc..a0921c9a 100644 --- a/include/internal/catch_expressionresult_builder.hpp +++ b/include/internal/catch_expressionresult_builder.hpp @@ -82,12 +82,10 @@ namespace Catch { else if( m_exprComponents.op == "matches" ) return m_exprComponents.lhs + " " + m_exprComponents.rhs; else if( m_exprComponents.op != "!" ) { - if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 30 ) + if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 ) 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"; + return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs; } else return "{can't expand - use " + info.macroName + "_FALSE( " + info.capturedExpression.substr(1) + " ) instead of " + info.macroName + "( " + info.capturedExpression + " ) for better diagnostics}"; diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index a699057f..2dcf92ae 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -216,7 +216,7 @@ namespace Catch { missingAssertions = true; } - m_runningTest->endSection( info.name ); + m_runningTest->endSection( info.name, false ); m_reporter->sectionEnded( SectionStats( info, assertions, missingAssertions ) ); m_messages.clear(); diff --git a/include/internal/catch_running_test.hpp b/include/internal/catch_running_test.hpp index 0b234c09..88ac27d8 100644 --- a/include/internal/catch_running_test.hpp +++ b/include/internal/catch_running_test.hpp @@ -78,13 +78,15 @@ namespace Catch { return false; } - void endSection( const std::string& ) { + void endSection( const std::string&, bool stealth ) { if( m_currentSection->ran() ) { - m_runStatus = RanAtLeastOneSection; + if( !stealth ) + m_runStatus = RanAtLeastOneSection; m_changed = true; } else if( m_runStatus == EncounteredASection ) { - m_runStatus = RanAtLeastOneSection; + if( !stealth ) + m_runStatus = RanAtLeastOneSection; m_lastSectionToRun = m_currentSection; } m_currentSection = m_currentSection->getParent(); diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index b6802af9..ef9b5efc 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -10,6 +10,8 @@ #include "catch_common.h" #include +#include +#include #ifdef __OBJC__ #include "catch_objc_arc.hpp" @@ -22,37 +24,53 @@ namespace Detail { template NonStreamable( const T& ){} }; - // If the type does not have its own << overload for ostream then - // this one will be used instead - inline std::ostream& operator << ( std::ostream& ss, NonStreamable ){ - return ss << "{?}"; - } - - template - inline std::string makeString( const T& value ) { +} // end namespace Detail + +// If the type does not have its own << overload for ostream then +// this one will be used instead +inline std::ostream& operator << ( std::ostream& ss, Detail::NonStreamable ){ + return ss << "{?}"; +} + +template +struct StringMaker { + static std::string convert( T const& value ) { std::ostringstream oss; oss << value; return oss.str(); - } - - template - inline std::string makeString( T* p ) { + } +}; +template +struct StringMaker { + static std::string convert( T const* p ) { if( !p ) return INTERNAL_CATCH_STRINGIFY( NULL ); std::ostringstream oss; oss << p; return oss.str(); - } + } +}; - template - inline std::string makeString( const T* p ) { - if( !p ) - return INTERNAL_CATCH_STRINGIFY( NULL ); +template +struct StringMaker > { + static std::string convert( std::vector const& v ) { std::ostringstream oss; - oss << p; + oss << "{ "; + for( std::size_t i = 0; i < v.size(); ++ i ) { + oss << v[i]; + if( i < v.size() - 1 ) + oss << ", "; + } + oss << " }"; return oss.str(); - } + } +}; +namespace Detail { + template + inline std::string makeString( const T& value ) { + return StringMaker::convert( value ); + } } // end namespace Detail /// \brief converts any type to a string @@ -64,7 +82,8 @@ namespace Detail { /// to provide an ostream overload for. template std::string toString( const T& value ) { - return Detail::makeString( value ); + return StringMaker::convert( value ); +// return Detail::makeString( value ); } // Built in overloads @@ -111,7 +130,8 @@ inline std::string toString( unsigned int value ) { inline std::string toString( const double value ) { std::ostringstream oss; - oss << value; + oss << std::setprecision (std::numeric_limits::digits10 + 1) + << value; return oss.str(); } diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index b272246c..15dc2633 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 20, "integration" ); + Version libraryVersion( 0, 9, 21, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 3acfb8e9..bb7fc236 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -174,13 +174,18 @@ namespace Catch { } void print() const { + printSourceInfo(); if( stats.totals.assertions.total() > 0 ) { + if( result.isOk() ) + stream << "\n"; printResultType(); printOriginalExpression(); printReconstructedExpression(); } + else { + stream << "\n"; + } printMessage(); - printSourceInfo(); } private: @@ -222,7 +227,7 @@ namespace Catch { } void printSourceInfo() const { TextColour colourGuard( TextColour::FileName ); - stream << result.getSourceInfo() << ":\n"; + stream << result.getSourceInfo() << ": "; } static std::string wrapLongStrings( std::string const& _string ){ diff --git a/projects/SelfTest/ApproxTests.cpp b/projects/SelfTest/ApproxTests.cpp index 5101c865..acf96c99 100644 --- a/projects/SelfTest/ApproxTests.cpp +++ b/projects/SelfTest/ApproxTests.cpp @@ -101,3 +101,12 @@ TEST_CASE REQUIRE( approx( d ) != 1.25 ); } +inline double divide( double a, double b ) { + return a/b; +} + +TEST_CASE( "Approximate PI", "[Approx][PI]" ) +{ + REQUIRE( divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) ); + REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ); +} diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 96f71267..6e83e3b4 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,1074 +1,1037 @@ -CatchSelfTest is a CATCH v0.9 b19 (integration) host application. +CatchSelfTest is a CATCH v0.9 b21 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- ./succeeding/Approx/simple ............................................................................... +ApproxTests.cpp:20: PASSED: REQUIRE( d == Approx( 1.23 ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:20: +ApproxTests.cpp:21: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: 1.23 != Approx( 1.22 ) -ApproxTests.cpp:21: +ApproxTests.cpp:22: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: 1.23 != Approx( 1.24 ) -ApproxTests.cpp:22: +ApproxTests.cpp:24: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:24: +ApproxTests.cpp:25: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: Approx( 1.23 ) != 1.22 -ApproxTests.cpp:25: +ApproxTests.cpp:26: PASSED: REQUIRE( Approx( d ) != 1.24 ) with expansion: Approx( 1.23 ) != 1.24 -ApproxTests.cpp:26: ------------------------------------------------------------------------------- ./succeeding/Approx/epsilon ............................................................................... +ApproxTests.cpp:38: PASSED: REQUIRE( d != Approx( 1.231 ) ) with expansion: 1.23 != Approx( 1.231 ) -ApproxTests.cpp:38: +ApproxTests.cpp:39: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) with expansion: 1.23 == Approx( 1.231 ) -ApproxTests.cpp:39: ------------------------------------------------------------------------------- ./succeeding/Approx/float ............................................................................... +ApproxTests.cpp:49: PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:49: +ApproxTests.cpp:50: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) with expansion: 0 == Approx( 0 ) -ApproxTests.cpp:50: ------------------------------------------------------------------------------- ./succeeding/Approx/int ............................................................................... +ApproxTests.cpp:60: PASSED: REQUIRE( 1 == Approx( 1 ) ) -ApproxTests.cpp:60: +ApproxTests.cpp:61: PASSED: REQUIRE( 0 == Approx( 0 ) ) -ApproxTests.cpp:61: ------------------------------------------------------------------------------- ./succeeding/Approx/mixed ............................................................................... +ApproxTests.cpp:75: PASSED: REQUIRE( 1.0f == Approx( 1 ) ) with expansion: 1 == Approx( 1 ) -ApproxTests.cpp:75: +ApproxTests.cpp:76: PASSED: REQUIRE( 0 == Approx( dZero) ) with expansion: 0 == Approx( 0 ) -ApproxTests.cpp:76: +ApproxTests.cpp:77: PASSED: REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) with expansion: 0 == Approx( 1e-05 ) -ApproxTests.cpp:77: +ApproxTests.cpp:78: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: 1.234 == Approx( 1.234 ) -ApproxTests.cpp:78: +ApproxTests.cpp:79: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) with expansion: 1.234 == Approx( 1.234 ) -ApproxTests.cpp:79: ------------------------------------------------------------------------------- ./succeeding/Approx/custom ............................................................................... +ApproxTests.cpp:93: PASSED: REQUIRE( d == approx( 1.23 ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:93: +ApproxTests.cpp:94: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: 1.23 == Approx( 1.22 ) -ApproxTests.cpp:94: +ApproxTests.cpp:95: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: 1.23 == Approx( 1.24 ) -ApproxTests.cpp:95: +ApproxTests.cpp:96: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: 1.23 != Approx( 1.25 ) -ApproxTests.cpp:96: +ApproxTests.cpp:98: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:98: +ApproxTests.cpp:99: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: Approx( 1.23 ) == 1.22 -ApproxTests.cpp:99: +ApproxTests.cpp:100: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: Approx( 1.23 ) == 1.24 -ApproxTests.cpp:100: +ApproxTests.cpp:101: PASSED: REQUIRE( approx( d ) != 1.25 ) with expansion: Approx( 1.23 ) != 1.25 -ApproxTests.cpp:101: + +------------------------------------------------------------------------------- +Approximate PI +............................................................................... + +ApproxTests.cpp:110: +PASSED: + REQUIRE( divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) ) +with expansion: + 3.142857142857143 == Approx( 3.141 ) + +ApproxTests.cpp:111: +PASSED: + REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) +with expansion: + 3.142857142857143 != Approx( 3.141 ) ------------------------------------------------------------------------------- ./succeeding/TestClass/succeedingCase ............................................................................... +ClassTests.cpp:24: PASSED: REQUIRE( s == "hello" ) with expansion: "hello" == "hello" -ClassTests.cpp:24: ------------------------------------------------------------------------------- ./failing/TestClass/failingCase ............................................................................... -FAILED: +ClassTests.cpp:28: FAILED: REQUIRE( s == "world" ) with expansion: "hello" == "world" -ClassTests.cpp:28: ------------------------------------------------------------------------------- ./succeeding/Fixture/succeedingCase ............................................................................... +ClassTests.cpp:47: PASSED: REQUIRE( m_a == 1 ) with expansion: 1 == 1 -ClassTests.cpp:47: ------------------------------------------------------------------------------- ./failing/Fixture/failingCase ............................................................................... -FAILED: +ClassTests.cpp:55: FAILED: REQUIRE( m_a == 2 ) with expansion: 1 == 2 -ClassTests.cpp:55: ------------------------------------------------------------------------------- ./succeeding/conditions/equality ............................................................................... +ConditionTests.cpp:55: PASSED: REQUIRE( data.int_seven == 7 ) with expansion: 7 == 7 -ConditionTests.cpp:55: +ConditionTests.cpp:56: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: 9.1 == Approx( 9.1 ) -ConditionTests.cpp:56: +ConditionTests.cpp:57: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: - 3.14159 == Approx( 3.14159 ) -ConditionTests.cpp:57: + 3.1415926535 == Approx( 3.14159 ) +ConditionTests.cpp:58: PASSED: REQUIRE( data.str_hello == "hello" ) with expansion: "hello" == "hello" -ConditionTests.cpp:58: +ConditionTests.cpp:59: PASSED: REQUIRE( "hello" == data.str_hello ) with expansion: "hello" == "hello" -ConditionTests.cpp:59: +ConditionTests.cpp:60: PASSED: REQUIRE( data.str_hello.size() == 5 ) with expansion: 5 == 5 -ConditionTests.cpp:60: +ConditionTests.cpp:63: PASSED: REQUIRE( x == Approx( 1.3 ) ) with expansion: 1.3 == Approx( 1.3 ) -ConditionTests.cpp:63: ------------------------------------------------------------------------------- ./failing/conditions/equality ............................................................................... -FAILED: +ConditionTests.cpp:71: FAILED: CHECK( data.int_seven == 6 ) with expansion: 7 == 6 -ConditionTests.cpp:71: -FAILED: +ConditionTests.cpp:72: FAILED: CHECK( data.int_seven == 8 ) with expansion: 7 == 8 -ConditionTests.cpp:72: -FAILED: +ConditionTests.cpp:73: FAILED: CHECK( data.int_seven == 0 ) with expansion: 7 == 0 -ConditionTests.cpp:73: -FAILED: +ConditionTests.cpp:74: FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: 9.1 == Approx( 9.11 ) -ConditionTests.cpp:74: -FAILED: +ConditionTests.cpp:75: FAILED: CHECK( data.float_nine_point_one == Approx( 9.0f ) ) with expansion: 9.1 == Approx( 9 ) -ConditionTests.cpp:75: -FAILED: +ConditionTests.cpp:76: FAILED: CHECK( data.float_nine_point_one == Approx( 1 ) ) with expansion: 9.1 == Approx( 1 ) -ConditionTests.cpp:76: -FAILED: +ConditionTests.cpp:77: FAILED: CHECK( data.float_nine_point_one == Approx( 0 ) ) with expansion: 9.1 == Approx( 0 ) -ConditionTests.cpp:77: -FAILED: +ConditionTests.cpp:78: FAILED: CHECK( data.double_pi == Approx( 3.1415 ) ) with expansion: - 3.14159 == Approx( 3.1415 ) -ConditionTests.cpp:78: + 3.1415926535 == Approx( 3.1415 ) -FAILED: +ConditionTests.cpp:79: FAILED: CHECK( data.str_hello == "goodbye" ) with expansion: "hello" == "goodbye" -ConditionTests.cpp:79: -FAILED: +ConditionTests.cpp:80: FAILED: CHECK( data.str_hello == "hell" ) with expansion: "hello" == "hell" -ConditionTests.cpp:80: -FAILED: +ConditionTests.cpp:81: FAILED: CHECK( data.str_hello == "hello1" ) with expansion: "hello" == "hello1" -ConditionTests.cpp:81: -FAILED: +ConditionTests.cpp:82: FAILED: CHECK( data.str_hello.size() == 6 ) with expansion: 5 == 6 -ConditionTests.cpp:82: -FAILED: +ConditionTests.cpp:85: FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: 1.3 == Approx( 1.301 ) -ConditionTests.cpp:85: ------------------------------------------------------------------------------- ./succeeding/conditions/inequality ............................................................................... +ConditionTests.cpp:93: PASSED: REQUIRE( data.int_seven != 6 ) with expansion: 7 != 6 -ConditionTests.cpp:93: +ConditionTests.cpp:94: PASSED: REQUIRE( data.int_seven != 8 ) with expansion: 7 != 8 -ConditionTests.cpp:94: +ConditionTests.cpp:95: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.11f ) ) with expansion: 9.1 != Approx( 9.11 ) -ConditionTests.cpp:95: +ConditionTests.cpp:96: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.0f ) ) with expansion: 9.1 != Approx( 9 ) -ConditionTests.cpp:96: +ConditionTests.cpp:97: PASSED: REQUIRE( data.float_nine_point_one != Approx( 1 ) ) with expansion: 9.1 != Approx( 1 ) -ConditionTests.cpp:97: +ConditionTests.cpp:98: PASSED: REQUIRE( data.float_nine_point_one != Approx( 0 ) ) with expansion: 9.1 != Approx( 0 ) -ConditionTests.cpp:98: +ConditionTests.cpp:99: PASSED: REQUIRE( data.double_pi != Approx( 3.1415 ) ) with expansion: - 3.14159 != Approx( 3.1415 ) -ConditionTests.cpp:99: + 3.1415926535 != Approx( 3.1415 ) +ConditionTests.cpp:100: PASSED: REQUIRE( data.str_hello != "goodbye" ) with expansion: "hello" != "goodbye" -ConditionTests.cpp:100: +ConditionTests.cpp:101: PASSED: REQUIRE( data.str_hello != "hell" ) with expansion: "hello" != "hell" -ConditionTests.cpp:101: +ConditionTests.cpp:102: PASSED: REQUIRE( data.str_hello != "hello1" ) with expansion: "hello" != "hello1" -ConditionTests.cpp:102: +ConditionTests.cpp:103: PASSED: REQUIRE( data.str_hello.size() != 6 ) with expansion: 5 != 6 -ConditionTests.cpp:103: ------------------------------------------------------------------------------- ./failing/conditions/inequality ............................................................................... -FAILED: +ConditionTests.cpp:111: FAILED: CHECK( data.int_seven != 7 ) with expansion: 7 != 7 -ConditionTests.cpp:111: -FAILED: +ConditionTests.cpp:112: FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: 9.1 != Approx( 9.1 ) -ConditionTests.cpp:112: -FAILED: +ConditionTests.cpp:113: FAILED: CHECK( data.double_pi != Approx( 3.1415926535 ) ) with expansion: - 3.14159 != Approx( 3.14159 ) -ConditionTests.cpp:113: + 3.1415926535 != Approx( 3.14159 ) -FAILED: +ConditionTests.cpp:114: FAILED: CHECK( data.str_hello != "hello" ) with expansion: "hello" != "hello" -ConditionTests.cpp:114: -FAILED: +ConditionTests.cpp:115: FAILED: CHECK( data.str_hello.size() != 5 ) with expansion: 5 != 5 -ConditionTests.cpp:115: ------------------------------------------------------------------------------- ./succeeding/conditions/ordered ............................................................................... +ConditionTests.cpp:124: PASSED: REQUIRE( data.int_seven < 8 ) with expansion: 7 < 8 -ConditionTests.cpp:124: +ConditionTests.cpp:125: PASSED: REQUIRE( data.int_seven > 6 ) with expansion: 7 > 6 -ConditionTests.cpp:125: +ConditionTests.cpp:126: PASSED: REQUIRE( data.int_seven > 0 ) with expansion: 7 > 0 -ConditionTests.cpp:126: +ConditionTests.cpp:127: PASSED: REQUIRE( data.int_seven > -1 ) with expansion: 7 > -1 -ConditionTests.cpp:127: +ConditionTests.cpp:129: PASSED: REQUIRE( data.int_seven >= 7 ) with expansion: 7 >= 7 -ConditionTests.cpp:129: +ConditionTests.cpp:130: PASSED: REQUIRE( data.int_seven >= 6 ) with expansion: 7 >= 6 -ConditionTests.cpp:130: +ConditionTests.cpp:131: PASSED: REQUIRE( data.int_seven <= 7 ) with expansion: 7 <= 7 -ConditionTests.cpp:131: +ConditionTests.cpp:132: PASSED: REQUIRE( data.int_seven <= 8 ) with expansion: 7 <= 8 -ConditionTests.cpp:132: +ConditionTests.cpp:134: PASSED: REQUIRE( data.float_nine_point_one > 9 ) with expansion: 9.1 > 9 -ConditionTests.cpp:134: +ConditionTests.cpp:135: PASSED: REQUIRE( data.float_nine_point_one < 10 ) with expansion: 9.1 < 10 -ConditionTests.cpp:135: +ConditionTests.cpp:136: PASSED: REQUIRE( data.float_nine_point_one < 9.2 ) with expansion: - 9.1 < 9.2 -ConditionTests.cpp:136: + 9.1 < 9.199999999999999 +ConditionTests.cpp:138: PASSED: REQUIRE( data.str_hello <= "hello" ) with expansion: "hello" <= "hello" -ConditionTests.cpp:138: +ConditionTests.cpp:139: PASSED: REQUIRE( data.str_hello >= "hello" ) with expansion: "hello" >= "hello" -ConditionTests.cpp:139: +ConditionTests.cpp:141: PASSED: REQUIRE( data.str_hello < "hellp" ) with expansion: "hello" < "hellp" -ConditionTests.cpp:141: +ConditionTests.cpp:142: PASSED: REQUIRE( data.str_hello < "zebra" ) with expansion: "hello" < "zebra" -ConditionTests.cpp:142: +ConditionTests.cpp:143: PASSED: REQUIRE( data.str_hello > "hellm" ) with expansion: "hello" > "hellm" -ConditionTests.cpp:143: +ConditionTests.cpp:144: PASSED: REQUIRE( data.str_hello > "a" ) with expansion: "hello" > "a" -ConditionTests.cpp:144: ------------------------------------------------------------------------------- ./failing/conditions/ordered ............................................................................... -FAILED: +ConditionTests.cpp:152: FAILED: CHECK( data.int_seven > 7 ) with expansion: 7 > 7 -ConditionTests.cpp:152: -FAILED: +ConditionTests.cpp:153: FAILED: CHECK( data.int_seven < 7 ) with expansion: 7 < 7 -ConditionTests.cpp:153: -FAILED: +ConditionTests.cpp:154: FAILED: CHECK( data.int_seven > 8 ) with expansion: 7 > 8 -ConditionTests.cpp:154: -FAILED: +ConditionTests.cpp:155: FAILED: CHECK( data.int_seven < 6 ) with expansion: 7 < 6 -ConditionTests.cpp:155: -FAILED: +ConditionTests.cpp:156: FAILED: CHECK( data.int_seven < 0 ) with expansion: 7 < 0 -ConditionTests.cpp:156: -FAILED: +ConditionTests.cpp:157: FAILED: CHECK( data.int_seven < -1 ) with expansion: 7 < -1 -ConditionTests.cpp:157: -FAILED: +ConditionTests.cpp:159: FAILED: CHECK( data.int_seven >= 8 ) with expansion: 7 >= 8 -ConditionTests.cpp:159: -FAILED: +ConditionTests.cpp:160: FAILED: CHECK( data.int_seven <= 6 ) with expansion: 7 <= 6 -ConditionTests.cpp:160: -FAILED: +ConditionTests.cpp:162: FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: 9.1 < 9 -ConditionTests.cpp:162: -FAILED: +ConditionTests.cpp:163: FAILED: CHECK( data.float_nine_point_one > 10 ) with expansion: 9.1 > 10 -ConditionTests.cpp:163: -FAILED: +ConditionTests.cpp:164: FAILED: CHECK( data.float_nine_point_one > 9.2 ) with expansion: - 9.1 > 9.2 -ConditionTests.cpp:164: + 9.1 > 9.199999999999999 -FAILED: +ConditionTests.cpp:166: FAILED: CHECK( data.str_hello > "hello" ) with expansion: "hello" > "hello" -ConditionTests.cpp:166: -FAILED: +ConditionTests.cpp:167: FAILED: CHECK( data.str_hello < "hello" ) with expansion: "hello" < "hello" -ConditionTests.cpp:167: -FAILED: +ConditionTests.cpp:168: FAILED: CHECK( data.str_hello > "hellp" ) with expansion: "hello" > "hellp" -ConditionTests.cpp:168: -FAILED: +ConditionTests.cpp:169: FAILED: CHECK( data.str_hello > "z" ) with expansion: "hello" > "z" -ConditionTests.cpp:169: -FAILED: +ConditionTests.cpp:170: FAILED: CHECK( data.str_hello < "hellm" ) with expansion: "hello" < "hellm" -ConditionTests.cpp:170: -FAILED: +ConditionTests.cpp:171: FAILED: CHECK( data.str_hello < "a" ) with expansion: "hello" < "a" -ConditionTests.cpp:171: -FAILED: +ConditionTests.cpp:173: FAILED: CHECK( data.str_hello >= "z" ) with expansion: "hello" >= "z" -ConditionTests.cpp:173: -FAILED: +ConditionTests.cpp:174: FAILED: CHECK( data.str_hello <= "a" ) with expansion: "hello" <= "a" -ConditionTests.cpp:174: ------------------------------------------------------------------------------- ./succeeding/conditions/int literals ............................................................................... +ConditionTests.cpp:188: PASSED: REQUIRE( i == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:188: +ConditionTests.cpp:189: PASSED: REQUIRE( ui == 2 ) with expansion: 2 == 2 -ConditionTests.cpp:189: +ConditionTests.cpp:190: PASSED: REQUIRE( l == 3 ) with expansion: 3 == 3 -ConditionTests.cpp:190: +ConditionTests.cpp:191: PASSED: REQUIRE( ul == 4 ) with expansion: 4 == 4 -ConditionTests.cpp:191: +ConditionTests.cpp:192: PASSED: REQUIRE( c == 5 ) with expansion: 5 == 5 -ConditionTests.cpp:192: +ConditionTests.cpp:193: PASSED: REQUIRE( uc == 6 ) with expansion: 6 == 6 -ConditionTests.cpp:193: +ConditionTests.cpp:195: PASSED: REQUIRE( 1 == i ) with expansion: 1 == 1 -ConditionTests.cpp:195: +ConditionTests.cpp:196: PASSED: REQUIRE( 2 == ui ) with expansion: 2 == 2 -ConditionTests.cpp:196: +ConditionTests.cpp:197: PASSED: REQUIRE( 3 == l ) with expansion: 3 == 3 -ConditionTests.cpp:197: +ConditionTests.cpp:198: PASSED: REQUIRE( 4 == ul ) with expansion: 4 == 4 -ConditionTests.cpp:198: +ConditionTests.cpp:199: PASSED: REQUIRE( 5 == c ) with expansion: 5 == 5 -ConditionTests.cpp:199: +ConditionTests.cpp:200: PASSED: REQUIRE( 6 == uc ) with expansion: 6 == 6 -ConditionTests.cpp:200: +ConditionTests.cpp:202: PASSED: REQUIRE( (std::numeric_limits::max)() > ul ) with expansion: 0x > 4 -ConditionTests.cpp:202: ------------------------------------------------------------------------------- ./succeeding/conditions//long_to_unsigned_x ............................................................................... +ConditionTests.cpp:223: PASSED: REQUIRE( long_var == unsigned_char_var ) with expansion: 1 == 1 -ConditionTests.cpp:223: +ConditionTests.cpp:224: PASSED: REQUIRE( long_var == unsigned_short_var ) with expansion: 1 == 1 -ConditionTests.cpp:224: +ConditionTests.cpp:225: PASSED: REQUIRE( long_var == unsigned_int_var ) with expansion: 1 == 1 -ConditionTests.cpp:225: +ConditionTests.cpp:226: PASSED: REQUIRE( long_var == unsigned_long_var ) with expansion: 1 == 1 -ConditionTests.cpp:226: ------------------------------------------------------------------------------- ./succeeding/conditions/const ints to int literal ............................................................................... +ConditionTests.cpp:237: PASSED: REQUIRE( unsigned_char_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:237: +ConditionTests.cpp:238: PASSED: REQUIRE( unsigned_short_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:238: +ConditionTests.cpp:239: PASSED: REQUIRE( unsigned_int_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:239: +ConditionTests.cpp:240: PASSED: REQUIRE( unsigned_long_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:240: ------------------------------------------------------------------------------- ./succeeding/conditions/negative ints ............................................................................... +ConditionTests.cpp:246: PASSED: CHECK( ( -1 > 2u ) ) with expansion: true -ConditionTests.cpp:246: +ConditionTests.cpp:247: PASSED: CHECK( -1 > 2u ) with expansion: -1 > 2 -ConditionTests.cpp:247: +ConditionTests.cpp:249: PASSED: CHECK( ( 2u < -1 ) ) with expansion: true -ConditionTests.cpp:249: +ConditionTests.cpp:250: PASSED: CHECK( 2u < -1 ) with expansion: 2 < -1 -ConditionTests.cpp:250: +ConditionTests.cpp:253: PASSED: CHECK( ( minInt > 2u ) ) with expansion: true -ConditionTests.cpp:253: +ConditionTests.cpp:254: PASSED: CHECK( minInt > 2u ) with expansion: -2147483648 > 2 -ConditionTests.cpp:254: ------------------------------------------------------------------------------- ./succeeding/conditions/computed ints ............................................................................... +ConditionTests.cpp:269: PASSED: CHECK( 54 == 6*9 ) with expansion: 54 == 54 -ConditionTests.cpp:269: ------------------------------------------------------------------------------- ./succeeding/conditions/ptr ............................................................................... +ConditionTests.cpp:285: PASSED: REQUIRE( p == __null ) with expansion: __null == 0 -ConditionTests.cpp:285: +ConditionTests.cpp:286: PASSED: REQUIRE( p == pNULL ) with expansion: __null == __null -ConditionTests.cpp:286: +ConditionTests.cpp:291: PASSED: REQUIRE( p != __null ) with expansion: 0x != 0 -ConditionTests.cpp:291: +ConditionTests.cpp:294: PASSED: REQUIRE( cp != __null ) with expansion: 0x != 0 -ConditionTests.cpp:294: +ConditionTests.cpp:297: PASSED: REQUIRE( cpc != __null ) with expansion: 0x != 0 -ConditionTests.cpp:297: +ConditionTests.cpp:299: PASSED: REQUIRE( returnsNull() == __null ) with expansion: {null string} == 0 -ConditionTests.cpp:299: +ConditionTests.cpp:300: PASSED: REQUIRE( returnsConstNull() == __null ) with expansion: {null string} == 0 -ConditionTests.cpp:300: +ConditionTests.cpp:302: PASSED: REQUIRE( __null != p ) with expansion: 0 != 0x -ConditionTests.cpp:302: ------------------------------------------------------------------------------- ./succeeding/conditions/not ............................................................................... +ConditionTests.cpp:317: PASSED: REQUIRE( false == false ) -ConditionTests.cpp:317: +ConditionTests.cpp:318: PASSED: REQUIRE( true == true ) -ConditionTests.cpp:318: +ConditionTests.cpp:319: PASSED: REQUIRE( !false ) with expansion: true -ConditionTests.cpp:319: +ConditionTests.cpp:320: PASSED: REQUIRE_FALSE( !false ) -ConditionTests.cpp:320: +ConditionTests.cpp:322: PASSED: REQUIRE( !falseValue ) with expansion: true -ConditionTests.cpp:322: +ConditionTests.cpp:323: PASSED: REQUIRE_FALSE( !falseValue ) with expansion: !false -ConditionTests.cpp:323: +ConditionTests.cpp:325: PASSED: REQUIRE( !(1 == 2) ) with expansion: true -ConditionTests.cpp:325: +ConditionTests.cpp:326: PASSED: REQUIRE_FALSE( !1 == 2 ) with expansion: !(1 == 2) -ConditionTests.cpp:326: ------------------------------------------------------------------------------- ./failing/conditions/not ............................................................................... -FAILED: +ConditionTests.cpp:334: FAILED: CHECK( false != false ) -ConditionTests.cpp:334: -FAILED: +ConditionTests.cpp:335: FAILED: CHECK( true != true ) -ConditionTests.cpp:335: -FAILED: +ConditionTests.cpp:336: FAILED: CHECK( !true ) with expansion: false -ConditionTests.cpp:336: -FAILED: +ConditionTests.cpp:337: FAILED: CHECK_FALSE( !true ) -ConditionTests.cpp:337: -FAILED: +ConditionTests.cpp:339: FAILED: CHECK( !trueValue ) with expansion: false -ConditionTests.cpp:339: -FAILED: +ConditionTests.cpp:340: FAILED: CHECK_FALSE( !trueValue ) with expansion: !true -ConditionTests.cpp:340: -FAILED: +ConditionTests.cpp:342: FAILED: CHECK( !(1 == 1) ) with expansion: false -ConditionTests.cpp:342: -FAILED: +ConditionTests.cpp:343: FAILED: CHECK_FALSE( !1 == 1 ) with expansion: !(1 == 1) -ConditionTests.cpp:343: ------------------------------------------------------------------------------- ./succeeding/exceptions/explicit ............................................................................... +ExceptionTests.cpp:39: PASSED: REQUIRE_THROWS_AS( thisThrows() ) -ExceptionTests.cpp:39: +ExceptionTests.cpp:40: PASSED: REQUIRE_NOTHROW( thisDoesntThrow() ) -ExceptionTests.cpp:40: +ExceptionTests.cpp:41: PASSED: REQUIRE_THROWS( thisThrows() ) -ExceptionTests.cpp:41: ------------------------------------------------------------------------------- ./failing/exceptions/explicit ............................................................................... -FAILED: +ExceptionTests.cpp:47: FAILED: CHECK_THROWS_AS( thisThrows() ) due to unexpected exception with message: expected exception -ExceptionTests.cpp:47: -FAILED: +ExceptionTests.cpp:48: FAILED: CHECK_THROWS_AS( thisDoesntThrow() ) because no exception was thrown where one was expected: -ExceptionTests.cpp:48: -FAILED: +ExceptionTests.cpp:49: FAILED: CHECK_NOTHROW( thisThrows() ) due to unexpected exception with message: expected exception -ExceptionTests.cpp:49: ------------------------------------------------------------------------------- ./failing/exceptions/implicit ............................................................................... -FAILED: +ExceptionTests.cpp:52: FAILED: due to unexpected exception with message: unexpected exception -ExceptionTests.cpp:52: ------------------------------------------------------------------------------- ./failing/exceptions/implicit/2 ............................................................................... +ExceptionTests.cpp:60: PASSED: CHECK( 1 == 1 ) -ExceptionTests.cpp:60: -FAILED: +ExceptionTests.cpp:60: FAILED: {Unknown expression after the reported line} due to unexpected exception with message: unexpected exception -ExceptionTests.cpp:60: ------------------------------------------------------------------------------- ./failing/exceptions/implicit/3 section name ............................................................................... -FAILED: +ExceptionTests.cpp:66: FAILED: due to unexpected exception with message: unexpected exception -ExceptionTests.cpp:66: ------------------------------------------------------------------------------- ./succeeding/exceptions/implicit @@ -1081,940 +1044,936 @@ No assertions in test case, './succeeding/exceptions/implicit' ./failing/exceptions/custom ............................................................................... -FAILED: +ExceptionTests.cpp:110: FAILED: due to unexpected exception with message: custom exception -ExceptionTests.cpp:110: ------------------------------------------------------------------------------- ./failing/exceptions/custom/nothrow ............................................................................... -FAILED: +ExceptionTests.cpp:117: FAILED: REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) due to unexpected exception with message: unexpected custom exception -ExceptionTests.cpp:117: ------------------------------------------------------------------------------- ./failing/exceptions/custom/throw ............................................................................... -FAILED: +ExceptionTests.cpp:122: FAILED: REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) due to unexpected exception with message: custom exception - not std -ExceptionTests.cpp:122: ------------------------------------------------------------------------------- ./failing/exceptions/custom/double ............................................................................... -FAILED: +ExceptionTests.cpp:126: FAILED: due to unexpected exception with message: 3.14 -ExceptionTests.cpp:126: ------------------------------------------------------------------------------- ./succeeding/exceptions/notimplemented ............................................................................... +ExceptionTests.cpp:137: PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) -ExceptionTests.cpp:137: ------------------------------------------------------------------------------- ./succeeding/generators/1 ............................................................................... +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27: +GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -GeneratorTests.cpp:26: +GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -GeneratorTests.cpp:27: ------------------------------------------------------------------------------- ./succeeding/generators/2 ............................................................................... +GeneratorTests.cpp:40: PASSED: CATCH_REQUIRE( i->first == i->second-1 ) with expansion: 0 == 0 -GeneratorTests.cpp:40: +GeneratorTests.cpp:40: PASSED: CATCH_REQUIRE( i->first == i->second-1 ) with expansion: 2 == 2 -GeneratorTests.cpp:40: ------------------------------------------------------------------------------- ./succeeding/message ............................................................................... +MessageTests.cpp:14: warning: this is a message this is a warning -MessageTests.cpp:14: No assertions in test case, './succeeding/message' @@ -2023,88 +1982,82 @@ No assertions in test case, './succeeding/message' ./succeeding/succeed ............................................................................... +MessageTests.cpp:18: PASSED: with message: this is a success -MessageTests.cpp:18: ------------------------------------------------------------------------------- ./failing/message/info/1 ............................................................................... -FAILED: +MessageTests.cpp:26: FAILED: REQUIRE( a == 1 ) with expansion: 2 == 1 with messages: this message should be logged so should this -MessageTests.cpp:26: ------------------------------------------------------------------------------- ./mixed/message/info/2 ............................................................................... +MessageTests.cpp:33: PASSED: CHECK( a == 2 ) with expansion: 2 == 2 with message: this message should not be logged -MessageTests.cpp:33: -FAILED: +MessageTests.cpp:37: FAILED: CHECK( a == 1 ) with expansion: 2 == 1 with message: this message should be logged -MessageTests.cpp:37: -FAILED: +MessageTests.cpp:41: FAILED: CHECK( a == 0 ) with expansion: 2 == 0 with message: and this, but later -MessageTests.cpp:41: +MessageTests.cpp:45: PASSED: CHECK( a == 2 ) with expansion: 2 == 2 with message: but not this -MessageTests.cpp:45: ------------------------------------------------------------------------------- ./failing/message/fail ............................................................................... -FAILED: +MessageTests.cpp:51: FAILED: explicitly with message: This is a failure -MessageTests.cpp:51: ------------------------------------------------------------------------------- ./failing/message/sections one ............................................................................... -FAILED: +MessageTests.cpp:58: FAILED: explicitly with message: Message from section one -MessageTests.cpp:58: ------------------------------------------------------------------------------- ./failing/message/sections two ............................................................................... -FAILED: +MessageTests.cpp:63: FAILED: explicitly with message: Message from section two -MessageTests.cpp:63: Message from section one ------------------------------------------------------------------------------- @@ -2128,6 +2081,7 @@ No assertions in section, 'two' ./mixed/message/scoped ............................................................................... +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: @@ -2135,8 +2089,8 @@ with expansion: with messages: current counter 0 i := 0 -MessageTests.cpp:86: +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: @@ -2144,8 +2098,8 @@ with expansion: with messages: current counter 1 i := 1 -MessageTests.cpp:86: +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: @@ -2153,8 +2107,8 @@ with expansion: with messages: current counter 2 i := 2 -MessageTests.cpp:86: +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: @@ -2162,8 +2116,8 @@ with expansion: with messages: current counter 3 i := 3 -MessageTests.cpp:86: +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: @@ -2171,8 +2125,8 @@ with expansion: with messages: current counter 4 i := 4 -MessageTests.cpp:86: +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: @@ -2180,8 +2134,8 @@ with expansion: with messages: current counter 5 i := 5 -MessageTests.cpp:86: +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: @@ -2189,8 +2143,8 @@ with expansion: with messages: current counter 6 i := 6 -MessageTests.cpp:86: +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: @@ -2198,8 +2152,8 @@ with expansion: with messages: current counter 7 i := 7 -MessageTests.cpp:86: +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: @@ -2207,8 +2161,8 @@ with expansion: with messages: current counter 8 i := 8 -MessageTests.cpp:86: +MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) with expansion: @@ -2216,24 +2170,22 @@ with expansion: with messages: current counter 9 i := 9 -MessageTests.cpp:86: -FAILED: +MessageTests.cpp:86: FAILED: REQUIRE( i < 10 ) with expansion: 10 < 10 with messages: current counter 10 i := 10 -MessageTests.cpp:86: ------------------------------------------------------------------------------- ./succeeding/nofail ............................................................................... +MessageTests.cpp:92: FAILED - but was ok: CHECK_NOFAIL( 1 == 2 ) -MessageTests.cpp:92: No assertions in test case, './succeeding/nofail' @@ -2249,55 +2201,54 @@ No assertions in test case, 'just info' just failure ............................................................................... -FAILED: +MessageTests.cpp:101: FAILED: explicitly with message: Previous info should not be seen -MessageTests.cpp:101: ------------------------------------------------------------------------------- ./succeeding/Misc/Sections s1 ............................................................................... -PASSED: - REQUIRE( a != b ) -with expansion: - 1 != 2 MiscTests.cpp:25: +PASSED: + REQUIRE( a != b ) +with expansion: + 1 != 2 +MiscTests.cpp:26: PASSED: REQUIRE( b != a ) with expansion: 2 != 1 -MiscTests.cpp:26: ------------------------------------------------------------------------------- ./succeeding/Misc/Sections s2 ............................................................................... +MiscTests.cpp:31: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:31: ------------------------------------------------------------------------------- ./succeeding/Misc/Sections/nested s1 ............................................................................... +MiscTests.cpp:42: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:42: +MiscTests.cpp:43: PASSED: REQUIRE( b != a ) with expansion: 2 != 1 -MiscTests.cpp:43: ------------------------------------------------------------------------------- ./succeeding/Misc/Sections/nested @@ -2305,11 +2256,11 @@ MiscTests.cpp:43: s2 ............................................................................... +MiscTests.cpp:47: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:47: ------------------------------------------------------------------------------- ./mixed/Misc/Sections/nested2 @@ -2317,11 +2268,10 @@ MiscTests.cpp:47: s2 ............................................................................... -FAILED: +MiscTests.cpp:61: FAILED: REQUIRE( a == b ) with expansion: 1 == 2 -MiscTests.cpp:61: ------------------------------------------------------------------------------- ./mixed/Misc/Sections/nested2 @@ -2329,11 +2279,11 @@ MiscTests.cpp:61: s3 ............................................................................... +MiscTests.cpp:66: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:66: ------------------------------------------------------------------------------- ./mixed/Misc/Sections/nested2 @@ -2341,11 +2291,11 @@ MiscTests.cpp:66: s4 ............................................................................... +MiscTests.cpp:70: PASSED: REQUIRE( a < b ) with expansion: 1 < 2 -MiscTests.cpp:70: ------------------------------------------------------------------------------- ./Sections/nested/a/b @@ -2378,79 +2328,72 @@ No assertions in section, 'f (leaf)' s1 ............................................................................... -FAILED: +MiscTests.cpp:103: FAILED: CHECK( b > a ) with expansion: 0 > 1 -MiscTests.cpp:103: ------------------------------------------------------------------------------- ./mixed/Misc/loops ............................................................................... -FAILED: +MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[0] (1) is even -MiscTests.cpp:115: -FAILED: +MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[1] (1) is even -MiscTests.cpp:115: +MiscTests.cpp:115: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 0 == 0 with message: Testing if fib[2] (2) is even -MiscTests.cpp:115: -FAILED: +MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[3] (3) is even -MiscTests.cpp:115: -FAILED: +MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[4] (5) is even -MiscTests.cpp:115: +MiscTests.cpp:115: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 0 == 0 with message: Testing if fib[5] (8) is even -MiscTests.cpp:115: -FAILED: +MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[6] (13) is even -MiscTests.cpp:115: -FAILED: +MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[7] (21) is even -MiscTests.cpp:115: Some information An error @@ -2465,92 +2408,87 @@ No assertions in test case, './succeeding/Misc/stdout,stderr' ./succeeding/Misc/null strings ............................................................................... +MiscTests.cpp:133: PASSED: REQUIRE( makeString( false ) != static_cast(__null) ) with expansion: "valid string" != {null string} -MiscTests.cpp:133: +MiscTests.cpp:134: PASSED: REQUIRE( makeString( true ) == static_cast(__null) ) with expansion: {null string} == {null string} -MiscTests.cpp:134: ------------------------------------------------------------------------------- ./failing/info ............................................................................... -FAILED: +MiscTests.cpp:142: FAILED: REQUIRE( false ) with messages: hi i := 7 -MiscTests.cpp:142: ------------------------------------------------------------------------------- ./succeeding/checkedif ............................................................................... +MiscTests.cpp:147: PASSED: CHECKED_IF( flag ) with expansion: true -MiscTests.cpp:147: +MiscTests.cpp:155: PASSED: REQUIRE( testCheckedIf( true ) ) with expansion: true -MiscTests.cpp:155: ------------------------------------------------------------------------------- ./failing/checkedif ............................................................................... -FAILED: +MiscTests.cpp:147: FAILED: CHECKED_IF( flag ) with expansion: false -MiscTests.cpp:147: -FAILED: +MiscTests.cpp:160: FAILED: REQUIRE( testCheckedIf( false ) ) with expansion: false -MiscTests.cpp:160: ------------------------------------------------------------------------------- ./succeeding/checkedelse ............................................................................... +MiscTests.cpp:165: PASSED: CHECKED_ELSE( flag ) with expansion: true -MiscTests.cpp:165: +MiscTests.cpp:173: PASSED: REQUIRE( testCheckedElse( true ) ) with expansion: true -MiscTests.cpp:173: ------------------------------------------------------------------------------- ./failing/checkedelse ............................................................................... -FAILED: +MiscTests.cpp:165: FAILED: CHECKED_ELSE( flag ) with expansion: false -MiscTests.cpp:165: -FAILED: +MiscTests.cpp:178: FAILED: REQUIRE( testCheckedElse( false ) ) with expansion: false -MiscTests.cpp:178: ------------------------------------------------------------------------------- ./misc/xmlentitycheck @@ -2572,163 +2510,158 @@ No assertions in section, 'encoded chars' ./manual/onechar ............................................................................... -FAILED: +MiscTests.cpp:196: FAILED: REQUIRE( false ) with message: 3 -MiscTests.cpp:196: ------------------------------------------------------------------------------- ./succeeding/atomic if ............................................................................... +MiscTests.cpp:206: PASSED: REQUIRE( x == 0 ) with expansion: 0 == 0 -MiscTests.cpp:206: ------------------------------------------------------------------------------- ./succeeding/matchers ............................................................................... +MiscTests.cpp:216: PASSED: REQUIRE_THAT( testStringForMatching() Contains( "string" ) ) with expansion: "this string contains 'abc' as a substring" contains: "string" -MiscTests.cpp:216: +MiscTests.cpp:217: PASSED: CHECK_THAT( testStringForMatching() Contains( "abc" ) ) with expansion: "this string contains 'abc' as a substring" contains: "abc" -MiscTests.cpp:217: +MiscTests.cpp:219: PASSED: CHECK_THAT( testStringForMatching() StartsWith( "this" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "this" -MiscTests.cpp:219: +MiscTests.cpp:220: PASSED: CHECK_THAT( testStringForMatching() EndsWith( "substring" ) ) with expansion: "this string contains 'abc' as a substring" ends with: "substring" -MiscTests.cpp:220: ------------------------------------------------------------------------------- ./failing/matchers/Contains ............................................................................... -FAILED: +MiscTests.cpp:225: FAILED: CHECK_THAT( testStringForMatching() Contains( "not there" ) ) with expansion: "this string contains 'abc' as a substring" contains: "not there" -MiscTests.cpp:225: ------------------------------------------------------------------------------- ./failing/matchers/StartsWith ............................................................................... -FAILED: +MiscTests.cpp:230: FAILED: CHECK_THAT( testStringForMatching() StartsWith( "string" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "string" -MiscTests.cpp:230: ------------------------------------------------------------------------------- ./failing/matchers/EndsWith ............................................................................... -FAILED: +MiscTests.cpp:235: FAILED: CHECK_THAT( testStringForMatching() EndsWith( "this" ) ) with expansion: "this string contains 'abc' as a substring" ends with: "this" -MiscTests.cpp:235: ------------------------------------------------------------------------------- ./failing/matchers/Equals ............................................................................... -FAILED: +MiscTests.cpp:240: FAILED: CHECK_THAT( testStringForMatching() Equals( "something else" ) ) with expansion: "this string contains 'abc' as a substring" equals: "something else" -MiscTests.cpp:240: ------------------------------------------------------------------------------- ./succeeding/matchers/AllOf ............................................................................... +MiscTests.cpp:248: PASSED: CHECK_THAT( testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) -MiscTests.cpp:248: ------------------------------------------------------------------------------- ./succeeding/matchers/AnyOf ............................................................................... +MiscTests.cpp:252: PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -MiscTests.cpp:252: +MiscTests.cpp:253: PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) -MiscTests.cpp:253: ------------------------------------------------------------------------------- ./succeeding/matchers/Equals ............................................................................... +MiscTests.cpp:258: PASSED: CHECK_THAT( testStringForMatching() Equals( "this string contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" -MiscTests.cpp:258: ------------------------------------------------------------------------------- example/factorial ............................................................................... +MiscTests.cpp:269: PASSED: REQUIRE( Factorial(0) == 1 ) with expansion: 1 == 1 -MiscTests.cpp:269: +MiscTests.cpp:270: PASSED: REQUIRE( Factorial(1) == 1 ) with expansion: 1 == 1 -MiscTests.cpp:270: +MiscTests.cpp:271: PASSED: REQUIRE( Factorial(2) == 2 ) with expansion: 2 == 2 -MiscTests.cpp:271: +MiscTests.cpp:272: PASSED: REQUIRE( Factorial(3) == 6 ) with expansion: 6 == 6 -MiscTests.cpp:272: +MiscTests.cpp:273: PASSED: REQUIRE( Factorial(10) == 3628800 ) with expansion: 0x == 3628800 -MiscTests.cpp:273: ------------------------------------------------------------------------------- empty @@ -2741,9 +2674,9 @@ No assertions in test case, 'empty' Nice descriptive name ............................................................................... +MiscTests.cpp:282: warning: This one ran -MiscTests.cpp:282: No assertions in test case, 'Nice descriptive name' @@ -2768,135 +2701,135 @@ selftest/main selftest/expected result/failing tests ............................................................................... +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:114: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: ------------------------------------------------------------------------------- selftest/main @@ -2904,239 +2837,239 @@ selftest/main selftest/expected result/succeeding tests ............................................................................... +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: Message from section one Message from section two +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: Some information An error +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:103: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: Message from section one Message from section two @@ -3148,17 +3081,17 @@ selftest/main selftest/test counts/succeeding tests ............................................................................... +TestMain.cpp:40: PASSED: CHECK( totals.assertions.passed == 296 ) with expansion: 296 == 296 -TestMain.cpp:40: +TestMain.cpp:41: PASSED: CHECK( totals.assertions.failed == 0 ) with expansion: 0 == 0 -TestMain.cpp:41: ------------------------------------------------------------------------------- selftest/main @@ -3166,66 +3099,66 @@ selftest/main selftest/test counts/failing tests ............................................................................... +TestMain.cpp:47: PASSED: CHECK( totals.assertions.passed == 1 ) with expansion: 1 == 1 -TestMain.cpp:47: +TestMain.cpp:48: PASSED: CHECK( totals.assertions.failed == 73 ) with expansion: 73 == 73 -TestMain.cpp:48: ------------------------------------------------------------------------------- meta/Misc/Sections ............................................................................... +TestMain.cpp:57: PASSED: CHECK( totals.assertions.passed == 2 ) with expansion: 2 == 2 -TestMain.cpp:57: +TestMain.cpp:58: PASSED: CHECK( totals.assertions.failed == 1 ) with expansion: 1 == 1 -TestMain.cpp:58: ------------------------------------------------------------------------------- selftest/parser/2 default ............................................................................... +TestMain.cpp:97: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:97: +TestMain.cpp:99: PASSED: CHECK( config.shouldDebugBreak == false ) with expansion: false == false -TestMain.cpp:99: +TestMain.cpp:100: PASSED: CHECK( config.cutoff == -1 ) with expansion: -1 == -1 -TestMain.cpp:100: +TestMain.cpp:101: PASSED: CHECK( config.allowThrows == true ) with expansion: true == true -TestMain.cpp:101: +TestMain.cpp:102: PASSED: CHECK( config.reporter.empty() ) with expansion: true -TestMain.cpp:102: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3233,27 +3166,27 @@ selftest/parser/2 -t/1 ............................................................................... +TestMain.cpp:108: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:108: +TestMain.cpp:110: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:110: +TestMain.cpp:111: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:111: +TestMain.cpp:112: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true -TestMain.cpp:112: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3261,27 +3194,27 @@ selftest/parser/2 -t/exclude:1 ............................................................................... +TestMain.cpp:116: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:116: +TestMain.cpp:118: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:118: +TestMain.cpp:119: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:119: +TestMain.cpp:120: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true -TestMain.cpp:120: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3289,27 +3222,27 @@ selftest/parser/2 --test/1 ............................................................................... +TestMain.cpp:125: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:125: +TestMain.cpp:127: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:127: +TestMain.cpp:128: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:128: +TestMain.cpp:129: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true -TestMain.cpp:129: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3317,27 +3250,27 @@ selftest/parser/2 --test/exclude:1 ............................................................................... +TestMain.cpp:134: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:134: +TestMain.cpp:136: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:136: +TestMain.cpp:137: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:137: +TestMain.cpp:138: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true -TestMain.cpp:138: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3345,27 +3278,27 @@ selftest/parser/2 --test/exclude:2 ............................................................................... +TestMain.cpp:143: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:143: +TestMain.cpp:145: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:145: +TestMain.cpp:146: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:146: +TestMain.cpp:147: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true -TestMain.cpp:147: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3373,33 +3306,33 @@ selftest/parser/2 -t/2 ............................................................................... +TestMain.cpp:152: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:152: +TestMain.cpp:154: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:154: +TestMain.cpp:155: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:155: +TestMain.cpp:156: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true -TestMain.cpp:156: +TestMain.cpp:157: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ) with expansion: true -TestMain.cpp:157: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3407,12 +3340,12 @@ selftest/parser/2 -t/0 ............................................................................... +TestMain.cpp:162: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) ) with expansion: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" -TestMain.cpp:162: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3420,15 +3353,15 @@ selftest/parser/2 -r/console ............................................................................... +TestMain.cpp:169: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:169: +TestMain.cpp:171: PASSED: REQUIRE( config.reporter == "console" ) with expansion: "console" == "console" -TestMain.cpp:171: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3436,15 +3369,15 @@ selftest/parser/2 -r/xml ............................................................................... +TestMain.cpp:175: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:175: +TestMain.cpp:177: PASSED: REQUIRE( config.reporter == "xml" ) with expansion: "xml" == "xml" -TestMain.cpp:177: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3452,15 +3385,15 @@ selftest/parser/2 --reporter/junit ............................................................................... +TestMain.cpp:181: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:181: +TestMain.cpp:183: PASSED: REQUIRE( config.reporter == "junit" ) with expansion: "junit" == "junit" -TestMain.cpp:183: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3468,12 +3401,12 @@ selftest/parser/2 -r/error ............................................................................... +TestMain.cpp:187: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) ) with expansion: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" -TestMain.cpp:187: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3481,15 +3414,15 @@ selftest/parser/2 -b ............................................................................... +TestMain.cpp:194: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:194: +TestMain.cpp:196: PASSED: REQUIRE( config.shouldDebugBreak == true ) with expansion: true == true -TestMain.cpp:196: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3497,15 +3430,15 @@ selftest/parser/2 --break ............................................................................... +TestMain.cpp:200: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:200: +TestMain.cpp:202: PASSED: REQUIRE( config.shouldDebugBreak ) with expansion: true -TestMain.cpp:202: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3513,12 +3446,12 @@ selftest/parser/2 -b ............................................................................... +TestMain.cpp:206: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) ) with expansion: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" -TestMain.cpp:206: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3526,15 +3459,15 @@ selftest/parser/2 -a ............................................................................... +TestMain.cpp:213: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:213: +TestMain.cpp:215: PASSED: REQUIRE( config.cutoff == 1 ) with expansion: 1 == 1 -TestMain.cpp:215: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3542,15 +3475,15 @@ selftest/parser/2 -a/2 ............................................................................... +TestMain.cpp:219: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:219: +TestMain.cpp:221: PASSED: REQUIRE( config.cutoff == 2 ) with expansion: 2 == 2 -TestMain.cpp:221: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3558,12 +3491,12 @@ selftest/parser/2 -a/error/0 ............................................................................... +TestMain.cpp:225: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" -TestMain.cpp:225: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3571,12 +3504,12 @@ selftest/parser/2 -a/error/non numeric ............................................................................... +TestMain.cpp:229: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" -TestMain.cpp:229: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3584,12 +3517,12 @@ selftest/parser/2 -a/error/two args ............................................................................... +TestMain.cpp:233: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) ) with expansion: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" -TestMain.cpp:233: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3597,15 +3530,15 @@ selftest/parser/2 -nt ............................................................................... +TestMain.cpp:240: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:240: +TestMain.cpp:242: PASSED: REQUIRE( config.allowThrows == false ) with expansion: false == false -TestMain.cpp:242: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3613,15 +3546,15 @@ selftest/parser/2 --nothrow ............................................................................... +TestMain.cpp:246: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:246: +TestMain.cpp:248: PASSED: REQUIRE( config.allowThrows == false ) with expansion: false == false -TestMain.cpp:248: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3629,21 +3562,21 @@ selftest/parser/2 -o filename ............................................................................... +TestMain.cpp:255: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:255: +TestMain.cpp:257: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: "filename.ext" == "filename.ext" -TestMain.cpp:257: +TestMain.cpp:258: PASSED: REQUIRE( config.stream.empty() ) with expansion: true -TestMain.cpp:258: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3651,21 +3584,21 @@ selftest/parser/2 -o %stdout ............................................................................... +TestMain.cpp:262: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:262: +TestMain.cpp:264: PASSED: REQUIRE( config.stream == "stdout" ) with expansion: "stdout" == "stdout" -TestMain.cpp:264: +TestMain.cpp:265: PASSED: REQUIRE( config.outputFilename.empty() ) with expansion: true -TestMain.cpp:265: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3673,15 +3606,15 @@ selftest/parser/2 --out ............................................................................... +TestMain.cpp:269: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:269: +TestMain.cpp:271: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: "filename.ext" == "filename.ext" -TestMain.cpp:271: ------------------------------------------------------------------------------- selftest/parser/2 @@ -3689,386 +3622,383 @@ selftest/parser/2 -a -b ............................................................................... +TestMain.cpp:278: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:278: +TestMain.cpp:280: PASSED: CHECK( config.cutoff == 1 ) with expansion: 1 == 1 -TestMain.cpp:280: +TestMain.cpp:281: PASSED: CHECK( config.shouldDebugBreak ) with expansion: true -TestMain.cpp:281: +TestMain.cpp:282: PASSED: CHECK( config.allowThrows == false ) with expansion: false == false -TestMain.cpp:282: ------------------------------------------------------------------------------- selftest/test filter ............................................................................... +TestMain.cpp:291: PASSED: CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -TestMain.cpp:291: +TestMain.cpp:292: PASSED: CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:292: +TestMain.cpp:297: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:297: +TestMain.cpp:298: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -TestMain.cpp:298: +TestMain.cpp:300: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ) with expansion: true -TestMain.cpp:300: +TestMain.cpp:301: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ) with expansion: false == false -TestMain.cpp:301: ------------------------------------------------------------------------------- selftest/test filters ............................................................................... +TestMain.cpp:312: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -TestMain.cpp:312: +TestMain.cpp:314: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:314: +TestMain.cpp:315: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -TestMain.cpp:315: +TestMain.cpp:316: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ) with expansion: false == false -TestMain.cpp:316: ------------------------------------------------------------------------------- selftest/filter/prefix wildcard ............................................................................... +TestMain.cpp:322: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) with expansion: true -TestMain.cpp:322: +TestMain.cpp:323: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) with expansion: false == false -TestMain.cpp:323: ------------------------------------------------------------------------------- selftest/filter/wildcard at both ends ............................................................................... +TestMain.cpp:328: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) with expansion: true -TestMain.cpp:328: +TestMain.cpp:329: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ) with expansion: true -TestMain.cpp:329: +TestMain.cpp:330: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ) with expansion: true -TestMain.cpp:330: +TestMain.cpp:331: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ) with expansion: false == false -TestMain.cpp:331: ------------------------------------------------------------------------------- selftest/option parsers ............................................................................... +TestMain.cpp:351: PASSED: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) -TestMain.cpp:351: +TestMain.cpp:353: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:353: +TestMain.cpp:354: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:354: +TestMain.cpp:355: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true -TestMain.cpp:355: ------------------------------------------------------------------------------- selftest/tags one tag ............................................................................... +TestMain.cpp:369: PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:369: +TestMain.cpp:370: PASSED: CHECK( oneTag.hasTag( "one" ) ) with expansion: true -TestMain.cpp:370: +TestMain.cpp:371: PASSED: CHECK( oneTag.getTags().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:371: +TestMain.cpp:373: PASSED: CHECK( oneTag.matchesTags( p1 ) == true ) with expansion: true == true -TestMain.cpp:373: +TestMain.cpp:374: PASSED: CHECK( oneTag.matchesTags( p2 ) == true ) with expansion: true == true -TestMain.cpp:374: +TestMain.cpp:375: PASSED: CHECK( oneTag.matchesTags( p3 ) == false ) with expansion: false == false -TestMain.cpp:375: +TestMain.cpp:376: PASSED: CHECK( oneTag.matchesTags( p4 ) == false ) with expansion: false == false -TestMain.cpp:376: +TestMain.cpp:377: PASSED: CHECK( oneTag.matchesTags( p5 ) == false ) with expansion: false == false -TestMain.cpp:377: ------------------------------------------------------------------------------- selftest/tags two tags ............................................................................... +TestMain.cpp:383: PASSED: CHECK( twoTags.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:383: +TestMain.cpp:384: PASSED: CHECK( twoTags.hasTag( "one" ) ) with expansion: true -TestMain.cpp:384: +TestMain.cpp:385: PASSED: CHECK( twoTags.hasTag( "two" ) ) with expansion: true -TestMain.cpp:385: +TestMain.cpp:386: PASSED: CHECK( twoTags.hasTag( "three" ) == false ) with expansion: false == false -TestMain.cpp:386: +TestMain.cpp:387: PASSED: CHECK( twoTags.getTags().size() == 2 ) with expansion: 2 == 2 -TestMain.cpp:387: +TestMain.cpp:389: PASSED: CHECK( twoTags.matchesTags( p1 ) == true ) with expansion: true == true -TestMain.cpp:389: +TestMain.cpp:390: PASSED: CHECK( twoTags.matchesTags( p2 ) == true ) with expansion: true == true -TestMain.cpp:390: +TestMain.cpp:391: PASSED: CHECK( twoTags.matchesTags( p3 ) == true ) with expansion: true == true -TestMain.cpp:391: +TestMain.cpp:392: PASSED: CHECK( twoTags.matchesTags( p4 ) == true ) with expansion: true == true -TestMain.cpp:392: +TestMain.cpp:393: PASSED: CHECK( twoTags.matchesTags( p5 ) == true ) with expansion: true == true -TestMain.cpp:393: ------------------------------------------------------------------------------- selftest/tags one tag with characters either side ............................................................................... +TestMain.cpp:399: PASSED: CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) with expansion: "1234" == "1234" -TestMain.cpp:399: +TestMain.cpp:400: PASSED: CHECK( oneTagWithExtras.hasTag( "one" ) ) with expansion: true -TestMain.cpp:400: +TestMain.cpp:401: PASSED: CHECK( oneTagWithExtras.hasTag( "two" ) == false ) with expansion: false == false -TestMain.cpp:401: +TestMain.cpp:402: PASSED: CHECK( oneTagWithExtras.getTags().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:402: ------------------------------------------------------------------------------- selftest/tags start of a tag, but not closed ............................................................................... +TestMain.cpp:409: PASSED: CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) with expansion: "[one" == "[one" -TestMain.cpp:409: +TestMain.cpp:410: PASSED: CHECK( oneTagOpen.hasTag( "one" ) == false ) with expansion: false == false -TestMain.cpp:410: +TestMain.cpp:411: PASSED: CHECK( oneTagOpen.getTags().size() == 0 ) with expansion: 0 == 0 -TestMain.cpp:411: ------------------------------------------------------------------------------- selftest/tags hidden ............................................................................... +TestMain.cpp:417: PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:417: +TestMain.cpp:418: PASSED: CHECK( oneTag.hasTag( "hide" ) ) with expansion: true -TestMain.cpp:418: +TestMain.cpp:419: PASSED: CHECK( oneTag.isHidden() ) with expansion: true -TestMain.cpp:419: +TestMain.cpp:421: PASSED: CHECK( oneTag.matchesTags( "~[hide]" ) == false ) with expansion: false == false -TestMain.cpp:421: ------------------------------------------------------------------------------- ./succeeding/Tricky/std::pair ............................................................................... +TrickyTests.cpp:37: PASSED: REQUIRE( (std::pair( 1, 2 )) == aNicePair ) with expansion: - - std::pair( 1, 2 ) - == - std::pair( 1, 2 ) -TrickyTests.cpp:37: + std::pair( 1, 2 ) == std::pair( 1, 2 ) ------------------------------------------------------------------------------- ./inprogress/failing/Tricky/trailing expression ............................................................................... +TrickyTests.cpp:55: warning: Uncomment the code in this test to check that it gives a sensible compiler error -TrickyTests.cpp:55: No assertions in test case, './inprogress/failing/Tricky/trailing expression' @@ -4077,10 +4007,10 @@ No assertions in test case, './inprogress/failing/Tricky/trailing expression' ./inprogress/failing/Tricky/compound lhs ............................................................................... +TrickyTests.cpp:71: warning: Uncomment the code in this test to check that it gives a sensible compiler error -TrickyTests.cpp:71: No assertions in test case, './inprogress/failing/Tricky/compound lhs' @@ -4089,482 +4019,506 @@ No assertions in test case, './inprogress/failing/Tricky/compound lhs' ./failing/Tricky/non streamable type ............................................................................... -FAILED: +TrickyTests.cpp:95: FAILED: CHECK( &o1 == &o2 ) with expansion: 0x == 0x -TrickyTests.cpp:95: -FAILED: +TrickyTests.cpp:96: FAILED: CHECK( o1 == o2 ) with expansion: {?} == {?} -TrickyTests.cpp:96: ------------------------------------------------------------------------------- ./failing/string literals ............................................................................... -FAILED: +TrickyTests.cpp:106: FAILED: REQUIRE( std::string( "first" ) == "second" ) with expansion: "first" == "second" -TrickyTests.cpp:106: ------------------------------------------------------------------------------- ./succeeding/side-effects ............................................................................... +TrickyTests.cpp:119: PASSED: REQUIRE( i++ == 7 ) with expansion: 7 == 7 -TrickyTests.cpp:119: +TrickyTests.cpp:120: PASSED: REQUIRE( i++ == 8 ) with expansion: 8 == 8 -TrickyTests.cpp:120: ------------------------------------------------------------------------------- ./succeeding/koenig ............................................................................... +TrickyTests.cpp:186: PASSED: REQUIRE( 0x == o ) with expansion: 0x == {?} -TrickyTests.cpp:186: ------------------------------------------------------------------------------- ./succeeding/non-const== ............................................................................... +TrickyTests.cpp:212: PASSED: REQUIRE( t == 1u ) with expansion: {?} == 1 -TrickyTests.cpp:212: ------------------------------------------------------------------------------- ./succeeding/enum/bits ............................................................................... +TrickyTests.cpp:224: PASSED: REQUIRE( 0x == bit30and31 ) with expansion: 0x == 3221225472 -TrickyTests.cpp:224: ------------------------------------------------------------------------------- ./succeeding/boolean member ............................................................................... +TrickyTests.cpp:239: PASSED: REQUIRE( obj.prop != __null ) with expansion: 0x != 0 -TrickyTests.cpp:239: ------------------------------------------------------------------------------- ./succeeding/unimplemented static bool compare to true ............................................................................... +TrickyTests.cpp:259: PASSED: REQUIRE( is_true::value == true ) with expansion: true == true -TrickyTests.cpp:259: +TrickyTests.cpp:260: PASSED: REQUIRE( true == is_true::value ) with expansion: true == true -TrickyTests.cpp:260: ------------------------------------------------------------------------------- ./succeeding/unimplemented static bool compare to false ............................................................................... +TrickyTests.cpp:264: PASSED: REQUIRE( is_true::value == false ) with expansion: false == false -TrickyTests.cpp:264: +TrickyTests.cpp:265: PASSED: REQUIRE( false == is_true::value ) with expansion: false == false -TrickyTests.cpp:265: ------------------------------------------------------------------------------- ./succeeding/unimplemented static bool negation ............................................................................... +TrickyTests.cpp:270: PASSED: REQUIRE( !is_true::value ) with expansion: true -TrickyTests.cpp:270: ------------------------------------------------------------------------------- ./succeeding/unimplemented static bool double negation ............................................................................... +TrickyTests.cpp:275: PASSED: REQUIRE( !!is_true::value ) with expansion: true -TrickyTests.cpp:275: ------------------------------------------------------------------------------- ./succeeding/unimplemented static bool direct ............................................................................... +TrickyTests.cpp:280: PASSED: REQUIRE( is_true::value ) with expansion: true -TrickyTests.cpp:280: +TrickyTests.cpp:281: PASSED: REQUIRE_FALSE( !is_true::value ) with expansion: !false -TrickyTests.cpp:281: ------------------------------------------------------------------------------- ./succeeding/SafeBool ............................................................................... +TrickyTests.cpp:313: PASSED: CHECK( True ) with expansion: true -TrickyTests.cpp:313: +TrickyTests.cpp:314: PASSED: CHECK( !False ) with expansion: true -TrickyTests.cpp:314: +TrickyTests.cpp:315: PASSED: CHECK_FALSE( !False ) with expansion: !false -TrickyTests.cpp:315: ------------------------------------------------------------------------------- Scenario: Do that thing with the thing - Given: This stuff exists - When: I do this - Then: it should do this + Given: This stuff exists + When: I do this + Then: it should do this ............................................................................... +BDDTests.cpp:33: PASSED: REQUIRE( itDoesThis() ) with expansion: true -BDDTests.cpp:29: + +------------------------------------------------------------------------------- +Scenario: Do that thing with the thing + Given: This stuff exists + When: I do this + Then: it should do this + And: do that +............................................................................... + +BDDTests.cpp:35: +PASSED: + REQUIRE( itDoesThat() ) +with expansion: + true =============================================================================== -99 test cases - 47 failed (616 assertions - 104 failed) +100 test cases - 47 failed (619 assertions - 104 failed) -CatchSelfTest is a CATCH v0.9 b19 (integration) host application. +CatchSelfTest is a CATCH v0.9 b21 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- ./succeeding/Approx/simple ............................................................................... +ApproxTests.cpp:20: PASSED: REQUIRE( d == Approx( 1.23 ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:20: +ApproxTests.cpp:21: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: 1.23 != Approx( 1.22 ) -ApproxTests.cpp:21: +ApproxTests.cpp:22: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: 1.23 != Approx( 1.24 ) -ApproxTests.cpp:22: +ApproxTests.cpp:24: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:24: +ApproxTests.cpp:25: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: Approx( 1.23 ) != 1.22 -ApproxTests.cpp:25: +ApproxTests.cpp:26: PASSED: REQUIRE( Approx( d ) != 1.24 ) with expansion: Approx( 1.23 ) != 1.24 -ApproxTests.cpp:26: ------------------------------------------------------------------------------- ./succeeding/Approx/epsilon ............................................................................... +ApproxTests.cpp:38: PASSED: REQUIRE( d != Approx( 1.231 ) ) with expansion: 1.23 != Approx( 1.231 ) -ApproxTests.cpp:38: +ApproxTests.cpp:39: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) with expansion: 1.23 == Approx( 1.231 ) -ApproxTests.cpp:39: ------------------------------------------------------------------------------- ./succeeding/Approx/float ............................................................................... +ApproxTests.cpp:49: PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:49: +ApproxTests.cpp:50: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) with expansion: 0 == Approx( 0 ) -ApproxTests.cpp:50: ------------------------------------------------------------------------------- ./succeeding/Approx/int ............................................................................... +ApproxTests.cpp:60: PASSED: REQUIRE( 1 == Approx( 1 ) ) -ApproxTests.cpp:60: +ApproxTests.cpp:61: PASSED: REQUIRE( 0 == Approx( 0 ) ) -ApproxTests.cpp:61: ------------------------------------------------------------------------------- ./succeeding/Approx/mixed ............................................................................... +ApproxTests.cpp:75: PASSED: REQUIRE( 1.0f == Approx( 1 ) ) with expansion: 1 == Approx( 1 ) -ApproxTests.cpp:75: +ApproxTests.cpp:76: PASSED: REQUIRE( 0 == Approx( dZero) ) with expansion: 0 == Approx( 0 ) -ApproxTests.cpp:76: +ApproxTests.cpp:77: PASSED: REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) with expansion: 0 == Approx( 1e-05 ) -ApproxTests.cpp:77: +ApproxTests.cpp:78: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: 1.234 == Approx( 1.234 ) -ApproxTests.cpp:78: +ApproxTests.cpp:79: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) with expansion: 1.234 == Approx( 1.234 ) -ApproxTests.cpp:79: ------------------------------------------------------------------------------- ./succeeding/Approx/custom ............................................................................... +ApproxTests.cpp:93: PASSED: REQUIRE( d == approx( 1.23 ) ) with expansion: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:93: +ApproxTests.cpp:94: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: 1.23 == Approx( 1.22 ) -ApproxTests.cpp:94: +ApproxTests.cpp:95: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: 1.23 == Approx( 1.24 ) -ApproxTests.cpp:95: +ApproxTests.cpp:96: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: 1.23 != Approx( 1.25 ) -ApproxTests.cpp:96: +ApproxTests.cpp:98: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:98: +ApproxTests.cpp:99: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: Approx( 1.23 ) == 1.22 -ApproxTests.cpp:99: +ApproxTests.cpp:100: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: Approx( 1.23 ) == 1.24 -ApproxTests.cpp:100: +ApproxTests.cpp:101: PASSED: REQUIRE( approx( d ) != 1.25 ) with expansion: Approx( 1.23 ) != 1.25 -ApproxTests.cpp:101: + +------------------------------------------------------------------------------- +Approximate PI +............................................................................... + +ApproxTests.cpp:110: +PASSED: + REQUIRE( divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) ) +with expansion: + 3.142857142857143 == Approx( 3.141 ) + +ApproxTests.cpp:111: +PASSED: + REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) +with expansion: + 3.142857142857143 != Approx( 3.141 ) ------------------------------------------------------------------------------- ./succeeding/TestClass/succeedingCase ............................................................................... +ClassTests.cpp:24: PASSED: REQUIRE( s == "hello" ) with expansion: "hello" == "hello" -ClassTests.cpp:24: ------------------------------------------------------------------------------- ./failing/TestClass/failingCase ............................................................................... -FAILED: +ClassTests.cpp:28: FAILED: REQUIRE( s == "world" ) with expansion: "hello" == "world" -ClassTests.cpp:28: ------------------------------------------------------------------------------- ./succeeding/Fixture/succeedingCase ............................................................................... +ClassTests.cpp:47: PASSED: REQUIRE( m_a == 1 ) with expansion: 1 == 1 -ClassTests.cpp:47: ------------------------------------------------------------------------------- ./failing/Fixture/failingCase ............................................................................... -FAILED: +ClassTests.cpp:55: FAILED: REQUIRE( m_a == 2 ) with expansion: 1 == 2 -ClassTests.cpp:55: ------------------------------------------------------------------------------- ./succeeding/conditions/equality ............................................................................... +ConditionTests.cpp:55: PASSED: REQUIRE( data.int_seven == 7 ) with expansion: 7 == 7 -ConditionTests.cpp:55: +ConditionTests.cpp:56: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: 9.1 == Approx( 9.1 ) -ConditionTests.cpp:56: +ConditionTests.cpp:57: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: - 3.14159 == Approx( 3.14159 ) -ConditionTests.cpp:57: + 3.1415926535 == Approx( 3.14159 ) +ConditionTests.cpp:58: PASSED: REQUIRE( data.str_hello == "hello" ) with expansion: "hello" == "hello" -ConditionTests.cpp:58: +ConditionTests.cpp:59: PASSED: REQUIRE( "hello" == data.str_hello ) with expansion: "hello" == "hello" -ConditionTests.cpp:59: +ConditionTests.cpp:60: PASSED: REQUIRE( data.str_hello.size() == 5 ) with expansion: 5 == 5 -ConditionTests.cpp:60: +ConditionTests.cpp:63: PASSED: REQUIRE( x == Approx( 1.3 ) ) with expansion: 1.3 == Approx( 1.3 ) -ConditionTests.cpp:63: ------------------------------------------------------------------------------- ./failing/conditions/equality ............................................................................... -FAILED: +ConditionTests.cpp:71: FAILED: CHECK( data.int_seven == 6 ) with expansion: 7 == 6 -ConditionTests.cpp:71: -FAILED: +ConditionTests.cpp:72: FAILED: CHECK( data.int_seven == 8 ) with expansion: 7 == 8 -ConditionTests.cpp:72: =============================================================================== -12 test cases - 3 failed (38 assertions - 4 failed) +13 test cases - 3 failed (40 assertions - 4 failed) - + + @@ -4600,7 +4554,7 @@ ConditionTests.cpp:76 ConditionTests.cpp:77 - + ConditionTests.cpp:78 @@ -4627,7 +4581,7 @@ ConditionTests.cpp:111 ConditionTests.cpp:112 - + ConditionTests.cpp:113 @@ -4669,7 +4623,7 @@ ConditionTests.cpp:162 ConditionTests.cpp:163 - + ConditionTests.cpp:164 @@ -5235,6 +5189,25 @@ ApproxTests.cpp" line="101"> + +ApproxTests.cpp" line="110"> + + divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) + + + 3.142857142857143 == Approx( 3.141 ) + + +ApproxTests.cpp" line="111"> + + divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) + + + 3.142857142857143 != Approx( 3.141 ) + + + + ClassTests.cpp" line="24"> @@ -5301,7 +5274,7 @@ ConditionTests.cpp" line="57"> data.double_pi == Approx( 3.1415926535 ) - 3.14159 == Approx( 3.14159 ) + 3.1415926535 == Approx( 3.14159 ) ConditionTests.cpp" line="58"> @@ -5400,7 +5373,7 @@ ConditionTests.cpp" line="78"> data.double_pi == Approx( 3.1415 ) - 3.14159 == Approx( 3.1415 ) + 3.1415926535 == Approx( 3.1415 ) ConditionTests.cpp" line="79"> @@ -5499,7 +5472,7 @@ ConditionTests.cpp" line="99"> data.double_pi != Approx( 3.1415 ) - 3.14159 != Approx( 3.1415 ) + 3.1415926535 != Approx( 3.1415 ) ConditionTests.cpp" line="100"> @@ -5558,7 +5531,7 @@ ConditionTests.cpp" line="113"> data.double_pi != Approx( 3.1415926535 ) - 3.14159 != Approx( 3.14159 ) + 3.1415926535 != Approx( 3.14159 ) ConditionTests.cpp" line="114"> @@ -5665,7 +5638,7 @@ ConditionTests.cpp" line="136"> data.float_nine_point_one < 9.2 - 9.1 < 9.2 + 9.1 < 9.199999999999999 ConditionTests.cpp" line="138"> @@ -5804,7 +5777,7 @@ ConditionTests.cpp" line="164"> data.float_nine_point_one > 9.2 - 9.1 > 9.2 + 9.1 > 9.199999999999999 ConditionTests.cpp" line="166"> @@ -9579,10 +9552,7 @@ TrickyTests.cpp" line="37"> (std::pair<int, int>( 1, 2 )) == aNicePair - - std::pair( 1, 2 ) - == - std::pair( 1, 2 ) + std::pair( 1, 2 ) == std::pair( 1, 2 ) @@ -9802,10 +9772,10 @@ TrickyTests.cpp" line="315"> -
-
-
-BDDTests.cpp" line="29"> +
+
+
+BDDTests.cpp" line="33"> itDoesThis() @@ -9813,17 +9783,28 @@ BDDTests.cpp" line="29"> true - +
+BDDTests.cpp" line="35"> + + itDoesThat() + + + true + + + +
+
- +
- +
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -9871,6 +9852,11 @@ ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 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: Approximate PI] +ApproxTests.cpp:110: divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) succeeded for: 3.142857142857143 == Approx( 3.141 ) +ApproxTests.cpp:111: divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) succeeded for: 3.142857142857143 != Approx( 3.141 ) +[Finished: 'Approximate PI' All tests passed (2 assertions in 1 test case)] + [Running: ./succeeding/TestClass/succeedingCase] ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" [Finished: './succeeding/TestClass/succeedingCase' All tests passed (1 assertion in 1 test case)] @@ -9890,7 +9876,7 @@ ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 [Running: ./succeeding/conditions/equality] ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) -ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) +ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.1415926535 == Approx( 3.14159 ) ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 @@ -9905,7 +9891,7 @@ ConditionTests.cpp:74: data.float_nine_point_one == Approx( 9.11f ) failed for: ConditionTests.cpp:75: data.float_nine_point_one == Approx( 9.0f ) failed for: 9.1 == Approx( 9 ) ConditionTests.cpp:76: data.float_nine_point_one == Approx( 1 ) failed for: 9.1 == Approx( 1 ) ConditionTests.cpp:77: data.float_nine_point_one == Approx( 0 ) failed for: 9.1 == Approx( 0 ) -ConditionTests.cpp:78: data.double_pi == Approx( 3.1415 ) failed for: 3.14159 == Approx( 3.1415 ) +ConditionTests.cpp:78: data.double_pi == Approx( 3.1415 ) failed for: 3.1415926535 == Approx( 3.1415 ) ConditionTests.cpp:79: data.str_hello == "goodbye" failed for: "hello" == "goodbye" ConditionTests.cpp:80: data.str_hello == "hell" failed for: "hello" == "hell" ConditionTests.cpp:81: data.str_hello == "hello1" failed for: "hello" == "hello1" @@ -9920,7 +9906,7 @@ ConditionTests.cpp:95: data.float_nine_point_one != Approx( 9.11f ) succeeded fo ConditionTests.cpp:96: data.float_nine_point_one != Approx( 9.0f ) succeeded for: 9.1 != Approx( 9 ) ConditionTests.cpp:97: data.float_nine_point_one != Approx( 1 ) succeeded for: 9.1 != Approx( 1 ) ConditionTests.cpp:98: data.float_nine_point_one != Approx( 0 ) succeeded for: 9.1 != Approx( 0 ) -ConditionTests.cpp:99: data.double_pi != Approx( 3.1415 ) succeeded for: 3.14159 != Approx( 3.1415 ) +ConditionTests.cpp:99: data.double_pi != Approx( 3.1415 ) succeeded for: 3.1415926535 != Approx( 3.1415 ) ConditionTests.cpp:100: data.str_hello != "goodbye" succeeded for: "hello" != "goodbye" ConditionTests.cpp:101: data.str_hello != "hell" succeeded for: "hello" != "hell" ConditionTests.cpp:102: data.str_hello != "hello1" succeeded for: "hello" != "hello1" @@ -9930,7 +9916,7 @@ ConditionTests.cpp:103: data.str_hello.size() != 6 succeeded for: 5 != 6 [Running: ./failing/conditions/inequality] ConditionTests.cpp:111: data.int_seven != 7 failed for: 7 != 7 ConditionTests.cpp:112: data.float_nine_point_one != Approx( 9.1f ) failed for: 9.1 != Approx( 9.1 ) -ConditionTests.cpp:113: data.double_pi != Approx( 3.1415926535 ) failed for: 3.14159 != Approx( 3.14159 ) +ConditionTests.cpp:113: data.double_pi != Approx( 3.1415926535 ) failed for: 3.1415926535 != Approx( 3.14159 ) ConditionTests.cpp:114: data.str_hello != "hello" failed for: "hello" != "hello" ConditionTests.cpp:115: data.str_hello.size() != 5 failed for: 5 != 5 [Finished: './failing/conditions/inequality' 1 test case failed (All 5 assertions failed)] @@ -9946,7 +9932,7 @@ ConditionTests.cpp:131: data.int_seven <= 7 succeeded for: 7 <= 7 ConditionTests.cpp:132: data.int_seven <= 8 succeeded for: 7 <= 8 ConditionTests.cpp:134: data.float_nine_point_one > 9 succeeded for: 9.1 > 9 ConditionTests.cpp:135: data.float_nine_point_one < 10 succeeded for: 9.1 < 10 -ConditionTests.cpp:136: data.float_nine_point_one < 9.2 succeeded for: 9.1 < 9.2 +ConditionTests.cpp:136: data.float_nine_point_one < 9.2 succeeded for: 9.1 < 9.199999999999999 ConditionTests.cpp:138: data.str_hello <= "hello" succeeded for: "hello" <= "hello" ConditionTests.cpp:139: data.str_hello >= "hello" succeeded for: "hello" >= "hello" ConditionTests.cpp:141: data.str_hello < "hellp" succeeded for: "hello" < "hellp" @@ -9966,7 +9952,7 @@ ConditionTests.cpp:159: data.int_seven >= 8 failed for: 7 >= 8 ConditionTests.cpp:160: data.int_seven <= 6 failed for: 7 <= 6 ConditionTests.cpp:162: data.float_nine_point_one < 9 failed for: 9.1 < 9 ConditionTests.cpp:163: data.float_nine_point_one > 10 failed for: 9.1 > 10 -ConditionTests.cpp:164: data.float_nine_point_one > 9.2 failed for: 9.1 > 9.2 +ConditionTests.cpp:164: data.float_nine_point_one > 9.2 failed for: 9.1 > 9.199999999999999 ConditionTests.cpp:166: data.str_hello > "hello" failed for: "hello" > "hello" ConditionTests.cpp:167: data.str_hello < "hello" failed for: "hello" < "hello" ConditionTests.cpp:168: data.str_hello > "hellp" failed for: "hello" > "hellp" @@ -11079,11 +11065,7 @@ TestMain.cpp:421: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false [Finished: 'selftest/tags' All tests passed (29 assertions in 1 test case)] [Running: ./succeeding/Tricky/std::pair] -TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: - - std::pair( 1, 2 ) - == - std::pair( 1, 2 ) +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: ./inprogress/failing/Tricky/trailing expression] @@ -11163,21 +11145,25 @@ TrickyTests.cpp:315: !False succeeded for: !false [Finished: './succeeding/SafeBool' All tests passed (3 assertions in 1 test case)] [Running: Scenario: Do that thing with the thing] -[Started section: ' Given: This stuff exists'] -[Started section: ' When: I do this'] -[Started section: ' Then: it should do this'] -BDDTests.cpp:29: itDoesThis() succeeded for: true -[End of section: ' Then: it should do this' 1 assertion passed] +[Started section: 'Given: This stuff exists'] +[Started section: ' When: I do this'] +[Started section: ' Then: it should do this'] +BDDTests.cpp:33: itDoesThis() succeeded for: true +[Started section: ' And: do that'] +BDDTests.cpp:35: itDoesThat() succeeded for: true +[End of section: ' And: do that' 1 assertion passed] -[End of section: ' When: I do this' 1 assertion passed] +[End of section: ' Then: it should do this' All 2 assertions passed] -[End of section: ' Given: This stuff exists' 1 assertion passed] +[End of section: ' When: I do this' All 2 assertions passed] -[Finished: 'Scenario: Do that thing with the thing' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 47 of 99 test cases failed (104 of 616 assertions failed)] +[End of section: 'Given: This stuff exists' All 2 assertions passed] + +[Finished: 'Scenario: Do that thing with the thing' All tests passed (2 assertions in 1 test case)] +[End of group: '~dummy'. 47 of 100 test cases failed (104 of 619 assertions failed)] -[Testing completed. 47 of 99 test cases failed (104 of 616 assertions failed)] +[Testing completed. 47 of 100 test cases failed (104 of 619 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -11225,6 +11211,11 @@ ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 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: Approximate PI] +ApproxTests.cpp:110: divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) succeeded for: 3.142857142857143 == Approx( 3.141 ) +ApproxTests.cpp:111: divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) succeeded for: 3.142857142857143 != Approx( 3.141 ) +[Finished: 'Approximate PI' All tests passed (2 assertions in 1 test case)] + [Running: ./succeeding/TestClass/succeedingCase] ClassTests.cpp:24: s == "hello" succeeded for: "hello" == "hello" [Finished: './succeeding/TestClass/succeedingCase' All tests passed (1 assertion in 1 test case)] @@ -11244,7 +11235,7 @@ ClassTests.cpp:55: m_a == 2 failed for: 1 == 2 [Running: ./succeeding/conditions/equality] ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) -ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.14159 == Approx( 3.14159 ) +ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.1415926535 == Approx( 3.14159 ) ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 @@ -11255,8 +11246,8 @@ ConditionTests.cpp:63: x == Approx( 1.3 ) succeeded for: 1.3 == Approx( 1.3 ) ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 [Finished: './failing/conditions/equality' 1 test case failed (All 2 assertions failed)] -[End of group: '~dummy'. 3 of 12 test cases failed (4 of 38 assertions failed)] +[End of group: '~dummy'. 3 of 13 test cases failed (4 of 40 assertions failed)] -[Testing aborted. 3 of 12 test cases failed (4 of 38 assertions failed)] +[Testing aborted. 3 of 13 test cases failed (4 of 40 assertions failed)] diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index f2777cb7..1f4395b8 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -580,7 +580,6 @@ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++98"; CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; - GCC_PREPROCESSOR_DEFINITIONS = CATCH_CONFIG_USE_ANSI_COLOUR_CODES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; PRODUCT_NAME = "$(TARGET_NAME)"; WARNING_CFLAGS = ( @@ -596,7 +595,6 @@ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++98"; CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; - GCC_PREPROCESSOR_DEFINITIONS = CATCH_CONFIG_USE_ANSI_COLOUR_CODES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; PRODUCT_NAME = "$(TARGET_NAME)"; WARNING_CFLAGS = ( diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index 43d40068..e9971bd3 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -14,11 +14,14 @@ // !TBD: story scenarios map to class based tests #define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) -#define GIVEN( desc ) SECTION( " Given: " desc, "" ) -#define WHEN( desc ) SECTION( " When: " desc, "" ) -#define THEN( desc ) SECTION( " Then: " desc, "" ) +#define GIVEN( desc ) SECTION( "Given: " desc, "" ) +#define WHEN( desc ) SECTION( " When: " desc, "" ) +#define AND_WHEN( desc ) SECTION( " And: " desc, "" ) +#define THEN( desc ) SECTION( " Then: " desc, "" ) +#define AND_THEN( desc ) SECTION( " And: " desc, "" ) inline bool itDoesThis(){ return true; } +inline bool itDoesThat(){ return true; } SCENARIO( "Do that thing with the thing", "[tags]" ) { GIVEN( "This stuff exists" ) { @@ -26,7 +29,11 @@ SCENARIO( "Do that thing with the thing", "[tags]" ) { WHEN( "I do this" ) { // do this THEN( "it should do this") + { REQUIRE( itDoesThis() ); + AND_THEN( "do that") + REQUIRE( itDoesThat() ); + } } } diff --git a/single_include/catch.hpp b/single_include/catch.hpp index f0fa4193..49f8afc5 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 20 (integration branch) - * Generated: 2013-02-19 19:57:51.967870 + * CATCH v0.9 build 21 (integration branch) + * Generated: 2013-03-04 12:17:59.865403 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -440,6 +440,8 @@ private: #define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED #include +#include +#include #ifdef __OBJC__ // #included from: catch_objc_arc.hpp @@ -494,37 +496,53 @@ namespace Detail { template NonStreamable( const T& ){} }; - // If the type does not have its own << overload for ostream then - // this one will be used instead - inline std::ostream& operator << ( std::ostream& ss, NonStreamable ){ - return ss << "{?}"; - } +} // end namespace Detail - template - inline std::string makeString( const T& value ) { +// If the type does not have its own << overload for ostream then +// this one will be used instead +inline std::ostream& operator << ( std::ostream& ss, Detail::NonStreamable ){ + return ss << "{?}"; +} + +template +struct StringMaker { + static std::string convert( T const& value ) { std::ostringstream oss; oss << value; return oss.str(); } - - template - inline std::string makeString( T* p ) { +}; +template +struct StringMaker { + static std::string convert( T const* p ) { if( !p ) return INTERNAL_CATCH_STRINGIFY( NULL ); std::ostringstream oss; oss << p; return oss.str(); } +}; - template - inline std::string makeString( const T* p ) { - if( !p ) - return INTERNAL_CATCH_STRINGIFY( NULL ); +template +struct StringMaker > { + static std::string convert( std::vector const& v ) { std::ostringstream oss; - oss << p; + oss << "{ "; + for( std::size_t i = 0; i < v.size(); ++ i ) { + oss << v[i]; + if( i < v.size() - 1 ) + oss << ", "; + } + oss << " }"; return oss.str(); } +}; +namespace Detail { + template + inline std::string makeString( const T& value ) { + return StringMaker::convert( value ); + } } // end namespace Detail /// \brief converts any type to a string @@ -536,7 +554,8 @@ namespace Detail { /// to provide an ostream overload for. template std::string toString( const T& value ) { - return Detail::makeString( value ); + return StringMaker::convert( value ); +// return Detail::makeString( value ); } // Built in overloads @@ -583,7 +602,8 @@ inline std::string toString( unsigned int value ) { inline std::string toString( const double value ) { std::ostringstream oss; - oss << value; + oss << std::setprecision (std::numeric_limits::digits10 + 1) + << value; return oss.str(); } @@ -4318,13 +4338,15 @@ namespace Catch { return false; } - void endSection( const std::string& ) { + void endSection( const std::string&, bool stealth ) { if( m_currentSection->ran() ) { - m_runStatus = RanAtLeastOneSection; + if( !stealth ) + m_runStatus = RanAtLeastOneSection; m_changed = true; } else if( m_runStatus == EncounteredASection ) { - m_runStatus = RanAtLeastOneSection; + if( !stealth ) + m_runStatus = RanAtLeastOneSection; m_lastSectionToRun = m_currentSection; } m_currentSection = m_currentSection->getParent(); @@ -4544,7 +4566,7 @@ namespace Catch { missingAssertions = true; } - m_runningTest->endSection( info.name ); + m_runningTest->endSection( info.name, false ); m_reporter->sectionEnded( SectionStats( info, assertions, missingAssertions ) ); m_messages.clear(); @@ -5352,6 +5374,10 @@ namespace Catch { } // end namespace Catch +#if !defined(CATCH_CONFIG_USE_ANSI_COLOUR_CODES) && !defined(CATCH_PLATFORM_WINDOWS) +#define CATCH_CONFIG_USE_ANSI_COLOUR_CODES 1 +#endif + #if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) #include @@ -5373,8 +5399,15 @@ namespace Catch { namespace { const char colourEscape = '\033'; } + inline bool shouldUseColour() { + static bool s_shouldUseColour + = CATCH_CONFIG_USE_ANSI_COLOUR_CODES != 0 && + isatty( fileno(stdout) ) && + !isDebuggerActive(); + return s_shouldUseColour; + } void TextColour::set( Colours colour ) { - if( isatty( fileno(stdout) ) && !isDebuggerActive() ) { + if( shouldUseColour() ) { switch( colour ) { case TextColour::FileName: std::cout << colourEscape << "[0m"; // white/ normal @@ -5711,12 +5744,10 @@ namespace Catch { else if( m_exprComponents.op == "matches" ) return m_exprComponents.lhs + " " + m_exprComponents.rhs; else if( m_exprComponents.op != "!" ) { - if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 30 ) + if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 ) 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"; + return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs; } else return "{can't expand - use " + info.macroName + "_FALSE( " + info.capturedExpression.substr(1) + " ) instead of " + info.macroName + "( " + info.capturedExpression + " ) for better diagnostics}"; @@ -5838,7 +5869,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 20, "integration" ); + Version libraryVersion( 0, 9, 21, "integration" ); } // #included from: catch_line_wrap.hpp @@ -7083,13 +7114,18 @@ namespace Catch { } void print() const { + printSourceInfo(); if( stats.totals.assertions.total() > 0 ) { + if( result.isOk() ) + stream << "\n"; printResultType(); printOriginalExpression(); printReconstructedExpression(); } + else { + stream << "\n"; + } printMessage(); - printSourceInfo(); } private: @@ -7131,7 +7167,7 @@ namespace Catch { } void printSourceInfo() const { TextColour colourGuard( TextColour::FileName ); - stream << result.getSourceInfo() << ":\n"; + stream << result.getSourceInfo() << ": "; } static std::string wrapLongStrings( std::string const& _string ){ From 90b2bfec3ddd89dd8b5ae550c3edfc05b23ba0f3 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 4 Mar 2013 15:06:31 +0100 Subject: [PATCH 141/296] Patched issue where an assert before the first section can cause a set-fault (needs a better fix, though) --- include/reporters/catch_reporter_console.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 1456 +++++++++++++++++ single_include/catch.hpp | 4 +- 3 files changed, 1459 insertions(+), 3 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index bb7fc236..44abbb6d 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -279,7 +279,7 @@ namespace Catch { if( !currentSectionInfo ) { printHeader( unusedTestCaseInfo->name ); stream << std::endl; - unusedTestCaseInfo.reset(); +// unusedTestCaseInfo.reset(); } } void lazyPrintSectionInfo() { diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 6e83e3b4..833e2092 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -12,30 +12,50 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) +------------------------------------------------------------------------------- +./succeeding/Approx/simple +............................................................................... + ApproxTests.cpp:21: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: 1.23 != Approx( 1.22 ) +------------------------------------------------------------------------------- +./succeeding/Approx/simple +............................................................................... + ApproxTests.cpp:22: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: 1.23 != Approx( 1.24 ) +------------------------------------------------------------------------------- +./succeeding/Approx/simple +............................................................................... + ApproxTests.cpp:24: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 +------------------------------------------------------------------------------- +./succeeding/Approx/simple +............................................................................... + ApproxTests.cpp:25: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: Approx( 1.23 ) != 1.22 +------------------------------------------------------------------------------- +./succeeding/Approx/simple +............................................................................... + ApproxTests.cpp:26: PASSED: REQUIRE( Approx( d ) != 1.24 ) @@ -52,6 +72,10 @@ PASSED: with expansion: 1.23 != Approx( 1.231 ) +------------------------------------------------------------------------------- +./succeeding/Approx/epsilon +............................................................................... + ApproxTests.cpp:39: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) @@ -68,6 +92,10 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) +------------------------------------------------------------------------------- +./succeeding/Approx/float +............................................................................... + ApproxTests.cpp:50: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) @@ -82,6 +110,10 @@ ApproxTests.cpp:60: PASSED: REQUIRE( 1 == Approx( 1 ) ) +------------------------------------------------------------------------------- +./succeeding/Approx/int +............................................................................... + ApproxTests.cpp:61: PASSED: REQUIRE( 0 == Approx( 0 ) ) @@ -96,24 +128,40 @@ PASSED: with expansion: 1 == Approx( 1 ) +------------------------------------------------------------------------------- +./succeeding/Approx/mixed +............................................................................... + ApproxTests.cpp:76: PASSED: REQUIRE( 0 == Approx( dZero) ) with expansion: 0 == Approx( 0 ) +------------------------------------------------------------------------------- +./succeeding/Approx/mixed +............................................................................... + ApproxTests.cpp:77: PASSED: REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) with expansion: 0 == Approx( 1e-05 ) +------------------------------------------------------------------------------- +./succeeding/Approx/mixed +............................................................................... + ApproxTests.cpp:78: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: 1.234 == Approx( 1.234 ) +------------------------------------------------------------------------------- +./succeeding/Approx/mixed +............................................................................... + ApproxTests.cpp:79: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) @@ -130,42 +178,70 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:94: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: 1.23 == Approx( 1.22 ) +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:95: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: 1.23 == Approx( 1.24 ) +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:96: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: 1.23 != Approx( 1.25 ) +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:98: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:99: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: Approx( 1.23 ) == 1.22 +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:100: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: Approx( 1.23 ) == 1.24 +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:101: PASSED: REQUIRE( approx( d ) != 1.25 ) @@ -182,6 +258,10 @@ PASSED: with expansion: 3.142857142857143 == Approx( 3.141 ) +------------------------------------------------------------------------------- +Approximate PI +............................................................................... + ApproxTests.cpp:111: PASSED: REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) @@ -236,36 +316,60 @@ PASSED: with expansion: 7 == 7 +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:56: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: 9.1 == Approx( 9.1 ) +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:57: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: 3.1415926535 == Approx( 3.14159 ) +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:58: PASSED: REQUIRE( data.str_hello == "hello" ) with expansion: "hello" == "hello" +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:59: PASSED: REQUIRE( "hello" == data.str_hello ) with expansion: "hello" == "hello" +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:60: PASSED: REQUIRE( data.str_hello.size() == 5 ) with expansion: 5 == 5 +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:63: PASSED: REQUIRE( x == Approx( 1.3 ) ) @@ -281,61 +385,109 @@ ConditionTests.cpp:71: FAILED: with expansion: 7 == 6 +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:72: FAILED: CHECK( data.int_seven == 8 ) with expansion: 7 == 8 +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:73: FAILED: CHECK( data.int_seven == 0 ) with expansion: 7 == 0 +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:74: FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: 9.1 == Approx( 9.11 ) +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:75: FAILED: CHECK( data.float_nine_point_one == Approx( 9.0f ) ) with expansion: 9.1 == Approx( 9 ) +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:76: FAILED: CHECK( data.float_nine_point_one == Approx( 1 ) ) with expansion: 9.1 == Approx( 1 ) +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:77: FAILED: CHECK( data.float_nine_point_one == Approx( 0 ) ) with expansion: 9.1 == Approx( 0 ) +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:78: FAILED: CHECK( data.double_pi == Approx( 3.1415 ) ) with expansion: 3.1415926535 == Approx( 3.1415 ) +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:79: FAILED: CHECK( data.str_hello == "goodbye" ) with expansion: "hello" == "goodbye" +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:80: FAILED: CHECK( data.str_hello == "hell" ) with expansion: "hello" == "hell" +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:81: FAILED: CHECK( data.str_hello == "hello1" ) with expansion: "hello" == "hello1" +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:82: FAILED: CHECK( data.str_hello.size() == 6 ) with expansion: 5 == 6 +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:85: FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: @@ -351,60 +503,100 @@ PASSED: with expansion: 7 != 6 +------------------------------------------------------------------------------- +./succeeding/conditions/inequality +............................................................................... + ConditionTests.cpp:94: PASSED: REQUIRE( data.int_seven != 8 ) with expansion: 7 != 8 +------------------------------------------------------------------------------- +./succeeding/conditions/inequality +............................................................................... + ConditionTests.cpp:95: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.11f ) ) with expansion: 9.1 != Approx( 9.11 ) +------------------------------------------------------------------------------- +./succeeding/conditions/inequality +............................................................................... + ConditionTests.cpp:96: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.0f ) ) with expansion: 9.1 != Approx( 9 ) +------------------------------------------------------------------------------- +./succeeding/conditions/inequality +............................................................................... + ConditionTests.cpp:97: PASSED: REQUIRE( data.float_nine_point_one != Approx( 1 ) ) with expansion: 9.1 != Approx( 1 ) +------------------------------------------------------------------------------- +./succeeding/conditions/inequality +............................................................................... + ConditionTests.cpp:98: PASSED: REQUIRE( data.float_nine_point_one != Approx( 0 ) ) with expansion: 9.1 != Approx( 0 ) +------------------------------------------------------------------------------- +./succeeding/conditions/inequality +............................................................................... + ConditionTests.cpp:99: PASSED: REQUIRE( data.double_pi != Approx( 3.1415 ) ) with expansion: 3.1415926535 != Approx( 3.1415 ) +------------------------------------------------------------------------------- +./succeeding/conditions/inequality +............................................................................... + ConditionTests.cpp:100: PASSED: REQUIRE( data.str_hello != "goodbye" ) with expansion: "hello" != "goodbye" +------------------------------------------------------------------------------- +./succeeding/conditions/inequality +............................................................................... + ConditionTests.cpp:101: PASSED: REQUIRE( data.str_hello != "hell" ) with expansion: "hello" != "hell" +------------------------------------------------------------------------------- +./succeeding/conditions/inequality +............................................................................... + ConditionTests.cpp:102: PASSED: REQUIRE( data.str_hello != "hello1" ) with expansion: "hello" != "hello1" +------------------------------------------------------------------------------- +./succeeding/conditions/inequality +............................................................................... + ConditionTests.cpp:103: PASSED: REQUIRE( data.str_hello.size() != 6 ) @@ -420,21 +612,37 @@ ConditionTests.cpp:111: FAILED: with expansion: 7 != 7 +------------------------------------------------------------------------------- +./failing/conditions/inequality +............................................................................... + ConditionTests.cpp:112: FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: 9.1 != Approx( 9.1 ) +------------------------------------------------------------------------------- +./failing/conditions/inequality +............................................................................... + ConditionTests.cpp:113: FAILED: CHECK( data.double_pi != Approx( 3.1415926535 ) ) with expansion: 3.1415926535 != Approx( 3.14159 ) +------------------------------------------------------------------------------- +./failing/conditions/inequality +............................................................................... + ConditionTests.cpp:114: FAILED: CHECK( data.str_hello != "hello" ) with expansion: "hello" != "hello" +------------------------------------------------------------------------------- +./failing/conditions/inequality +............................................................................... + ConditionTests.cpp:115: FAILED: CHECK( data.str_hello.size() != 5 ) with expansion: @@ -450,96 +658,160 @@ PASSED: with expansion: 7 < 8 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:125: PASSED: REQUIRE( data.int_seven > 6 ) with expansion: 7 > 6 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:126: PASSED: REQUIRE( data.int_seven > 0 ) with expansion: 7 > 0 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:127: PASSED: REQUIRE( data.int_seven > -1 ) with expansion: 7 > -1 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:129: PASSED: REQUIRE( data.int_seven >= 7 ) with expansion: 7 >= 7 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:130: PASSED: REQUIRE( data.int_seven >= 6 ) with expansion: 7 >= 6 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:131: PASSED: REQUIRE( data.int_seven <= 7 ) with expansion: 7 <= 7 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:132: PASSED: REQUIRE( data.int_seven <= 8 ) with expansion: 7 <= 8 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:134: PASSED: REQUIRE( data.float_nine_point_one > 9 ) with expansion: 9.1 > 9 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:135: PASSED: REQUIRE( data.float_nine_point_one < 10 ) with expansion: 9.1 < 10 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:136: PASSED: REQUIRE( data.float_nine_point_one < 9.2 ) with expansion: 9.1 < 9.199999999999999 +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:138: PASSED: REQUIRE( data.str_hello <= "hello" ) with expansion: "hello" <= "hello" +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:139: PASSED: REQUIRE( data.str_hello >= "hello" ) with expansion: "hello" >= "hello" +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:141: PASSED: REQUIRE( data.str_hello < "hellp" ) with expansion: "hello" < "hellp" +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:142: PASSED: REQUIRE( data.str_hello < "zebra" ) with expansion: "hello" < "zebra" +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:143: PASSED: REQUIRE( data.str_hello > "hellm" ) with expansion: "hello" > "hellm" +------------------------------------------------------------------------------- +./succeeding/conditions/ordered +............................................................................... + ConditionTests.cpp:144: PASSED: REQUIRE( data.str_hello > "a" ) @@ -555,91 +827,163 @@ ConditionTests.cpp:152: FAILED: with expansion: 7 > 7 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:153: FAILED: CHECK( data.int_seven < 7 ) with expansion: 7 < 7 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:154: FAILED: CHECK( data.int_seven > 8 ) with expansion: 7 > 8 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:155: FAILED: CHECK( data.int_seven < 6 ) with expansion: 7 < 6 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:156: FAILED: CHECK( data.int_seven < 0 ) with expansion: 7 < 0 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:157: FAILED: CHECK( data.int_seven < -1 ) with expansion: 7 < -1 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:159: FAILED: CHECK( data.int_seven >= 8 ) with expansion: 7 >= 8 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:160: FAILED: CHECK( data.int_seven <= 6 ) with expansion: 7 <= 6 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:162: FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: 9.1 < 9 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:163: FAILED: CHECK( data.float_nine_point_one > 10 ) with expansion: 9.1 > 10 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:164: FAILED: CHECK( data.float_nine_point_one > 9.2 ) with expansion: 9.1 > 9.199999999999999 +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:166: FAILED: CHECK( data.str_hello > "hello" ) with expansion: "hello" > "hello" +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:167: FAILED: CHECK( data.str_hello < "hello" ) with expansion: "hello" < "hello" +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:168: FAILED: CHECK( data.str_hello > "hellp" ) with expansion: "hello" > "hellp" +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:169: FAILED: CHECK( data.str_hello > "z" ) with expansion: "hello" > "z" +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:170: FAILED: CHECK( data.str_hello < "hellm" ) with expansion: "hello" < "hellm" +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:171: FAILED: CHECK( data.str_hello < "a" ) with expansion: "hello" < "a" +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:173: FAILED: CHECK( data.str_hello >= "z" ) with expansion: "hello" >= "z" +------------------------------------------------------------------------------- +./failing/conditions/ordered +............................................................................... + ConditionTests.cpp:174: FAILED: CHECK( data.str_hello <= "a" ) with expansion: @@ -655,72 +999,120 @@ PASSED: with expansion: 1 == 1 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:189: PASSED: REQUIRE( ui == 2 ) with expansion: 2 == 2 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:190: PASSED: REQUIRE( l == 3 ) with expansion: 3 == 3 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:191: PASSED: REQUIRE( ul == 4 ) with expansion: 4 == 4 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:192: PASSED: REQUIRE( c == 5 ) with expansion: 5 == 5 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:193: PASSED: REQUIRE( uc == 6 ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:195: PASSED: REQUIRE( 1 == i ) with expansion: 1 == 1 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:196: PASSED: REQUIRE( 2 == ui ) with expansion: 2 == 2 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:197: PASSED: REQUIRE( 3 == l ) with expansion: 3 == 3 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:198: PASSED: REQUIRE( 4 == ul ) with expansion: 4 == 4 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:199: PASSED: REQUIRE( 5 == c ) with expansion: 5 == 5 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:200: PASSED: REQUIRE( 6 == uc ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +./succeeding/conditions/int literals +............................................................................... + ConditionTests.cpp:202: PASSED: REQUIRE( (std::numeric_limits::max)() > ul ) @@ -737,18 +1129,30 @@ PASSED: with expansion: 1 == 1 +------------------------------------------------------------------------------- +./succeeding/conditions//long_to_unsigned_x +............................................................................... + ConditionTests.cpp:224: PASSED: REQUIRE( long_var == unsigned_short_var ) with expansion: 1 == 1 +------------------------------------------------------------------------------- +./succeeding/conditions//long_to_unsigned_x +............................................................................... + ConditionTests.cpp:225: PASSED: REQUIRE( long_var == unsigned_int_var ) with expansion: 1 == 1 +------------------------------------------------------------------------------- +./succeeding/conditions//long_to_unsigned_x +............................................................................... + ConditionTests.cpp:226: PASSED: REQUIRE( long_var == unsigned_long_var ) @@ -765,18 +1169,30 @@ PASSED: with expansion: 1 == 1 +------------------------------------------------------------------------------- +./succeeding/conditions/const ints to int literal +............................................................................... + ConditionTests.cpp:238: PASSED: REQUIRE( unsigned_short_var == 1 ) with expansion: 1 == 1 +------------------------------------------------------------------------------- +./succeeding/conditions/const ints to int literal +............................................................................... + ConditionTests.cpp:239: PASSED: REQUIRE( unsigned_int_var == 1 ) with expansion: 1 == 1 +------------------------------------------------------------------------------- +./succeeding/conditions/const ints to int literal +............................................................................... + ConditionTests.cpp:240: PASSED: REQUIRE( unsigned_long_var == 1 ) @@ -793,30 +1209,50 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +./succeeding/conditions/negative ints +............................................................................... + ConditionTests.cpp:247: PASSED: CHECK( -1 > 2u ) with expansion: -1 > 2 +------------------------------------------------------------------------------- +./succeeding/conditions/negative ints +............................................................................... + ConditionTests.cpp:249: PASSED: CHECK( ( 2u < -1 ) ) with expansion: true +------------------------------------------------------------------------------- +./succeeding/conditions/negative ints +............................................................................... + ConditionTests.cpp:250: PASSED: CHECK( 2u < -1 ) with expansion: 2 < -1 +------------------------------------------------------------------------------- +./succeeding/conditions/negative ints +............................................................................... + ConditionTests.cpp:253: PASSED: CHECK( ( minInt > 2u ) ) with expansion: true +------------------------------------------------------------------------------- +./succeeding/conditions/negative ints +............................................................................... + ConditionTests.cpp:254: PASSED: CHECK( minInt > 2u ) @@ -843,42 +1279,70 @@ PASSED: with expansion: __null == 0 +------------------------------------------------------------------------------- +./succeeding/conditions/ptr +............................................................................... + ConditionTests.cpp:286: PASSED: REQUIRE( p == pNULL ) with expansion: __null == __null +------------------------------------------------------------------------------- +./succeeding/conditions/ptr +............................................................................... + ConditionTests.cpp:291: PASSED: REQUIRE( p != __null ) with expansion: 0x != 0 +------------------------------------------------------------------------------- +./succeeding/conditions/ptr +............................................................................... + ConditionTests.cpp:294: PASSED: REQUIRE( cp != __null ) with expansion: 0x != 0 +------------------------------------------------------------------------------- +./succeeding/conditions/ptr +............................................................................... + ConditionTests.cpp:297: PASSED: REQUIRE( cpc != __null ) with expansion: 0x != 0 +------------------------------------------------------------------------------- +./succeeding/conditions/ptr +............................................................................... + ConditionTests.cpp:299: PASSED: REQUIRE( returnsNull() == __null ) with expansion: {null string} == 0 +------------------------------------------------------------------------------- +./succeeding/conditions/ptr +............................................................................... + ConditionTests.cpp:300: PASSED: REQUIRE( returnsConstNull() == __null ) with expansion: {null string} == 0 +------------------------------------------------------------------------------- +./succeeding/conditions/ptr +............................................................................... + ConditionTests.cpp:302: PASSED: REQUIRE( __null != p ) @@ -893,38 +1357,66 @@ ConditionTests.cpp:317: PASSED: REQUIRE( false == false ) +------------------------------------------------------------------------------- +./succeeding/conditions/not +............................................................................... + ConditionTests.cpp:318: PASSED: REQUIRE( true == true ) +------------------------------------------------------------------------------- +./succeeding/conditions/not +............................................................................... + ConditionTests.cpp:319: PASSED: REQUIRE( !false ) with expansion: true +------------------------------------------------------------------------------- +./succeeding/conditions/not +............................................................................... + ConditionTests.cpp:320: PASSED: REQUIRE_FALSE( !false ) +------------------------------------------------------------------------------- +./succeeding/conditions/not +............................................................................... + ConditionTests.cpp:322: PASSED: REQUIRE( !falseValue ) with expansion: true +------------------------------------------------------------------------------- +./succeeding/conditions/not +............................................................................... + ConditionTests.cpp:323: PASSED: REQUIRE_FALSE( !falseValue ) with expansion: !false +------------------------------------------------------------------------------- +./succeeding/conditions/not +............................................................................... + ConditionTests.cpp:325: PASSED: REQUIRE( !(1 == 2) ) with expansion: true +------------------------------------------------------------------------------- +./succeeding/conditions/not +............................................................................... + ConditionTests.cpp:326: PASSED: REQUIRE_FALSE( !1 == 2 ) @@ -938,32 +1430,60 @@ with expansion: ConditionTests.cpp:334: FAILED: CHECK( false != false ) +------------------------------------------------------------------------------- +./failing/conditions/not +............................................................................... + ConditionTests.cpp:335: FAILED: CHECK( true != true ) +------------------------------------------------------------------------------- +./failing/conditions/not +............................................................................... + ConditionTests.cpp:336: FAILED: CHECK( !true ) with expansion: false +------------------------------------------------------------------------------- +./failing/conditions/not +............................................................................... + ConditionTests.cpp:337: FAILED: CHECK_FALSE( !true ) +------------------------------------------------------------------------------- +./failing/conditions/not +............................................................................... + ConditionTests.cpp:339: FAILED: CHECK( !trueValue ) with expansion: false +------------------------------------------------------------------------------- +./failing/conditions/not +............................................................................... + ConditionTests.cpp:340: FAILED: CHECK_FALSE( !trueValue ) with expansion: !true +------------------------------------------------------------------------------- +./failing/conditions/not +............................................................................... + ConditionTests.cpp:342: FAILED: CHECK( !(1 == 1) ) with expansion: false +------------------------------------------------------------------------------- +./failing/conditions/not +............................................................................... + ConditionTests.cpp:343: FAILED: CHECK_FALSE( !1 == 1 ) with expansion: @@ -977,10 +1497,18 @@ ExceptionTests.cpp:39: PASSED: REQUIRE_THROWS_AS( thisThrows() ) +------------------------------------------------------------------------------- +./succeeding/exceptions/explicit +............................................................................... + ExceptionTests.cpp:40: PASSED: REQUIRE_NOTHROW( thisDoesntThrow() ) +------------------------------------------------------------------------------- +./succeeding/exceptions/explicit +............................................................................... + ExceptionTests.cpp:41: PASSED: REQUIRE_THROWS( thisThrows() ) @@ -994,10 +1522,18 @@ ExceptionTests.cpp:47: FAILED: due to unexpected exception with message: expected exception +------------------------------------------------------------------------------- +./failing/exceptions/explicit +............................................................................... + ExceptionTests.cpp:48: FAILED: CHECK_THROWS_AS( thisDoesntThrow() ) because no exception was thrown where one was expected: +------------------------------------------------------------------------------- +./failing/exceptions/explicit +............................................................................... + ExceptionTests.cpp:49: FAILED: CHECK_NOTHROW( thisThrows() ) due to unexpected exception with message: @@ -1019,6 +1555,10 @@ ExceptionTests.cpp:60: PASSED: CHECK( 1 == 1 ) +------------------------------------------------------------------------------- +./failing/exceptions/implicit/2 +............................................................................... + ExceptionTests.cpp:60: FAILED: {Unknown expression after the reported line} due to unexpected exception with message: @@ -1092,858 +1632,1430 @@ PASSED: with expansion: 2 == 2 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 +------------------------------------------------------------------------------- +./succeeding/generators/1 +............................................................................... + GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) @@ -1960,6 +3072,10 @@ PASSED: with expansion: 0 == 0 +------------------------------------------------------------------------------- +./succeeding/generators/2 +............................................................................... + GeneratorTests.cpp:40: PASSED: CATCH_REQUIRE( i->first == i->second-1 ) @@ -1975,6 +3091,10 @@ warning: this is a message this is a warning +------------------------------------------------------------------------------- +./succeeding/message +............................................................................... + No assertions in test case, './succeeding/message' @@ -2011,6 +3131,10 @@ with expansion: with message: this message should not be logged +------------------------------------------------------------------------------- +./mixed/message/info/2 +............................................................................... + MessageTests.cpp:37: FAILED: CHECK( a == 1 ) with expansion: @@ -2018,6 +3142,10 @@ with expansion: with message: this message should be logged +------------------------------------------------------------------------------- +./mixed/message/info/2 +............................................................................... + MessageTests.cpp:41: FAILED: CHECK( a == 0 ) with expansion: @@ -2025,6 +3153,10 @@ with expansion: with message: and this, but later +------------------------------------------------------------------------------- +./mixed/message/info/2 +............................................................................... + MessageTests.cpp:45: PASSED: CHECK( a == 2 ) @@ -2090,6 +3222,10 @@ with messages: current counter 0 i := 0 +------------------------------------------------------------------------------- +./mixed/message/scoped +............................................................................... + MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -2099,6 +3235,10 @@ with messages: current counter 1 i := 1 +------------------------------------------------------------------------------- +./mixed/message/scoped +............................................................................... + MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -2108,6 +3248,10 @@ with messages: current counter 2 i := 2 +------------------------------------------------------------------------------- +./mixed/message/scoped +............................................................................... + MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -2117,6 +3261,10 @@ with messages: current counter 3 i := 3 +------------------------------------------------------------------------------- +./mixed/message/scoped +............................................................................... + MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -2126,6 +3274,10 @@ with messages: current counter 4 i := 4 +------------------------------------------------------------------------------- +./mixed/message/scoped +............................................................................... + MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -2135,6 +3287,10 @@ with messages: current counter 5 i := 5 +------------------------------------------------------------------------------- +./mixed/message/scoped +............................................................................... + MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -2144,6 +3300,10 @@ with messages: current counter 6 i := 6 +------------------------------------------------------------------------------- +./mixed/message/scoped +............................................................................... + MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -2153,6 +3313,10 @@ with messages: current counter 7 i := 7 +------------------------------------------------------------------------------- +./mixed/message/scoped +............................................................................... + MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -2162,6 +3326,10 @@ with messages: current counter 8 i := 8 +------------------------------------------------------------------------------- +./mixed/message/scoped +............................................................................... + MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -2171,6 +3339,10 @@ with messages: current counter 9 i := 9 +------------------------------------------------------------------------------- +./mixed/message/scoped +............................................................................... + MessageTests.cpp:86: FAILED: REQUIRE( i < 10 ) with expansion: @@ -2187,6 +3359,10 @@ MessageTests.cpp:92: FAILED - but was ok: CHECK_NOFAIL( 1 == 2 ) +------------------------------------------------------------------------------- +./succeeding/nofail +............................................................................... + No assertions in test case, './succeeding/nofail' @@ -2344,6 +3520,10 @@ with expansion: with message: Testing if fib[0] (1) is even +------------------------------------------------------------------------------- +./mixed/Misc/loops +............................................................................... + MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -2351,6 +3531,10 @@ with expansion: with message: Testing if fib[1] (1) is even +------------------------------------------------------------------------------- +./mixed/Misc/loops +............................................................................... + MiscTests.cpp:115: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) @@ -2359,6 +3543,10 @@ with expansion: with message: Testing if fib[2] (2) is even +------------------------------------------------------------------------------- +./mixed/Misc/loops +............................................................................... + MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -2366,6 +3554,10 @@ with expansion: with message: Testing if fib[3] (3) is even +------------------------------------------------------------------------------- +./mixed/Misc/loops +............................................................................... + MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -2373,6 +3565,10 @@ with expansion: with message: Testing if fib[4] (5) is even +------------------------------------------------------------------------------- +./mixed/Misc/loops +............................................................................... + MiscTests.cpp:115: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) @@ -2381,6 +3577,10 @@ with expansion: with message: Testing if fib[5] (8) is even +------------------------------------------------------------------------------- +./mixed/Misc/loops +............................................................................... + MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -2388,6 +3588,10 @@ with expansion: with message: Testing if fib[6] (13) is even +------------------------------------------------------------------------------- +./mixed/Misc/loops +............................................................................... + MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -2414,6 +3618,10 @@ PASSED: with expansion: "valid string" != {null string} +------------------------------------------------------------------------------- +./succeeding/Misc/null strings +............................................................................... + MiscTests.cpp:134: PASSED: REQUIRE( makeString( true ) == static_cast(__null) ) @@ -2440,6 +3648,10 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +./succeeding/checkedif +............................................................................... + MiscTests.cpp:155: PASSED: REQUIRE( testCheckedIf( true ) ) @@ -2455,6 +3667,10 @@ MiscTests.cpp:147: FAILED: with expansion: false +------------------------------------------------------------------------------- +./failing/checkedif +............................................................................... + MiscTests.cpp:160: FAILED: REQUIRE( testCheckedIf( false ) ) with expansion: @@ -2470,6 +3686,10 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +./succeeding/checkedelse +............................................................................... + MiscTests.cpp:173: PASSED: REQUIRE( testCheckedElse( true ) ) @@ -2485,6 +3705,10 @@ MiscTests.cpp:165: FAILED: with expansion: false +------------------------------------------------------------------------------- +./failing/checkedelse +............................................................................... + MiscTests.cpp:178: FAILED: REQUIRE( testCheckedElse( false ) ) with expansion: @@ -2535,18 +3759,30 @@ PASSED: with expansion: "this string contains 'abc' as a substring" contains: "string" +------------------------------------------------------------------------------- +./succeeding/matchers +............................................................................... + MiscTests.cpp:217: PASSED: CHECK_THAT( testStringForMatching() Contains( "abc" ) ) with expansion: "this string contains 'abc' as a substring" contains: "abc" +------------------------------------------------------------------------------- +./succeeding/matchers +............................................................................... + MiscTests.cpp:219: PASSED: CHECK_THAT( testStringForMatching() StartsWith( "this" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "this" +------------------------------------------------------------------------------- +./succeeding/matchers +............................................................................... + MiscTests.cpp:220: PASSED: CHECK_THAT( testStringForMatching() EndsWith( "substring" ) ) @@ -2611,6 +3847,10 @@ with expansion: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) +------------------------------------------------------------------------------- +./succeeding/matchers/AnyOf +............................................................................... + MiscTests.cpp:253: PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) ) @@ -2639,24 +3879,40 @@ PASSED: with expansion: 1 == 1 +------------------------------------------------------------------------------- +example/factorial +............................................................................... + MiscTests.cpp:270: PASSED: REQUIRE( Factorial(1) == 1 ) with expansion: 1 == 1 +------------------------------------------------------------------------------- +example/factorial +............................................................................... + MiscTests.cpp:271: PASSED: REQUIRE( Factorial(2) == 2 ) with expansion: 2 == 2 +------------------------------------------------------------------------------- +example/factorial +............................................................................... + MiscTests.cpp:272: PASSED: REQUIRE( Factorial(3) == 6 ) with expansion: 6 == 6 +------------------------------------------------------------------------------- +example/factorial +............................................................................... + MiscTests.cpp:273: PASSED: REQUIRE( Factorial(10) == 3628800 ) @@ -2678,6 +3934,10 @@ MiscTests.cpp:282: warning: This one ran +------------------------------------------------------------------------------- +Nice descriptive name +............................................................................... + No assertions in test case, 'Nice descriptive name' @@ -3121,6 +4381,10 @@ PASSED: with expansion: 2 == 2 +------------------------------------------------------------------------------- +meta/Misc/Sections +............................................................................... + TestMain.cpp:58: PASSED: CHECK( totals.assertions.failed == 1 ) @@ -3654,30 +4918,50 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +selftest/test filter +............................................................................... + TestMain.cpp:292: PASSED: CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false +------------------------------------------------------------------------------- +selftest/test filter +............................................................................... + TestMain.cpp:297: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false +------------------------------------------------------------------------------- +selftest/test filter +............................................................................... + TestMain.cpp:298: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true +------------------------------------------------------------------------------- +selftest/test filter +............................................................................... + TestMain.cpp:300: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ) with expansion: true +------------------------------------------------------------------------------- +selftest/test filter +............................................................................... + TestMain.cpp:301: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ) @@ -3694,18 +4978,30 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +selftest/test filters +............................................................................... + TestMain.cpp:314: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false +------------------------------------------------------------------------------- +selftest/test filters +............................................................................... + TestMain.cpp:315: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true +------------------------------------------------------------------------------- +selftest/test filters +............................................................................... + TestMain.cpp:316: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ) @@ -3722,6 +5018,10 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +selftest/filter/prefix wildcard +............................................................................... + TestMain.cpp:323: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) @@ -3738,18 +5038,30 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +selftest/filter/wildcard at both ends +............................................................................... + TestMain.cpp:329: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ) with expansion: true +------------------------------------------------------------------------------- +selftest/filter/wildcard at both ends +............................................................................... + TestMain.cpp:330: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ) with expansion: true +------------------------------------------------------------------------------- +selftest/filter/wildcard at both ends +............................................................................... + TestMain.cpp:331: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ) @@ -3764,18 +5076,30 @@ TestMain.cpp:351: PASSED: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) +------------------------------------------------------------------------------- +selftest/option parsers +............................................................................... + TestMain.cpp:353: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 +------------------------------------------------------------------------------- +selftest/option parsers +............................................................................... + TestMain.cpp:354: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false +------------------------------------------------------------------------------- +selftest/option parsers +............................................................................... + TestMain.cpp:355: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) @@ -4000,6 +5324,10 @@ warning: Uncomment the code in this test to check that it gives a sensible compiler error +------------------------------------------------------------------------------- +./inprogress/failing/Tricky/trailing expression +............................................................................... + No assertions in test case, './inprogress/failing/Tricky/trailing expression' @@ -4012,6 +5340,10 @@ warning: Uncomment the code in this test to check that it gives a sensible compiler error +------------------------------------------------------------------------------- +./inprogress/failing/Tricky/compound lhs +............................................................................... + No assertions in test case, './inprogress/failing/Tricky/compound lhs' @@ -4024,6 +5356,10 @@ TrickyTests.cpp:95: FAILED: with expansion: 0x == 0x +------------------------------------------------------------------------------- +./failing/Tricky/non streamable type +............................................................................... + TrickyTests.cpp:96: FAILED: CHECK( o1 == o2 ) with expansion: @@ -4048,6 +5384,10 @@ PASSED: with expansion: 7 == 7 +------------------------------------------------------------------------------- +./succeeding/side-effects +............................................................................... + TrickyTests.cpp:120: PASSED: REQUIRE( i++ == 8 ) @@ -4177,12 +5517,20 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +./succeeding/SafeBool +............................................................................... + TrickyTests.cpp:314: PASSED: CHECK( !False ) with expansion: true +------------------------------------------------------------------------------- +./succeeding/SafeBool +............................................................................... + TrickyTests.cpp:315: PASSED: CHECK_FALSE( !False ) @@ -4233,30 +5581,50 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) +------------------------------------------------------------------------------- +./succeeding/Approx/simple +............................................................................... + ApproxTests.cpp:21: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: 1.23 != Approx( 1.22 ) +------------------------------------------------------------------------------- +./succeeding/Approx/simple +............................................................................... + ApproxTests.cpp:22: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: 1.23 != Approx( 1.24 ) +------------------------------------------------------------------------------- +./succeeding/Approx/simple +............................................................................... + ApproxTests.cpp:24: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 +------------------------------------------------------------------------------- +./succeeding/Approx/simple +............................................................................... + ApproxTests.cpp:25: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: Approx( 1.23 ) != 1.22 +------------------------------------------------------------------------------- +./succeeding/Approx/simple +............................................................................... + ApproxTests.cpp:26: PASSED: REQUIRE( Approx( d ) != 1.24 ) @@ -4273,6 +5641,10 @@ PASSED: with expansion: 1.23 != Approx( 1.231 ) +------------------------------------------------------------------------------- +./succeeding/Approx/epsilon +............................................................................... + ApproxTests.cpp:39: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) @@ -4289,6 +5661,10 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) +------------------------------------------------------------------------------- +./succeeding/Approx/float +............................................................................... + ApproxTests.cpp:50: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) @@ -4303,6 +5679,10 @@ ApproxTests.cpp:60: PASSED: REQUIRE( 1 == Approx( 1 ) ) +------------------------------------------------------------------------------- +./succeeding/Approx/int +............................................................................... + ApproxTests.cpp:61: PASSED: REQUIRE( 0 == Approx( 0 ) ) @@ -4317,24 +5697,40 @@ PASSED: with expansion: 1 == Approx( 1 ) +------------------------------------------------------------------------------- +./succeeding/Approx/mixed +............................................................................... + ApproxTests.cpp:76: PASSED: REQUIRE( 0 == Approx( dZero) ) with expansion: 0 == Approx( 0 ) +------------------------------------------------------------------------------- +./succeeding/Approx/mixed +............................................................................... + ApproxTests.cpp:77: PASSED: REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) with expansion: 0 == Approx( 1e-05 ) +------------------------------------------------------------------------------- +./succeeding/Approx/mixed +............................................................................... + ApproxTests.cpp:78: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: 1.234 == Approx( 1.234 ) +------------------------------------------------------------------------------- +./succeeding/Approx/mixed +............................................................................... + ApproxTests.cpp:79: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) @@ -4351,42 +5747,70 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:94: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: 1.23 == Approx( 1.22 ) +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:95: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: 1.23 == Approx( 1.24 ) +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:96: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: 1.23 != Approx( 1.25 ) +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:98: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:99: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: Approx( 1.23 ) == 1.22 +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:100: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: Approx( 1.23 ) == 1.24 +------------------------------------------------------------------------------- +./succeeding/Approx/custom +............................................................................... + ApproxTests.cpp:101: PASSED: REQUIRE( approx( d ) != 1.25 ) @@ -4403,6 +5827,10 @@ PASSED: with expansion: 3.142857142857143 == Approx( 3.141 ) +------------------------------------------------------------------------------- +Approximate PI +............................................................................... + ApproxTests.cpp:111: PASSED: REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) @@ -4457,36 +5885,60 @@ PASSED: with expansion: 7 == 7 +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:56: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: 9.1 == Approx( 9.1 ) +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:57: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: 3.1415926535 == Approx( 3.14159 ) +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:58: PASSED: REQUIRE( data.str_hello == "hello" ) with expansion: "hello" == "hello" +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:59: PASSED: REQUIRE( "hello" == data.str_hello ) with expansion: "hello" == "hello" +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:60: PASSED: REQUIRE( data.str_hello.size() == 5 ) with expansion: 5 == 5 +------------------------------------------------------------------------------- +./succeeding/conditions/equality +............................................................................... + ConditionTests.cpp:63: PASSED: REQUIRE( x == Approx( 1.3 ) ) @@ -4502,6 +5954,10 @@ ConditionTests.cpp:71: FAILED: with expansion: 7 == 6 +------------------------------------------------------------------------------- +./failing/conditions/equality +............................................................................... + ConditionTests.cpp:72: FAILED: CHECK( data.int_seven == 8 ) with expansion: diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 49f8afc5..30e6d663 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* * CATCH v0.9 build 21 (integration branch) - * Generated: 2013-03-04 12:17:59.865403 + * Generated: 2013-03-04 15:05:07.210014 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -7219,7 +7219,7 @@ namespace Catch { if( !currentSectionInfo ) { printHeader( unusedTestCaseInfo->name ); stream << std::endl; - unusedTestCaseInfo.reset(); +// unusedTestCaseInfo.reset(); } } void lazyPrintSectionInfo() { From b7ff995e890f8d4fa26eb794f502724b3726761d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 6 Mar 2013 20:40:16 +0100 Subject: [PATCH 142/296] Tidied up some loose ends with reporting test cases and sections (now handles them as a single block). This should fixes an issue where sections not being printed when they should be (and reverses a workaround where they were being printed too much) --- include/reporters/catch_reporter_console.hpp | 61 +- .../SelfTest/Baselines/approvedResults.txt | 1731 +++-------------- projects/SelfTest/TrickyTests.cpp | 59 + 3 files changed, 359 insertions(+), 1492 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 44abbb6d..a9b88fbe 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -17,7 +17,7 @@ namespace Catch { struct ConsoleReporter : StreamingReporterBase { ConsoleReporter( ReporterConfig const& _config ) : StreamingReporterBase( _config ), - m_printedCurrentSection( false ), + m_headerPrinted( false ), m_atLeastOneTestCasePrinted( false ) {} @@ -50,7 +50,7 @@ namespace Catch { } virtual void sectionStarting( SectionInfo const& _sectionInfo ) { - m_printedCurrentSection = false; + m_headerPrinted = false; StreamingReporterBase::sectionStarting( _sectionInfo ); } virtual void sectionEnded( SectionStats const& _sectionStats ) { @@ -59,7 +59,7 @@ namespace Catch { TextColour colour( TextColour::ResultError ); stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; } - m_printedCurrentSection = false; + m_headerPrinted = false; StreamingReporterBase::sectionEnded( _sectionStats ); } @@ -71,6 +71,7 @@ namespace Catch { stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl; } StreamingReporterBase::testCaseEnded( _testCaseStats ); + m_headerPrinted = false; } virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { if( !unusedGroupInfo ) { @@ -250,11 +251,11 @@ namespace Catch { lazyPrintRunInfo(); if( unusedGroupInfo ) lazyPrintGroupInfo(); - if( unusedTestCaseInfo ) - lazyPrintTestCaseInfo(); - if( currentSectionInfo && !m_printedCurrentSection ) - lazyPrintSectionInfo(); + if( !m_headerPrinted ) { + printTestCaseAndSectionHeader(); + m_headerPrinted = true; + } m_atLeastOneTestCasePrinted = true; } void lazyPrintRunInfo() { @@ -271,42 +272,42 @@ namespace Catch { } void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() && unusedGroupInfo->groupsCounts > 1 ) { - printHeader( "Group: " + unusedGroupInfo->name ); + printClosedHeader( "Group: " + unusedGroupInfo->name ); unusedGroupInfo.reset(); } } void lazyPrintTestCaseInfo() { if( !currentSectionInfo ) { - printHeader( unusedTestCaseInfo->name ); + printClosedHeader( unusedTestCaseInfo->name ); stream << std::endl; -// unusedTestCaseInfo.reset(); } } - void lazyPrintSectionInfo() { - - std::vector sections; - for( ThreadedSectionInfo* section = currentSectionInfo.get(); - section; - section = section->parent ) - sections.push_back( section ); - - // Sections - if( !sections.empty() ) { - printHeader( unusedTestCaseInfo->name, false ); + void printTestCaseAndSectionHeader() { + printOpenHeader( unusedTestCaseInfo->name ); + if( currentSectionInfo ) { + std::vector sections; + for( ThreadedSectionInfo* section = currentSectionInfo.get(); + section; + section = section->parent ) + sections.push_back( section ); - typedef std::vector::const_reverse_iterator It; - for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) - stream << " " << (*it)->name << "\n"; - stream << getDots() << "\n" << std::endl; + // Sections + if( !sections.empty() ) { + typedef std::vector::const_reverse_iterator It; + for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) + stream << " " << (*it)->name << "\n"; + } } - m_printedCurrentSection = true; + stream << getDots() << "\n" << std::endl; } - void printHeader( std::string const& _name, bool closed = true ) { + void printClosedHeader( std::string const& _name ) { + printOpenHeader( _name ); + stream << getDots() << "\n"; + } + void printOpenHeader( std::string const& _name ) { stream << getDashes() << "\n" << _name << "\n"; - if( closed ) - stream << getDots() << "\n"; } void printTotals( const Totals& totals ) { @@ -376,7 +377,7 @@ namespace Catch { } private: - bool m_printedCurrentSection; + bool m_headerPrinted; bool m_atLeastOneTestCasePrinted; }; diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 833e2092..a9d0650d 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -12,50 +12,30 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) -------------------------------------------------------------------------------- -./succeeding/Approx/simple -............................................................................... - ApproxTests.cpp:21: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: 1.23 != Approx( 1.22 ) -------------------------------------------------------------------------------- -./succeeding/Approx/simple -............................................................................... - ApproxTests.cpp:22: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: 1.23 != Approx( 1.24 ) -------------------------------------------------------------------------------- -./succeeding/Approx/simple -............................................................................... - ApproxTests.cpp:24: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -------------------------------------------------------------------------------- -./succeeding/Approx/simple -............................................................................... - ApproxTests.cpp:25: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: Approx( 1.23 ) != 1.22 -------------------------------------------------------------------------------- -./succeeding/Approx/simple -............................................................................... - ApproxTests.cpp:26: PASSED: REQUIRE( Approx( d ) != 1.24 ) @@ -72,10 +52,6 @@ PASSED: with expansion: 1.23 != Approx( 1.231 ) -------------------------------------------------------------------------------- -./succeeding/Approx/epsilon -............................................................................... - ApproxTests.cpp:39: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) @@ -92,10 +68,6 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) -------------------------------------------------------------------------------- -./succeeding/Approx/float -............................................................................... - ApproxTests.cpp:50: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) @@ -110,10 +82,6 @@ ApproxTests.cpp:60: PASSED: REQUIRE( 1 == Approx( 1 ) ) -------------------------------------------------------------------------------- -./succeeding/Approx/int -............................................................................... - ApproxTests.cpp:61: PASSED: REQUIRE( 0 == Approx( 0 ) ) @@ -128,40 +96,24 @@ PASSED: with expansion: 1 == Approx( 1 ) -------------------------------------------------------------------------------- -./succeeding/Approx/mixed -............................................................................... - ApproxTests.cpp:76: PASSED: REQUIRE( 0 == Approx( dZero) ) with expansion: 0 == Approx( 0 ) -------------------------------------------------------------------------------- -./succeeding/Approx/mixed -............................................................................... - ApproxTests.cpp:77: PASSED: REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) with expansion: 0 == Approx( 1e-05 ) -------------------------------------------------------------------------------- -./succeeding/Approx/mixed -............................................................................... - ApproxTests.cpp:78: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: 1.234 == Approx( 1.234 ) -------------------------------------------------------------------------------- -./succeeding/Approx/mixed -............................................................................... - ApproxTests.cpp:79: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) @@ -178,70 +130,42 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:94: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: 1.23 == Approx( 1.22 ) -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:95: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: 1.23 == Approx( 1.24 ) -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:96: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: 1.23 != Approx( 1.25 ) -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:98: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:99: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: Approx( 1.23 ) == 1.22 -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:100: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: Approx( 1.23 ) == 1.24 -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:101: PASSED: REQUIRE( approx( d ) != 1.25 ) @@ -258,10 +182,6 @@ PASSED: with expansion: 3.142857142857143 == Approx( 3.141 ) -------------------------------------------------------------------------------- -Approximate PI -............................................................................... - ApproxTests.cpp:111: PASSED: REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) @@ -316,60 +236,36 @@ PASSED: with expansion: 7 == 7 -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:56: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: 9.1 == Approx( 9.1 ) -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:57: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: 3.1415926535 == Approx( 3.14159 ) -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:58: PASSED: REQUIRE( data.str_hello == "hello" ) with expansion: "hello" == "hello" -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:59: PASSED: REQUIRE( "hello" == data.str_hello ) with expansion: "hello" == "hello" -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:60: PASSED: REQUIRE( data.str_hello.size() == 5 ) with expansion: 5 == 5 -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:63: PASSED: REQUIRE( x == Approx( 1.3 ) ) @@ -385,109 +281,61 @@ ConditionTests.cpp:71: FAILED: with expansion: 7 == 6 -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:72: FAILED: CHECK( data.int_seven == 8 ) with expansion: 7 == 8 -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:73: FAILED: CHECK( data.int_seven == 0 ) with expansion: 7 == 0 -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:74: FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: 9.1 == Approx( 9.11 ) -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:75: FAILED: CHECK( data.float_nine_point_one == Approx( 9.0f ) ) with expansion: 9.1 == Approx( 9 ) -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:76: FAILED: CHECK( data.float_nine_point_one == Approx( 1 ) ) with expansion: 9.1 == Approx( 1 ) -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:77: FAILED: CHECK( data.float_nine_point_one == Approx( 0 ) ) with expansion: 9.1 == Approx( 0 ) -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:78: FAILED: CHECK( data.double_pi == Approx( 3.1415 ) ) with expansion: 3.1415926535 == Approx( 3.1415 ) -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:79: FAILED: CHECK( data.str_hello == "goodbye" ) with expansion: "hello" == "goodbye" -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:80: FAILED: CHECK( data.str_hello == "hell" ) with expansion: "hello" == "hell" -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:81: FAILED: CHECK( data.str_hello == "hello1" ) with expansion: "hello" == "hello1" -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:82: FAILED: CHECK( data.str_hello.size() == 6 ) with expansion: 5 == 6 -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:85: FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: @@ -503,100 +351,60 @@ PASSED: with expansion: 7 != 6 -------------------------------------------------------------------------------- -./succeeding/conditions/inequality -............................................................................... - ConditionTests.cpp:94: PASSED: REQUIRE( data.int_seven != 8 ) with expansion: 7 != 8 -------------------------------------------------------------------------------- -./succeeding/conditions/inequality -............................................................................... - ConditionTests.cpp:95: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.11f ) ) with expansion: 9.1 != Approx( 9.11 ) -------------------------------------------------------------------------------- -./succeeding/conditions/inequality -............................................................................... - ConditionTests.cpp:96: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.0f ) ) with expansion: 9.1 != Approx( 9 ) -------------------------------------------------------------------------------- -./succeeding/conditions/inequality -............................................................................... - ConditionTests.cpp:97: PASSED: REQUIRE( data.float_nine_point_one != Approx( 1 ) ) with expansion: 9.1 != Approx( 1 ) -------------------------------------------------------------------------------- -./succeeding/conditions/inequality -............................................................................... - ConditionTests.cpp:98: PASSED: REQUIRE( data.float_nine_point_one != Approx( 0 ) ) with expansion: 9.1 != Approx( 0 ) -------------------------------------------------------------------------------- -./succeeding/conditions/inequality -............................................................................... - ConditionTests.cpp:99: PASSED: REQUIRE( data.double_pi != Approx( 3.1415 ) ) with expansion: 3.1415926535 != Approx( 3.1415 ) -------------------------------------------------------------------------------- -./succeeding/conditions/inequality -............................................................................... - ConditionTests.cpp:100: PASSED: REQUIRE( data.str_hello != "goodbye" ) with expansion: "hello" != "goodbye" -------------------------------------------------------------------------------- -./succeeding/conditions/inequality -............................................................................... - ConditionTests.cpp:101: PASSED: REQUIRE( data.str_hello != "hell" ) with expansion: "hello" != "hell" -------------------------------------------------------------------------------- -./succeeding/conditions/inequality -............................................................................... - ConditionTests.cpp:102: PASSED: REQUIRE( data.str_hello != "hello1" ) with expansion: "hello" != "hello1" -------------------------------------------------------------------------------- -./succeeding/conditions/inequality -............................................................................... - ConditionTests.cpp:103: PASSED: REQUIRE( data.str_hello.size() != 6 ) @@ -612,37 +420,21 @@ ConditionTests.cpp:111: FAILED: with expansion: 7 != 7 -------------------------------------------------------------------------------- -./failing/conditions/inequality -............................................................................... - ConditionTests.cpp:112: FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: 9.1 != Approx( 9.1 ) -------------------------------------------------------------------------------- -./failing/conditions/inequality -............................................................................... - ConditionTests.cpp:113: FAILED: CHECK( data.double_pi != Approx( 3.1415926535 ) ) with expansion: 3.1415926535 != Approx( 3.14159 ) -------------------------------------------------------------------------------- -./failing/conditions/inequality -............................................................................... - ConditionTests.cpp:114: FAILED: CHECK( data.str_hello != "hello" ) with expansion: "hello" != "hello" -------------------------------------------------------------------------------- -./failing/conditions/inequality -............................................................................... - ConditionTests.cpp:115: FAILED: CHECK( data.str_hello.size() != 5 ) with expansion: @@ -658,160 +450,96 @@ PASSED: with expansion: 7 < 8 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:125: PASSED: REQUIRE( data.int_seven > 6 ) with expansion: 7 > 6 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:126: PASSED: REQUIRE( data.int_seven > 0 ) with expansion: 7 > 0 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:127: PASSED: REQUIRE( data.int_seven > -1 ) with expansion: 7 > -1 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:129: PASSED: REQUIRE( data.int_seven >= 7 ) with expansion: 7 >= 7 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:130: PASSED: REQUIRE( data.int_seven >= 6 ) with expansion: 7 >= 6 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:131: PASSED: REQUIRE( data.int_seven <= 7 ) with expansion: 7 <= 7 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:132: PASSED: REQUIRE( data.int_seven <= 8 ) with expansion: 7 <= 8 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:134: PASSED: REQUIRE( data.float_nine_point_one > 9 ) with expansion: 9.1 > 9 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:135: PASSED: REQUIRE( data.float_nine_point_one < 10 ) with expansion: 9.1 < 10 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:136: PASSED: REQUIRE( data.float_nine_point_one < 9.2 ) with expansion: 9.1 < 9.199999999999999 -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:138: PASSED: REQUIRE( data.str_hello <= "hello" ) with expansion: "hello" <= "hello" -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:139: PASSED: REQUIRE( data.str_hello >= "hello" ) with expansion: "hello" >= "hello" -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:141: PASSED: REQUIRE( data.str_hello < "hellp" ) with expansion: "hello" < "hellp" -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:142: PASSED: REQUIRE( data.str_hello < "zebra" ) with expansion: "hello" < "zebra" -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:143: PASSED: REQUIRE( data.str_hello > "hellm" ) with expansion: "hello" > "hellm" -------------------------------------------------------------------------------- -./succeeding/conditions/ordered -............................................................................... - ConditionTests.cpp:144: PASSED: REQUIRE( data.str_hello > "a" ) @@ -827,163 +555,91 @@ ConditionTests.cpp:152: FAILED: with expansion: 7 > 7 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:153: FAILED: CHECK( data.int_seven < 7 ) with expansion: 7 < 7 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:154: FAILED: CHECK( data.int_seven > 8 ) with expansion: 7 > 8 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:155: FAILED: CHECK( data.int_seven < 6 ) with expansion: 7 < 6 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:156: FAILED: CHECK( data.int_seven < 0 ) with expansion: 7 < 0 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:157: FAILED: CHECK( data.int_seven < -1 ) with expansion: 7 < -1 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:159: FAILED: CHECK( data.int_seven >= 8 ) with expansion: 7 >= 8 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:160: FAILED: CHECK( data.int_seven <= 6 ) with expansion: 7 <= 6 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:162: FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: 9.1 < 9 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:163: FAILED: CHECK( data.float_nine_point_one > 10 ) with expansion: 9.1 > 10 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:164: FAILED: CHECK( data.float_nine_point_one > 9.2 ) with expansion: 9.1 > 9.199999999999999 -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:166: FAILED: CHECK( data.str_hello > "hello" ) with expansion: "hello" > "hello" -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:167: FAILED: CHECK( data.str_hello < "hello" ) with expansion: "hello" < "hello" -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:168: FAILED: CHECK( data.str_hello > "hellp" ) with expansion: "hello" > "hellp" -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:169: FAILED: CHECK( data.str_hello > "z" ) with expansion: "hello" > "z" -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:170: FAILED: CHECK( data.str_hello < "hellm" ) with expansion: "hello" < "hellm" -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:171: FAILED: CHECK( data.str_hello < "a" ) with expansion: "hello" < "a" -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:173: FAILED: CHECK( data.str_hello >= "z" ) with expansion: "hello" >= "z" -------------------------------------------------------------------------------- -./failing/conditions/ordered -............................................................................... - ConditionTests.cpp:174: FAILED: CHECK( data.str_hello <= "a" ) with expansion: @@ -999,120 +655,72 @@ PASSED: with expansion: 1 == 1 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:189: PASSED: REQUIRE( ui == 2 ) with expansion: 2 == 2 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:190: PASSED: REQUIRE( l == 3 ) with expansion: 3 == 3 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:191: PASSED: REQUIRE( ul == 4 ) with expansion: 4 == 4 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:192: PASSED: REQUIRE( c == 5 ) with expansion: 5 == 5 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:193: PASSED: REQUIRE( uc == 6 ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:195: PASSED: REQUIRE( 1 == i ) with expansion: 1 == 1 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:196: PASSED: REQUIRE( 2 == ui ) with expansion: 2 == 2 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:197: PASSED: REQUIRE( 3 == l ) with expansion: 3 == 3 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:198: PASSED: REQUIRE( 4 == ul ) with expansion: 4 == 4 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:199: PASSED: REQUIRE( 5 == c ) with expansion: 5 == 5 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:200: PASSED: REQUIRE( 6 == uc ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -./succeeding/conditions/int literals -............................................................................... - ConditionTests.cpp:202: PASSED: REQUIRE( (std::numeric_limits::max)() > ul ) @@ -1129,30 +737,18 @@ PASSED: with expansion: 1 == 1 -------------------------------------------------------------------------------- -./succeeding/conditions//long_to_unsigned_x -............................................................................... - ConditionTests.cpp:224: PASSED: REQUIRE( long_var == unsigned_short_var ) with expansion: 1 == 1 -------------------------------------------------------------------------------- -./succeeding/conditions//long_to_unsigned_x -............................................................................... - ConditionTests.cpp:225: PASSED: REQUIRE( long_var == unsigned_int_var ) with expansion: 1 == 1 -------------------------------------------------------------------------------- -./succeeding/conditions//long_to_unsigned_x -............................................................................... - ConditionTests.cpp:226: PASSED: REQUIRE( long_var == unsigned_long_var ) @@ -1169,30 +765,18 @@ PASSED: with expansion: 1 == 1 -------------------------------------------------------------------------------- -./succeeding/conditions/const ints to int literal -............................................................................... - ConditionTests.cpp:238: PASSED: REQUIRE( unsigned_short_var == 1 ) with expansion: 1 == 1 -------------------------------------------------------------------------------- -./succeeding/conditions/const ints to int literal -............................................................................... - ConditionTests.cpp:239: PASSED: REQUIRE( unsigned_int_var == 1 ) with expansion: 1 == 1 -------------------------------------------------------------------------------- -./succeeding/conditions/const ints to int literal -............................................................................... - ConditionTests.cpp:240: PASSED: REQUIRE( unsigned_long_var == 1 ) @@ -1209,50 +793,30 @@ PASSED: with expansion: true -------------------------------------------------------------------------------- -./succeeding/conditions/negative ints -............................................................................... - ConditionTests.cpp:247: PASSED: CHECK( -1 > 2u ) with expansion: -1 > 2 -------------------------------------------------------------------------------- -./succeeding/conditions/negative ints -............................................................................... - ConditionTests.cpp:249: PASSED: CHECK( ( 2u < -1 ) ) with expansion: true -------------------------------------------------------------------------------- -./succeeding/conditions/negative ints -............................................................................... - ConditionTests.cpp:250: PASSED: CHECK( 2u < -1 ) with expansion: 2 < -1 -------------------------------------------------------------------------------- -./succeeding/conditions/negative ints -............................................................................... - ConditionTests.cpp:253: PASSED: CHECK( ( minInt > 2u ) ) with expansion: true -------------------------------------------------------------------------------- -./succeeding/conditions/negative ints -............................................................................... - ConditionTests.cpp:254: PASSED: CHECK( minInt > 2u ) @@ -1279,70 +843,42 @@ PASSED: with expansion: __null == 0 -------------------------------------------------------------------------------- -./succeeding/conditions/ptr -............................................................................... - ConditionTests.cpp:286: PASSED: REQUIRE( p == pNULL ) with expansion: __null == __null -------------------------------------------------------------------------------- -./succeeding/conditions/ptr -............................................................................... - ConditionTests.cpp:291: PASSED: REQUIRE( p != __null ) with expansion: 0x != 0 -------------------------------------------------------------------------------- -./succeeding/conditions/ptr -............................................................................... - ConditionTests.cpp:294: PASSED: REQUIRE( cp != __null ) with expansion: 0x != 0 -------------------------------------------------------------------------------- -./succeeding/conditions/ptr -............................................................................... - ConditionTests.cpp:297: PASSED: REQUIRE( cpc != __null ) with expansion: 0x != 0 -------------------------------------------------------------------------------- -./succeeding/conditions/ptr -............................................................................... - ConditionTests.cpp:299: PASSED: REQUIRE( returnsNull() == __null ) with expansion: {null string} == 0 -------------------------------------------------------------------------------- -./succeeding/conditions/ptr -............................................................................... - ConditionTests.cpp:300: PASSED: REQUIRE( returnsConstNull() == __null ) with expansion: {null string} == 0 -------------------------------------------------------------------------------- -./succeeding/conditions/ptr -............................................................................... - ConditionTests.cpp:302: PASSED: REQUIRE( __null != p ) @@ -1357,66 +893,38 @@ ConditionTests.cpp:317: PASSED: REQUIRE( false == false ) -------------------------------------------------------------------------------- -./succeeding/conditions/not -............................................................................... - ConditionTests.cpp:318: PASSED: REQUIRE( true == true ) -------------------------------------------------------------------------------- -./succeeding/conditions/not -............................................................................... - ConditionTests.cpp:319: PASSED: REQUIRE( !false ) with expansion: true -------------------------------------------------------------------------------- -./succeeding/conditions/not -............................................................................... - ConditionTests.cpp:320: PASSED: REQUIRE_FALSE( !false ) -------------------------------------------------------------------------------- -./succeeding/conditions/not -............................................................................... - ConditionTests.cpp:322: PASSED: REQUIRE( !falseValue ) with expansion: true -------------------------------------------------------------------------------- -./succeeding/conditions/not -............................................................................... - ConditionTests.cpp:323: PASSED: REQUIRE_FALSE( !falseValue ) with expansion: !false -------------------------------------------------------------------------------- -./succeeding/conditions/not -............................................................................... - ConditionTests.cpp:325: PASSED: REQUIRE( !(1 == 2) ) with expansion: true -------------------------------------------------------------------------------- -./succeeding/conditions/not -............................................................................... - ConditionTests.cpp:326: PASSED: REQUIRE_FALSE( !1 == 2 ) @@ -1430,60 +938,32 @@ with expansion: ConditionTests.cpp:334: FAILED: CHECK( false != false ) -------------------------------------------------------------------------------- -./failing/conditions/not -............................................................................... - ConditionTests.cpp:335: FAILED: CHECK( true != true ) -------------------------------------------------------------------------------- -./failing/conditions/not -............................................................................... - ConditionTests.cpp:336: FAILED: CHECK( !true ) with expansion: false -------------------------------------------------------------------------------- -./failing/conditions/not -............................................................................... - ConditionTests.cpp:337: FAILED: CHECK_FALSE( !true ) -------------------------------------------------------------------------------- -./failing/conditions/not -............................................................................... - ConditionTests.cpp:339: FAILED: CHECK( !trueValue ) with expansion: false -------------------------------------------------------------------------------- -./failing/conditions/not -............................................................................... - ConditionTests.cpp:340: FAILED: CHECK_FALSE( !trueValue ) with expansion: !true -------------------------------------------------------------------------------- -./failing/conditions/not -............................................................................... - ConditionTests.cpp:342: FAILED: CHECK( !(1 == 1) ) with expansion: false -------------------------------------------------------------------------------- -./failing/conditions/not -............................................................................... - ConditionTests.cpp:343: FAILED: CHECK_FALSE( !1 == 1 ) with expansion: @@ -1497,18 +977,10 @@ ExceptionTests.cpp:39: PASSED: REQUIRE_THROWS_AS( thisThrows() ) -------------------------------------------------------------------------------- -./succeeding/exceptions/explicit -............................................................................... - ExceptionTests.cpp:40: PASSED: REQUIRE_NOTHROW( thisDoesntThrow() ) -------------------------------------------------------------------------------- -./succeeding/exceptions/explicit -............................................................................... - ExceptionTests.cpp:41: PASSED: REQUIRE_THROWS( thisThrows() ) @@ -1522,18 +994,10 @@ ExceptionTests.cpp:47: FAILED: due to unexpected exception with message: expected exception -------------------------------------------------------------------------------- -./failing/exceptions/explicit -............................................................................... - ExceptionTests.cpp:48: FAILED: CHECK_THROWS_AS( thisDoesntThrow() ) because no exception was thrown where one was expected: -------------------------------------------------------------------------------- -./failing/exceptions/explicit -............................................................................... - ExceptionTests.cpp:49: FAILED: CHECK_NOTHROW( thisThrows() ) due to unexpected exception with message: @@ -1555,10 +1019,6 @@ ExceptionTests.cpp:60: PASSED: CHECK( 1 == 1 ) -------------------------------------------------------------------------------- -./failing/exceptions/implicit/2 -............................................................................... - ExceptionTests.cpp:60: FAILED: {Unknown expression after the reported line} due to unexpected exception with message: @@ -1632,1430 +1092,858 @@ PASSED: with expansion: 2 == 2 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 200 == 200 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 202 == 202 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 204 == 204 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 206 == 206 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 208 == 208 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 210 == 210 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 212 == 212 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 2 == 2 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 4 == 4 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 8 == 8 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 10 == 10 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 30 == 30 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 40 == 40 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 42 == 42 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) with expansion: 214 == 214 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:26: PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) with expansion: 72 == 72 -------------------------------------------------------------------------------- -./succeeding/generators/1 -............................................................................... - GeneratorTests.cpp:27: PASSED: CATCH_REQUIRE( multiply( j, 2 ) == j*2 ) @@ -3072,10 +1960,6 @@ PASSED: with expansion: 0 == 0 -------------------------------------------------------------------------------- -./succeeding/generators/2 -............................................................................... - GeneratorTests.cpp:40: PASSED: CATCH_REQUIRE( i->first == i->second-1 ) @@ -3091,10 +1975,6 @@ warning: this is a message this is a warning -------------------------------------------------------------------------------- -./succeeding/message -............................................................................... - No assertions in test case, './succeeding/message' @@ -3131,10 +2011,6 @@ with expansion: with message: this message should not be logged -------------------------------------------------------------------------------- -./mixed/message/info/2 -............................................................................... - MessageTests.cpp:37: FAILED: CHECK( a == 1 ) with expansion: @@ -3142,10 +2018,6 @@ with expansion: with message: this message should be logged -------------------------------------------------------------------------------- -./mixed/message/info/2 -............................................................................... - MessageTests.cpp:41: FAILED: CHECK( a == 0 ) with expansion: @@ -3153,10 +2025,6 @@ with expansion: with message: and this, but later -------------------------------------------------------------------------------- -./mixed/message/info/2 -............................................................................... - MessageTests.cpp:45: PASSED: CHECK( a == 2 ) @@ -3222,10 +2090,6 @@ with messages: current counter 0 i := 0 -------------------------------------------------------------------------------- -./mixed/message/scoped -............................................................................... - MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -3235,10 +2099,6 @@ with messages: current counter 1 i := 1 -------------------------------------------------------------------------------- -./mixed/message/scoped -............................................................................... - MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -3248,10 +2108,6 @@ with messages: current counter 2 i := 2 -------------------------------------------------------------------------------- -./mixed/message/scoped -............................................................................... - MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -3261,10 +2117,6 @@ with messages: current counter 3 i := 3 -------------------------------------------------------------------------------- -./mixed/message/scoped -............................................................................... - MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -3274,10 +2126,6 @@ with messages: current counter 4 i := 4 -------------------------------------------------------------------------------- -./mixed/message/scoped -............................................................................... - MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -3287,10 +2135,6 @@ with messages: current counter 5 i := 5 -------------------------------------------------------------------------------- -./mixed/message/scoped -............................................................................... - MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -3300,10 +2144,6 @@ with messages: current counter 6 i := 6 -------------------------------------------------------------------------------- -./mixed/message/scoped -............................................................................... - MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -3313,10 +2153,6 @@ with messages: current counter 7 i := 7 -------------------------------------------------------------------------------- -./mixed/message/scoped -............................................................................... - MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -3326,10 +2162,6 @@ with messages: current counter 8 i := 8 -------------------------------------------------------------------------------- -./mixed/message/scoped -............................................................................... - MessageTests.cpp:86: PASSED: REQUIRE( i < 10 ) @@ -3339,10 +2171,6 @@ with messages: current counter 9 i := 9 -------------------------------------------------------------------------------- -./mixed/message/scoped -............................................................................... - MessageTests.cpp:86: FAILED: REQUIRE( i < 10 ) with expansion: @@ -3359,10 +2187,6 @@ MessageTests.cpp:92: FAILED - but was ok: CHECK_NOFAIL( 1 == 2 ) -------------------------------------------------------------------------------- -./succeeding/nofail -............................................................................... - No assertions in test case, './succeeding/nofail' @@ -3520,10 +2344,6 @@ with expansion: with message: Testing if fib[0] (1) is even -------------------------------------------------------------------------------- -./mixed/Misc/loops -............................................................................... - MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -3531,10 +2351,6 @@ with expansion: with message: Testing if fib[1] (1) is even -------------------------------------------------------------------------------- -./mixed/Misc/loops -............................................................................... - MiscTests.cpp:115: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) @@ -3543,10 +2359,6 @@ with expansion: with message: Testing if fib[2] (2) is even -------------------------------------------------------------------------------- -./mixed/Misc/loops -............................................................................... - MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -3554,10 +2366,6 @@ with expansion: with message: Testing if fib[3] (3) is even -------------------------------------------------------------------------------- -./mixed/Misc/loops -............................................................................... - MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -3565,10 +2373,6 @@ with expansion: with message: Testing if fib[4] (5) is even -------------------------------------------------------------------------------- -./mixed/Misc/loops -............................................................................... - MiscTests.cpp:115: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) @@ -3577,10 +2381,6 @@ with expansion: with message: Testing if fib[5] (8) is even -------------------------------------------------------------------------------- -./mixed/Misc/loops -............................................................................... - MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -3588,10 +2388,6 @@ with expansion: with message: Testing if fib[6] (13) is even -------------------------------------------------------------------------------- -./mixed/Misc/loops -............................................................................... - MiscTests.cpp:115: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -3618,10 +2414,6 @@ PASSED: with expansion: "valid string" != {null string} -------------------------------------------------------------------------------- -./succeeding/Misc/null strings -............................................................................... - MiscTests.cpp:134: PASSED: REQUIRE( makeString( true ) == static_cast(__null) ) @@ -3648,10 +2440,6 @@ PASSED: with expansion: true -------------------------------------------------------------------------------- -./succeeding/checkedif -............................................................................... - MiscTests.cpp:155: PASSED: REQUIRE( testCheckedIf( true ) ) @@ -3667,10 +2455,6 @@ MiscTests.cpp:147: FAILED: with expansion: false -------------------------------------------------------------------------------- -./failing/checkedif -............................................................................... - MiscTests.cpp:160: FAILED: REQUIRE( testCheckedIf( false ) ) with expansion: @@ -3686,10 +2470,6 @@ PASSED: with expansion: true -------------------------------------------------------------------------------- -./succeeding/checkedelse -............................................................................... - MiscTests.cpp:173: PASSED: REQUIRE( testCheckedElse( true ) ) @@ -3705,10 +2485,6 @@ MiscTests.cpp:165: FAILED: with expansion: false -------------------------------------------------------------------------------- -./failing/checkedelse -............................................................................... - MiscTests.cpp:178: FAILED: REQUIRE( testCheckedElse( false ) ) with expansion: @@ -3759,30 +2535,18 @@ PASSED: with expansion: "this string contains 'abc' as a substring" contains: "string" -------------------------------------------------------------------------------- -./succeeding/matchers -............................................................................... - MiscTests.cpp:217: PASSED: CHECK_THAT( testStringForMatching() Contains( "abc" ) ) with expansion: "this string contains 'abc' as a substring" contains: "abc" -------------------------------------------------------------------------------- -./succeeding/matchers -............................................................................... - MiscTests.cpp:219: PASSED: CHECK_THAT( testStringForMatching() StartsWith( "this" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "this" -------------------------------------------------------------------------------- -./succeeding/matchers -............................................................................... - MiscTests.cpp:220: PASSED: CHECK_THAT( testStringForMatching() EndsWith( "substring" ) ) @@ -3847,10 +2611,6 @@ with expansion: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -------------------------------------------------------------------------------- -./succeeding/matchers/AnyOf -............................................................................... - MiscTests.cpp:253: PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) ) @@ -3879,40 +2639,24 @@ PASSED: with expansion: 1 == 1 -------------------------------------------------------------------------------- -example/factorial -............................................................................... - MiscTests.cpp:270: PASSED: REQUIRE( Factorial(1) == 1 ) with expansion: 1 == 1 -------------------------------------------------------------------------------- -example/factorial -............................................................................... - MiscTests.cpp:271: PASSED: REQUIRE( Factorial(2) == 2 ) with expansion: 2 == 2 -------------------------------------------------------------------------------- -example/factorial -............................................................................... - MiscTests.cpp:272: PASSED: REQUIRE( Factorial(3) == 6 ) with expansion: 6 == 6 -------------------------------------------------------------------------------- -example/factorial -............................................................................... - MiscTests.cpp:273: PASSED: REQUIRE( Factorial(10) == 3628800 ) @@ -3934,10 +2678,6 @@ MiscTests.cpp:282: warning: This one ran -------------------------------------------------------------------------------- -Nice descriptive name -............................................................................... - No assertions in test case, 'Nice descriptive name' @@ -4381,10 +3121,6 @@ PASSED: with expansion: 2 == 2 -------------------------------------------------------------------------------- -meta/Misc/Sections -............................................................................... - TestMain.cpp:58: PASSED: CHECK( totals.assertions.failed == 1 ) @@ -4918,50 +3654,30 @@ PASSED: with expansion: true -------------------------------------------------------------------------------- -selftest/test filter -............................................................................... - TestMain.cpp:292: PASSED: CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -------------------------------------------------------------------------------- -selftest/test filter -............................................................................... - TestMain.cpp:297: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -------------------------------------------------------------------------------- -selftest/test filter -............................................................................... - TestMain.cpp:298: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -------------------------------------------------------------------------------- -selftest/test filter -............................................................................... - TestMain.cpp:300: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ) with expansion: true -------------------------------------------------------------------------------- -selftest/test filter -............................................................................... - TestMain.cpp:301: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ) @@ -4978,30 +3694,18 @@ PASSED: with expansion: true -------------------------------------------------------------------------------- -selftest/test filters -............................................................................... - TestMain.cpp:314: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -------------------------------------------------------------------------------- -selftest/test filters -............................................................................... - TestMain.cpp:315: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -------------------------------------------------------------------------------- -selftest/test filters -............................................................................... - TestMain.cpp:316: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ) @@ -5018,10 +3722,6 @@ PASSED: with expansion: true -------------------------------------------------------------------------------- -selftest/filter/prefix wildcard -............................................................................... - TestMain.cpp:323: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) @@ -5038,30 +3738,18 @@ PASSED: with expansion: true -------------------------------------------------------------------------------- -selftest/filter/wildcard at both ends -............................................................................... - TestMain.cpp:329: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ) with expansion: true -------------------------------------------------------------------------------- -selftest/filter/wildcard at both ends -............................................................................... - TestMain.cpp:330: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ) with expansion: true -------------------------------------------------------------------------------- -selftest/filter/wildcard at both ends -............................................................................... - TestMain.cpp:331: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ) @@ -5076,30 +3764,18 @@ TestMain.cpp:351: PASSED: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) -------------------------------------------------------------------------------- -selftest/option parsers -............................................................................... - TestMain.cpp:353: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -------------------------------------------------------------------------------- -selftest/option parsers -............................................................................... - TestMain.cpp:354: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -------------------------------------------------------------------------------- -selftest/option parsers -............................................................................... - TestMain.cpp:355: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) @@ -5324,10 +4000,6 @@ warning: Uncomment the code in this test to check that it gives a sensible compiler error -------------------------------------------------------------------------------- -./inprogress/failing/Tricky/trailing expression -............................................................................... - No assertions in test case, './inprogress/failing/Tricky/trailing expression' @@ -5340,10 +4012,6 @@ warning: Uncomment the code in this test to check that it gives a sensible compiler error -------------------------------------------------------------------------------- -./inprogress/failing/Tricky/compound lhs -............................................................................... - No assertions in test case, './inprogress/failing/Tricky/compound lhs' @@ -5356,10 +4024,6 @@ TrickyTests.cpp:95: FAILED: with expansion: 0x == 0x -------------------------------------------------------------------------------- -./failing/Tricky/non streamable type -............................................................................... - TrickyTests.cpp:96: FAILED: CHECK( o1 == o2 ) with expansion: @@ -5384,10 +4048,6 @@ PASSED: with expansion: 7 == 7 -------------------------------------------------------------------------------- -./succeeding/side-effects -............................................................................... - TrickyTests.cpp:120: PASSED: REQUIRE( i++ == 8 ) @@ -5517,26 +4177,132 @@ PASSED: with expansion: true -------------------------------------------------------------------------------- -./succeeding/SafeBool -............................................................................... - TrickyTests.cpp:314: PASSED: CHECK( !False ) with expansion: true -------------------------------------------------------------------------------- -./succeeding/SafeBool -............................................................................... - TrickyTests.cpp:315: PASSED: CHECK_FALSE( !False ) with expansion: !false +------------------------------------------------------------------------------- +Assertions then sections +............................................................................... + +TrickyTests.cpp:323: +PASSED: + REQUIRE( Catch::isTrue( true ) ) +with expansion: + true + +------------------------------------------------------------------------------- +Assertions then sections + A section +............................................................................... + +TrickyTests.cpp:327: +PASSED: + REQUIRE( Catch::isTrue( true ) ) +with expansion: + true + +------------------------------------------------------------------------------- +Assertions then sections + A section + Another section +............................................................................... + +TrickyTests.cpp:331: +PASSED: + REQUIRE( Catch::isTrue( true ) ) +with expansion: + true + +------------------------------------------------------------------------------- +Assertions then sections +............................................................................... + +TrickyTests.cpp:323: +PASSED: + REQUIRE( Catch::isTrue( true ) ) +with expansion: + true + +------------------------------------------------------------------------------- +Assertions then sections + A section +............................................................................... + +TrickyTests.cpp:327: +PASSED: + REQUIRE( Catch::isTrue( true ) ) +with expansion: + true + +------------------------------------------------------------------------------- +Assertions then sections + A section + Another other section +............................................................................... + +TrickyTests.cpp:335: +PASSED: + REQUIRE( Catch::isTrue( true ) ) +with expansion: + true + +------------------------------------------------------------------------------- +sort +............................................................................... + +TrickyTests.cpp:357: +PASSED: + REQUIRE( v == sorted ) +with expansion: + { 2, 3, 4 } == { 2, 3, 4 } + +------------------------------------------------------------------------------- +sort + already sorted +............................................................................... + +TrickyTests.cpp:362: +PASSED: + REQUIRE( v == sorted ) +with expansion: + { 2, 3, 4 } == { 2, 3, 4 } + +------------------------------------------------------------------------------- +sort +............................................................................... + +TrickyTests.cpp:357: +PASSED: + REQUIRE( v == sorted ) +with expansion: + { 2, 3, 4 } == { 2, 3, 4 } + +------------------------------------------------------------------------------- +sort + reverse sorted +............................................................................... + +TrickyTests.cpp:368: +PASSED: + REQUIRE( v != sorted ) +with expansion: + { 4, 3, 2 } != { 2, 3, 4 } + +TrickyTests.cpp:372: +PASSED: + REQUIRE( v == sorted ) +with expansion: + { 2, 3, 4 } == { 2, 3, 4 } + ------------------------------------------------------------------------------- Scenario: Do that thing with the thing Given: This stuff exists @@ -5565,7 +4331,7 @@ with expansion: true =============================================================================== -100 test cases - 47 failed (619 assertions - 104 failed) +102 test cases - 47 failed (630 assertions - 104 failed) CatchSelfTest is a CATCH v0.9 b21 (integration) host application. @@ -5581,50 +4347,30 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) -------------------------------------------------------------------------------- -./succeeding/Approx/simple -............................................................................... - ApproxTests.cpp:21: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: 1.23 != Approx( 1.22 ) -------------------------------------------------------------------------------- -./succeeding/Approx/simple -............................................................................... - ApproxTests.cpp:22: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: 1.23 != Approx( 1.24 ) -------------------------------------------------------------------------------- -./succeeding/Approx/simple -............................................................................... - ApproxTests.cpp:24: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -------------------------------------------------------------------------------- -./succeeding/Approx/simple -............................................................................... - ApproxTests.cpp:25: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: Approx( 1.23 ) != 1.22 -------------------------------------------------------------------------------- -./succeeding/Approx/simple -............................................................................... - ApproxTests.cpp:26: PASSED: REQUIRE( Approx( d ) != 1.24 ) @@ -5641,10 +4387,6 @@ PASSED: with expansion: 1.23 != Approx( 1.231 ) -------------------------------------------------------------------------------- -./succeeding/Approx/epsilon -............................................................................... - ApproxTests.cpp:39: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) @@ -5661,10 +4403,6 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) -------------------------------------------------------------------------------- -./succeeding/Approx/float -............................................................................... - ApproxTests.cpp:50: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) @@ -5679,10 +4417,6 @@ ApproxTests.cpp:60: PASSED: REQUIRE( 1 == Approx( 1 ) ) -------------------------------------------------------------------------------- -./succeeding/Approx/int -............................................................................... - ApproxTests.cpp:61: PASSED: REQUIRE( 0 == Approx( 0 ) ) @@ -5697,40 +4431,24 @@ PASSED: with expansion: 1 == Approx( 1 ) -------------------------------------------------------------------------------- -./succeeding/Approx/mixed -............................................................................... - ApproxTests.cpp:76: PASSED: REQUIRE( 0 == Approx( dZero) ) with expansion: 0 == Approx( 0 ) -------------------------------------------------------------------------------- -./succeeding/Approx/mixed -............................................................................... - ApproxTests.cpp:77: PASSED: REQUIRE( 0 == Approx( dSmall ).epsilon( 0.001 ) ) with expansion: 0 == Approx( 1e-05 ) -------------------------------------------------------------------------------- -./succeeding/Approx/mixed -............................................................................... - ApproxTests.cpp:78: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: 1.234 == Approx( 1.234 ) -------------------------------------------------------------------------------- -./succeeding/Approx/mixed -............................................................................... - ApproxTests.cpp:79: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) @@ -5747,70 +4465,42 @@ PASSED: with expansion: 1.23 == Approx( 1.23 ) -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:94: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: 1.23 == Approx( 1.22 ) -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:95: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: 1.23 == Approx( 1.24 ) -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:96: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: 1.23 != Approx( 1.25 ) -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:98: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:99: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: Approx( 1.23 ) == 1.22 -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:100: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: Approx( 1.23 ) == 1.24 -------------------------------------------------------------------------------- -./succeeding/Approx/custom -............................................................................... - ApproxTests.cpp:101: PASSED: REQUIRE( approx( d ) != 1.25 ) @@ -5827,10 +4517,6 @@ PASSED: with expansion: 3.142857142857143 == Approx( 3.141 ) -------------------------------------------------------------------------------- -Approximate PI -............................................................................... - ApproxTests.cpp:111: PASSED: REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) @@ -5885,60 +4571,36 @@ PASSED: with expansion: 7 == 7 -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:56: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: 9.1 == Approx( 9.1 ) -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:57: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: 3.1415926535 == Approx( 3.14159 ) -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:58: PASSED: REQUIRE( data.str_hello == "hello" ) with expansion: "hello" == "hello" -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:59: PASSED: REQUIRE( "hello" == data.str_hello ) with expansion: "hello" == "hello" -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:60: PASSED: REQUIRE( data.str_hello.size() == 5 ) with expansion: 5 == 5 -------------------------------------------------------------------------------- -./succeeding/conditions/equality -............................................................................... - ConditionTests.cpp:63: PASSED: REQUIRE( x == Approx( 1.3 ) ) @@ -5954,10 +4616,6 @@ ConditionTests.cpp:71: FAILED: with expansion: 7 == 6 -------------------------------------------------------------------------------- -./failing/conditions/equality -............................................................................... - ConditionTests.cpp:72: FAILED: CHECK( data.int_seven == 8 ) with expansion: @@ -5967,7 +4625,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -6403,6 +5061,8 @@ TrickyTests.cpp:106 + + @@ -11227,6 +9887,118 @@ TrickyTests.cpp" line="315"> + +TrickyTests.cpp" line="323"> + + Catch::isTrue( true ) + + + true + + +
+TrickyTests.cpp" line="327"> + + Catch::isTrue( true ) + + + true + + +
+TrickyTests.cpp" line="331"> + + Catch::isTrue( true ) + + + true + + + +
+ +
+TrickyTests.cpp" line="323"> + + Catch::isTrue( true ) + + + true + + +
+TrickyTests.cpp" line="327"> + + Catch::isTrue( true ) + + + true + + +
+TrickyTests.cpp" line="335"> + + Catch::isTrue( true ) + + + true + + + +
+ +
+ +
+ +TrickyTests.cpp" line="357"> + + v == sorted + + + { 2, 3, 4 } == { 2, 3, 4 } + + +
+TrickyTests.cpp" line="362"> + + v == sorted + + + { 2, 3, 4 } == { 2, 3, 4 } + + + +
+TrickyTests.cpp" line="357"> + + v == sorted + + + { 2, 3, 4 } == { 2, 3, 4 } + + +
+TrickyTests.cpp" line="368"> + + v != sorted + + + { 4, 3, 2 } != { 2, 3, 4 } + + +TrickyTests.cpp" line="372"> + + v == sorted + + + { 2, 3, 4 } == { 2, 3, 4 } + + + +
+ +
@@ -11258,9 +10030,9 @@ BDDTests.cpp" line="35">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -12600,6 +11372,41 @@ TrickyTests.cpp:314: !False succeeded for: true TrickyTests.cpp:315: !False succeeded for: !false [Finished: './succeeding/SafeBool' All tests passed (3 assertions in 1 test case)] +[Running: Assertions then sections] +TrickyTests.cpp:323: Catch::isTrue( true ) succeeded for: true +[Started section: 'A section'] +TrickyTests.cpp:327: Catch::isTrue( true ) succeeded for: true +[Started section: 'Another section'] +TrickyTests.cpp:331: Catch::isTrue( true ) succeeded for: true +[End of section: 'Another section' 1 assertion passed] + +[End of section: 'A section' All 2 assertions passed] + +TrickyTests.cpp:323: Catch::isTrue( true ) succeeded for: true +[Started section: 'A section'] +TrickyTests.cpp:327: Catch::isTrue( true ) succeeded for: true +[Started section: 'Another other section'] +TrickyTests.cpp:335: Catch::isTrue( true ) succeeded for: true +[End of section: 'Another other section' 1 assertion passed] + +[End of section: 'A section' All 2 assertions passed] + +[Finished: 'Assertions then sections' All tests passed (6 assertions in 1 test case)] + +[Running: sort] +TrickyTests.cpp:357: v == sorted succeeded for: { 2, 3, 4 } == { 2, 3, 4 } +[Started section: 'already sorted'] +TrickyTests.cpp:362: v == sorted succeeded for: { 2, 3, 4 } == { 2, 3, 4 } +[End of section: 'already sorted' 1 assertion passed] + +TrickyTests.cpp:357: v == sorted succeeded for: { 2, 3, 4 } == { 2, 3, 4 } +[Started section: 'reverse sorted'] +TrickyTests.cpp:368: v != sorted succeeded for: { 4, 3, 2 } != { 2, 3, 4 } +TrickyTests.cpp:372: v == sorted succeeded for: { 2, 3, 4 } == { 2, 3, 4 } +[End of section: 'reverse sorted' All 2 assertions passed] + +[Finished: 'sort' All tests passed (5 assertions in 1 test case)] + [Running: Scenario: Do that thing with the thing] [Started section: 'Given: This stuff exists'] [Started section: ' When: I do this'] @@ -12616,10 +11423,10 @@ BDDTests.cpp:35: itDoesThat() succeeded for: true [End of section: 'Given: This stuff exists' All 2 assertions passed] [Finished: 'Scenario: Do that thing with the thing' All tests passed (2 assertions in 1 test case)] -[End of group: '~dummy'. 47 of 100 test cases failed (104 of 619 assertions failed)] +[End of group: '~dummy'. 47 of 102 test cases failed (104 of 630 assertions failed)] -[Testing completed. 47 of 100 test cases failed (104 of 619 assertions failed)] +[Testing completed. 47 of 102 test cases failed (104 of 630 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index f15d236c..bd24471c 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -314,3 +314,62 @@ TEST_CASE( "./succeeding/SafeBool", "Objects that evaluated in boolean contexts CHECK( !False ); CHECK_FALSE( False ); } + +TEST_CASE( "Assertions then sections", "" ) +{ + // This was causing a failure due to the way the console reporter was handling + // the current section + + REQUIRE( Catch::isTrue( true ) ); + + SECTION( "A section", "" ) + { + REQUIRE( Catch::isTrue( true ) ); + + SECTION( "Another section", "" ) + { + REQUIRE( Catch::isTrue( true ) ); + } + SECTION( "Another other section", "" ) + { + REQUIRE( Catch::isTrue( true ) ); + } + } +} + +inline void sort( std::vector& v ) { + std::sort( v.begin(), v.end() ); +} + +TEST_CASE( "sort", "" ) { + std::vector v; + v.push_back( 3 ); + v.push_back( 2 ); + v.push_back( 4 ); + + std::vector sorted; + sorted.push_back( 2 ); + sorted.push_back( 3 ); + sorted.push_back( 4 ); + + sort( v ); + + REQUIRE( v == sorted ); + + SECTION( "already sorted", "" ) { + sort( v ); + + REQUIRE( v == sorted ); + + } + SECTION( "reverse sorted", "" ) { + std::reverse( v.begin(), v.end() ); + + REQUIRE( v != sorted ); + + sort( v ); + + REQUIRE( v == sorted ); + + } +} From 5de07c3a30dac94022d16e4354836c2848f07499 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 6 Mar 2013 20:41:02 +0100 Subject: [PATCH 143/296] Removed unnecessary test --- .../SelfTest/Baselines/approvedResults.txt | 124 +----------------- projects/SelfTest/TrickyTests.cpp | 37 ------ 2 files changed, 6 insertions(+), 155 deletions(-) diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index a9d0650d..6f376058 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -4255,54 +4255,6 @@ PASSED: with expansion: true -------------------------------------------------------------------------------- -sort -............................................................................... - -TrickyTests.cpp:357: -PASSED: - REQUIRE( v == sorted ) -with expansion: - { 2, 3, 4 } == { 2, 3, 4 } - -------------------------------------------------------------------------------- -sort - already sorted -............................................................................... - -TrickyTests.cpp:362: -PASSED: - REQUIRE( v == sorted ) -with expansion: - { 2, 3, 4 } == { 2, 3, 4 } - -------------------------------------------------------------------------------- -sort -............................................................................... - -TrickyTests.cpp:357: -PASSED: - REQUIRE( v == sorted ) -with expansion: - { 2, 3, 4 } == { 2, 3, 4 } - -------------------------------------------------------------------------------- -sort - reverse sorted -............................................................................... - -TrickyTests.cpp:368: -PASSED: - REQUIRE( v != sorted ) -with expansion: - { 4, 3, 2 } != { 2, 3, 4 } - -TrickyTests.cpp:372: -PASSED: - REQUIRE( v == sorted ) -with expansion: - { 2, 3, 4 } == { 2, 3, 4 } - ------------------------------------------------------------------------------- Scenario: Do that thing with the thing Given: This stuff exists @@ -4331,7 +4283,7 @@ with expansion: true =============================================================================== -102 test cases - 47 failed (630 assertions - 104 failed) +101 test cases - 47 failed (625 assertions - 104 failed) CatchSelfTest is a CATCH v0.9 b21 (integration) host application. @@ -4625,7 +4577,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -5062,7 +5014,6 @@ TrickyTests.cpp:106 - @@ -9950,55 +9901,6 @@ TrickyTests.cpp" line="335">
- -TrickyTests.cpp" line="357"> - - v == sorted - - - { 2, 3, 4 } == { 2, 3, 4 } - - -
-TrickyTests.cpp" line="362"> - - v == sorted - - - { 2, 3, 4 } == { 2, 3, 4 } - - - -
-TrickyTests.cpp" line="357"> - - v == sorted - - - { 2, 3, 4 } == { 2, 3, 4 } - - -
-TrickyTests.cpp" line="368"> - - v != sorted - - - { 4, 3, 2 } != { 2, 3, 4 } - - -TrickyTests.cpp" line="372"> - - v == sorted - - - { 2, 3, 4 } == { 2, 3, 4 } - - - -
- -
@@ -10030,9 +9932,9 @@ BDDTests.cpp" line="35">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -11393,20 +11295,6 @@ TrickyTests.cpp:335: Catch::isTrue( true ) succeeded for: true [Finished: 'Assertions then sections' All tests passed (6 assertions in 1 test case)] -[Running: sort] -TrickyTests.cpp:357: v == sorted succeeded for: { 2, 3, 4 } == { 2, 3, 4 } -[Started section: 'already sorted'] -TrickyTests.cpp:362: v == sorted succeeded for: { 2, 3, 4 } == { 2, 3, 4 } -[End of section: 'already sorted' 1 assertion passed] - -TrickyTests.cpp:357: v == sorted succeeded for: { 2, 3, 4 } == { 2, 3, 4 } -[Started section: 'reverse sorted'] -TrickyTests.cpp:368: v != sorted succeeded for: { 4, 3, 2 } != { 2, 3, 4 } -TrickyTests.cpp:372: v == sorted succeeded for: { 2, 3, 4 } == { 2, 3, 4 } -[End of section: 'reverse sorted' All 2 assertions passed] - -[Finished: 'sort' All tests passed (5 assertions in 1 test case)] - [Running: Scenario: Do that thing with the thing] [Started section: 'Given: This stuff exists'] [Started section: ' When: I do this'] @@ -11423,10 +11311,10 @@ BDDTests.cpp:35: itDoesThat() succeeded for: true [End of section: 'Given: This stuff exists' All 2 assertions passed] [Finished: 'Scenario: Do that thing with the thing' All tests passed (2 assertions in 1 test case)] -[End of group: '~dummy'. 47 of 102 test cases failed (104 of 630 assertions failed)] +[End of group: '~dummy'. 47 of 101 test cases failed (104 of 625 assertions failed)] -[Testing completed. 47 of 102 test cases failed (104 of 630 assertions failed)] +[Testing completed. 47 of 101 test cases failed (104 of 625 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index bd24471c..ad84b5ca 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -336,40 +336,3 @@ TEST_CASE( "Assertions then sections", "" ) } } } - -inline void sort( std::vector& v ) { - std::sort( v.begin(), v.end() ); -} - -TEST_CASE( "sort", "" ) { - std::vector v; - v.push_back( 3 ); - v.push_back( 2 ); - v.push_back( 4 ); - - std::vector sorted; - sorted.push_back( 2 ); - sorted.push_back( 3 ); - sorted.push_back( 4 ); - - sort( v ); - - REQUIRE( v == sorted ); - - SECTION( "already sorted", "" ) { - sort( v ); - - REQUIRE( v == sorted ); - - } - SECTION( "reverse sorted", "" ) { - std::reverse( v.begin(), v.end() ); - - REQUIRE( v != sorted ); - - sort( v ); - - REQUIRE( v == sorted ); - - } -} From 85dff2bce846956a36d613f8f1d11426c50161e0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 6 Mar 2013 20:45:21 +0100 Subject: [PATCH 144/296] Added duplicate method warnings --- .../CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 1f4395b8..049feb47 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -427,7 +427,7 @@ 4A6D0C17149B3D3B00DB3EAA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0430; + LastUpgradeCheck = 0460; }; buildConfigurationList = 4A6D0C1A149B3D3B00DB3EAA /* Build configuration list for PBXProject "CatchSelfTest" */; compatibilityVersion = "Xcode 3.2"; @@ -497,6 +497,7 @@ CLANG_WARN_CXX0X_EXTENSIONS = YES; CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__EXIT_TIME_DESTRUCTORS = NO; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -544,6 +545,7 @@ CLANG_WARN_CXX0X_EXTENSIONS = YES; CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__EXIT_TIME_DESTRUCTORS = NO; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; From e57a56bb2855e713566e4ea90c2a99af60850e76 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 8 Mar 2013 09:26:20 +0000 Subject: [PATCH 145/296] Converted tabs to spaces in some files where they have crept back in --- include/internal/catch_common.h | 14 +++++++------- include/internal/catch_debugger.hpp | 4 ++-- include/internal/catch_expression_lhs.hpp | 2 +- include/internal/catch_generators.hpp | 6 +++--- include/internal/catch_stream.hpp | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 2eeb572a..55acbd4f 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -27,13 +27,13 @@ namespace Catch { - class NonCopyable { - NonCopyable( const NonCopyable& ); - void operator = ( const NonCopyable& ); - protected: - NonCopyable() {} - virtual ~NonCopyable(); - }; + class NonCopyable { + NonCopyable( const NonCopyable& ); + void operator = ( const NonCopyable& ); + protected: + NonCopyable() {} + virtual ~NonCopyable(); + }; class SafeBool { public: diff --git a/include/internal/catch_debugger.hpp b/include/internal/catch_debugger.hpp index 4b0c8337..42769898 100644 --- a/include/internal/catch_debugger.hpp +++ b/include/internal/catch_debugger.hpp @@ -97,8 +97,8 @@ return IsDebuggerPresent() != 0; } #else - inline void BreakIntoDebugger(){} - inline bool isDebuggerActive() { return false; } + inline void BreakIntoDebugger(){} + inline bool isDebuggerActive() { return false; } #endif #ifdef CATCH_PLATFORM_WINDOWS diff --git a/include/internal/catch_expression_lhs.hpp b/include/internal/catch_expression_lhs.hpp index edc5dd84..2cc7397d 100644 --- a/include/internal/catch_expression_lhs.hpp +++ b/include/internal/catch_expression_lhs.hpp @@ -19,7 +19,7 @@ struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; // in an ExpressionResultBuilder object template class ExpressionLhs { - void operator = ( const ExpressionLhs& ); + void operator = ( const ExpressionLhs& ); public: ExpressionLhs( T lhs ) : m_lhs( lhs ) {} diff --git a/include/internal/catch_generators.hpp b/include/internal/catch_generators.hpp index 76a13f44..030b1804 100644 --- a/include/internal/catch_generators.hpp +++ b/include/internal/catch_generators.hpp @@ -69,12 +69,12 @@ class CompositeGenerator { public: CompositeGenerator() : m_totalSize( 0 ) {} - // *** Move semantics, similar to auto_ptr *** + // *** Move semantics, similar to auto_ptr *** CompositeGenerator( CompositeGenerator& other ) : m_fileInfo( other.m_fileInfo ), m_totalSize( 0 ) { - move( other ); + move( other ); } CompositeGenerator& setFileInfo( const char* fileInfo ) { @@ -101,7 +101,7 @@ public: 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 + 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 ) { diff --git a/include/internal/catch_stream.hpp b/include/internal/catch_stream.hpp index 92d3310b..b3135751 100644 --- a/include/internal/catch_stream.hpp +++ b/include/internal/catch_stream.hpp @@ -32,7 +32,7 @@ namespace Catch { } private: - int overflow( int c ) { + int overflow( int c ) { sync(); if( c != EOF ) { @@ -44,7 +44,7 @@ namespace Catch { return 0; } - int sync() { + int sync() { if( pbase() != pptr() ) { m_writer( std::string( pbase(), static_cast( pptr() - pbase() ) ) ); setp( pbase(), epptr() ); From a04981b4507110d5d73c23ec403d908bafb33bec Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 8 Mar 2013 09:30:25 +0000 Subject: [PATCH 146/296] Build 22 --- README | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 4 +- single_include/catch.hpp | 97 ++++++++++--------- 4 files changed, 53 insertions(+), 52 deletions(-) diff --git a/README b/README index b3cb66b9..f2126777 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 21 (integration branch) +CATCH v0.9 build 22 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 15dc2633..b1839c74 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 21, "integration" ); + Version libraryVersion( 0, 9, 22, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 6f376058..802ad5c4 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,5 +1,5 @@ -CatchSelfTest is a CATCH v0.9 b21 (integration) host application. +CatchSelfTest is a CATCH v0.9 b22 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4286,7 +4286,7 @@ with expansion: 101 test cases - 47 failed (625 assertions - 104 failed) -CatchSelfTest is a CATCH v0.9 b21 (integration) host application. +CatchSelfTest is a CATCH v0.9 b22 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 30e6d663..b1bb8962 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 21 (integration branch) - * Generated: 2013-03-04 15:05:07.210014 + * CATCH v0.9 build 22 (integration branch) + * Generated: 2013-03-08 09:29:15.097480 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -45,13 +45,13 @@ namespace Catch { - class NonCopyable { - NonCopyable( const NonCopyable& ); - void operator = ( const NonCopyable& ); - protected: - NonCopyable() {} - virtual ~NonCopyable(); - }; + class NonCopyable { + NonCopyable( const NonCopyable& ); + void operator = ( const NonCopyable& ); + protected: + NonCopyable() {} + virtual ~NonCopyable(); + }; class SafeBool { public: @@ -949,7 +949,7 @@ struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; // in an ExpressionResultBuilder object template class ExpressionLhs { - void operator = ( const ExpressionLhs& ); + void operator = ( const ExpressionLhs& ); public: ExpressionLhs( T lhs ) : m_lhs( lhs ) {} @@ -1282,8 +1282,8 @@ namespace Catch { return IsDebuggerPresent() != 0; } #else - inline void BreakIntoDebugger(){} - inline bool isDebuggerActive() { return false; } + inline void BreakIntoDebugger(){} + inline bool isDebuggerActive() { return false; } #endif #ifdef CATCH_PLATFORM_WINDOWS @@ -1753,7 +1753,7 @@ namespace Catch { } private: - int overflow( int c ) { + int overflow( int c ) { sync(); if( c != EOF ) { @@ -1765,7 +1765,7 @@ namespace Catch { return 0; } - int sync() { + int sync() { if( pbase() != pptr() ) { m_writer( std::string( pbase(), static_cast( pptr() - pbase() ) ) ); setp( pbase(), epptr() ); @@ -2757,12 +2757,12 @@ class CompositeGenerator { public: CompositeGenerator() : m_totalSize( 0 ) {} - // *** Move semantics, similar to auto_ptr *** + // *** Move semantics, similar to auto_ptr *** CompositeGenerator( CompositeGenerator& other ) : m_fileInfo( other.m_fileInfo ), m_totalSize( 0 ) { - move( other ); + move( other ); } CompositeGenerator& setFileInfo( const char* fileInfo ) { @@ -2789,7 +2789,7 @@ public: 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 + 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 ) { @@ -5869,7 +5869,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 21, "integration" ); + Version libraryVersion( 0, 9, 22, "integration" ); } // #included from: catch_line_wrap.hpp @@ -6957,7 +6957,7 @@ namespace Catch { struct ConsoleReporter : StreamingReporterBase { ConsoleReporter( ReporterConfig const& _config ) : StreamingReporterBase( _config ), - m_printedCurrentSection( false ), + m_headerPrinted( false ), m_atLeastOneTestCasePrinted( false ) {} @@ -6990,7 +6990,7 @@ namespace Catch { } virtual void sectionStarting( SectionInfo const& _sectionInfo ) { - m_printedCurrentSection = false; + m_headerPrinted = false; StreamingReporterBase::sectionStarting( _sectionInfo ); } virtual void sectionEnded( SectionStats const& _sectionStats ) { @@ -6999,7 +6999,7 @@ namespace Catch { TextColour colour( TextColour::ResultError ); stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; } - m_printedCurrentSection = false; + m_headerPrinted = false; StreamingReporterBase::sectionEnded( _sectionStats ); } @@ -7011,6 +7011,7 @@ namespace Catch { stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl; } StreamingReporterBase::testCaseEnded( _testCaseStats ); + m_headerPrinted = false; } virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { if( !unusedGroupInfo ) { @@ -7190,11 +7191,11 @@ namespace Catch { lazyPrintRunInfo(); if( unusedGroupInfo ) lazyPrintGroupInfo(); - if( unusedTestCaseInfo ) - lazyPrintTestCaseInfo(); - if( currentSectionInfo && !m_printedCurrentSection ) - lazyPrintSectionInfo(); + if( !m_headerPrinted ) { + printTestCaseAndSectionHeader(); + m_headerPrinted = true; + } m_atLeastOneTestCasePrinted = true; } void lazyPrintRunInfo() { @@ -7211,42 +7212,42 @@ namespace Catch { } void lazyPrintGroupInfo() { if( !unusedGroupInfo->name.empty() && unusedGroupInfo->groupsCounts > 1 ) { - printHeader( "Group: " + unusedGroupInfo->name ); + printClosedHeader( "Group: " + unusedGroupInfo->name ); unusedGroupInfo.reset(); } } void lazyPrintTestCaseInfo() { if( !currentSectionInfo ) { - printHeader( unusedTestCaseInfo->name ); + printClosedHeader( unusedTestCaseInfo->name ); stream << std::endl; -// unusedTestCaseInfo.reset(); } } - void lazyPrintSectionInfo() { + void printTestCaseAndSectionHeader() { + printOpenHeader( unusedTestCaseInfo->name ); + if( currentSectionInfo ) { + std::vector sections; + for( ThreadedSectionInfo* section = currentSectionInfo.get(); + section; + section = section->parent ) + sections.push_back( section ); - std::vector sections; - for( ThreadedSectionInfo* section = currentSectionInfo.get(); - section; - section = section->parent ) - sections.push_back( section ); - - // Sections - if( !sections.empty() ) { - printHeader( unusedTestCaseInfo->name, false ); - - typedef std::vector::const_reverse_iterator It; - for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) - stream << " " << (*it)->name << "\n"; - stream << getDots() << "\n" << std::endl; + // Sections + if( !sections.empty() ) { + typedef std::vector::const_reverse_iterator It; + for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) + stream << " " << (*it)->name << "\n"; + } } - m_printedCurrentSection = true; + stream << getDots() << "\n" << std::endl; } - void printHeader( std::string const& _name, bool closed = true ) { + void printClosedHeader( std::string const& _name ) { + printOpenHeader( _name ); + stream << getDots() << "\n"; + } + void printOpenHeader( std::string const& _name ) { stream << getDashes() << "\n" << _name << "\n"; - if( closed ) - stream << getDots() << "\n"; } void printTotals( const Totals& totals ) { @@ -7316,7 +7317,7 @@ namespace Catch { } private: - bool m_printedCurrentSection; + bool m_headerPrinted; bool m_atLeastOneTestCasePrinted; }; From 3df6c0d1b4b444be040464befd6e9ebdd3287d42 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 11 Mar 2013 18:38:29 +0000 Subject: [PATCH 147/296] Refactored ConsoleColour impl. Tweaked the (Windows) colours a bit. Also fixed issue that would cause warnings on some compilers when doing REQUIRE( p ); where p is a pointer. Moved to build 23 --- README | 2 +- include/internal/catch_capture.hpp | 2 +- include/internal/catch_console_colour.hpp | 15 +- .../internal/catch_console_colour_impl.hpp | 214 ++++++++-------- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 4 +- single_include/catch.hpp | 233 +++++++++--------- 7 files changed, 237 insertions(+), 235 deletions(-) diff --git a/README b/README index f2126777..098e5dfc 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 22 (integration branch) +CATCH v0.9 build 23 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index a32528a9..4cc9705f 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -70,7 +70,7 @@ inline bool isTrue( bool value ){ return value; } if( internal_catch_action & Catch::ResultAction::Debug ) BreakIntoDebugger(); \ if( internal_catch_action & Catch::ResultAction::Abort ) 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 ); } \ + Catch::isTrue( false && originalExpr ); \ } /////////////////////////////////////////////////////////////////////////////// diff --git a/include/internal/catch_console_colour.hpp b/include/internal/catch_console_colour.hpp index 6cb0b828..c508a64b 100644 --- a/include/internal/catch_console_colour.hpp +++ b/include/internal/catch_console_colour.hpp @@ -12,11 +12,7 @@ namespace Catch { - struct ConsoleColourImpl; - - class TextColour : NonCopyable { - public: - + struct IConsoleColourCodes : NonCopyable { enum Colours { None, @@ -30,13 +26,18 @@ namespace Catch { OriginalExpression, ReconstructedExpression }; - + + virtual void set( Colours colour ) = 0; + }; + + class TextColour : public IConsoleColourCodes { + public: TextColour( Colours colour = None ); void set( Colours colour ); ~TextColour(); private: - ConsoleColourImpl* m_impl; + IConsoleColourCodes* m_impl; }; } // end namespace Catch diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index d3b1c12c..58c926e7 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -10,102 +10,36 @@ #include "catch_console_colour.hpp" -#if !defined(CATCH_CONFIG_USE_ANSI_COLOUR_CODES) && !defined(CATCH_PLATFORM_WINDOWS) -#define CATCH_CONFIG_USE_ANSI_COLOUR_CODES 1 -#endif - -#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'; } - - inline bool shouldUseColour() { - static bool s_shouldUseColour - = CATCH_CONFIG_USE_ANSI_COLOUR_CODES != 0 && - isatty( fileno(stdout) ) && - !isDebuggerActive(); - return s_shouldUseColour; - } - void TextColour::set( Colours colour ) { - if( shouldUseColour() ) { - 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 ) +#if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// #include -namespace Catch { - - namespace { +namespace { + using namespace Catch; - WORD mapConsoleColour( TextColour::Colours colour ) { - switch( colour ) { - case TextColour::FileName: - return FOREGROUND_INTENSITY; // greyed out - case TextColour::ResultError: - return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red - case TextColour::ResultSuccess: - return FOREGROUND_GREEN | FOREGROUND_INTENSITY; // bright green - case TextColour::Error: - return FOREGROUND_RED; // dark red - case TextColour::Success: - return FOREGROUND_GREEN; // dark green - case TextColour::OriginalExpression: - return FOREGROUND_BLUE | FOREGROUND_GREEN; // turquoise - case TextColour::ReconstructedExpression: - return FOREGROUND_RED | FOREGROUND_GREEN; // greeny-yellow - default: return 0; - } + WORD mapConsoleColour( IConsoleColourCodes::Colours colour ) { + switch( colour ) { + case IConsoleColourCodes::FileName: + return FOREGROUND_INTENSITY; // greyed out + case IConsoleColourCodes::ResultError: + return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red + case IConsoleColourCodes::ResultSuccess: + return FOREGROUND_GREEN | FOREGROUND_INTENSITY; // bright green + case IConsoleColourCodes::Error: + return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red + case IConsoleColourCodes::Success: + return FOREGROUND_GREEN; // dark green + case IConsoleColourCodes::OriginalExpression: + return FOREGROUND_BLUE | FOREGROUND_GREEN; // turquoise + case IConsoleColourCodes::ReconstructedExpression: + return FOREGROUND_RED | FOREGROUND_GREEN; // greeny-yellow + default: return 0; } } + + struct WindowsConsoleColourCodes : IConsoleColourCodes { - struct ConsoleColourImpl { - - ConsoleColourImpl() + WindowsConsoleColourCodes() : hStdout( GetStdHandle(STD_OUTPUT_HANDLE) ), wOldColorAttrs( 0 ) { @@ -113,11 +47,11 @@ namespace Catch { wOldColorAttrs = csbiInfo.wAttributes; } - ~ConsoleColourImpl() { + ~WindowsConsoleColourCodes() { SetConsoleTextAttribute( hStdout, wOldColorAttrs ); } - void set( TextColour::Colours colour ) { + void set( Colours colour ) { WORD consoleColour = mapConsoleColour( colour ); if( consoleColour > 0 ) SetConsoleTextAttribute( hStdout, consoleColour ); @@ -127,12 +61,90 @@ namespace Catch { CONSOLE_SCREEN_BUFFER_INFO csbiInfo; WORD wOldColorAttrs; }; + + inline bool shouldUseColourForPlatform() { + return true; + } - TextColour::TextColour( Colours colour ) - : m_impl( new ConsoleColourImpl() ) - { + typedef WindowsConsoleColourCodes PlatformConsoleColourCodes; + +} // end anon namespace + +#else // Not Windows - assumed to be POSIX compatible ////////////////////////// + +#include + +namespace { + using namespace Catch; + + // use POSIX/ ANSI console terminal codes + // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) + // https://github.com/philsquared/Catch/pull/131 + + struct AnsiConsoleColourCodes : IConsoleColourCodes { + + ~AnsiConsoleColourCodes() { + set( None ); + } + + void set( Colours colour ) { + const char colourEscape = '\033'; + switch( colour ) { + case FileName: + std::cout << colourEscape << "[0m"; // white/ normal + break; + case ResultError: + std::cout << colourEscape << "[0;31m"; // red + break; + case ResultSuccess: + std::cout << colourEscape << "[0;32m"; // green + break; + case Error: + std::cout << colourEscape << "[1;31m"; // bold red + break; + case Success: + std::cout << colourEscape << "[1;32m"; // bold green + break; + case OriginalExpression: + std::cout << colourEscape << "[0;36m"; // cyan + break; + case ReconstructedExpression: + std::cout << colourEscape << "[0;33m"; // yellow + break; + case None: + std::cout << colourEscape << "[0m"; // reset + } + } + }; + + inline bool shouldUseColourForPlatform() { + return isatty( fileno(stdout) ); + } + + typedef AnsiConsoleColourCodes PlatformConsoleColourCodes; + +} // namespace Catch + +#endif // not Windows + +namespace { + struct NoConsoleColourCodes : IConsoleColourCodes { + void set( Colours ) {} + }; +} + +namespace Catch { + + TextColour::TextColour( Colours colour ) : m_impl( NULL ) { + static bool s_shouldUseColour = shouldUseColourForPlatform() && + !isDebuggerActive(); + if( s_shouldUseColour ) + m_impl = new PlatformConsoleColourCodes(); + else + m_impl = new NoConsoleColourCodes(); + if( colour ) - m_impl->set( colour ); + set( colour ); } TextColour::~TextColour() { @@ -145,16 +157,4 @@ namespace Catch { } // end namespace Catch -#else - -namespace Catch { - - TextColour::TextColour( Colours ){} - TextColour::~TextColour(){} - void TextColour::set( Colours ){} - -} // end namespace Catch - -#endif - #endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index b1839c74..e1485d5c 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 22, "integration" ); + Version libraryVersion( 0, 9, 23, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 802ad5c4..e03921ad 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,5 +1,5 @@ -CatchSelfTest is a CATCH v0.9 b22 (integration) host application. +CatchSelfTest is a CATCH v0.9 b23 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4286,7 +4286,7 @@ with expansion: 101 test cases - 47 failed (625 assertions - 104 failed) -CatchSelfTest is a CATCH v0.9 b22 (integration) host application. +CatchSelfTest is a CATCH v0.9 b23 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/single_include/catch.hpp b/single_include/catch.hpp index b1bb8962..b08b6d6f 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 22 (integration branch) - * Generated: 2013-03-08 09:29:15.097480 + * CATCH v0.9 build 23 (integration branch) + * Generated: 2013-03-11 18:35:52.716695 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -2544,7 +2544,7 @@ inline bool isTrue( bool value ){ return value; } if( internal_catch_action & Catch::ResultAction::Debug ) BreakIntoDebugger(); \ if( internal_catch_action & Catch::ResultAction::Abort ) 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 ); } \ + Catch::isTrue( false && originalExpr ); \ } /////////////////////////////////////////////////////////////////////////////// @@ -5345,11 +5345,7 @@ namespace Catch { namespace Catch { - struct ConsoleColourImpl; - - class TextColour : NonCopyable { - public: - + struct IConsoleColourCodes : NonCopyable { enum Colours { None, @@ -5364,112 +5360,51 @@ namespace Catch { ReconstructedExpression }; + virtual void set( Colours colour ) = 0; + }; + + class TextColour : public IConsoleColourCodes { + public: TextColour( Colours colour = None ); void set( Colours colour ); ~TextColour(); private: - ConsoleColourImpl* m_impl; + IConsoleColourCodes* m_impl; }; } // end namespace Catch -#if !defined(CATCH_CONFIG_USE_ANSI_COLOUR_CODES) && !defined(CATCH_PLATFORM_WINDOWS) -#define CATCH_CONFIG_USE_ANSI_COLOUR_CODES 1 -#endif - -#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'; } - - inline bool shouldUseColour() { - static bool s_shouldUseColour - = CATCH_CONFIG_USE_ANSI_COLOUR_CODES != 0 && - isatty( fileno(stdout) ) && - !isDebuggerActive(); - return s_shouldUseColour; - } - void TextColour::set( Colours colour ) { - if( shouldUseColour() ) { - 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 ) +#if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// #include -namespace Catch { +namespace { + using namespace Catch; - namespace { - - WORD mapConsoleColour( TextColour::Colours colour ) { - switch( colour ) { - case TextColour::FileName: - return FOREGROUND_INTENSITY; // greyed out - case TextColour::ResultError: - return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red - case TextColour::ResultSuccess: - return FOREGROUND_GREEN | FOREGROUND_INTENSITY; // bright green - case TextColour::Error: - return FOREGROUND_RED; // dark red - case TextColour::Success: - return FOREGROUND_GREEN; // dark green - case TextColour::OriginalExpression: - return FOREGROUND_BLUE | FOREGROUND_GREEN; // turquoise - case TextColour::ReconstructedExpression: - return FOREGROUND_RED | FOREGROUND_GREEN; // greeny-yellow - default: return 0; - } + WORD mapConsoleColour( IConsoleColourCodes::Colours colour ) { + switch( colour ) { + case IConsoleColourCodes::FileName: + return FOREGROUND_INTENSITY; // greyed out + case IConsoleColourCodes::ResultError: + return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red + case IConsoleColourCodes::ResultSuccess: + return FOREGROUND_GREEN | FOREGROUND_INTENSITY; // bright green + case IConsoleColourCodes::Error: + return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red + case IConsoleColourCodes::Success: + return FOREGROUND_GREEN; // dark green + case IConsoleColourCodes::OriginalExpression: + return FOREGROUND_BLUE | FOREGROUND_GREEN; // turquoise + case IConsoleColourCodes::ReconstructedExpression: + return FOREGROUND_RED | FOREGROUND_GREEN; // greeny-yellow + default: return 0; } } - struct ConsoleColourImpl { + struct WindowsConsoleColourCodes : IConsoleColourCodes { - ConsoleColourImpl() + WindowsConsoleColourCodes() : hStdout( GetStdHandle(STD_OUTPUT_HANDLE) ), wOldColorAttrs( 0 ) { @@ -5477,11 +5412,11 @@ namespace Catch { wOldColorAttrs = csbiInfo.wAttributes; } - ~ConsoleColourImpl() { + ~WindowsConsoleColourCodes() { SetConsoleTextAttribute( hStdout, wOldColorAttrs ); } - void set( TextColour::Colours colour ) { + void set( Colours colour ) { WORD consoleColour = mapConsoleColour( colour ); if( consoleColour > 0 ) SetConsoleTextAttribute( hStdout, consoleColour ); @@ -5492,11 +5427,89 @@ namespace Catch { WORD wOldColorAttrs; }; - TextColour::TextColour( Colours colour ) - : m_impl( new ConsoleColourImpl() ) - { + inline bool shouldUseColourForPlatform() { + return true; + } + + typedef WindowsConsoleColourCodes PlatformConsoleColourCodes; + +} // end anon namespace + +#else // Not Windows - assumed to be POSIX compatible ////////////////////////// + +#include + +namespace { + using namespace Catch; + + // use POSIX/ ANSI console terminal codes + // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) + // https://github.com/philsquared/Catch/pull/131 + + struct AnsiConsoleColourCodes : IConsoleColourCodes { + + ~AnsiConsoleColourCodes() { + set( None ); + } + + void set( Colours colour ) { + const char colourEscape = '\033'; + switch( colour ) { + case FileName: + std::cout << colourEscape << "[0m"; // white/ normal + break; + case ResultError: + std::cout << colourEscape << "[0;31m"; // red + break; + case ResultSuccess: + std::cout << colourEscape << "[0;32m"; // green + break; + case Error: + std::cout << colourEscape << "[1;31m"; // bold red + break; + case Success: + std::cout << colourEscape << "[1;32m"; // bold green + break; + case OriginalExpression: + std::cout << colourEscape << "[0;36m"; // cyan + break; + case ReconstructedExpression: + std::cout << colourEscape << "[0;33m"; // yellow + break; + case None: + std::cout << colourEscape << "[0m"; // reset + } + } + }; + + inline bool shouldUseColourForPlatform() { + return isatty( fileno(stdout) ); + } + + typedef AnsiConsoleColourCodes PlatformConsoleColourCodes; + +} // namespace Catch + +#endif // not Windows + +namespace { + struct NoConsoleColourCodes : IConsoleColourCodes { + void set( Colours ) {} + }; +} + +namespace Catch { + + TextColour::TextColour( Colours colour ) : m_impl( NULL ) { + static bool s_shouldUseColour = shouldUseColourForPlatform() && + !isDebuggerActive(); + if( s_shouldUseColour ) + m_impl = new PlatformConsoleColourCodes(); + else + m_impl = new NoConsoleColourCodes(); + if( colour ) - m_impl->set( colour ); + set( colour ); } TextColour::~TextColour() { @@ -5509,18 +5522,6 @@ namespace Catch { } // end namespace Catch -#else - -namespace Catch { - - TextColour::TextColour( Colours ){} - TextColour::~TextColour(){} - void TextColour::set( Colours ){} - -} // end namespace Catch - -#endif - // #included from: catch_generators_impl.hpp #define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED @@ -5869,7 +5870,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 22, "integration" ); + Version libraryVersion( 0, 9, 23, "integration" ); } // #included from: catch_line_wrap.hpp From d78cfe127591bdd7d3effaaa782971aafd20a3f1 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 12 Mar 2013 18:47:01 +0000 Subject: [PATCH 148/296] Tweaked colours again --- include/internal/catch_console_colour_impl.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 58c926e7..b54eab4d 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -94,16 +94,16 @@ namespace { std::cout << colourEscape << "[0m"; // white/ normal break; case ResultError: - std::cout << colourEscape << "[0;31m"; // red + std::cout << colourEscape << "[1;31m"; // bold red break; case ResultSuccess: - std::cout << colourEscape << "[0;32m"; // green + std::cout << colourEscape << "[1;32m"; // bold green break; case Error: std::cout << colourEscape << "[1;31m"; // bold red break; case Success: - std::cout << colourEscape << "[1;32m"; // bold green + std::cout << colourEscape << "[0;32m"; // green break; case OriginalExpression: std::cout << colourEscape << "[0;36m"; // cyan From 17479c6e499996c220c71ce4e5bf17de7b7d248c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 12 Mar 2013 18:47:53 +0000 Subject: [PATCH 149/296] Tag and test case name querying are now case insensitive --- include/internal/catch_common.h | 3 +++ include/internal/catch_tags.hpp | 10 ++++++++-- include/internal/catch_test_spec.h | 6 +++++- .../XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp | 3 +-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 55acbd4f..e06796b8 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -80,6 +80,9 @@ namespace Catch { inline bool contains( const std::string& s, const std::string& infix ) { return s.find( infix ) != std::string::npos; } + inline void toLower( std::string& s ) { + std::transform( s.begin(), s.end(), s.begin(), ::tolower ); + } struct pluralise { pluralise( std::size_t count, const std::string& label ) diff --git a/include/internal/catch_tags.hpp b/include/internal/catch_tags.hpp index 510bff3c..15c3c3d8 100644 --- a/include/internal/catch_tags.hpp +++ b/include/internal/catch_tags.hpp @@ -8,6 +8,8 @@ #ifndef TWOBLUECUBES_CATCH_TAGS_HPP_INCLUDED #define TWOBLUECUBES_CATCH_TAGS_HPP_INCLUDED +#include "catch_common.h" + #include #include #include @@ -68,7 +70,9 @@ namespace Catch { private: virtual void acceptTag( const std::string& tag ) { - m_tags.insert( tag ); + std::string lcTag = tag; + toLower( lcTag ); + m_tags.insert( lcTag ); } virtual void acceptChar( char c ) { m_remainder += c; @@ -111,7 +115,9 @@ namespace Catch { typedef std::map TagMap; public: void add( const Tag& tag ) { - m_tags.insert( std::make_pair( tag.getName(), tag ) ); + std::string tagName = tag.getName(); + toLower( tagName ); + m_tags.insert( std::make_pair( tagName, tag ) ); } bool empty() const { diff --git a/include/internal/catch_test_spec.h b/include/internal/catch_test_spec.h index 3a30c4ea..ab1895ac 100644 --- a/include/internal/catch_test_spec.h +++ b/include/internal/catch_test_spec.h @@ -10,6 +10,7 @@ #include "catch_test_case_info.h" #include "catch_tags.hpp" +#include "catch_common.h" #include #include @@ -36,6 +37,8 @@ namespace Catch { m_filterType( matchBehaviour ), m_wildcardPosition( NoWildcard ) { + toLower( m_stringToMatch ); + if( m_filterType == IfFilterMatches::AutoDetectBehaviour ) { if( startsWith( m_stringToMatch, "exclude:" ) ) { m_stringToMatch = m_stringToMatch.substr( 8 ); @@ -75,7 +78,8 @@ namespace Catch { #endif bool isMatch( const TestCase& testCase ) const { - const std::string& name = testCase.getTestCaseInfo().name; + std::string name = testCase.getTestCaseInfo().name; + toLower( name ); switch( m_wildcardPosition ) { case NoWildcard: diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index e9971bd3..76cae47a 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -23,7 +23,7 @@ inline bool itDoesThis(){ return true; } inline bool itDoesThat(){ return true; } -SCENARIO( "Do that thing with the thing", "[tags]" ) { +SCENARIO( "Do that thing with the thing", "[Tags]" ) { GIVEN( "This stuff exists" ) { // make stuff exist WHEN( "I do this" ) { @@ -35,6 +35,5 @@ SCENARIO( "Do that thing with the thing", "[tags]" ) { REQUIRE( itDoesThat() ); } } - } } From 32e70b223509cb5a166e1110ee56ad19a5238592 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 12 Mar 2013 18:49:22 +0000 Subject: [PATCH 150/296] Fixes nil NSString issue reported in #159 --- include/internal/catch_tostring.hpp | 4 ++++ projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index ef9b5efc..f87127e0 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -161,9 +161,13 @@ inline std::string toString( std::nullptr_t ) { #ifdef __OBJC__ inline std::string toString( NSString const * const& nsstring ) { + if( !nsstring ) + return "nil"; return std::string( "@\"" ) + [nsstring UTF8String] + "\""; } inline std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) { + if( !nsstring ) + return "nil"; return std::string( "@\"" ) + [nsstring UTF8String] + "\""; } inline std::string toString( NSObject* const& nsObject ) { diff --git a/projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm b/projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm index 9fdb17a7..1ed7aa5f 100644 --- a/projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm +++ b/projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm @@ -74,4 +74,9 @@ OC_TEST_CASE( "OCTest/matchers", "Matches work with OC types (NSString so far)" REQUIRE_THAT( @"This is a string", EndsWith( @"string" ) ); } +OC_TEST_CASE( "OCTest/matchers/nil", "nil NSString should not crash the test" ) +{ + REQUIRE_THAT( (NSString*)nil, Equals( @"This should fail, but not crash" ) ); +} + @end From 6d56d71318cca7ae88a453a413aa167bd33a7735 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 12 Mar 2013 18:49:37 +0000 Subject: [PATCH 151/296] build 24 --- README | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 4 +-- single_include/catch.hpp | 32 +++++++++++++------ 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/README b/README index 098e5dfc..1b4aace1 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 23 (integration branch) +CATCH v0.9 build 24 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index e1485d5c..3f447bcc 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 23, "integration" ); + Version libraryVersion( 0, 9, 24, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index e03921ad..18ee4ec4 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,5 +1,5 @@ -CatchSelfTest is a CATCH v0.9 b23 (integration) host application. +CatchSelfTest is a CATCH v0.9 b24 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4286,7 +4286,7 @@ with expansion: 101 test cases - 47 failed (625 assertions - 104 failed) -CatchSelfTest is a CATCH v0.9 b23 (integration) host application. +CatchSelfTest is a CATCH v0.9 b24 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/single_include/catch.hpp b/single_include/catch.hpp index b08b6d6f..f28c6a08 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 23 (integration branch) - * Generated: 2013-03-11 18:35:52.716695 + * CATCH v0.9 build 24 (integration branch) + * Generated: 2013-03-12 18:45:29.590076 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -98,6 +98,9 @@ namespace Catch { inline bool contains( const std::string& s, const std::string& infix ) { return s.find( infix ) != std::string::npos; } + inline void toLower( std::string& s ) { + std::transform( s.begin(), s.end(), s.begin(), ::tolower ); + } struct pluralise { pluralise( std::size_t count, const std::string& label ) @@ -633,9 +636,13 @@ inline std::string toString( std::nullptr_t ) { #ifdef __OBJC__ inline std::string toString( NSString const * const& nsstring ) { + if( !nsstring ) + return "nil"; return std::string( "@\"" ) + [nsstring UTF8String] + "\""; } inline std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) { + if( !nsstring ) + return "nil"; return std::string( "@\"" ) + [nsstring UTF8String] + "\""; } inline std::string toString( NSObject* const& nsObject ) { @@ -1434,7 +1441,9 @@ namespace Catch { private: virtual void acceptTag( const std::string& tag ) { - m_tags.insert( tag ); + std::string lcTag = tag; + toLower( lcTag ); + m_tags.insert( lcTag ); } virtual void acceptChar( char c ) { m_remainder += c; @@ -1477,7 +1486,9 @@ namespace Catch { typedef std::map TagMap; public: void add( const Tag& tag ) { - m_tags.insert( std::make_pair( tag.getName(), tag ) ); + std::string tagName = tag.getName(); + toLower( tagName ); + m_tags.insert( std::make_pair( tagName, tag ) ); } bool empty() const { @@ -1579,6 +1590,8 @@ namespace Catch { m_filterType( matchBehaviour ), m_wildcardPosition( NoWildcard ) { + toLower( m_stringToMatch ); + if( m_filterType == IfFilterMatches::AutoDetectBehaviour ) { if( startsWith( m_stringToMatch, "exclude:" ) ) { m_stringToMatch = m_stringToMatch.substr( 8 ); @@ -1618,7 +1631,8 @@ namespace Catch { #endif bool isMatch( const TestCase& testCase ) const { - const std::string& name = testCase.getTestCaseInfo().name; + std::string name = testCase.getTestCaseInfo().name; + toLower( name ); switch( m_wildcardPosition ) { case NoWildcard: @@ -5459,16 +5473,16 @@ namespace { std::cout << colourEscape << "[0m"; // white/ normal break; case ResultError: - std::cout << colourEscape << "[0;31m"; // red + std::cout << colourEscape << "[1;31m"; // bold red break; case ResultSuccess: - std::cout << colourEscape << "[0;32m"; // green + std::cout << colourEscape << "[1;32m"; // bold green break; case Error: std::cout << colourEscape << "[1;31m"; // bold red break; case Success: - std::cout << colourEscape << "[1;32m"; // bold green + std::cout << colourEscape << "[0;32m"; // green break; case OriginalExpression: std::cout << colourEscape << "[0;36m"; // cyan @@ -5870,7 +5884,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 23, "integration" ); + Version libraryVersion( 0, 9, 24, "integration" ); } // #included from: catch_line_wrap.hpp From 7542685a2f53f9cb54013517884755b879759f8c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 12 Mar 2013 19:06:40 +0000 Subject: [PATCH 152/296] Moved "no test cases matched" message to reporter --- include/catch_runner.hpp | 2 +- include/internal/catch_interfaces_reporter.h | 5 +++++ include/reporters/catch_reporter_console.hpp | 4 ++++ projects/SelfTest/catch_self_test.hpp | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 0b2fad79..edceeccb 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -70,7 +70,7 @@ namespace Catch { } } if( testsRunForGroup == 0 && !filterGroup.getName().empty() ) - std::cerr << "\n[No test cases matched with: " << filterGroup.getName() << "]" << std::endl; + m_reporter->noMatchingTestCases( filterGroup.getName() ); return totals; } diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 8fa7cf1a..2b3be789 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -197,6 +197,8 @@ namespace Catch // static std::string getDescription(); virtual ReporterPreferences getPreferences() const = 0; + + virtual void noMatchingTestCases( std::string const& spec ) = 0; virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0; @@ -221,6 +223,8 @@ namespace Catch {} virtual ~StreamingReporterBase(); + + virtual void noMatchingTestCases( std::string const& ) {} virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { testRunInfo = _testRunInfo; @@ -390,6 +394,7 @@ namespace Catch return prefs; } + virtual void noMatchingTestCases( std::string const& ) {} virtual void testRunStarting( TestRunInfo const& ) { m_legacyReporter->StartTesting(); } diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index a9b88fbe..3f0c770c 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -31,6 +31,10 @@ namespace Catch { return prefs; } + + virtual void noMatchingTestCases( std::string const& spec ) { + stream << "No test cases matched '" << spec << "'" << std::endl; + } virtual void assertionStarting( AssertionInfo const& ) { } diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index 44293e0c..a5c7e812 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -35,6 +35,7 @@ namespace Catch { return ReporterPreferences(); } + virtual void noMatchingTestCases( std::string const& ) {} virtual void testRunStarting( TestRunInfo const& ) {} virtual void testGroupStarting( GroupInfo const& ) {} virtual void testCaseStarting( TestCaseInfo const& ) {} From dc2735c23d375bff4a3dc71ae7340061d88bd3e7 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 13 Mar 2013 08:04:50 +0000 Subject: [PATCH 153/296] Removed some cruft and warnings --- include/internal/catch_impl.hpp | 1 - include/internal/catch_interfaces_reporter.h | 68 ----- include/internal/catch_ptr.hpp | 9 + include/internal/catch_test_case_info.h | 9 + include/reporters/catch_reporter_junit.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 288 +++++++++--------- 6 files changed, 163 insertions(+), 214 deletions(-) diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index fc610748..9856d8e4 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -63,7 +63,6 @@ namespace Catch { BasicReporter::~BasicReporter() {} StreamingReporterBase::~StreamingReporterBase() {} - CumulativeReporterBase::~CumulativeReporterBase() {} ConsoleReporter::~ConsoleReporter() {} IRunner::~IRunner() {} IMutableContext::~IMutableContext() {} diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 2b3be789..72b922ee 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -291,74 +291,6 @@ namespace Catch std::vector groups; }; - - - // !TBD: Derived helper that implements the streaming interface but holds the stats - // - declares a new interface where methods are called at the end of each event - // - this would be used by the JUnit reporter, for example. - // - it may be used by the basic reporter, too, but that would clear down the stack - // as it goes - struct CumulativeReporterBase : SharedImpl { - - CumulativeReporterBase( ReporterConfig const& _config ) - : m_config( _config ), - stream( _config.stream() ) - {} - - virtual ~CumulativeReporterBase(); - - virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { -// testRunInfo = _testRunInfo; - } - virtual void testGroupStarting( GroupInfo const& _groupInfo ) { - testGroupNode = TestGroupNode( _groupInfo ); - } - - virtual void testCaseStarting( TestCaseInfo const& _testInfo ) { -// unusedTestCaseInfo = _testInfo; - } - virtual void sectionStarting( SectionInfo const& _sectionInfo ) { -// Ptr sectionInfo = new ThreadedSectionInfo( _sectionInfo ); -// if( !currentSectionInfo ) { -// currentSectionInfo = sectionInfo; -// } -// else { -// currentSectionInfo->children.push_back( sectionInfo ); -// sectionInfo->parent = currentSectionInfo; -// currentSectionInfo = sectionInfo; -// } - } - - virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { -// currentSectionInfo = currentSectionInfo->parent; - } - virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { -// unusedTestCaseInfo.reset(); - } - virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { -// testGroupNode-> // populate -// Ptr node ( new TestGroupNode( _testGroupStats ) ); -// unusedGroupInfo.reset(); - } - virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { -// currentSectionInfo.reset(); -// unusedTestCaseInfo.reset(); -// unusedGroupInfo.reset(); -// testRunInfo.reset(); - } - - ReporterConfig m_config; -// Option testRunInfo; -// Option unusedGroupInfo; -// Option unusedTestCaseInfo; -// Ptr currentSectionInfo; -// Ptr testGroupNode; - Option testGroupNode; - std::ostream& stream; - }; - - - // Deprecated struct IReporter : IShared { virtual ~IReporter(); diff --git a/include/internal/catch_ptr.hpp b/include/internal/catch_ptr.hpp index 2817ddd1..0dae6f81 100644 --- a/include/internal/catch_ptr.hpp +++ b/include/internal/catch_ptr.hpp @@ -10,6 +10,11 @@ #include "catch_common.h" +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + namespace Catch { // An intrusive reference counting smart pointer. @@ -82,4 +87,8 @@ namespace Catch { } // end namespace Catch +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + #endif // TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h index fd4e44ad..f84106a7 100644 --- a/include/internal/catch_test_case_info.h +++ b/include/internal/catch_test_case_info.h @@ -13,6 +13,11 @@ #include #include +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + namespace Catch { struct ITestCase; @@ -68,4 +73,8 @@ namespace Catch { const SourceLineInfo& lineInfo ); } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + #endif // TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 21c4ccfb..af43b3b7 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -234,7 +234,7 @@ namespace Catch { private: ReporterConfig m_config; - bool m_currentTestSuccess; +// bool m_currentTestSuccess; Stats m_testSuiteStats; Stats* m_currentStats; diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 18ee4ec4..2b24cb8c 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -2701,132 +2701,132 @@ selftest/main selftest/expected result/failing tests ............................................................................... -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:114: +catch_self_test.hpp:115: PASSED: with message: Tests failed, as expected @@ -2837,236 +2837,236 @@ selftest/main selftest/expected result/succeeding tests ............................................................................... -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected Message from section one Message from section two -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected Some information An error -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:103: +catch_self_test.hpp:104: PASSED: with message: Tests passed, as expected @@ -10699,57 +10699,57 @@ No assertions in test case, 'second tag' [Running: selftest/main] [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/failing tests'] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:114: succeeded +catch_self_test.hpp:115: succeeded [with message: Tests failed, as expected] [End of section: 'selftest/expected result/failing tests' All 26 assertions passed] @@ -10757,101 +10757,101 @@ catch_self_test.hpp:114: succeeded [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/succeeding tests'] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] Message from section one Message from section two -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] Some information An error -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:103: succeeded +catch_self_test.hpp:104: succeeded [with message: Tests passed, as expected] [End of section: 'selftest/expected result/succeeding tests' All 46 assertions passed] From 0db35c0f35947a3b6fddc6002ecc9a2f865e5181 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 13 Mar 2013 08:18:30 +0000 Subject: [PATCH 154/296] Cleaned up -Wpadded warning handling a bit more --- projects/SelfTest/ExceptionTests.cpp | 4 ---- projects/SelfTest/MiscTests.cpp | 4 ---- projects/SelfTest/catch_self_test.cpp | 4 ---- projects/SelfTest/catch_self_test.hpp | 9 +++++++++ projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp | 4 ---- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp index 5787c6be..963af1e5 100644 --- a/projects/SelfTest/ExceptionTests.cpp +++ b/projects/SelfTest/ExceptionTests.cpp @@ -6,10 +6,6 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wpadded" -#endif - #include "catch.hpp" #include diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index 97734927..d0b61b0c 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -6,10 +6,6 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wpadded" -#endif - #include "catch.hpp" #include "catch_self_test.hpp" diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index 49592325..9bd40b5a 100644 --- a/projects/SelfTest/catch_self_test.cpp +++ b/projects/SelfTest/catch_self_test.cpp @@ -6,10 +6,6 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wpadded" -#endif - #define CATCH_CONFIG_MAIN #include "catch_self_test.hpp" diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp index a5c7e812..6ce00738 100644 --- a/projects/SelfTest/catch_self_test.hpp +++ b/projects/SelfTest/catch_self_test.hpp @@ -18,6 +18,11 @@ #include "set" +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + namespace Catch { class NullStreamingReporter : public SharedImpl { @@ -162,6 +167,10 @@ namespace Catch { } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + #define CATCH_REGISTER_LINE_INFO( name ) ::Catch::LineInfoRegistrar INTERNAL_CATCH_UNIQUE_NAME( lineRegistrar )( name, ::Catch::SourceLineInfo( __FILE__, __LINE__ ) ); #define CATCH_GET_LINE_INFO( name ) ::Catch::LineInfoRegistry::get().infoForName( name ) diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index 76cae47a..de95ec74 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -6,10 +6,6 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wpadded" -#endif - #include "catch.hpp" // !TBD: story scenarios map to class based tests From 37186a1d043c9d0f6cad0367cb01772be2427f1e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 13 Mar 2013 12:19:30 +0000 Subject: [PATCH 155/296] Added BDD macros (Also includes regenerated files from previous commits) --- include/catch.hpp | 16 + .../SelfTest/Baselines/approvedResults.txt | 750 +++++++++--------- .../CatchSelfTest/CatchSelfTest/BDDTests.cpp | 8 - single_include/catch.hpp | 114 ++- 4 files changed, 437 insertions(+), 451 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index 2519ebf6..0633997f 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -88,6 +88,14 @@ #define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) +// "BDD-style" convenience wrappers +#define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags ) +#define CATCH_GIVEN( desc ) CATCH_SECTION( "Given: " desc, "" ) +#define CATCH_WHEN( desc ) CATCH_SECTION( " When: " desc, "" ) +#define CATCH_AND_WHEN( desc ) CATCH_SECTION( " And: " desc, "" ) +#define CATCH_THEN( desc ) CATCH_SECTION( " Then: " desc, "" ) +#define CATCH_AND_THEN( desc ) CATCH_SECTION( " And: " desc, "" ) + // If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required #else @@ -135,6 +143,14 @@ #define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) +// "BDD-style" convenience wrappers +#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) +#define GIVEN( desc ) SECTION( "Given: " desc, "" ) +#define WHEN( desc ) SECTION( " When: " desc, "" ) +#define AND_WHEN( desc ) SECTION( " And: " desc, "" ) +#define THEN( desc ) SECTION( " Then: " desc, "" ) +#define AND_THEN( desc ) SECTION( " And: " desc, "" ) + using Catch::Detail::Approx; #ifdef __clang__ diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 2b24cb8c..65ce34f4 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -973,15 +973,15 @@ with expansion: ./succeeding/exceptions/explicit ............................................................................... -ExceptionTests.cpp:39: +ExceptionTests.cpp:35: PASSED: REQUIRE_THROWS_AS( thisThrows() ) -ExceptionTests.cpp:40: +ExceptionTests.cpp:36: PASSED: REQUIRE_NOTHROW( thisDoesntThrow() ) -ExceptionTests.cpp:41: +ExceptionTests.cpp:37: PASSED: REQUIRE_THROWS( thisThrows() ) @@ -989,16 +989,16 @@ PASSED: ./failing/exceptions/explicit ............................................................................... -ExceptionTests.cpp:47: FAILED: +ExceptionTests.cpp:43: FAILED: CHECK_THROWS_AS( thisThrows() ) due to unexpected exception with message: expected exception -ExceptionTests.cpp:48: FAILED: +ExceptionTests.cpp:44: FAILED: CHECK_THROWS_AS( thisDoesntThrow() ) because no exception was thrown where one was expected: -ExceptionTests.cpp:49: FAILED: +ExceptionTests.cpp:45: FAILED: CHECK_NOTHROW( thisThrows() ) due to unexpected exception with message: expected exception @@ -1007,7 +1007,7 @@ due to unexpected exception with message: ./failing/exceptions/implicit ............................................................................... -ExceptionTests.cpp:52: FAILED: +ExceptionTests.cpp:48: FAILED: due to unexpected exception with message: unexpected exception @@ -1015,11 +1015,11 @@ due to unexpected exception with message: ./failing/exceptions/implicit/2 ............................................................................... -ExceptionTests.cpp:60: +ExceptionTests.cpp:56: PASSED: CHECK( 1 == 1 ) -ExceptionTests.cpp:60: FAILED: +ExceptionTests.cpp:56: FAILED: {Unknown expression after the reported line} due to unexpected exception with message: unexpected exception @@ -1029,7 +1029,7 @@ due to unexpected exception with message: section name ............................................................................... -ExceptionTests.cpp:66: FAILED: +ExceptionTests.cpp:62: FAILED: due to unexpected exception with message: unexpected exception @@ -1044,7 +1044,7 @@ No assertions in test case, './succeeding/exceptions/implicit' ./failing/exceptions/custom ............................................................................... -ExceptionTests.cpp:110: FAILED: +ExceptionTests.cpp:106: FAILED: due to unexpected exception with message: custom exception @@ -1052,7 +1052,7 @@ due to unexpected exception with message: ./failing/exceptions/custom/nothrow ............................................................................... -ExceptionTests.cpp:117: FAILED: +ExceptionTests.cpp:113: FAILED: REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) due to unexpected exception with message: unexpected custom exception @@ -1061,7 +1061,7 @@ due to unexpected exception with message: ./failing/exceptions/custom/throw ............................................................................... -ExceptionTests.cpp:122: FAILED: +ExceptionTests.cpp:118: FAILED: REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) due to unexpected exception with message: custom exception - not std @@ -1070,7 +1070,7 @@ due to unexpected exception with message: ./failing/exceptions/custom/double ............................................................................... -ExceptionTests.cpp:126: FAILED: +ExceptionTests.cpp:122: FAILED: due to unexpected exception with message: 3.14 @@ -1078,7 +1078,7 @@ due to unexpected exception with message: ./succeeding/exceptions/notimplemented ............................................................................... -ExceptionTests.cpp:137: +ExceptionTests.cpp:133: PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) @@ -2210,13 +2210,13 @@ explicitly with message: s1 ............................................................................... -MiscTests.cpp:25: +MiscTests.cpp:21: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:26: +MiscTests.cpp:22: PASSED: REQUIRE( b != a ) with expansion: @@ -2227,7 +2227,7 @@ with expansion: s2 ............................................................................... -MiscTests.cpp:31: +MiscTests.cpp:27: PASSED: REQUIRE( a != b ) with expansion: @@ -2238,13 +2238,13 @@ with expansion: s1 ............................................................................... -MiscTests.cpp:42: +MiscTests.cpp:38: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -MiscTests.cpp:43: +MiscTests.cpp:39: PASSED: REQUIRE( b != a ) with expansion: @@ -2256,7 +2256,7 @@ with expansion: s2 ............................................................................... -MiscTests.cpp:47: +MiscTests.cpp:43: PASSED: REQUIRE( a != b ) with expansion: @@ -2268,7 +2268,7 @@ with expansion: s2 ............................................................................... -MiscTests.cpp:61: FAILED: +MiscTests.cpp:57: FAILED: REQUIRE( a == b ) with expansion: 1 == 2 @@ -2279,7 +2279,7 @@ with expansion: s3 ............................................................................... -MiscTests.cpp:66: +MiscTests.cpp:62: PASSED: REQUIRE( a != b ) with expansion: @@ -2291,7 +2291,7 @@ with expansion: s4 ............................................................................... -MiscTests.cpp:70: +MiscTests.cpp:66: PASSED: REQUIRE( a < b ) with expansion: @@ -2328,7 +2328,7 @@ No assertions in section, 'f (leaf)' s1 ............................................................................... -MiscTests.cpp:103: FAILED: +MiscTests.cpp:99: FAILED: CHECK( b > a ) with expansion: 0 > 1 @@ -2337,21 +2337,21 @@ with expansion: ./mixed/Misc/loops ............................................................................... -MiscTests.cpp:115: FAILED: +MiscTests.cpp:111: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[0] (1) is even -MiscTests.cpp:115: FAILED: +MiscTests.cpp:111: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[1] (1) is even -MiscTests.cpp:115: +MiscTests.cpp:111: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -2359,21 +2359,21 @@ with expansion: with message: Testing if fib[2] (2) is even -MiscTests.cpp:115: FAILED: +MiscTests.cpp:111: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[3] (3) is even -MiscTests.cpp:115: FAILED: +MiscTests.cpp:111: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[4] (5) is even -MiscTests.cpp:115: +MiscTests.cpp:111: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: @@ -2381,14 +2381,14 @@ with expansion: with message: Testing if fib[5] (8) is even -MiscTests.cpp:115: FAILED: +MiscTests.cpp:111: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 with message: Testing if fib[6] (13) is even -MiscTests.cpp:115: FAILED: +MiscTests.cpp:111: FAILED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 1 == 0 @@ -2408,13 +2408,13 @@ No assertions in test case, './succeeding/Misc/stdout,stderr' ./succeeding/Misc/null strings ............................................................................... -MiscTests.cpp:133: +MiscTests.cpp:129: PASSED: REQUIRE( makeString( false ) != static_cast(__null) ) with expansion: "valid string" != {null string} -MiscTests.cpp:134: +MiscTests.cpp:130: PASSED: REQUIRE( makeString( true ) == static_cast(__null) ) with expansion: @@ -2424,7 +2424,7 @@ with expansion: ./failing/info ............................................................................... -MiscTests.cpp:142: FAILED: +MiscTests.cpp:138: FAILED: REQUIRE( false ) with messages: hi @@ -2434,13 +2434,13 @@ with messages: ./succeeding/checkedif ............................................................................... -MiscTests.cpp:147: +MiscTests.cpp:143: PASSED: CHECKED_IF( flag ) with expansion: true -MiscTests.cpp:155: +MiscTests.cpp:151: PASSED: REQUIRE( testCheckedIf( true ) ) with expansion: @@ -2450,12 +2450,12 @@ with expansion: ./failing/checkedif ............................................................................... -MiscTests.cpp:147: FAILED: +MiscTests.cpp:143: FAILED: CHECKED_IF( flag ) with expansion: false -MiscTests.cpp:160: FAILED: +MiscTests.cpp:156: FAILED: REQUIRE( testCheckedIf( false ) ) with expansion: false @@ -2464,13 +2464,13 @@ with expansion: ./succeeding/checkedelse ............................................................................... -MiscTests.cpp:165: +MiscTests.cpp:161: PASSED: CHECKED_ELSE( flag ) with expansion: true -MiscTests.cpp:173: +MiscTests.cpp:169: PASSED: REQUIRE( testCheckedElse( true ) ) with expansion: @@ -2480,12 +2480,12 @@ with expansion: ./failing/checkedelse ............................................................................... -MiscTests.cpp:165: FAILED: +MiscTests.cpp:161: FAILED: CHECKED_ELSE( flag ) with expansion: false -MiscTests.cpp:178: FAILED: +MiscTests.cpp:174: FAILED: REQUIRE( testCheckedElse( false ) ) with expansion: false @@ -2510,7 +2510,7 @@ No assertions in section, 'encoded chars' ./manual/onechar ............................................................................... -MiscTests.cpp:196: FAILED: +MiscTests.cpp:192: FAILED: REQUIRE( false ) with message: 3 @@ -2519,7 +2519,7 @@ with message: ./succeeding/atomic if ............................................................................... -MiscTests.cpp:206: +MiscTests.cpp:202: PASSED: REQUIRE( x == 0 ) with expansion: @@ -2529,25 +2529,25 @@ with expansion: ./succeeding/matchers ............................................................................... -MiscTests.cpp:216: +MiscTests.cpp:212: PASSED: REQUIRE_THAT( testStringForMatching() Contains( "string" ) ) with expansion: "this string contains 'abc' as a substring" contains: "string" -MiscTests.cpp:217: +MiscTests.cpp:213: PASSED: CHECK_THAT( testStringForMatching() Contains( "abc" ) ) with expansion: "this string contains 'abc' as a substring" contains: "abc" -MiscTests.cpp:219: +MiscTests.cpp:215: PASSED: CHECK_THAT( testStringForMatching() StartsWith( "this" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "this" -MiscTests.cpp:220: +MiscTests.cpp:216: PASSED: CHECK_THAT( testStringForMatching() EndsWith( "substring" ) ) with expansion: @@ -2557,7 +2557,7 @@ with expansion: ./failing/matchers/Contains ............................................................................... -MiscTests.cpp:225: FAILED: +MiscTests.cpp:221: FAILED: CHECK_THAT( testStringForMatching() Contains( "not there" ) ) with expansion: "this string contains 'abc' as a substring" contains: "not there" @@ -2566,7 +2566,7 @@ with expansion: ./failing/matchers/StartsWith ............................................................................... -MiscTests.cpp:230: FAILED: +MiscTests.cpp:226: FAILED: CHECK_THAT( testStringForMatching() StartsWith( "string" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "string" @@ -2575,7 +2575,7 @@ with expansion: ./failing/matchers/EndsWith ............................................................................... -MiscTests.cpp:235: FAILED: +MiscTests.cpp:231: FAILED: CHECK_THAT( testStringForMatching() EndsWith( "this" ) ) with expansion: "this string contains 'abc' as a substring" ends with: "this" @@ -2584,7 +2584,7 @@ with expansion: ./failing/matchers/Equals ............................................................................... -MiscTests.cpp:240: FAILED: +MiscTests.cpp:236: FAILED: CHECK_THAT( testStringForMatching() Equals( "something else" ) ) with expansion: "this string contains 'abc' as a substring" equals: "something else" @@ -2593,7 +2593,7 @@ with expansion: ./succeeding/matchers/AllOf ............................................................................... -MiscTests.cpp:248: +MiscTests.cpp:244: PASSED: CHECK_THAT( testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ) with expansion: @@ -2604,14 +2604,14 @@ with expansion: ./succeeding/matchers/AnyOf ............................................................................... -MiscTests.cpp:252: +MiscTests.cpp:248: PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -MiscTests.cpp:253: +MiscTests.cpp:249: PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) ) with expansion: @@ -2622,7 +2622,7 @@ with expansion: ./succeeding/matchers/Equals ............................................................................... -MiscTests.cpp:258: +MiscTests.cpp:254: PASSED: CHECK_THAT( testStringForMatching() Equals( "this string contains 'abc' as a substring" ) ) with expansion: @@ -2633,31 +2633,31 @@ with expansion: example/factorial ............................................................................... -MiscTests.cpp:269: +MiscTests.cpp:265: PASSED: REQUIRE( Factorial(0) == 1 ) with expansion: 1 == 1 -MiscTests.cpp:270: +MiscTests.cpp:266: PASSED: REQUIRE( Factorial(1) == 1 ) with expansion: 1 == 1 -MiscTests.cpp:271: +MiscTests.cpp:267: PASSED: REQUIRE( Factorial(2) == 2 ) with expansion: 2 == 2 -MiscTests.cpp:272: +MiscTests.cpp:268: PASSED: REQUIRE( Factorial(3) == 6 ) with expansion: 6 == 6 -MiscTests.cpp:273: +MiscTests.cpp:269: PASSED: REQUIRE( Factorial(10) == 3628800 ) with expansion: @@ -2674,7 +2674,7 @@ No assertions in test case, 'empty' Nice descriptive name ............................................................................... -MiscTests.cpp:282: +MiscTests.cpp:278: warning: This one ran @@ -2701,132 +2701,132 @@ selftest/main selftest/expected result/failing tests ............................................................................... -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected -catch_self_test.hpp:115: +catch_self_test.hpp:120: PASSED: with message: Tests failed, as expected @@ -2837,236 +2837,236 @@ selftest/main selftest/expected result/succeeding tests ............................................................................... -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected Message from section one Message from section two -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected Some information An error -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected -catch_self_test.hpp:104: +catch_self_test.hpp:109: PASSED: with message: Tests passed, as expected @@ -4262,7 +4262,7 @@ Scenario: Do that thing with the thing Then: it should do this ............................................................................... -BDDTests.cpp:33: +BDDTests.cpp:21: PASSED: REQUIRE( itDoesThis() ) with expansion: @@ -4276,7 +4276,7 @@ Scenario: Do that thing with the thing And: do that ............................................................................... -BDDTests.cpp:35: +BDDTests.cpp:23: PASSED: REQUIRE( itDoesThat() ) with expansion: @@ -4753,49 +4753,49 @@ ConditionTests.cpp:343 -ExceptionTests.cpp:47 +ExceptionTests.cpp:43 < message="thisDoesntThrow()" type="CHECK_THROWS_AS"> -ExceptionTests.cpp:48 +ExceptionTests.cpp:44 -ExceptionTests.cpp:49 +ExceptionTests.cpp:45 -ExceptionTests.cpp:52 +ExceptionTests.cpp:48 -ExceptionTests.cpp:60 +ExceptionTests.cpp:56 -ExceptionTests.cpp:66 +ExceptionTests.cpp:62 -ExceptionTests.cpp:110 +ExceptionTests.cpp:106 -ExceptionTests.cpp:117 +ExceptionTests.cpp:113 -ExceptionTests.cpp:122 +ExceptionTests.cpp:118 -ExceptionTests.cpp:126 +ExceptionTests.cpp:122 @@ -4859,33 +4859,33 @@ MessageTests.cpp:101 -MiscTests.cpp:61 +MiscTests.cpp:57 -MiscTests.cpp:103 +MiscTests.cpp:99 -MiscTests.cpp:115 +MiscTests.cpp:111 -MiscTests.cpp:115 +MiscTests.cpp:111 -MiscTests.cpp:115 +MiscTests.cpp:111 -MiscTests.cpp:115 +MiscTests.cpp:111 -MiscTests.cpp:115 +MiscTests.cpp:111 -MiscTests.cpp:115 +MiscTests.cpp:111 @@ -4899,53 +4899,53 @@ An error -MiscTests.cpp:142 +MiscTests.cpp:138 -MiscTests.cpp:147 +MiscTests.cpp:143 -MiscTests.cpp:160 +MiscTests.cpp:156 -MiscTests.cpp:165 +MiscTests.cpp:161 -MiscTests.cpp:178 +MiscTests.cpp:174 -MiscTests.cpp:196 +MiscTests.cpp:192 -MiscTests.cpp:225 +MiscTests.cpp:221 -MiscTests.cpp:230 +MiscTests.cpp:226 -MiscTests.cpp:235 +MiscTests.cpp:231 -MiscTests.cpp:240 +MiscTests.cpp:236 @@ -4955,7 +4955,7 @@ MiscTests.cpp:240 -MiscTests.cpp:282 +MiscTests.cpp:278 @@ -6354,7 +6354,7 @@ ConditionTests.cpp" line="343"> -ExceptionTests.cpp" line="39"> +ExceptionTests.cpp" line="35"> thisThrows() @@ -6362,7 +6362,7 @@ ExceptionTests.cpp" line="39"> thisThrows() -ExceptionTests.cpp" line="40"> +ExceptionTests.cpp" line="36"> thisDoesntThrow() @@ -6370,7 +6370,7 @@ ExceptionTests.cpp" line="40"> thisDoesntThrow() -ExceptionTests.cpp" line="41"> +ExceptionTests.cpp" line="37"> thisThrows() @@ -6381,18 +6381,18 @@ ExceptionTests.cpp" line="41"> -ExceptionTests.cpp" line="47"> +ExceptionTests.cpp" line="43"> thisThrows() thisThrows() -ExceptionTests.cpp" line="47"> +ExceptionTests.cpp" line="43"> expected exception -ExceptionTests.cpp" line="48"> +ExceptionTests.cpp" line="44"> thisDoesntThrow() @@ -6400,27 +6400,27 @@ ExceptionTests.cpp" line="48"> thisDoesntThrow() -ExceptionTests.cpp" line="49"> +ExceptionTests.cpp" line="45"> thisThrows() thisThrows() -ExceptionTests.cpp" line="49"> +ExceptionTests.cpp" line="45"> expected exception -ExceptionTests.cpp" line="52"> +ExceptionTests.cpp" line="48"> unexpected exception -ExceptionTests.cpp" line="60"> +ExceptionTests.cpp" line="56"> 1 == 1 @@ -6428,14 +6428,14 @@ ExceptionTests.cpp" line="60"> 1 == 1 -ExceptionTests.cpp" line="60"> +ExceptionTests.cpp" line="56"> {Unknown expression after the reported line} {Unknown expression after the reported line} -ExceptionTests.cpp" line="60"> +ExceptionTests.cpp" line="56"> unexpected exception @@ -6443,7 +6443,7 @@ ExceptionTests.cpp" line="60">
-ExceptionTests.cpp" line="66"> +ExceptionTests.cpp" line="62"> unexpected exception @@ -6454,47 +6454,47 @@ ExceptionTests.cpp" line="66"> -ExceptionTests.cpp" line="110"> +ExceptionTests.cpp" line="106"> custom exception -ExceptionTests.cpp" line="117"> +ExceptionTests.cpp" line="113"> throw CustomException( "unexpected custom exception" ) throw CustomException( "unexpected custom exception" ) -ExceptionTests.cpp" line="117"> +ExceptionTests.cpp" line="113"> unexpected custom exception -ExceptionTests.cpp" line="122"> +ExceptionTests.cpp" line="118"> throw CustomException( "custom exception - not std" ) throw CustomException( "custom exception - not std" ) -ExceptionTests.cpp" line="122"> +ExceptionTests.cpp" line="118"> custom exception - not std -ExceptionTests.cpp" line="126"> +ExceptionTests.cpp" line="122"> 3.14 -ExceptionTests.cpp" line="137"> +ExceptionTests.cpp" line="133"> thisFunctionNotImplemented( 7 ) @@ -7876,7 +7876,7 @@ MessageTests.cpp" line="92">
-MiscTests.cpp" line="25"> +MiscTests.cpp" line="21"> a != b @@ -7884,7 +7884,7 @@ MiscTests.cpp" line="25"> 1 != 2 -MiscTests.cpp" line="26"> +MiscTests.cpp" line="22"> b != a @@ -7895,7 +7895,7 @@ MiscTests.cpp" line="26">
-MiscTests.cpp" line="31"> +MiscTests.cpp" line="27"> a != b @@ -7909,7 +7909,7 @@ MiscTests.cpp" line="31">
-MiscTests.cpp" line="42"> +MiscTests.cpp" line="38"> a != b @@ -7917,7 +7917,7 @@ MiscTests.cpp" line="42"> 1 != 2 -MiscTests.cpp" line="43"> +MiscTests.cpp" line="39"> b != a @@ -7926,7 +7926,7 @@ MiscTests.cpp" line="43">
-MiscTests.cpp" line="47"> +MiscTests.cpp" line="43"> a != b @@ -7943,7 +7943,7 @@ MiscTests.cpp" line="47">
-MiscTests.cpp" line="61"> +MiscTests.cpp" line="57"> a == b @@ -7957,7 +7957,7 @@ MiscTests.cpp" line="61">
-MiscTests.cpp" line="66"> +MiscTests.cpp" line="62"> a != b @@ -7971,7 +7971,7 @@ MiscTests.cpp" line="66">
-MiscTests.cpp" line="70"> +MiscTests.cpp" line="66"> a < b @@ -8008,7 +8008,7 @@ MiscTests.cpp" line="70">
-MiscTests.cpp" line="103"> +MiscTests.cpp" line="99"> b > a @@ -8021,7 +8021,7 @@ MiscTests.cpp" line="103"> -MiscTests.cpp" line="115"> +MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -8029,7 +8029,7 @@ MiscTests.cpp" line="115"> 1 == 0 -MiscTests.cpp" line="115"> +MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -8037,7 +8037,7 @@ MiscTests.cpp" line="115"> 1 == 0 -MiscTests.cpp" line="115"> +MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -8045,7 +8045,7 @@ MiscTests.cpp" line="115"> 0 == 0 -MiscTests.cpp" line="115"> +MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -8053,7 +8053,7 @@ MiscTests.cpp" line="115"> 1 == 0 -MiscTests.cpp" line="115"> +MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -8061,7 +8061,7 @@ MiscTests.cpp" line="115"> 1 == 0 -MiscTests.cpp" line="115"> +MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -8069,7 +8069,7 @@ MiscTests.cpp" line="115"> 0 == 0 -MiscTests.cpp" line="115"> +MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -8077,7 +8077,7 @@ MiscTests.cpp" line="115"> 1 == 0 -MiscTests.cpp" line="115"> +MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -8091,7 +8091,7 @@ MiscTests.cpp" line="115"> -MiscTests.cpp" line="133"> +MiscTests.cpp" line="129"> makeString( false ) != static_cast<char*>(__null) @@ -8099,7 +8099,7 @@ MiscTests.cpp" line="133"> "valid string" != {null string} -MiscTests.cpp" line="134"> +MiscTests.cpp" line="130"> makeString( true ) == static_cast<char*>(__null) @@ -8110,7 +8110,7 @@ MiscTests.cpp" line="134"> -MiscTests.cpp" line="142"> +MiscTests.cpp" line="138"> false @@ -8121,7 +8121,7 @@ MiscTests.cpp" line="142"> -MiscTests.cpp" line="147"> +MiscTests.cpp" line="143"> flag @@ -8129,7 +8129,7 @@ MiscTests.cpp" line="147"> true -MiscTests.cpp" line="155"> +MiscTests.cpp" line="151"> testCheckedIf( true ) @@ -8140,7 +8140,7 @@ MiscTests.cpp" line="155"> -MiscTests.cpp" line="147"> +MiscTests.cpp" line="143"> flag @@ -8148,7 +8148,7 @@ MiscTests.cpp" line="147"> false -MiscTests.cpp" line="160"> +MiscTests.cpp" line="156"> testCheckedIf( false ) @@ -8159,7 +8159,7 @@ MiscTests.cpp" line="160"> -MiscTests.cpp" line="165"> +MiscTests.cpp" line="161"> flag @@ -8167,7 +8167,7 @@ MiscTests.cpp" line="165"> true -MiscTests.cpp" line="173"> +MiscTests.cpp" line="169"> testCheckedElse( true ) @@ -8178,7 +8178,7 @@ MiscTests.cpp" line="173"> -MiscTests.cpp" line="165"> +MiscTests.cpp" line="161"> flag @@ -8186,7 +8186,7 @@ MiscTests.cpp" line="165"> false -MiscTests.cpp" line="178"> +MiscTests.cpp" line="174"> testCheckedElse( false ) @@ -8206,7 +8206,7 @@ MiscTests.cpp" line="178"> -MiscTests.cpp" line="196"> +MiscTests.cpp" line="192"> false @@ -8217,7 +8217,7 @@ MiscTests.cpp" line="196"> -MiscTests.cpp" line="206"> +MiscTests.cpp" line="202"> x == 0 @@ -8228,7 +8228,7 @@ MiscTests.cpp" line="206"> -MiscTests.cpp" line="216"> +MiscTests.cpp" line="212"> testStringForMatching() Contains( "string" ) @@ -8236,7 +8236,7 @@ MiscTests.cpp" line="216"> "this string contains 'abc' as a substring" contains: "string" -MiscTests.cpp" line="217"> +MiscTests.cpp" line="213"> testStringForMatching() Contains( "abc" ) @@ -8244,7 +8244,7 @@ MiscTests.cpp" line="217"> "this string contains 'abc' as a substring" contains: "abc" -MiscTests.cpp" line="219"> +MiscTests.cpp" line="215"> testStringForMatching() StartsWith( "this" ) @@ -8252,7 +8252,7 @@ MiscTests.cpp" line="219"> "this string contains 'abc' as a substring" starts with: "this" -MiscTests.cpp" line="220"> +MiscTests.cpp" line="216"> testStringForMatching() EndsWith( "substring" ) @@ -8263,7 +8263,7 @@ MiscTests.cpp" line="220"> -MiscTests.cpp" line="225"> +MiscTests.cpp" line="221"> testStringForMatching() Contains( "not there" ) @@ -8274,7 +8274,7 @@ MiscTests.cpp" line="225"> -MiscTests.cpp" line="230"> +MiscTests.cpp" line="226"> testStringForMatching() StartsWith( "string" ) @@ -8285,7 +8285,7 @@ MiscTests.cpp" line="230"> -MiscTests.cpp" line="235"> +MiscTests.cpp" line="231"> testStringForMatching() EndsWith( "this" ) @@ -8296,7 +8296,7 @@ MiscTests.cpp" line="235"> -MiscTests.cpp" line="240"> +MiscTests.cpp" line="236"> testStringForMatching() Equals( "something else" ) @@ -8307,7 +8307,7 @@ MiscTests.cpp" line="240"> -MiscTests.cpp" line="248"> +MiscTests.cpp" line="244"> testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) @@ -8318,7 +8318,7 @@ MiscTests.cpp" line="248"> -MiscTests.cpp" line="252"> +MiscTests.cpp" line="248"> testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) @@ -8326,7 +8326,7 @@ MiscTests.cpp" line="252"> "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -MiscTests.cpp" line="253"> +MiscTests.cpp" line="249"> testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) @@ -8337,7 +8337,7 @@ MiscTests.cpp" line="253"> -MiscTests.cpp" line="258"> +MiscTests.cpp" line="254"> testStringForMatching() Equals( "this string contains 'abc' as a substring" ) @@ -8348,7 +8348,7 @@ MiscTests.cpp" line="258"> -MiscTests.cpp" line="269"> +MiscTests.cpp" line="265"> Factorial(0) == 1 @@ -8356,7 +8356,7 @@ MiscTests.cpp" line="269"> 1 == 1 -MiscTests.cpp" line="270"> +MiscTests.cpp" line="266"> Factorial(1) == 1 @@ -8364,7 +8364,7 @@ MiscTests.cpp" line="270"> 1 == 1 -MiscTests.cpp" line="271"> +MiscTests.cpp" line="267"> Factorial(2) == 2 @@ -8372,7 +8372,7 @@ MiscTests.cpp" line="271"> 2 == 2 -MiscTests.cpp" line="272"> +MiscTests.cpp" line="268"> Factorial(3) == 6 @@ -8380,7 +8380,7 @@ MiscTests.cpp" line="272"> 6 == 6 -MiscTests.cpp" line="273"> +MiscTests.cpp" line="269"> Factorial(10) == 3628800 @@ -9905,7 +9905,7 @@ TrickyTests.cpp" line="335">
-BDDTests.cpp" line="33"> +BDDTests.cpp" line="21"> itDoesThis() @@ -9914,7 +9914,7 @@ BDDTests.cpp" line="33">
-BDDTests.cpp" line="35"> +BDDTests.cpp" line="23"> itDoesThat() @@ -10170,30 +10170,30 @@ ConditionTests.cpp:343: !1 == 1 failed for: !(1 == 1) [Finished: './failing/conditions/not' 1 test case failed (All 8 assertions failed)] [Running: ./succeeding/exceptions/explicit] -ExceptionTests.cpp:39: thisThrows() succeeded -ExceptionTests.cpp:40: thisDoesntThrow() succeeded -ExceptionTests.cpp:41: thisThrows() succeeded +ExceptionTests.cpp:35: thisThrows() succeeded +ExceptionTests.cpp:36: thisDoesntThrow() succeeded +ExceptionTests.cpp:37: thisThrows() succeeded [Finished: './succeeding/exceptions/explicit' All tests passed (3 assertions in 1 test case)] [Running: ./failing/exceptions/explicit] -ExceptionTests.cpp:47: thisThrows() failed with unexpected exception with message: 'expected exception' -ExceptionTests.cpp:48: thisDoesntThrow() failed because no exception was thrown where one was expected -ExceptionTests.cpp:49: thisThrows() failed with unexpected exception with message: 'expected exception' +ExceptionTests.cpp:43: thisThrows() failed with unexpected exception with message: 'expected exception' +ExceptionTests.cpp:44: thisDoesntThrow() failed because no exception was thrown where one was expected +ExceptionTests.cpp:45: 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] -ExceptionTests.cpp:52: Unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:48: Unexpected exception with message: 'unexpected exception' [Finished: './failing/exceptions/implicit' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/implicit/2] -ExceptionTests.cpp:60: 1 == 1 succeeded -ExceptionTests.cpp:60: {Unknown expression after the reported line} failed with unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:56: 1 == 1 succeeded +ExceptionTests.cpp:56: {Unknown expression after the reported line} failed with unexpected exception with message: 'unexpected exception' [Finished: './failing/exceptions/implicit/2' 1 test case failed (1 of 2 assertions failed)] [Running: ./failing/exceptions/implicit/3] [Started section: 'section name'] -ExceptionTests.cpp:66: Unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:62: Unexpected exception with message: 'unexpected exception' [End of section: 'section name' 1 assertion failed] [Finished: './failing/exceptions/implicit/3' 1 test case failed (1 assertion failed)] @@ -10205,23 +10205,23 @@ No assertions in test case, './succeeding/exceptions/implicit' [Finished: './succeeding/exceptions/implicit' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/custom] -ExceptionTests.cpp:110: Unexpected exception with message: 'custom exception' +ExceptionTests.cpp:106: Unexpected exception with message: 'custom exception' [Finished: './failing/exceptions/custom' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/custom/nothrow] -ExceptionTests.cpp:117: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' +ExceptionTests.cpp:113: 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] -ExceptionTests.cpp:122: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' +ExceptionTests.cpp:118: 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] -ExceptionTests.cpp:126: Unexpected exception with message: '3.14' +ExceptionTests.cpp:122: Unexpected exception with message: '3.14' [Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] [Running: ./succeeding/exceptions/notimplemented] -ExceptionTests.cpp:137: thisFunctionNotImplemented( 7 ) succeeded +ExceptionTests.cpp:133: thisFunctionNotImplemented( 7 ) succeeded [Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/generators/1] @@ -10464,22 +10464,22 @@ MessageTests.cpp:101: failed with message: 'Previous info should not be seen' [Running: ./succeeding/Misc/Sections] [Started section: 's1'] -MiscTests.cpp:25: a != b succeeded for: 1 != 2 -MiscTests.cpp:26: b != a succeeded for: 2 != 1 +MiscTests.cpp:21: a != b succeeded for: 1 != 2 +MiscTests.cpp:22: b != a succeeded for: 2 != 1 [End of section: 's1' All 2 assertions passed] [Started section: 's2'] -MiscTests.cpp:31: a != b succeeded for: 1 != 2 +MiscTests.cpp:27: 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'] -MiscTests.cpp:42: a != b succeeded for: 1 != 2 -MiscTests.cpp:43: b != a succeeded for: 2 != 1 +MiscTests.cpp:38: a != b succeeded for: 1 != 2 +MiscTests.cpp:39: b != a succeeded for: 2 != 1 [Started section: 's2'] -MiscTests.cpp:47: a != b succeeded for: 1 != 2 +MiscTests.cpp:43: a != b succeeded for: 1 != 2 [End of section: 's2' 1 assertion passed] [End of section: 's1' All 3 assertions passed] @@ -10489,21 +10489,21 @@ MiscTests.cpp:47: a != b succeeded for: 1 != 2 [Running: ./mixed/Misc/Sections/nested2] [Started section: 's1'] [Started section: 's2'] -MiscTests.cpp:61: a == b failed for: 1 == 2 +MiscTests.cpp:57: a == b failed for: 1 == 2 [End of section: 's2' 1 assertion failed] [End of section: 's1' 1 assertion failed] [Started section: 's1'] [Started section: 's3'] -MiscTests.cpp:66: a != b succeeded for: 1 != 2 +MiscTests.cpp:62: a != b succeeded for: 1 != 2 [End of section: 's3' 1 assertion passed] [End of section: 's1' 1 assertion passed] [Started section: 's1'] [Started section: 's4'] -MiscTests.cpp:70: a < b succeeded for: 1 < 2 +MiscTests.cpp:66: a < b succeeded for: 1 < 2 [End of section: 's4' 1 assertion passed] [End of section: 's1' 1 assertion passed] @@ -10539,20 +10539,20 @@ No assertions in section, 'f (leaf)' [Running: ./mixed/Misc/Sections/loops] [Started section: 's1'] -MiscTests.cpp:103: b > a failed for: 0 > 1 +MiscTests.cpp:99: b > a failed for: 0 > 1 [End of section: 's1' 1 assertion failed] [Finished: './mixed/Misc/Sections/loops' 1 test case failed (1 assertion failed)] [Running: ./mixed/Misc/loops] -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 -MiscTests.cpp:115: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:111: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:111: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 [Finished: './mixed/Misc/loops' 1 test case failed (6 of 8 assertions failed)] Some information An error @@ -10564,32 +10564,32 @@ No assertions in test case, './succeeding/Misc/stdout,stderr' [Finished: './succeeding/Misc/stdout,stderr' 1 test case failed (1 assertion failed)] [Running: ./succeeding/Misc/null strings] -MiscTests.cpp:133: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} -MiscTests.cpp:134: makeString( true ) == static_cast(__null) succeeded for: {null string} == {null string} +MiscTests.cpp:129: makeString( false ) != static_cast(__null) succeeded for: "valid string" != {null string} +MiscTests.cpp:130: 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] -MiscTests.cpp:142: false failed +MiscTests.cpp:138: false failed [Finished: './failing/info' 1 test case failed (1 assertion failed)] [Running: ./succeeding/checkedif] -MiscTests.cpp:147: flag succeeded for: true -MiscTests.cpp:155: testCheckedIf( true ) succeeded for: true +MiscTests.cpp:143: flag succeeded for: true +MiscTests.cpp:151: testCheckedIf( true ) succeeded for: true [Finished: './succeeding/checkedif' All tests passed (2 assertions in 1 test case)] [Running: ./failing/checkedif] -MiscTests.cpp:147: flag failed for: false -MiscTests.cpp:160: testCheckedIf( false ) failed for: false +MiscTests.cpp:143: flag failed for: false +MiscTests.cpp:156: testCheckedIf( false ) failed for: false [Finished: './failing/checkedif' 1 test case failed (All 2 assertions failed)] [Running: ./succeeding/checkedelse] -MiscTests.cpp:165: flag succeeded for: true -MiscTests.cpp:173: testCheckedElse( true ) succeeded for: true +MiscTests.cpp:161: flag succeeded for: true +MiscTests.cpp:169: testCheckedElse( true ) succeeded for: true [Finished: './succeeding/checkedelse' All tests passed (2 assertions in 1 test case)] [Running: ./failing/checkedelse] -MiscTests.cpp:165: flag failed for: false -MiscTests.cpp:178: testCheckedElse( false ) failed for: false +MiscTests.cpp:161: flag failed for: false +MiscTests.cpp:174: testCheckedElse( false ) failed for: false [Finished: './failing/checkedelse' 1 test case failed (All 2 assertions failed)] [Running: ./misc/xmlentitycheck] @@ -10608,67 +10608,67 @@ No assertions in section, 'encoded chars' [Finished: './misc/xmlentitycheck' 1 test case failed (All 2 assertions failed)] [Running: ./manual/onechar] -MiscTests.cpp:196: false failed +MiscTests.cpp:192: false failed [Finished: './manual/onechar' 1 test case failed (1 assertion failed)] [Running: ./succeeding/atomic if] -MiscTests.cpp:206: x == 0 succeeded for: 0 == 0 +MiscTests.cpp:202: x == 0 succeeded for: 0 == 0 [Finished: './succeeding/atomic if' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/matchers] -MiscTests.cpp:216: testStringForMatching() Contains( "string" ) succeeded for: +MiscTests.cpp:212: testStringForMatching() Contains( "string" ) succeeded for: "this string contains 'abc' as a substring" contains: "string" -MiscTests.cpp:217: testStringForMatching() Contains( "abc" ) succeeded for: +MiscTests.cpp:213: testStringForMatching() Contains( "abc" ) succeeded for: "this string contains 'abc' as a substring" contains: "abc" -MiscTests.cpp:219: testStringForMatching() StartsWith( "this" ) succeeded for: +MiscTests.cpp:215: testStringForMatching() StartsWith( "this" ) succeeded for: "this string contains 'abc' as a substring" starts with: "this" -MiscTests.cpp:220: testStringForMatching() EndsWith( "substring" ) succeeded for: +MiscTests.cpp:216: 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] -MiscTests.cpp:225: testStringForMatching() Contains( "not there" ) failed for: +MiscTests.cpp:221: 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] -MiscTests.cpp:230: testStringForMatching() StartsWith( "string" ) failed for: +MiscTests.cpp:226: 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] -MiscTests.cpp:235: testStringForMatching() EndsWith( "this" ) failed for: +MiscTests.cpp:231: 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] -MiscTests.cpp:240: testStringForMatching() Equals( "something else" ) failed for: +MiscTests.cpp:236: 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/AllOf] -MiscTests.cpp:248: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: +MiscTests.cpp:244: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) [Finished: './succeeding/matchers/AllOf' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/matchers/AnyOf] -MiscTests.cpp:252: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: +MiscTests.cpp:248: testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" ) -MiscTests.cpp:253: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: +MiscTests.cpp:249: testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" ) [Finished: './succeeding/matchers/AnyOf' All tests passed (2 assertions in 1 test case)] [Running: ./succeeding/matchers/Equals] -MiscTests.cpp:258: testStringForMatching() Equals( "this string contains 'abc' as a substring" ) succeeded for: +MiscTests.cpp:254: 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: example/factorial] -MiscTests.cpp:269: Factorial(0) == 1 succeeded for: 1 == 1 -MiscTests.cpp:270: Factorial(1) == 1 succeeded for: 1 == 1 -MiscTests.cpp:271: Factorial(2) == 2 succeeded for: 2 == 2 -MiscTests.cpp:272: Factorial(3) == 6 succeeded for: 6 == 6 -MiscTests.cpp:273: Factorial(10) == 3628800 succeeded for: 0x == 3628800 +MiscTests.cpp:265: Factorial(0) == 1 succeeded for: 1 == 1 +MiscTests.cpp:266: Factorial(1) == 1 succeeded for: 1 == 1 +MiscTests.cpp:267: Factorial(2) == 2 succeeded for: 2 == 2 +MiscTests.cpp:268: Factorial(3) == 6 succeeded for: 6 == 6 +MiscTests.cpp:269: Factorial(10) == 3628800 succeeded for: 0x == 3628800 [Finished: 'example/factorial' All tests passed (5 assertions in 1 test case)] [Running: empty] @@ -10678,7 +10678,7 @@ No assertions in test case, 'empty' [Finished: 'empty' 1 test case failed (1 assertion failed)] [Running: Nice descriptive name] -MiscTests.cpp:282: [warning: This one ran] +MiscTests.cpp:278: [warning: This one ran] No assertions in test case, 'Nice descriptive name' @@ -10699,57 +10699,57 @@ No assertions in test case, 'second tag' [Running: selftest/main] [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/failing tests'] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -catch_self_test.hpp:115: succeeded +catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] [End of section: 'selftest/expected result/failing tests' All 26 assertions passed] @@ -10757,101 +10757,101 @@ catch_self_test.hpp:115: succeeded [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/succeeding tests'] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] Message from section one Message from section two -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] Some information An error -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] -catch_self_test.hpp:104: succeeded +catch_self_test.hpp:109: succeeded [with message: Tests passed, as expected] [End of section: 'selftest/expected result/succeeding tests' All 46 assertions passed] @@ -11299,9 +11299,9 @@ TrickyTests.cpp:335: Catch::isTrue( true ) succeeded for: true [Started section: 'Given: This stuff exists'] [Started section: ' When: I do this'] [Started section: ' Then: it should do this'] -BDDTests.cpp:33: itDoesThis() succeeded for: true +BDDTests.cpp:21: itDoesThis() succeeded for: true [Started section: ' And: do that'] -BDDTests.cpp:35: itDoesThat() succeeded for: true +BDDTests.cpp:23: itDoesThat() succeeded for: true [End of section: ' And: do that' 1 assertion passed] [End of section: ' Then: it should do this' All 2 assertions passed] diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index de95ec74..900fb8ee 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -8,14 +8,6 @@ #include "catch.hpp" -// !TBD: story scenarios map to class based tests -#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) -#define GIVEN( desc ) SECTION( "Given: " desc, "" ) -#define WHEN( desc ) SECTION( " When: " desc, "" ) -#define AND_WHEN( desc ) SECTION( " And: " desc, "" ) -#define THEN( desc ) SECTION( " Then: " desc, "" ) -#define AND_THEN( desc ) SECTION( " And: " desc, "" ) - inline bool itDoesThis(){ return true; } inline bool itDoesThat(){ return true; } diff --git a/single_include/catch.hpp b/single_include/catch.hpp index f28c6a08..99bf8a1c 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* * CATCH v0.9 build 24 (integration branch) - * Generated: 2013-03-12 18:45:29.590076 + * Generated: 2013-03-13 12:18:41.022404 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -256,6 +256,11 @@ namespace Catch { // #included from: catch_ptr.hpp #define TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + namespace Catch { // An intrusive reference counting smart pointer. @@ -328,6 +333,10 @@ namespace Catch { } // end namespace Catch +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + #include namespace Catch { @@ -1323,6 +1332,11 @@ inline void writeToDebugConsole( const std::string& text ) { #include #include +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + namespace Catch { struct ITestCase; @@ -1378,6 +1392,10 @@ namespace Catch { const SourceLineInfo& lineInfo ); } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + // #included from: catch_tags.hpp #define TWOBLUECUBES_CATCH_TAGS_HPP_INCLUDED @@ -2217,6 +2235,8 @@ namespace Catch virtual ReporterPreferences getPreferences() const = 0; + virtual void noMatchingTestCases( std::string const& spec ) = 0; + virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0; @@ -2241,6 +2261,8 @@ namespace Catch virtual ~StreamingReporterBase(); + virtual void noMatchingTestCases( std::string const& ) {} + virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { testRunInfo = _testRunInfo; } @@ -2306,70 +2328,6 @@ namespace Catch std::vector groups; }; - // !TBD: Derived helper that implements the streaming interface but holds the stats - // - declares a new interface where methods are called at the end of each event - // - this would be used by the JUnit reporter, for example. - // - it may be used by the basic reporter, too, but that would clear down the stack - // as it goes - struct CumulativeReporterBase : SharedImpl { - - CumulativeReporterBase( ReporterConfig const& _config ) - : m_config( _config ), - stream( _config.stream() ) - {} - - virtual ~CumulativeReporterBase(); - - virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { -// testRunInfo = _testRunInfo; - } - virtual void testGroupStarting( GroupInfo const& _groupInfo ) { - testGroupNode = TestGroupNode( _groupInfo ); - } - - virtual void testCaseStarting( TestCaseInfo const& _testInfo ) { -// unusedTestCaseInfo = _testInfo; - } - virtual void sectionStarting( SectionInfo const& _sectionInfo ) { -// Ptr sectionInfo = new ThreadedSectionInfo( _sectionInfo ); -// if( !currentSectionInfo ) { -// currentSectionInfo = sectionInfo; -// } -// else { -// currentSectionInfo->children.push_back( sectionInfo ); -// sectionInfo->parent = currentSectionInfo; -// currentSectionInfo = sectionInfo; -// } - } - - virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { -// currentSectionInfo = currentSectionInfo->parent; - } - virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { -// unusedTestCaseInfo.reset(); - } - virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { -// testGroupNode-> // populate -// Ptr node ( new TestGroupNode( _testGroupStats ) ); -// unusedGroupInfo.reset(); - } - virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { -// currentSectionInfo.reset(); -// unusedTestCaseInfo.reset(); -// unusedGroupInfo.reset(); -// testRunInfo.reset(); - } - - ReporterConfig m_config; -// Option testRunInfo; -// Option unusedGroupInfo; -// Option unusedTestCaseInfo; -// Ptr currentSectionInfo; -// Ptr testGroupNode; - Option testGroupNode; - std::ostream& stream; - }; - // Deprecated struct IReporter : IShared { virtual ~IReporter(); @@ -2405,6 +2363,7 @@ namespace Catch return prefs; } + virtual void noMatchingTestCases( std::string const& ) {} virtual void testRunStarting( TestRunInfo const& ) { m_legacyReporter->StartTesting(); } @@ -4785,7 +4744,7 @@ namespace Catch { } } if( testsRunForGroup == 0 && !filterGroup.getName().empty() ) - std::cerr << "\n[No test cases matched with: " << filterGroup.getName() << "]" << std::endl; + m_reporter->noMatchingTestCases( filterGroup.getName() ); return totals; } @@ -6952,7 +6911,7 @@ namespace Catch { private: ReporterConfig m_config; - bool m_currentTestSuccess; +// bool m_currentTestSuccess; Stats m_testSuiteStats; Stats* m_currentStats; @@ -6987,6 +6946,10 @@ namespace Catch { } + virtual void noMatchingTestCases( std::string const& spec ) { + stream << "No test cases matched '" << spec << "'" << std::endl; + } + virtual void assertionStarting( AssertionInfo const& ) { } @@ -7368,7 +7331,6 @@ namespace Catch { BasicReporter::~BasicReporter() {} StreamingReporterBase::~StreamingReporterBase() {} - CumulativeReporterBase::~CumulativeReporterBase() {} ConsoleReporter::~ConsoleReporter() {} IRunner::~IRunner() {} IMutableContext::~IMutableContext() {} @@ -7480,6 +7442,14 @@ int main (int argc, char * const argv[]) { #define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) +// "BDD-style" convenience wrappers +#define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags ) +#define CATCH_GIVEN( desc ) CATCH_SECTION( "Given: " desc, "" ) +#define CATCH_WHEN( desc ) CATCH_SECTION( " When: " desc, "" ) +#define CATCH_AND_WHEN( desc ) CATCH_SECTION( " And: " desc, "" ) +#define CATCH_THEN( desc ) CATCH_SECTION( " Then: " desc, "" ) +#define CATCH_AND_THEN( desc ) CATCH_SECTION( " And: " desc, "" ) + // If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required #else @@ -7527,6 +7497,14 @@ int main (int argc, char * const argv[]) { #define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) +// "BDD-style" convenience wrappers +#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) +#define GIVEN( desc ) SECTION( "Given: " desc, "" ) +#define WHEN( desc ) SECTION( " When: " desc, "" ) +#define AND_WHEN( desc ) SECTION( " And: " desc, "" ) +#define THEN( desc ) SECTION( " Then: " desc, "" ) +#define AND_THEN( desc ) SECTION( " And: " desc, "" ) + using Catch::Detail::Approx; #ifdef __clang__ From 9c5bbab239f1a01521d58585cfadddc5b27c6fad Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 13 Mar 2013 20:54:19 +0000 Subject: [PATCH 156/296] build 25 --- README | 2 +- include/internal/catch_version.hpp | 2 +- projects/SelfTest/Baselines/approvedResults.txt | 4 ++-- single_include/catch.hpp | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README b/README index 1b4aace1..50023fc5 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 24 (integration branch) +CATCH v0.9 build 25 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 3f447bcc..5edce277 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 24, "integration" ); + Version libraryVersion( 0, 9, 25, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 65ce34f4..ddd466cf 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,5 +1,5 @@ -CatchSelfTest is a CATCH v0.9 b24 (integration) host application. +CatchSelfTest is a CATCH v0.9 b25 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4286,7 +4286,7 @@ with expansion: 101 test cases - 47 failed (625 assertions - 104 failed) -CatchSelfTest is a CATCH v0.9 b24 (integration) host application. +CatchSelfTest is a CATCH v0.9 b25 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 99bf8a1c..f33bf9c1 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 24 (integration branch) - * Generated: 2013-03-13 12:18:41.022404 + * CATCH v0.9 build 25 (integration branch) + * Generated: 2013-03-13 20:53:37.480746 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -5843,7 +5843,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 24, "integration" ); + Version libraryVersion( 0, 9, 25, "integration" ); } // #included from: catch_line_wrap.hpp From c0b698073e5e69204b6c5468a74ce5cfdc8e65fa Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 16 Mar 2013 20:18:52 +0000 Subject: [PATCH 157/296] Initial support for variadic macros --- include/catch.hpp | 45 ++++++-- include/internal/catch_section.hpp | 15 ++- .../catch_test_case_registry_impl.hpp | 25 ++-- include/internal/catch_test_registry.hpp | 109 ++++++++++++------ projects/SelfTest/VariadicMacrosTests.cpp | 28 +++++ .../CatchSelfTest.xcodeproj/project.pbxproj | 4 + 6 files changed, 163 insertions(+), 63 deletions(-) create mode 100644 projects/SelfTest/VariadicMacrosTests.cpp diff --git a/include/catch.hpp b/include/catch.hpp index 0633997f..8f74962b 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -11,11 +11,20 @@ #ifdef __clang__ #pragma clang diagnostic ignored "-Wglobal-constructors" +#pragma clang diagnostic ignored "-Wvariadic-macros" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif +// Use variadic macros if the compiler supports them +#if ( defined _MSC_VER && _MSC_VER >= 1400 && !defined __EDGE__) || \ + ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ + ( defined __GNUC__ && __GNUC__ >= 3 ) || \ + ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) + #define CATCH_CONFIG_VARIADIC_MACROS +#endif + #include "internal/catch_notimplemented_exception.h" #include "internal/catch_context.h" #include "internal/catch_test_registry.hpp" @@ -76,12 +85,18 @@ #define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "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 ) - -#define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) -#define CATCH_TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) -#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "Anonymous test case" ) -#define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) + #define CATCH_TEST_CASE_NORETURN( ... ) INTERNAL_CATCH_TESTCASE_NORETURN( __VA_ARGS__ ) + #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) +#else + #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) + #define CATCH_TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) + #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) + #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) +#endif +#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) #define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) #define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) @@ -127,12 +142,18 @@ #define CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) #define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "SCOPED_CAPTURE" ) -#define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) - -#define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) -#define TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) -#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "Anonymous test case" ) -#define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) + #define TEST_CASE_NORETURN( ... ) INTERNAL_CATCH_TESTCASE_NORETURN( __VA_ARGS__ ) + #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) +#else + #define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) + #define TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) + #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) + #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) +#endif +#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) #define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) #define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) diff --git a/include/internal/catch_section.hpp b/include/internal/catch_section.hpp index e6a6d254..5c7e53aa 100644 --- a/include/internal/catch_section.hpp +++ b/include/internal/catch_section.hpp @@ -17,9 +17,9 @@ namespace Catch { class Section { public: - Section( const std::string& name, - const std::string& description, - const SourceLineInfo& lineInfo ) + Section( const SourceLineInfo& lineInfo, + const std::string& name, + const std::string& description = "" ) : m_info( name, description, lineInfo ), m_sectionIncluded( getCurrentContext().getResultCapture().sectionStarted( m_info, m_assertions ) ) {} @@ -44,7 +44,12 @@ namespace Catch { } // 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 ) ) +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define INTERNAL_CATCH_SECTION( ... ) \ + if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) +#else + #define INTERNAL_CATCH_SECTION( name, desc ) \ + if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, name, desc ) ) +#endif #endif // TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED diff --git a/include/internal/catch_test_case_registry_impl.hpp b/include/internal/catch_test_case_registry_impl.hpp index 5404766c..ffccb284 100644 --- a/include/internal/catch_test_case_registry_impl.hpp +++ b/include/internal/catch_test_case_registry_impl.hpp @@ -29,7 +29,7 @@ namespace Catch { std::string name = testCase.getTestCaseInfo().name; if( name == "" ) { std::ostringstream oss; - oss << name << "unnamed/" << ++m_unnamedCount; + oss << "Anonymous test case " << ++m_unnamedCount; return registerTest( testCase.withName( oss.str() ) ); } @@ -124,22 +124,25 @@ namespace Catch { /////////////////////////////////////////////////////////////////////////// - AutoReg::AutoReg( TestFunction function, - const char* name, - const char* description, - const SourceLineInfo& lineInfo ) { - registerTestCase( new FreeFunctionTestCase( function ), "global", name, description, lineInfo ); + AutoReg::AutoReg( TestFunction function, + SourceLineInfo const& lineInfo, + NameAndDesc const& nameAndDesc ) { + registerTestCase( new FreeFunctionTestCase( function ), "global", nameAndDesc, lineInfo ); } AutoReg::~AutoReg() {} void AutoReg::registerTestCase( ITestCase* testCase, - const char* classOrQualifiedMethodName, - const char* name, - const char* description, - const SourceLineInfo& lineInfo ) { + char const* classOrQualifiedMethodName, + NameAndDesc const& nameAndDesc, + SourceLineInfo const& lineInfo ) { - getMutableRegistryHub().registerTest( makeTestCase( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); + getMutableRegistryHub().registerTest + ( makeTestCase( testCase, + extractClassName( classOrQualifiedMethodName ), + nameAndDesc.name, + nameAndDesc.description, + lineInfo ) ); } } // end namespace Catch diff --git a/include/internal/catch_test_registry.hpp b/include/internal/catch_test_registry.hpp index 0530e4f2..108de42a 100644 --- a/include/internal/catch_test_registry.hpp +++ b/include/internal/catch_test_registry.hpp @@ -31,28 +31,37 @@ private: }; typedef void(*TestFunction)(); - + +struct NameAndDesc { + NameAndDesc( const char* _name = "", const char* _description= "" ) + : name( _name ), description( _description ) + {} + + const char* name; + const char* description; +}; + struct AutoReg { AutoReg( TestFunction function, - const char* name, - const char* description, - const SourceLineInfo& lineInfo ); + SourceLineInfo const& lineInfo, + NameAndDesc const& nameAndDesc ); template AutoReg( void (C::*method)(), - const char* className, - const char* name, - const char* description, - const SourceLineInfo& lineInfo ) { - registerTestCase( new MethodTestCase( method ), className, name, description, lineInfo ); + char const* className, + NameAndDesc const& nameAndDesc, + SourceLineInfo const& lineInfo ) { + registerTestCase( new MethodTestCase( method ), + className, + nameAndDesc, + lineInfo ); } void registerTestCase( ITestCase* testCase, - const char* className, - const char* name, - const char* description, - const SourceLineInfo& lineInfo ); + char const* className, + NameAndDesc const& nameAndDesc, + SourceLineInfo const& lineInfo ); ~AutoReg(); @@ -63,30 +72,60 @@ private: } // end namespace Catch -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TESTCASE( Name, Desc ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), Name, Desc, CATCH_INTERNAL_LINEINFO ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() +#ifdef CATCH_CONFIG_VARIADIC_MACROS + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TESTCASE( ... ) \ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TESTCASE_NORETURN( Name, Desc ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), Name, Desc, CATCH_INTERNAL_LINEINFO ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TESTCASE_NORETURN( ... ) \ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Name, Desc, CATCH_INTERNAL_LINEINFO ); } + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } -/////////////////////////////////////////////////////////////////////////////// -#define TEST_CASE_METHOD( ClassName, TestName, Desc )\ - namespace{ \ - 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, #ClassName, TestName, Desc, CATCH_INTERNAL_LINEINFO ); \ - } \ - void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() + /////////////////////////////////////////////////////////////////////////////// + #define TEST_CASE_METHOD( ClassName, ... )\ + namespace{ \ + 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, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \ + } \ + void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() + +#else + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TESTCASE_NORETURN( Name, Desc ) \ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } + + /////////////////////////////////////////////////////////////////////////////// + #define TEST_CASE_METHOD( ClassName, TestName, Desc )\ + namespace{ \ + 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, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \ + } \ + void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() + +#endif #endif // TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED diff --git a/projects/SelfTest/VariadicMacrosTests.cpp b/projects/SelfTest/VariadicMacrosTests.cpp new file mode 100644 index 00000000..7155f801 --- /dev/null +++ b/projects/SelfTest/VariadicMacrosTests.cpp @@ -0,0 +1,28 @@ +/* + * Created by Phil on 15/03/2013. + * Copyright 2013 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) + */ + +//#define CATCH_CONFIG_VARIADIC_MACROS +#include "catch.hpp" + +TEST_CASE() +{ + SUCCEED( "anonymous test case" ); +} + +TEST_CASE( "Test case with one argument" ) +{ + SUCCEED( "no assertions" ); +} + +TEST_CASE( "Variadic macros", "[variadic][sections]" ) +{ + SECTION( "Section with one argument" ) + { + SUCCEED( "no assertions" ); + } +} diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 049feb47..2e8a5d58 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 266B06B816F3A60A004ED264 /* VariadicMacrosTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */; }; 26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26847E5D16BBADB40043B9C1 /* catch_message.cpp */; }; 2694A1FD16A0000E004816E3 /* catch_line_wrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */; }; 4A45DA2416161EF9004F8D6B /* catch_console_colour.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA2316161EF9004F8D6B /* catch_console_colour.cpp */; }; @@ -54,6 +55,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VariadicMacrosTests.cpp; path = ../../../SelfTest/VariadicMacrosTests.cpp; sourceTree = ""; }; 26847E5B16BBAB790043B9C1 /* catch_message.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_message.h; sourceTree = ""; }; 26847E5C16BBACB60043B9C1 /* catch_message.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_message.hpp; sourceTree = ""; }; 26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = ""; }; @@ -211,6 +213,7 @@ 4A6D0C33149B3D9E00DB3EAA /* MessageTests.cpp */, 4A6D0C34149B3D9E00DB3EAA /* MiscTests.cpp */, 4AA7FF4115F3E89D009AD7F9 /* BDDTests.cpp */, + 266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */, ); name = Tests; sourceTree = ""; @@ -481,6 +484,7 @@ 4ACE21CC166CA1B300FB5509 /* catch_option.cpp in Sources */, 2694A1FD16A0000E004816E3 /* catch_line_wrap.cpp in Sources */, 26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */, + 266B06B816F3A60A004ED264 /* VariadicMacrosTests.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From a46ee0222a2db8340e4efe63eb9e9f7a7e20bf75 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 16 Mar 2013 20:19:38 +0000 Subject: [PATCH 158/296] Print ~~~ at start of console output. Some cleanup in the reporter code --- include/reporters/catch_reporter_console.hpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 3f0c770c..ea3ea47a 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -129,9 +129,6 @@ namespace Catch { messageLabel = "with message"; if( _stats.infoMessages.size() > 1 ) messageLabel = "with messages"; -// if( result.hasMessage() ){ -// messageLabel = "with message"; -// } break; case ResultWas::ThrewException: colour = TextColour::Error; @@ -152,7 +149,6 @@ namespace Catch { case ResultWas::ExplicitFailure: passOrFail = "FAILED"; colour = TextColour::Error; -// messageLabel = "explicitly with message"; if( _stats.infoMessages.size() == 1 ) messageLabel = "explicitly with message"; if( _stats.infoMessages.size() > 1 ) @@ -165,8 +161,6 @@ namespace Catch { messageLabel = "with message"; if( _stats.infoMessages.size() > 1 ) messageLabel = "with messages"; -// if( result.hasMessage() ) -// messageLabel = "with message"; break; // These cases are here to prevent compiler warnings @@ -227,8 +221,6 @@ namespace Catch { ++it ) { stream << wrapLongStrings( it->message ) << "\n"; } -// if( !message.empty() ) -// stream << wrapLongStrings( message ) << "\n"; } void printSourceInfo() const { TextColour colourGuard( TextColour::FileName ); @@ -263,7 +255,8 @@ namespace Catch { m_atLeastOneTestCasePrinted = true; } void lazyPrintRunInfo() { - stream << "\n" << testRunInfo->name + stream << "\n" << getTildes() << "\n"; + stream << testRunInfo->name << " is a CATCH v" << libraryVersion.majorVersion << "." << libraryVersion.minorVersion << " b" << libraryVersion.buildNumber; @@ -379,6 +372,10 @@ namespace Catch { static const std::string doubleDashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' ); return doubleDashes; } + static std::string const& getTildes() { + static const std::string dots( CATCH_CONFIG_CONSOLE_WIDTH-1, '~' ); + return dots; + } private: bool m_headerPrinted; From 9390675260ac8b0906a6846c82f8113224fc2c7a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 16 Mar 2013 20:21:51 +0000 Subject: [PATCH 159/296] Build 26 --- README | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 79 ++++++- single_include/catch.hpp | 211 ++++++++++++------ 4 files changed, 211 insertions(+), 83 deletions(-) diff --git a/README b/README index 50023fc5..dc010d9b 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 25 (integration branch) +CATCH v0.9 build 26 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 5edce277..125bdf3d 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 25, "integration" ); + Version libraryVersion( 0, 9, 26, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index ddd466cf..75a6fc81 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,5 +1,6 @@ -CatchSelfTest is a CATCH v0.9 b25 (integration) host application. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +CatchSelfTest is a CATCH v0.9 b26 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4282,11 +4283,40 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +Anonymous test case 1 +............................................................................... + +VariadicMacrosTests.cpp:14: +PASSED: +with message: + anonymous test case + +------------------------------------------------------------------------------- +Test case with one argument +............................................................................... + +VariadicMacrosTests.cpp:19: +PASSED: +with message: + no assertions + +------------------------------------------------------------------------------- +Variadic macros + Section with one argument +............................................................................... + +VariadicMacrosTests.cpp:26: +PASSED: +with message: + no assertions + =============================================================================== -101 test cases - 47 failed (625 assertions - 104 failed) +104 test cases - 47 failed (628 assertions - 104 failed) -CatchSelfTest is a CATCH v0.9 b25 (integration) host application. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +CatchSelfTest is a CATCH v0.9 b26 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4577,7 +4607,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -5015,6 +5045,9 @@ TrickyTests.cpp:106 + + + Message from section one @@ -9932,9 +9965,21 @@ BDDTests.cpp" line="23">
- + + + + + + + +
+ +
+ +
+ - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -11311,10 +11356,28 @@ BDDTests.cpp:23: itDoesThat() succeeded for: true [End of section: 'Given: This stuff exists' All 2 assertions passed] [Finished: 'Scenario: Do that thing with the thing' All tests passed (2 assertions in 1 test case)] -[End of group: '~dummy'. 47 of 101 test cases failed (104 of 625 assertions failed)] + +[Running: Anonymous test case 1] +VariadicMacrosTests.cpp:14: succeeded +[with message: anonymous test case] +[Finished: 'Anonymous test case 1' All tests passed (1 assertion in 1 test case)] + +[Running: Test case with one argument] +VariadicMacrosTests.cpp:19: succeeded +[with message: no assertions] +[Finished: 'Test case with one argument' All tests passed (1 assertion in 1 test case)] + +[Running: Variadic macros] +[Started section: 'Section with one argument'] +VariadicMacrosTests.cpp:26: succeeded +[with message: no assertions] +[End of section: 'Section with one argument' 1 assertion passed] + +[Finished: 'Variadic macros' All tests passed (1 assertion in 1 test case)] +[End of group: '~dummy'. 47 of 104 test cases failed (104 of 628 assertions failed)] -[Testing completed. 47 of 101 test cases failed (104 of 625 assertions failed)] +[Testing completed. 47 of 104 test cases failed (104 of 628 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/single_include/catch.hpp b/single_include/catch.hpp index f33bf9c1..41cc75c2 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 25 (integration branch) - * Generated: 2013-03-13 20:53:37.480746 + * CATCH v0.9 build 26 (integration branch) + * Generated: 2013-03-16 20:19:56.120579 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -15,11 +15,20 @@ #ifdef __clang__ #pragma clang diagnostic ignored "-Wglobal-constructors" +#pragma clang diagnostic ignored "-Wvariadic-macros" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif +// Use variadic macros if the compiler supports them +#if ( defined _MSC_VER && _MSC_VER >= 1400 && !defined __EDGE__) || \ + ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ + ( defined __GNUC__ && __GNUC__ >= 3 ) || \ + ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) + #define CATCH_CONFIG_VARIADIC_MACROS +#endif + // #included from: internal/catch_notimplemented_exception.h #define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED @@ -379,27 +388,36 @@ private: typedef void(*TestFunction)(); +struct NameAndDesc { + NameAndDesc( const char* _name = "", const char* _description= "" ) + : name( _name ), description( _description ) + {} + + const char* name; + const char* description; +}; + struct AutoReg { AutoReg( TestFunction function, - const char* name, - const char* description, - const SourceLineInfo& lineInfo ); + SourceLineInfo const& lineInfo, + NameAndDesc const& nameAndDesc ); template AutoReg( void (C::*method)(), - const char* className, - const char* name, - const char* description, - const SourceLineInfo& lineInfo ) { - registerTestCase( new MethodTestCase( method ), className, name, description, lineInfo ); + char const* className, + NameAndDesc const& nameAndDesc, + SourceLineInfo const& lineInfo ) { + registerTestCase( new MethodTestCase( method ), + className, + nameAndDesc, + lineInfo ); } void registerTestCase( ITestCase* testCase, - const char* className, - const char* name, - const char* description, - const SourceLineInfo& lineInfo ); + char const* className, + NameAndDesc const& nameAndDesc, + SourceLineInfo const& lineInfo ); ~AutoReg(); @@ -410,31 +428,61 @@ private: } // end namespace Catch -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TESTCASE( Name, Desc ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), Name, Desc, CATCH_INTERNAL_LINEINFO ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() +#ifdef CATCH_CONFIG_VARIADIC_MACROS + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TESTCASE( ... ) \ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TESTCASE_NORETURN( Name, Desc ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), Name, Desc, CATCH_INTERNAL_LINEINFO ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TESTCASE_NORETURN( ... ) \ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Name, Desc, CATCH_INTERNAL_LINEINFO ); } + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } -/////////////////////////////////////////////////////////////////////////////// -#define TEST_CASE_METHOD( ClassName, TestName, Desc )\ - namespace{ \ - 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, #ClassName, TestName, Desc, CATCH_INTERNAL_LINEINFO ); \ - } \ - void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() + /////////////////////////////////////////////////////////////////////////////// + #define TEST_CASE_METHOD( ClassName, ... )\ + namespace{ \ + 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, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \ + } \ + void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() + +#else + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TESTCASE_NORETURN( Name, Desc ) \ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } + + /////////////////////////////////////////////////////////////////////////////// + #define TEST_CASE_METHOD( ClassName, TestName, Desc )\ + namespace{ \ + 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, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \ + } \ + void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() + +#endif // #included from: internal/catch_capture.hpp #define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED @@ -2638,9 +2686,9 @@ namespace Catch { class Section { public: - Section( const std::string& name, - const std::string& description, - const SourceLineInfo& lineInfo ) + Section( const SourceLineInfo& lineInfo, + const std::string& name, + const std::string& description = "" ) : m_info( name, description, lineInfo ), m_sectionIncluded( getCurrentContext().getResultCapture().sectionStarted( m_info, m_assertions ) ) {} @@ -2665,8 +2713,13 @@ namespace Catch { } // 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 ) ) +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define INTERNAL_CATCH_SECTION( ... ) \ + if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) +#else + #define INTERNAL_CATCH_SECTION( name, desc ) \ + if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, name, desc ) ) +#endif // #included from: internal/catch_generators.hpp #define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED @@ -4911,7 +4964,7 @@ namespace Catch { std::string name = testCase.getTestCaseInfo().name; if( name == "" ) { std::ostringstream oss; - oss << name << "unnamed/" << ++m_unnamedCount; + oss << "Anonymous test case " << ++m_unnamedCount; return registerTest( testCase.withName( oss.str() ) ); } @@ -5007,21 +5060,24 @@ namespace Catch { /////////////////////////////////////////////////////////////////////////// AutoReg::AutoReg( TestFunction function, - const char* name, - const char* description, - const SourceLineInfo& lineInfo ) { - registerTestCase( new FreeFunctionTestCase( function ), "global", name, description, lineInfo ); + SourceLineInfo const& lineInfo, + NameAndDesc const& nameAndDesc ) { + registerTestCase( new FreeFunctionTestCase( function ), "global", nameAndDesc, lineInfo ); } AutoReg::~AutoReg() {} void AutoReg::registerTestCase( ITestCase* testCase, - const char* classOrQualifiedMethodName, - const char* name, - const char* description, - const SourceLineInfo& lineInfo ) { + char const* classOrQualifiedMethodName, + NameAndDesc const& nameAndDesc, + SourceLineInfo const& lineInfo ) { - getMutableRegistryHub().registerTest( makeTestCase( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); + getMutableRegistryHub().registerTest + ( makeTestCase( testCase, + extractClassName( classOrQualifiedMethodName ), + nameAndDesc.name, + nameAndDesc.description, + lineInfo ) ); } } // end namespace Catch @@ -5843,7 +5899,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 25, "integration" ); + Version libraryVersion( 0, 9, 26, "integration" ); } // #included from: catch_line_wrap.hpp @@ -7043,9 +7099,6 @@ namespace Catch { messageLabel = "with message"; if( _stats.infoMessages.size() > 1 ) messageLabel = "with messages"; -// if( result.hasMessage() ){ -// messageLabel = "with message"; -// } break; case ResultWas::ThrewException: colour = TextColour::Error; @@ -7066,7 +7119,6 @@ namespace Catch { case ResultWas::ExplicitFailure: passOrFail = "FAILED"; colour = TextColour::Error; -// messageLabel = "explicitly with message"; if( _stats.infoMessages.size() == 1 ) messageLabel = "explicitly with message"; if( _stats.infoMessages.size() > 1 ) @@ -7079,8 +7131,6 @@ namespace Catch { messageLabel = "with message"; if( _stats.infoMessages.size() > 1 ) messageLabel = "with messages"; -// if( result.hasMessage() ) -// messageLabel = "with message"; break; // These cases are here to prevent compiler warnings @@ -7141,8 +7191,6 @@ namespace Catch { ++it ) { stream << wrapLongStrings( it->message ) << "\n"; } -// if( !message.empty() ) -// stream << wrapLongStrings( message ) << "\n"; } void printSourceInfo() const { TextColour colourGuard( TextColour::FileName ); @@ -7177,7 +7225,8 @@ namespace Catch { m_atLeastOneTestCasePrinted = true; } void lazyPrintRunInfo() { - stream << "\n" << testRunInfo->name + stream << "\n" << getTildes() << "\n"; + stream << testRunInfo->name << " is a CATCH v" << libraryVersion.majorVersion << "." << libraryVersion.minorVersion << " b" << libraryVersion.buildNumber; @@ -7293,6 +7342,10 @@ namespace Catch { static const std::string doubleDashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' ); return doubleDashes; } + static std::string const& getTildes() { + static const std::string dots( CATCH_CONFIG_CONSOLE_WIDTH-1, '~' ); + return dots; + } private: bool m_headerPrinted; @@ -7430,12 +7483,18 @@ int main (int argc, char * const argv[]) { #define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "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 ) - -#define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) -#define CATCH_TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) -#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "Anonymous test case" ) -#define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) + #define CATCH_TEST_CASE_NORETURN( ... ) INTERNAL_CATCH_TESTCASE_NORETURN( __VA_ARGS__ ) + #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) +#else + #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) + #define CATCH_TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) + #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) + #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) +#endif +#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) #define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) #define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) @@ -7481,12 +7540,18 @@ int main (int argc, char * const argv[]) { #define CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) #define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "SCOPED_CAPTURE" ) -#define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) - -#define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) -#define TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) -#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "Anonymous test case" ) -#define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) + #define TEST_CASE_NORETURN( ... ) INTERNAL_CATCH_TESTCASE_NORETURN( __VA_ARGS__ ) + #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) +#else + #define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) + #define TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) + #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) + #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) +#endif +#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) #define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) #define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) From 444f4ddc602018e2093c90ed5d28fe2b2c66a911 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 16 Mar 2013 20:39:19 +0000 Subject: [PATCH 160/296] Variadics support for BDD macros (scenarios) --- include/catch.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/catch.hpp b/include/catch.hpp index 8f74962b..7a95541c 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -104,7 +104,11 @@ #define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) // "BDD-style" convenience wrappers +#ifdef CATCH_CONFIG_VARIADIC_MACROS +#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ ) +#else #define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags ) +#endif #define CATCH_GIVEN( desc ) CATCH_SECTION( "Given: " desc, "" ) #define CATCH_WHEN( desc ) CATCH_SECTION( " When: " desc, "" ) #define CATCH_AND_WHEN( desc ) CATCH_SECTION( " And: " desc, "" ) @@ -165,7 +169,11 @@ #define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) // "BDD-style" convenience wrappers +#ifdef CATCH_CONFIG_VARIADIC_MACROS +#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ ) +#else #define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) +#endif #define GIVEN( desc ) SECTION( "Given: " desc, "" ) #define WHEN( desc ) SECTION( " When: " desc, "" ) #define AND_WHEN( desc ) SECTION( " And: " desc, "" ) From 49d7ce40e864951a94f83e863335a2538597ff10 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 08:58:22 +0000 Subject: [PATCH 161/296] Minor tidy up --- include/internal/catch_objc.hpp | 2 +- include/internal/catch_test_spec.h | 4 ++-- projects/SelfTest/ConditionTests.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/internal/catch_objc.hpp b/include/internal/catch_objc.hpp index 1769e55b..a25dd8cd 100644 --- a/include/internal/catch_objc.hpp +++ b/include/internal/catch_objc.hpp @@ -72,7 +72,7 @@ namespace Catch { return ""; } } - + inline size_t registerTestMethods() { size_t noTestMethods = 0; int noClasses = objc_getClassList( NULL, 0 ); diff --git a/include/internal/catch_test_spec.h b/include/internal/catch_test_spec.h index ab1895ac..fa60ce73 100644 --- a/include/internal/catch_test_spec.h +++ b/include/internal/catch_test_spec.h @@ -53,11 +53,11 @@ namespace Catch { } } - if( m_stringToMatch[0] == '*' ) { + if( startsWith( m_stringToMatch, "*" ) ) { m_stringToMatch = m_stringToMatch.substr( 1 ); m_wildcardPosition = (WildcardPosition)( m_wildcardPosition | WildcardAtStart ); } - if( m_stringToMatch[m_stringToMatch.size()-1] == '*' ) { + if( endsWith( m_stringToMatch, "*" ) ) { m_stringToMatch = m_stringToMatch.substr( 0, m_stringToMatch.size()-1 ); m_wildcardPosition = (WildcardPosition)( m_wildcardPosition | WildcardAtEnd ); } diff --git a/projects/SelfTest/ConditionTests.cpp b/projects/SelfTest/ConditionTests.cpp index e3e3dffe..aebd123e 100644 --- a/projects/SelfTest/ConditionTests.cpp +++ b/projects/SelfTest/ConditionTests.cpp @@ -204,7 +204,7 @@ TEST_CASE( "./succeeding/conditions/int literals", // Disable warnings about sign conversions for the next two tests // (as we are deliberately invoking them) -// - Current only disabled for GCC/ LLVM. Should add VC++ too +// - Currently only disabled for GCC/ LLVM. Should add VC++ too #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-compare" From 3453639732c924b762f4e1e7e972d782bc2a9117 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 08:59:05 +0000 Subject: [PATCH 162/296] tags can be specified using -t (or as default command) Previously -g had to be used --- include/internal/catch_commandline.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index f95eaca8..7558e257 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -262,8 +262,12 @@ namespace Catch { groupName += cmd[i]; } TestCaseFilters filters( groupName ); - for( std::size_t i = 0; i < cmd.argsCount(); ++i ) - filters.addFilter( TestCaseFilter( cmd[i] ) ); + for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { + if( startsWith( cmd[i], "[" ) || startsWith( cmd[i], "~[" ) ) + filters.addTags( cmd[i] ); + else + filters.addFilter( TestCaseFilter( cmd[i] ) ); + } config.filters.push_back( filters ); } }; From bd7f797e09300402eedc29cfad971933de4db666 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 09:00:24 +0000 Subject: [PATCH 163/296] build 27 --- README | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 4 +-- single_include/catch.hpp | 26 ++++++++++++++----- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/README b/README index dc010d9b..22025388 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -CATCH v0.9 build 26 (integration branch) +CATCH v0.9 build 27 (integration branch) --------------------------------------------- CATCH is an automated test framework for C, C++ and Objective-C. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 125bdf3d..9f8a669f 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 26, "integration" ); + Version libraryVersion( 0, 9, 27, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 75a6fc81..df505ae0 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b26 (integration) host application. +CatchSelfTest is a CATCH v0.9 b27 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4316,7 +4316,7 @@ with message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b26 (integration) host application. +CatchSelfTest is a CATCH v0.9 b27 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 41cc75c2..28baa440 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 26 (integration branch) - * Generated: 2013-03-16 20:19:56.120579 + * CATCH v0.9 build 27 (integration branch) + * Generated: 2013-03-21 08:59:28.031778 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -1672,11 +1672,11 @@ namespace Catch { } } - if( m_stringToMatch[0] == '*' ) { + if( startsWith( m_stringToMatch, "*" ) ) { m_stringToMatch = m_stringToMatch.substr( 1 ); m_wildcardPosition = (WildcardPosition)( m_wildcardPosition | WildcardAtStart ); } - if( m_stringToMatch[m_stringToMatch.size()-1] == '*' ) { + if( endsWith( m_stringToMatch, "*" ) ) { m_stringToMatch = m_stringToMatch.substr( 0, m_stringToMatch.size()-1 ); m_wildcardPosition = (WildcardPosition)( m_wildcardPosition | WildcardAtEnd ); } @@ -3719,8 +3719,12 @@ namespace Catch { groupName += cmd[i]; } TestCaseFilters filters( groupName ); - for( std::size_t i = 0; i < cmd.argsCount(); ++i ) - filters.addFilter( TestCaseFilter( cmd[i] ) ); + for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { + if( startsWith( cmd[i], "[" ) || startsWith( cmd[i], "~[" ) ) + filters.addTags( cmd[i] ); + else + filters.addFilter( TestCaseFilter( cmd[i] ) ); + } config.filters.push_back( filters ); } }; @@ -5899,7 +5903,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 26, "integration" ); + Version libraryVersion( 0, 9, 27, "integration" ); } // #included from: catch_line_wrap.hpp @@ -7502,7 +7506,11 @@ int main (int argc, char * const argv[]) { #define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) // "BDD-style" convenience wrappers +#ifdef CATCH_CONFIG_VARIADIC_MACROS +#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ ) +#else #define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags ) +#endif #define CATCH_GIVEN( desc ) CATCH_SECTION( "Given: " desc, "" ) #define CATCH_WHEN( desc ) CATCH_SECTION( " When: " desc, "" ) #define CATCH_AND_WHEN( desc ) CATCH_SECTION( " And: " desc, "" ) @@ -7563,7 +7571,11 @@ int main (int argc, char * const argv[]) { #define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) // "BDD-style" convenience wrappers +#ifdef CATCH_CONFIG_VARIADIC_MACROS +#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ ) +#else #define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) +#endif #define GIVEN( desc ) SECTION( "Given: " desc, "" ) #define WHEN( desc ) SECTION( " When: " desc, "" ) #define AND_WHEN( desc ) SECTION( " And: " desc, "" ) From 3f7976665a002097937d7625ad065aa97313c75f Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 19:12:21 +0000 Subject: [PATCH 164/296] Added logo to readme --- README | 2 ++ catch-logo-small.png | Bin 0 -> 51470 bytes 2 files changed, 2 insertions(+) create mode 100644 catch-logo-small.png diff --git a/README b/README index 22025388..cf3f9e6c 100644 --- a/README +++ b/README @@ -1,3 +1,5 @@ +![Alt text](/catch-logo-small.png) + CATCH v0.9 build 27 (integration branch) --------------------------------------------- diff --git a/catch-logo-small.png b/catch-logo-small.png new file mode 100644 index 0000000000000000000000000000000000000000..a4e74e8a27efefa4974928735be4bc94ae7fba89 GIT binary patch literal 51470 zcmagE1ymg0(l|H_&JdizHMj?N1`7lyxJw{FaF^hc5FCOB5AN-KjI@bl<-BR^9Td?oS$O3eT{}u>b(Tvsa38uK@s{J^+A3kAe0y!YEX^ z0{~#j*~!Xkypolr)o^ouYv*7M04P4oPW9F%f|7h+`{BUdXp%~Az2DV>TFBLKLekEgPU>;%ey;QncV7`0Sdv>V;10fHb=C08yZ zCyDh9>GL-)GHFN4dDU(QcY<#GE!D{`>LbMG6jB=^)5br$l8jPZ6#6G8;w49)qulu? zJLgsAGLD1u?$E6L1am)w03YaQ8U39^M}M+t4NfOIB<}(td4&N(tY&rLX2Cm{05OF| zISxhTG@jTtCKU=B8!%sRZthT;B1gZ-vPxX~cdK2iXyJZFfd9=~10s#2`P5I~#p!R0 z)6@Mw2{<2juj0Stc0G_;b=_~B@orA$NXO)GFQqMT8>(>vDp?x^jk;}F#gJ@`aDxw4 zxHBIl0b3v>+vD4V_oVf{uhJCdxO8<92t+DS68c(qYVt5h)c^YKJ^VmidC@o5{`=)d ziCduoL2+g2a#kf}S$YQhrVBzP`jL7whzhP_Xtr%ZJ)*uHjgYx4CG{9Z>E~};k;#G3 z599Nq_V*mZda!TV(8&Tb?TKtXX^@o2z|Z}3zWo$#NC*gmCp6U^9Rpcf(v}*p?BuvwOk7j2TH+b zU*b9YbuAC;I2S+*Ulufv>?v`+_mXX7xgfRr7^69nRTH&PKx4$B55LE*7sGry$yc#Y zKj03y!wCHG1DPK%9O#v(ljaV%+ElZ9npGms@ND^3?;&yc?+F8kyW;*ooqq{4KVls$rPh2$&H7UiGp z|4CdWP+7Ae{q;h!TvT#>hFgMLs@uo&B&8zq*Aiuz+L)evO(A|cHwiZ{mg<(A4XY5Gsc|P`7=mG7fR3h!;2N(%(gaqHi|BxF0oK42o<2u@a-{P zp6+#BzOrVte!oq+4csQ*)*6+?4!0P_u(EnFO8T9&h4fULU#C+W&h|w+QyWdYSZBA? zul!smTIY+7b9uMcn{q_Cb-AOCz1I7@I87m)c#TQDwXcEF0hTxcafg&AS(_r?cb4aa z1yls+1yb!Or}n1PXXa)up+t5kbK*53`9o9ZbE8w`Q=(M@)vB{zP_V6@ZSHj7sPn=`{Ct>x(^iCzp!&j%g9m5IR)PFw>zr{T=SSZ7~A^~pxE^Dj_@x! zx{VVFdh)0WRlPXo3mc~#M|s;ZeluRTGqEFcVR#`8ii${+&yoK+RLeNPJLpzr{bk#o zJ)i=mqDpr~m!^uUvZ3;@@^q195oNKmX}=b+@^dcL-ssKyfw*_OHZ7yoD<=_M84_!O z@%N7CnX;t=Xdl%+;>M}PS$=2w?#dicVpU?I7RDjUo~1L|z7^wn?Pa>{KZB@>{u({F zoj&GV4X)0p{%Df>Lm+c3*GR~FP!$^cyLruVID0?msCzPCSoV9^Z_UHAVXeu}y9TEs zJJy>i8=ixQZ7oeL3mrr6GmraC`y>y;;P6|b+shj^#KfPf>wvwI!?Ydfp3wg3de4tX z2Y?{0u(^G&dEQ%Ep;|f@-eFc-c?~@tMq##AQMhKLU8Hc~b0VB)SSw(^pqxJOjm~Bs zJTPf9=aF=)CVUe{^V|i01783?{<$N4nu3?YbU{)9jzU-5bsSf8x6qnTw@08&jK7Md zitG=MN_7X{BaJMb<*3$*vxBox_%({ZjEYP^{~T})^%qGDlPCk2an;bavDSQJTmB%r z9-OU|q`t{OrT&fSI}?ps;3VenIk)21KrOE#6}QD@s%0B-byHO5tkZAYyYWTsMX4o{ zuiTY?r3&VpB${SO(wT$GQMq}6yw`74Y(7|1|HvAT8hm67+Z8$G~j#UE8y#V{^mTMgyqR~`K6|F zEjC&?l&#G;r&*-Brg?Hf4Z7bVU|2Q8w|X+{TDo4w3w4`l5X?RlYhjX(Vy z5lec9mQYWkci?I+N`up$?mES4MPvTfKF@*G*!0-Y*sd=}g2&63b?JKkMT6~y^;-d~ zEtjK0f@|6Vd>ta5?#>x+7IQdTIr}+Vn*AIkw5#>I8~v?}_L_fUy_I(zsyKf2i(79= z?_@=KiEibEHu3BEZmpo*)a=uW*$U^MK2ZMCnS~}h=%v%@Nr*(w`^@WiC!CA7PPyi5 z$M+AnM)uF_*>Tr#wy1oJNwlE%oQJrP+p$>g>CzXD%xfXOOy#)HuQOlOd(i_r>=+Brtwl+;zZ%Z z``zCYYkN_92VHpn8#D4f(Yqa8?UTlC9UkZPW7~v!`g%*%qNa|=u6uTfk&Tj6)9eVdohR2_GMlI-s=pUUfoTS=5d+rXcbawFl z(Ovt#${m;o%RA5iHn5bd8t6prMky+A#J7CGaxmS6e=^))<`(2DWe88dX?0V1U%Bz= z`19xAfxn?STt1>VDwhs#3-)d~L{XfS4|48<*d;34k`M=Tp_sRd0=)a?)vd)e!Zr1L9>68=@=l*|; z{SRxz|Mkq^wY9smgXdosN(%A*XTkp-{681y|GzEx--G|3Z1^{Gp5!ly^~At`bV(BH zh;2O#0Du5q$w_PbART3+w|dAY{z+RQ9tsyp_-deuLW~>=+!-1!$V>WRr=yaNzcoM! zKz;?0$8K$Zshw2H5*k{n=#NA!jX#L8$F=qd)q31m_GQiz=KHf+y<4^~8PLw|>FJ#< zDZy8<>@x7|G0DQ$&^$#)7a_!-hI?1TnOFawa#Fya@69tm&`Q3oU4fX?qw7CjR1 zd-x7Kx@OZE(f$`8hhM?p96nmV4e85MgdUEesFO&_!yy~x{jM6I`e z6ty!iGK>|y#qb}j=8HzO==x*5s6_BedVxg?H*-%ZlOAb!uFMJ2@^f{KZC>k-zz}eU z&Lg!qxAqOnv=lSCfkk4L73klLWq6M*p0|B z8mmcGwS9_VA)8k{C>}}|9X4bPvdxfxLGO7ZBwOCo*YI7Uood2!7Bsz1th+WCs?1Gx zZxn5$NojjvuNuj2)57?YTx$v*OSjBX%GRVq$Uk6hh19cY@RE%?K!;c#(Tk8u>FME@ z)PPS--O(uR|7pI-p&hFsIwcTyOX5uU57bt2YIyHj8c;aqr079B2~B6|zMea4yR|2* zM^Ulkl&;C`1uHJ<_SPW#>ZJdVbe{N>S7j1o?L2Hi0qN7mN+mYFmqomPl`{~5i`9lv z-F{?`uHOO*6d3^z{|EGcf``TQmGf?iHC%rlJVLg;QFKlk@00Y)T8K%IufQ;ZeL`PkPqSIeJS_%tLehU5A&#&i7Zvbj z%J~m3cuv9TKk3C!z4W!uS@SlHLOTf4@?E0P{8tZ}+b>u*eutxog+1by7EA=M$Mt4G zPX6@o5`|U}!OI+~gISb-h$dFn>!byt1g>CBPn}OUzBW!FP3Q9eaFFG%HYQu|l!}Az zFU>+n*Axl@UbTiK=!G89bAN$7rM3NL|CxQ-*niC|_sPrzb_1&ACAz-Nmrtnkh|6!DE5Y8%&~W8` zKI^+xl4gjPTytEph&CBv!4dHsi`&m$GB5l{^I<8KPgi!FMiz3@`(27W&*E; z6y{Ne)FA>ppOol*tV;USvrcEL>D4U#ayW#B8{=Gi0%vU?BA&>JiJ^3}(vYh4bu0!) zJV~H#Cq_F4*X{j)=ZAkx$N}lE{WlM06&ZHkiph=!8E;B(%Q39ex9*b*=MGNbz?CB)_Xb(8$Z+xY&)=DzS~*cknBv4_6o1tK3jH|RAbZ8KG)G^zdYB5B)g zB*DAhDhB%>)ekQY{>}u`BMau#Z`nKBl(ln3^1>2&;LgL)%7!Lr0@5s0 z2Mjd9Z#`L|N7~0+{*_PC3=6C2%Vu74&Lps^iyope%BAx!-D+3kC4duqfA?Vj#|V1e znjko}JEgl+gDl%YD31z0%=ySU)r_7ly=s$o{n^AkSBLECEK*Y-^Cy9;2Hoa}g+FHUJ~;2x@wqE1>S6m8 zlzuL3mA#f3IeXEn2sXuZb7rFryrf?S%hv-YIL)H#!eXJ=I3eiMVBV32^kwIQD6TQK`JqOEZ8Y{pF? zj@nJ*dG?53#H55rbVg7w*4nIe)xNrS68i57`QGh47qk5JU$KrY052N#IV+r|M3;lI z3-8d2?#3cGe$a-Sga{;A1e5 z-7BitZ&m5$mg3Ve@YIIQw+R+v48qXx?;fo$rf|QJUTb^Y(H`W`{l^XQbJmiAYwVW3 zx|`x~CD+gPS$GBZjCAm?;_oZrtYLAU-af{_kt+ zFLApjr~OcEi2&0{5xk>SG*FQyMk2oE81*l&UgP=_D9b8%{J4w;{a;DdId_})921R`H`&C@mC?iRqF4H~E3AJ=yocmx2`)y4KAmTF`}TgbBLd z&`N&T&}ot3ZA}`-y$NGV6IOw0?_dkwhU(NA1LG~`>3CD{`4FDINGUxJ>N6>w9ny{6 zqTdLvUGKvfP9qB&pD z2+@T9@`XQ{=PIOU2+q2pt?JH&anyeB*V`cG4W&S6TCO{Xd|Wv!RuD%#74xVnZuMf{fQ(_(;e- zXgwW1W=!3ej2)cI&cu0+?W0o4gKONKpA(>O_awLj`PoX_jd`iL8A?T^+l|ZkLoUxM zWE|4M*eIAv{)u<790_Llg1ly;a%wI^{SzVQvMEPQ9(Z!DM(gV#<~yhT&`;bos2jgV z*!wUf2bsFOj1?*+S^Rm$QB6=2Bo4Nv97()#?hNC92Hq=Zcouk&Hfzaiq};@z%>ovQ zL}F_h%)sX&we_i^SN~3i-a3T%F8Zd|ksZ{<5Ah1<=IFh}sg42#NNj?PM9kkn4;bjy z2*lIaHpePPxJ)sx!vxP3I=hYPAAhNDs8)rf}4a7PL^dgJ7*+ zWmu1pmt)L{GhAfnP_!H4*nDL(NCSS?Qs~x)f6n@xGr_y|W#-%SSPUmP(@KT*ZI=vK z94uM;Oc7LyQI|(x)un2`-;D=W2WAB|ceO@w^#KAyOtYFqA#i>=or$8ct5(138C4zh>|1Pgg_o-~_Q9G+rIG2fLRo!b{- z79#V8YWd#ltt-gM=W+s8%w$o$30L)edWLJhCaznDrYZ3?CN{GPVRmoRpmh9FMG+Fw&I0im-p(I%K) zHmfXB4+*b<6>4COX+|HVHA!tRf$fc!k9g@r)x?6dwQjZHl)dWVC_3LqnR*HU7>GK( zU1=Sd43|UmYo4#Shvj#D{hajM%p40Da?8V5CQQHEgz@dzdL}e1Q7i zJ;d1N-}O=H8>C6^Or!L8lHe21dTLJd`eAOjV4XVTZEc+DlbYhAf@R~#i@IK+2>NX2 zsD=)!(9vvy&lPJ zoW4|ssm@Gzdibrk1_C)EokCBaPDyqVMOc8^rO~f`YnWmc)GA%u`)ztEK4=mTK<7I{AOL6j_Hg z+jBDSHHOuRiOjb5>jjDSk66)nR7gVPm~E<5jQkh!LnrN1Tr_CXcdChz2o-A~Q-C{F z#bDp$gn@&jIfgvkWXU{U~GI2 z^?Na8|8c{GZBITJ(rYEGoS}~8yW*J-V&v{4nc9CJbmpqjw661YbTQGd)J1Hgx&Ia; zS_9i7PkK$2qL!JE9trW$x+m>T3)h{^Qj~SzUs7iqf_Gvc!ZPa7qc5oYvVEOgoPM7! zdQFSF7a#1YsW4#|!2j`rGhNQV@*y$QZ5VCB*- z8@9&PVgwq>zGTYo`&6RuZRmRhq8$U*ZiN@Ks_%R zZE+$IZ8+vR8y0cNO;OMfN0~v4lS1`!NKbmo^R2d$l8G~C!^OYiBtnL=y7hv$(k_D+ zUC&<(HobXfRCoCJpiKtUIf(Rn#FRxy%wMleuexc|=@oH>B~pRWzHVS!W1PfEJCo3V zJvTwuxwKm%CUizu>SWsf67UP7g~W-IqxykXPXHYSR$G&4}O zmAG!Ex&Y4mrBhzGo$c|qo^Rag44vX_G{}l_54$eD3#|hDIuzaRp%+)V35=x(zPyh6 zskAnFIB&Z<>z@u$(X_5$@2P^7$(SO6!`PTeTynh17$)>qk3XR?p(>dAQ$8lG)JKSl>-ubjkmY65qZ2G5?M0hwuRR!Fx9XbjJ8J z`u(Z48O=n0Vw2;9-LmPQZo?Cy?EAr;*pv^2zR$N2(i5uTC}b!&CU8KA&gN4;AQq-2 z1FSI91SnGbG#G6|I8s^=bkuto1f7hMY;QIf4B;MhH2^39dFg;t%CAH&rrIF4<~Z|2 zz1sgIc}xbu=2$*y2_iFxMApB9g$O&DI>TV9{b`^KAyxIoZA@Qud%2zlxV`k-ie%dd zg?=Lp1Ao^}Ci9Z*ruEd#v-cP8WIXhZrd9hwd|;B5z}e z3Fw$o&&eKCq=)6QC%h^K!)TGI;ohz-2iz7)J~6QUIMY zIXq|SvshHR|C)e&EC)A1)f*Z(q9N(o#Y6&fS=oZ}6g1vQ-Bh2Sra0Y!wSfD>5~j!n zLCmz&*j8S4>xuBv7-*gt$eXB|k>7AK2)6&tr; z^M^U(zD4#xm1H3*z{MM#^?c$58O7kH$}o29IwBI%%XdKW`-b;dYDK~nAh+4Pa0rUg zqw4U)JhyyL#ro*(H{q}W-wFlHjmco?7D0d?Hq-4S>*y(SR}?z5?YkPm^&yIt?B$s~ z#58PG1$v|_Vb&Tu)eG@nx5#)Rswfa|{Uf03&HgKA*8L36znwtaNnqu(AMr+*2qppF z(Q+Veb*}_`YI!p2$6cqxZeCI6!qoQ^NcZ}BxVxw`-X^JP7yEE{;r}in>GLga;GS$QjSJq@AJck5Ah3DalO_G z*oh2s9~EK5^tLi*kvfb|3gf6)vMsnmscOM927b}`C9P2fb@F>;fTToQJzTcqE7UR(7;(cMzy|5;$xrXgAUyq z?M2*&ZM&p;jo;j~Hp6iI_OSIbk9Q$DDA=sF3DuowTYn6_@K)6@e7s|69m;Nm2x+@9 z3rbug&bgCf;hf~A&vw?8&_@22;5^H~Oy-$H(jCyekI&qBra$-kQ6_aiIj;`78BKHzEv*|f(r<$WURqbr>0$M(JRa@mPJ*f*|xl-98zm>zrTcH zr#6SO1Hk|@>D)h{KZ(@-Mpn8Z^Uap`^cz|Ubioh(;JxnT-at95yfyQwN97bMHiq@_ z-D<1Ie>EG5IC_oyDSPr=e%rnf?vZod4{sa2(Aj^fT(?<|TT2gdT?Q6-Ad@ z*$r;1Ak*1vX|IAB(fj7Nxdsz|`_vo)pk*nd^W`-;DeCJPWHUl~<^1D%oZ3bfgvPDx ze8!y<;S~S*^$9*`bC#fQwL+S*g_w443ixG@^-&T(peP}NoO1bCL(?v=Yr6zr%+DE* z+e-zbniB4^$QF5RZXV$*sTb)aZi0luK>G(AecEo8rF2OI!Iyh>O)P!L*zX=Lh5w-K z(+s1(>Qmai-osrPaLNuSgEaE}i#iif;YW`$?=_9O{TuX*Lw+;Q^S95fjQK|_4GIl~ zY*9dzSUqi#G-TK=QA~oa?oAb6kJyN0u9Mu}o74Nd&dQ z@V)^cmlggUt*>oQ$}$p6m#Y`Y^(ZC^l)$Kgjb*dZ8#Ej}lmZEgnK`YkIV9snWJ6_Vwbyq)XbbP zWX%QARR2Qp2+7$iL6wHaL$@g+I?GWzHL%gxx;h#Vh4EAxbRl7R(qx#$TzGC6D>aC~ zqC4lxn)85!lgn&7hMRJQo-Olo=b|jKw;?d9P-dw-7$M&w##u=Z=HzUba&j^BRtaM+ z+MT$Cm%|L?v!XA{)Ebc9XRTW4R%AD_l6ocHd<5iBRT4iwdzS!J&oTpMiV`CsHQxo> z2B|b+epn!WhZ>p_miSdJc^&HpR>>~*x&HQ1e;c!UhDM!zZN$QEKcw>B-MD>O8|sYj z#En84leb;qpu27!#XmyD8j^xUVamXeE~@JDc55-ikX1OPyV3eAtazW$wpv^7&yyC% zGy>kd3jBPhXwYqP%d~MH;ZOJj#=LTy!*#7U|Je>%P7FG-f8G=fjcXb}fooB~KGIs= zI8GTS^Y2*DeaYP5Z-M_Q(BFz9Dv*jcA{2vPExBg43MV{k+%DZ8(ej`&4lr!YWtH1u z5_3w;FyHBsdmK>Om_J}wwFRmiD7`kXNOnf6{(4!}zY-3(c1tkCHlG=14WLE7ruBqG z19+aowj*fJN9i~vsD#&<1+O7!<9!8a zkt(qB;B0A4iX=?x?J&3&mC}4eEX+OUF!`0lnhAbNfJyOjQspc|t$qxe#o4z{tK7?S zdl1=0!*z&FgyAUwRn_WV&(~Negr0Ld9-q^P9}^=(AJYnB!pHH7L$%!|QV=<0o$!4l z7JY2|8K;ofGw1xfoRAjmmp^Tmy3<3cM<7uTDjY*2sAAdNTYwwfa1`yHWa=R8c0hli zQ*=<7p=5A(uOgyA6~v>9IPMUNV(ClyE+DDz56NG4pL-~O6lxNKlubJ9dwsBWK)OTL zuSjE%igKtLM4AuHO(>JM`^2AlT_DKU;QLy0)JxQ+#-*C+rXgV_CvR&%vvncP*%4i_ zafX3y3B^%?&5qm{pN9wO`2|VDWa5t?>9^a6K8=$Wv|(;byYF}f?K^huY4xcV;ifWfYbN zQh!j*c1AhjUKS+PP=gH(t_hgS-e6tMcICn_VGBcVybrAC#Iz}~Oz~`$9*9^DObfo= zPRV_IigpdP!T0WK=5aLY zG4jqmF3;z!UvZNPPz-V$4i3hFV};j}s@l2J;`2-SUQ80xs^@IC(%WXV;WVEM!$hr> z!#uZtIf^N+)}Y5foV>PEB4mr=;*A=5hSJc9;~x!cn*PzJ29-po!84*$$JgE4)ZW1C z*9t$<@a>zi#u9b3xd|S4C{8=sjdut!FbF=2=wS|8N#?awId8vgIHA;+ntqbjuThLLye?<+7 ztP|5?W5d@&=IHP5BPcMCMmsJAj^eXBf5~CN_=hUGPchW-9^`l*4D4taDz-z>kcd5a zpX$j5R4?p}@)-6VFmz4H7g)&zD$lgh9|Y%}W?VQicDnCP57OkJy7Xq#f?Nzv-;o9S zxf&#u+n=e3DJuyjhwguIQ~Dx|AI*(4S`%TH1fq829A#C+A5V*Vkd&cJHqS5r(J0Gw z^M^uaBJyk?zpCpS(KyOp4R#1-hwdTkBNv_2b0nU8_a2axtb$jXV!ksq_Q~gPGyEKu zHZF}N^pQPUjwXeZhw-ctaJm*~*m=>_{LedqPjEP1!$c=UtB0U`NpfMw3RAx~K;5Ou zZ|`@#=)sFzAp2Gc_k-zSwVk3#Ah3|RCFYq8AyPZ^gF?~)b> z{ztAQdOgaFS4tGciq{jMsr$AEnD_9DVfWXF;?Ks<3f<2z{DwaUoEBfo_J2ot>X$nt z=(E1+OH|4LkhYrYcbDARgqx*Qld!7NW*9R!&31JvTmRnjs59)1UJH{6+0^I$O8BPl z;(p(nd`on!9~da1$fNDq#Y#T>FyfkwZGnW_%4m&;PNXE1V3~yq>}2^IyyRkxO>QsD8?| zWv-c|D>JzPXc8Xz`+Yq!h{>l?nQBra6H+fyI*LB)n4HDM2=Wm!kIq!WH-8~1^86w? z&mz+`zx`3)YS}Eq6}jfgdzVXOqMc+%a8Q3_o3w5;FLQgWO0drhQH7H6LwEb<^WKX zb%M_Z^+lC`@5WDQcaIbpMtE0?1%X}GYF0vRr}}drxH@_EG6IdcCap$L^$%Xs5Cw&t z#}n2gzt&UdJ}(rrx4aSiob?(Q^^#U}DEAdSG}4j5BTqY``4{Zh^Y~4>^7Lm0$fQUBWL8Cy?y}1F5Ad^3Nm2SV=0C`o&S-RY1X1+j z6JmBFVyaN|=t>;@(9eW5T4gb2pL(9r=*Tk0dwr~DeV9(FJzriW8K z)%HTs%u0^S)I!p5Ke1mRJoyD_#b^Z+J5nP+{egrfC>Vxurq)vwN~w*vwNjo#b-sJv z1d!sv^2s?gQGKwgd-GuVF+_?5UHsZl58*Ci5RAA*8?UNNbi5lbb=++T__63%l~UZr zGAjrkY11&C*t}3t{|vdqA^ePmq)3&=+1&OTo=H2Uq|GHV%auO!J*wJ!G5xMwT>7c1 zg516#in$y0kp21cRbuM7Ghtl|S|1aVy(ZI_&=3-l5{w#i=d-K};G~_l?rM+}4CM2_Y0!J9>_KJ4s~?oVXW6oppz;Ca)&h^)LV{ z(|H!`+Oqw2?x)3ca?hi(51O6l!#y(gny=pR1R$$l{v>I56H2F^v|7YE%EP7}a1(3( z5&77rnS};9BAY!h(1L1Piq$_HFW7k{SO9+tov>@4XCs%}s^!e(Or=I(h-Bs5Ddq3` z5D3^j3x@oag00J2KfIo89ToO#I`TSZ2z%@o@J?=Ed;sM-u^ensb$PQ57(2AlF;uR8 zNW!R{WA}>lX6b3J9Z`$+{uo#+|Jb|dDkc5R`bv(_N_0-G{K@Zn2Evoq2Pf`ml1{a! z?b+e%-30zwa7xy#W#aaMS^tzOY;0kx?`u=J(9AoQeTAYh?@EkSI4Jj9GdTMxmrx!8 z=KK=;EF(ndCsbY;XbQ0NR^lH8nHwB(j{9AgHOX|9OX@UYb)$5df%Gs!j?5&)8r|ZU z6vvq~gE#cTa8ppYous*efc0_zbV)=zExDJiqQ7x#TkSi%VOp1j3l&uQHN3^<(2574 z=ko5(XRq3!37V?9Kp+#49abaL9WtD2^=Qg^?P(q%@f32O%Hzghk_rVm*ZHBT3$)!g zfu?zN3Ci7uYG9aOqgo$L=ZQ{J*!`Ja=4?&ex9i37##G|~aF;yDFe`eOPt)z++0snP0-t=|*2)^c#Z@*U--}lRJIP3*!&l z_DHvb?G`{Yp}OIH{?s6Zsv@DGa&Z+&&rmsDG_y^OX>qa%U1(^#=!TWkt=BdZlc4R- z59w3FvmR3TBD5Gf84QWh>j0BKvs*p@wMu`jwuBI9>abVPb`LGXp80u%q&|8A^gj4r zjksIQU+n|wwZ_ao8T%PT2u-xTa7a%6DX-Aq5R?fmZwepquwuSsl<9W5dsEaoAtBQU zmyyna@W_0yGw8j*4N~x|F;_AmcDW}k=O6VY5PJxB- zxl@>(iPrBos{0i%o#{A2Z%Mu^c{@PAlpSq^)ZkZjF^UBQkN^0p$iCZvy3`yTkks?t z!hf@7fEw%NnKhj?w(;{z+$%pT@_X5g}2k|Kj zk&4CJsX49AnP7BP$WyXHOhIUebp7v@RM7QM7&=YeAzyzThk77{@{yN<^a8zI&8KMC z{gV>bu^#q5buQrfO5dTiNuSgHF$tpD#>F460iCi)V5}Z2DHT4ML~=cZyrdjaT596C z+;P8uZV=c>QmXV7$`-^$3@S8Nx_}0|KD5F1`@hwcVDaKZ z@br&q2fc=Mp@9o=%~RqEaJEI*p;Dp{suK!>u{Y9Y-_|-b1jdlQq%h2G09b*bYbB?I z$O*9#*jg}~zIad+r)JNFAJ=t$CPo{5)d5a$F3Lt@jLAnwziJ0&%(u~!OVN+)3;Oc005brFuSe~2+^)Sdx2!# zL`NChplbhVSRphayAIpr@{Q$vHtcNXPfbCJSI8(owXVW36>LT4PY*XkYdsaFWI0f< z{{%(vsd7ni(Ha@$!tHp4-5i8bvBycUjYK^M2BH1=(9gYpJ|+{&?jbAbPf2!o^D(n{ z9h>}!rJDJ!+sBc>pLH^UbE+9tT{>YE7fpGm znOW*HOWUzQ#ZhMy6Z#|+1)LAs#?J~Qkk*Rd`F==Xw)7fa*Rs)|1$Bq1ywPhv)y@={4)PvUW*RBS0)+ay)tn_WK zn<1DWA7dwCPcnBd_UTS3bd$nSe?Bm*bFO1FcWfGXo$o2*>;EK-Bk9@`#MQ@X9&{Ko z*jO7W70jDkx3O~eMJ7#j!h&zzm?JI?Bt;sb%1r0wq$Tl)3Bt88;o4oe3#bSTo(Td;jYizi_-zMEvFR@uo5;d>8((yW&#dS~>C9I0G*#I{ zyz8k;b!lqmc=aa0=}%oi;l8Oy)@|u?I?b+8aT&tNl$iH_%vIU}kY>)c>T_%$)r6~d$Jz*gOxIb9H?t&3Fhv&M++c zULCaKN`Y&XGcU|g!iGH|*SBKi9ePk6eSHQBmJG1o^v0cBty^pImsFE)Y{r-;X;>;COnURJOr`XZ=d$d( zl88y|o$kxEvWU*f@Zy_`w-WokT!i2CoY)rO^@JMU&#nyJ-o>i~N|1W#CvZeDJBfsw zbxD}cTqs3imVP=?fi(8W!8PgDUzK_5Y-pY1&$%$!J{PzUq8JmcwrH-Ssck7t{C`q{8c*W7rq+F4}Hyh+K6Ber~KCv)pf5Vf< zr`QR%@@8b++w{W$Nc9WBH;K=YbpoOVsngQf9{I3PuG?019#p{Qc#{IdWf?9DFZ%FT z@%v}`>;Q8_t2pOK(+{5&p*g`a)%*ZP5c<=Dm5*Inz05#GAp~ zTnkzV8<$2q2ddM@Ab+jlTxByIz2?`HAGPb%VDrZ{AR11F+OMaFD%kISiuz!8DY{Y9 zi=7=L2aBP$SGgN)p;%Mgj7zfeF^a`D%!j_8roL5U?9B~nt9vFY1@XyUS2rMrE&KSV zyliulV%f~)OtjXX_L6MDf*<1?`plJKvVP5E*O zbds;|_k7H&B2(lsO?{@OPT?O7?J8iE;touqSbxGcGU3J^ZJ$Uy+f7OonFsoDXw zd)~g3@}ld6LLkXeYdf*tb-=Lb%xvM+OOM8^xW+#~u@AgT$GiCArY)EoM@H7xSDW5NXC$QXPH#2_XBT?w+|P!EuCRCC zYlyjEAf7&8V|=k{qDcfMI|{0XSx^70AKKoM>!gZ=jW=_Hd}sO>$IyJsm(bC98rMv& zMUupxQU?tY*r8TcI_qAzNe`oc?Nq%^p?NQ#X=>G;-wRJkNOd9RhP?) z{NL&*TJZ!NeT;1(;dH!e=5%lmqji*P->ua;L6JxkcSD zku_foxu0n&!2w0yIwyoH;%nKIsw`tXgFtsG^H-*#1kAJm1BFO;!9+5{#vWszbUfR7 z4Bp{91o%nC>d%R@FXhSop>XmH>Xq+&rhgeVuCX!f8L~-(FEBf(jzVD?NE*86q+$SEg(|Ltr1);qa0~1E?quxy zJM#eplixzHR9kU|2K)A07u-=`ErlnngV&s-0uv%peF^62P+mavTgwU>AQKB z{*~}rSbgt8FWH*ZGK8sb6wmFLc;jvZ?hT&TL)&iu9E&=DpVxQmx=IE0@@i5gOq;ol z&e>)c!!z)xy=P|lekL9Le*vgKSHA_iG!*!=Q}s3BRzffG%9aKO9d>~ZfdRiBe}(Ax zpXyXL6|hdh?8{0CuC5oB+1-d{V-xG@iH6GfLsP$kj{AOl>9MA4_#355W#LD^Qh?5? z$WDv{tNZBs`NIDc5@Z>?=(8vpZ9~@?OzAh;;j3>EuRDv+3xxz(@GSQ0VB5uTjU51X zJ+KA3R+*#G-}O&Y9;jp!?AUA8?-O5}7W6RnAljkb;0pcG1^JHk>PKZuz1Xt+k{zunAXzE+g zV?u=v-!x*U=EFkDYWbMjEh>mH!JDi>NUb=b14M8s9={ma}RU~uH2t55TC2X zlQ{yKrmyVc1L=YP0POMswp;IN@+Wq|zkew_GpZ;5i~gYqnx^YCsxAnAypa0d&{TBU ziKH(%D+xW?k>Ur}N~i0Dl=b^YZDti61`mVTzYwwjT_#*z zxQ&n}*Ti3G8xzKpMTY$pr(y&L#3OG))qm}_A5)?KKw)3<9g9zac42tWq;Smbw<)u{hRCN9fiC$ z1J@AJufFDd5o3pkiPeORFWMOB8-faca^|l}FBhIC{IT#j$-)l#)OUBq6S?4vpKhZ3 zF~YkG@gwX~bq-aNQb0d2pKU9??-c*NlxHkBpjNhXKzDuvi+)=(xKUOGuoH4$C;Wai zoaj$cZ+Rx_Z1#KS3e^)#*mTIjLNW|i(z?h(N877}cMaMMw90y`J+qaPv|ya2lnVw* z8QDCLsr#^?!=g}14z=mato$c~Cj++(?_!-|n_WW=Pd=q&DJyfCdXnG${pQf6tUZf5 z4d#n9=yzTLY${x}D3h*lBP6J!eX)NA>6N*5`@e|RhGEyFTao8d%1h6_|0+*V#SXD; z#kjRiT-Ii4KR#c4ZWi|LkCDY>XUU)JsPv;kY-HWa+6z0|*4qx#UH92-!r#{u639JP zxQmbl{{Z0^g)E#G3K=t|S5}5H^{y0Me(z67Z`==)we2$TNWygvj0U^5fQQM?w z%ZG*>{jt-wzJv6nr{~yv6m&1jWI4yBo>NaVebGwmp|5kga4qM_W3E6EHjcnk7q1w0 z3*nl|i6b$<4ijzum>9>#S?YkFJUGmJUm?L8Wn}<4sLT87??nUJPXx)#!a;j>nGRR7 zlMo%M+J=dnC$(#Y+l%IjqK8Z~IU6C~>2;)1`g(661Dw8U0@e{49}?~-Jz4k@h!^zJ z)0@h#R(^Mt{Yfcj>8kXnsxJU&(nq{{c!cl*VdA57NrCKz&&Yh~TfX;H{$oOP2JlPn zceNt`4*=hX*M`DZ3EwHCZ__wY+B!(@F8Y(8pYtr}@!Sv^`&9*G!}m8At$Qn7TX;Jm zyHTXZTPn}aQyCasaNTCm4ujX!qb=Z+JTiP<@@*oW&r+J^dv0_E;!&JC2`2XqUiePe zK5DhFkLT-;NT$uCKRan@d(o9TOx-_gh{vkJVxN>{>ozCQK%zHUN6Yf8To0QfUIB|V zrn}Cmlc&C8F^;D!;Yj;a%G04t7^HQP$(FV}v1|x$LEvz~7D9|c zQ&u+X^74?Q)Dw*8<1FU=uHXk>>sFROPixfW_1L{b1_GR!_<&?cyp?V(v=0AU$h)jc zY8%r(TU$5fS&Uh<7CdoLUZ}&QyYpd;}8F7mF}QiqJO*)z3oF~ZBVRNWlo?j^9cNmTw_zP3az3H zRYs+w|d5Ko13$yu5BQ4m9UAoT-Z4djG zucw*X=KSP|L`ny)*~v22wm&qAcGWe(R-4FcJLbC+ga~h4n%EB-^ata~NEyi7QD^>W zB2Tfc_3M0mNYDOUul!L$jEDu`deFh@$wwU?j8D89j})A z3bp0iyGj<0jkaX1N=I@q$1kv6IY$flZ zitmofp5Vu}E!<>MVJrNH!fi#b(GRQ^=+?@H?${E0aPH&wLd#f(CjE>p88Cc_;dv0T z?Z}UVurK|~@6{j=UtVy3jcYpWo_%5i(PARHT$L!ZZx3rT_hr%r9aymNMFN7)2sajD zC+^{2vjW?EAIbI|$$0LdAS%b#bgTT=mb_rD)wX^_>_`o30ViQi~U8}sRKbja~)q8U>$j*kg|zu zf$B5?)88P7RJ8%^k(2XRm&>L+w3ucSxoWqS2#jg|>ydt?pYNt*d*P#mn+WeB9MqHF zBKxMw`9bK@l?T!|S6TZYCUdciCC$8}@i66CjJ#+%Unj+pX?F~I3NU0Xebv_T?W8=! z=+r7QG1#fUW5|-|jgv=p{nSAeZeFJ2>q)7fR8AL-TL$k$cO37o?nwq5KJ|mrPYB$f z9Vh?*KmbWZK~$07GEUNE*nI}MZSsE0t+I*sbzM@|SGui`0_YCoH>u3+NbeW4`%ltE zo{J?fJ(yV2E|Ah4gzhh=lWa1L`yP+K4jI=|x`wd-#2S6k*JYgj)y_W3S)~(&UF%@^ zyXG@%`quMo+0^q}?H$HpeJHy9d0zQXN8hm)cx=wv2A;1t7kV4}}{JD@9kBj>3o}Mtze@~ z0ZdB<@Pzi?%3}lvM@55F$rlHczp>Zv6!R^cN**sTynd=GpF8(bwOt*ag8n2hOa|R| zK*vG)zX)k$CogLU+we5CHQ$*9SE0A{dU@z%8O!Q4SkE^3P|)uOaKr36s!X!De|ai8 zGh{REL7tPY?R$?a>O6|~JeSK3eLq#+uc*<#X}?XfVV(QM{$kAV8s;~`GlT~SIar+L zJmvd~j?0Rv?%PlIR~}h7JA}^gXdCS>b#z{AZR|JvT!T!R9=OK#MX_HdQ-pZr*=n%@}UOzM+1?~8BW zPRetngWag24(=!PE6PnBt|>421OF9SYEE#yD(PGVSW?)N*+Z4Lu?CIf^0KK1@;5Mu zp!OhETRZ4l%3mdfU=;^-hrTal={w1=&Ju0gV-4kbB8Q*#sjC0kYI}<^e22->W|`#h z6Kk=btJrZ+ciWZMf*vIO3D#w0Q^{w$zfJi%Hn)79Ja>Y(>6VpaUg}Bi{sW2f2MGuD z^L3q+@r|A6Lwwugoz#=0%c{`FpT_yr{O9Xl7gugavN)ql8B{sTgIR-HF3Cn?_9Z$Z!MY57otOxezr}%VjGIyNV~euxYX^HK16667yHj;lTz#DL)SC4{WzUR z-IM58q7VA>U9k`9c(@H` z(C!nqXf%I~vYF`HpSP|lvu*L;A!loSHcIAVxn%B-Q{_2h2OA5L3AFR9$Q`cZ_?@5_+N9ifmX&qw~WaQwSd6bpW&UtKf;8^Dr zeFq|k1h3-4VBV8b>+kL71wXD?#|BN>NDrPY-4FieSslHsw{7|}(OoU<+IVs*$jCRl z&K1JX1JJz7q?Yf+A={z~u%vU}mdbxI>_C5&_4#2oqOI-X`@Fj2%O|@Fw-as|DT^3q zD(uHj-L7tG{^yBy>Jz0a?P96Sa}vMBXFqMCdtG^#N;}4o?TAj#iE+_iIGfBb#W4nL zAw1}>I(rur9w%;d%Uy|KCW|2x4FJ`Z3pqFi6oA4C8QRvto zgiZAmO)suTgsirw`IkxE#ycgg$=6iBN$sVxeXw}A+xnEzeOR4hdw!DRJ;Jn`J5CmAMIWEU$M@aF z58wR3eK&FqYeQbskgV?4wUqx}$c{Y4ezGl_qz?Yy)3$yy z4X|V=cl-mxco?bJp>>RAr_$Y+8`@z>w7w?>HIR{^kD1CUuD1@(loqQQ|{qt4d zJMjznSdJ#CXxpDZ7jhMKog}CI{xY>)J#=m@I3A^!c)4FWuHiAr98$&aCh6w;*71*` zzebxn&P#xGq!dHhCX>01W#?)2mvSYWo%9aM`yKGOAj`oOgKzA?K;2J+3Le6r3em-S zSg$gv+swtQDd}LncryD@1HG)f_1h-~K^lak25Fsg$>@o5^N<(bRR^^P?Dk#BSx2{V zZKPv=(p0|qTF|zyn!2xOcbxDZ=C3?K)k=$&?>kkU^lDq_8bU9gwry2;s9)^I2g66O zQh*iZ_FV^eUJUE-ou@X~02`tYePraij%{iGXCVvlc|zu|lZBrVzD@W9;T;Nn+S-^E zUC+t9(*KDNJJ(r5(1Et-@!05p=Hj8gQP9OZEOlSK*&mVl?!k8~PxCIDimv?_eNGdi zXBA(zZN47zb+XH5eUMk^Ie7bmtabXe%DA(ht-c0jqMHfm$GtEj|2fDu{4+y{rt;vh z(6~}~c+jM*F-TT^aFEI24@#dXg5MF|PUuMq2L|8=@?^t1{HLf5KkP|c9D5kB*l=$z z;U3GiegeTBX2fcpv>oG(fK$QaNy{{=?* zL{Po!)rKJJw@Nt+^FCo4wnSH6F^>cL?y;)0rI0q1%{$mWq(#Ih!L&e*QGzziTiAyu zdUnH^Pf4!`r2J~(Rgn^ya1fja&cCa_EQ2n4p#H;l+$z=gZZ|3wz2bO0O!e+BwBLZQxZU>>Yh zYX!ABJiZrgS+}isW8sPfqEDHNhznkzd+d4w@WV!3f^G7jV#2FJeh8c3bR}P|Bn0he zff6!3$teA>5G5EKq)pIKu74A$wWlT9Nb*_k^_Bnj7XhJO{` zw5)7v-!bT}mOrYU$H$$OXOV}8ZCq78 zw<9=Mb6nr(zWLr#`AdcHx-QbHe7mlXUic_DX^hdgJUH-MZ(kE0B7B>04ZzCO^sPtLFErjU6WXw}9 zKVWvP?o$^h83jy4bS{${XFia>sx6>TUmh)9->`jkJrgj0rK?E*_eCAOEWi8l<)N{Qy18gVHXA%+Bd-$KlqFIK1cQ7 z&8{?l2XBx?p)A0s$cwgB+K=L6TNLeqtqJfi5ndp?Perf}@4w8p{;V+xE6mcF3fI-=MrK3ObRrI1i2_8-pJ?53`M>iRJhdKW> zLdFg@C@YWc#?cd?Y`b3V$)BdTo~j}neNyxlU5*6TWxSjfwOa2}*&P{)3D~)Mk@5!y zFZWSgcA6lA*U?8Qf40!JtIfF1L|U6!p&=biM`28!5UrT9wSmq+pD(JT&Q?dI4y#RV zOheHpIAqf2e~`YSs$bDHdNA;LI!+LECM_%;U_4;}zV2O3{=|;x&9?sQqk3b<2s(8W z_wW89u#u2StnL=Ced7zV?ZMHnodj0}W!(qgR@uJ7I^*O!(389l*0`K2kZdVXRl1u5 zLr?Uk@2dI_?d*r2RzK~eYjkfb5Vkxgi!1?_uVGUK+^?5OMs`ETg6epjpCDZxsmh-e zu3cz^Z$fiW9`m8x_9Q>7-e8%kRRZX<^Zg^?>B651dDZk=$^R#%V?lZmWE5pUc4K;{ zCpyfna{xup5$D+)Fb$=m!X&+N| zD0t$g{a2$#s}s^tt~CnnCrYe*-bR=D6IPQF^n|>hKb~RGRC)}Lgy2Qc;URrkMp^6C{AS| z$E3uQA7{1zU-z!Ye|mEHzIeVXs#f7Wo_fW*;fw@VJdGU~&D}Q@sio?k99|>+ej~b5 z2_ES{@p7Pej3gnzvMl5D@WjpktZ`VDvrV1*;W&YY-3#4V5Z2XwUTpw%#vwLwaP?v7 z$`hz3;x_%zw!cK=IR|x9A!Sv@imLbFmyu)4PV680Fl@%5?l&pVZr`TD&4nyncNN}3 z2=JhFh42r7ye1}prSO_S05wvbU zxsNz+nEcN4eceWCno4ggBv?V_Nqs?`L3EoZ)af75W5H={jER=*@3A~6@2G3r{k@?F zueWA4?x(?9w({J1Dvh0rvB zT_)fe!VQEB5SJ-i3ryn@wf56E&ao&!o#;cn7f9ewgwQN_%sEbxZPsDo@GC>~Zz&)cVHP zW^uW+64?sB@>n`V+A%k9U1j~kFKGunSM;tET^9K^{MCN6LbO?jfU@bIs`+HJ z8I{HUt!!nW58Mxx8y6aw z#si|Pk>k=SpFt9EQ*bc(xPl-Nm+;2r~ywJyaHh{ak;Vy zxMo4LBl3fy$A-?7&k}6&_euyB?5Y!BQFaH4`%1r`g?=t8*6TWNo!%ivOq@Ik4hw$K z6`eT;lU|c4o!ZzEud=|{;PvO8YVb^<B`Gx&@A*D;_(BXmY@WAPo*lWWKzkM>cJh7{jjdZ;F1aL) zCHdIC(rh!K{jZ9mwh_k-P8ThLt5)Vr(cvK(|G!oOoe@I0pU25a9dtvs3!-9~c2RX= z;$UhW)x_Tbm-Vhje_D>8gnm3gyKHo;33p^C=nz~X&)0;j3+wbJoUj{n7=T_N*Y0a& zD}(KG-{@2N)@7B6O>+@QL4jm_f~0(q5F z;m?HxS#}tlhRK<07IJL2tJ-}8Cs3YyGXu%sg?lFn@i-y!&@XksZO>KXcLsqb1E!7) zsZI0?x)C@%ONbl}vfL*GT-Nnjs=FfWG1ESgObb9Vr3FRlR=V--xLIfXGa2H89DIE$ zbVQR$a~geAd!mz=UL4Msto{a}%TQxlU>(*F!`lT@mz9yhc0OHtTq)c0;Oeq6?H5%Y zsmJ(ZXM76@zE=qE@m5wB#wu+%8~L7SL|L2Qv2;=eqVBf~)aJZs=duc9Mpm_7tsga* zlUz2k(ZCG{@m1RmkV*3dL8#}&FQ~%CLeD2F)t^v6|6z0c0z2E#=DNw6=ziQ#bk-CC zwRJbK9+_@GZP@fJBe813kxY}HW?*3}c3`*Kv`ihxll&}Hmx%O(g$D_-5e@@782z^L zo2lL>sIR=T&7Ukprxt|GnE-j^@s3(V7B;doze#HGq|??m{z5J#uOtJyG0A^VO|}*O zPDqgDJ|WLSy_4#EE$X&Cd5e5~kW7ARu2{s?$p=v^(LPxVoH>!F0P#(W6igH`P1Ih2Q2 zzshDjwB7fncf9xzG$6CflpPAb|6Pg0E6cX!vYj>#?&ddCm_i}-kRRZjAW*h#ulB$v zed!`)4^Vy^VV&R#Ihb#d?=Qml3m-1Lmyp+bZxYhijEg$+lI3J)jWG(itanx6(?+b& zqbb^lr&Dw^ju2uUjV!>jNrO80{Vp7>ocuV2$g{SJ?PnEK3 zke=+w&lp&wnZ#ZvTwllpSl6%ImjAu_oOGl=DVr%s7J@AL<#?s{kuZA*A1-7N{zAw% z=zbn`W-hPf>4Riqk@7@CaJ81O&cx=0indP@&0mXjYp+@Q0*}uS+!4qFRmZyP|E$-% za{Fl3TEc<=R9(0{Z=TX?zNA0VmGSg8A?F3jSDjmIUtSHK-=WVkK6u*wg?JGBZY8A5 z{iWAnGnbg(+R#`IG3|X!aa%2Ut9eY>RKUuGMU}l4bK$kg*@mvLH zgU!It3;9#-OOzUZtqey>zNGZq!aEDyM%mI}KfAkHoFuH@FA}ixZ=Xm&jEi;zLS%TY zLfQnG=xKja&}Jd&T$gF^kWK_GEa*e^8Fz0~n=Z;NhthS0JWbFaICPzUWip^0&b*(ez;+jnhW)oo3-A}!@l4LQciQ39QoEC^`h(1YBv&RO)YsK3aLxtLr!K51*;M4k1*hplFf_fE@t7#jry#!yrw; zQRSgQs12G;Woo6p?B#DO@vS4ifn?;GL5OqC6TDHv+(O78sOwYK=_AtbOmv<%JtYr* z%(ukokECbh8Gx35Zu$k;Bo|MO50Oys48iL3kNfoi(fgF>p)Zs0w1Fp5{0#8;?_G`m zWTFMG5nh;bz1@Y#PA8Gw7`r|+dyn8+MGqDV;7rl^BlMKFZt2ES_y{}UbHMw0Nt#=# z*b2L__>#T~8lua1=+a)E1K5#b=Z7`PWyPE33tAAXj_ya^QO_rukstN)I*U#%rRJeUA3>s^ihbiE%%6$bs@?ch_FX=Pt^9{|dWv?%ZEc21F6Z`W+ss~izM}6zNzIdgeT&c^rUmBVQI%63j z6h=_OH{x~~Te;dzPnbuG{$l-UhH4tmUu`c?Zwk>E2(_G0?cAU5QGZ?`f0^mQ_W3h) zEs5M0>;T+N$i$Wwt_sw=u>DbOcA}m7h6%_0Re@A1Rqq{Cs`9t5UMShw(IfbDSu28- zB;xs&{@`os$l$UvB;0>LC{uYc)``Ah&A5Z)e@EzGUoNYX{q_Pi*e4oQ^_jA~7Sxkl zrCn~N$LaGwq|o%>XNoJ_O>cn~==V{@SZ}P+-1tv0t`zh(OE|Yg>lA?DmiJ(0&?=S$SQr9Xl@^L>-MV$(F)Ny zFlc#z#AQyZSRf`Lb{C(Zc6$gJA8E3yK!-M-A9mAx=D#Xp+)W!izVFwNary?KXw;f4 z8}g>P`C5-Ee$L!U`>TXr_@)vxh~G59HhPPga;$_01N&iFIZWeC^4q`1c$lWGlD~@g zD`h2P8yU~yM!&p#Vb`ovZx6vAN3=Dt~tvclDe|b zO}iKmOl&-P@ud=g{;JwP?o$qWvMtYqHF0uF+*%RY6sWF!EryxSXkv6IKS zt4{_)*66b14p|*sVXxyvEA3nbtul#uof4JtiLy4JEp{Mn6kt_#UhyjpDe#eD_-%@9 zqLqzSn#hofrg3Q8!*F(rA=PtHn-)-i5&$uH9xA#|4BGCKs;n4vv}GIjuxOlvE$Ntb_QS zeJ_b6cjzp*8t^rbnJ`D`u%}}zV$ZCT}AuIR+0zs9MHR( z{Aqvsv#MSa)m=8Zb$d0E9cBDrCZwQgm&c&`3onaYc;j(tq&Hjia;yGg7GL=Wwsp`O^=qxD5 zC^C+>2zQK|Wjc5Pogo)i`V--}bS52=VG0&dzow@yr4JIjrv^(8$f^=BXlQ$y`tayz zTxTFv!qe1lh0-3#MkzDp z*VctGcXRRoU`XTf5|^bCCLzWuKg@WR=vLjDFU6!xCGk#Ql8L(BEiKcuSjRS?&n}M} zE-TjSI*(1UEeG}SBV;HWV7X7OQ=6X%fm!I#$~!A2^=CmpDG0T9@M+Rr|Z`CyUPR zE>ym>48=B*gE-`RrR*LeQ)N18vsTco)3)*xLhzcHcrtmKYTilc#dKoBF%>+3coO|= z)T1oJ^eyn>U`asIG)R9Bv@{526D;?FDSox?pAv$FkMn{%34Pv2*_D9c%kXElJ5?9Q z3cn;em!%s$x*F1*9$>W$q#ko`RDMI@KZI4D992E-TG5{;YGV2T1%g>Vz@QU508Ea& zk_ITN0-hKzkxo4H5wy9i3Z1sFB;VK*|Pjb)$?4%?r&AF4rjPRkjo|R?E&o@bI{NmRRxy0Cvuy(FU9!MC#1NcSaW4E3G>BRDK#PqpS`6C{^A< zSTtUl_M_^!0}hW0m6aVuIG2~QfbG4jYWwNLWu*udD!JYJ7{Kydo>a;X zzu<^3RRwlRfvM}zW82B6*9(pu@JimnQWa+Q|98u0u9BUZPh3`o&QhuCxs=z@b-=Ho zz2=Uk5%%T*Z&Ou#XH>4@-|nkD)oC^-7dVUy%Ri~@r2CftH>!wC(019RwjQ6iQAHk{0hjfzN_>_zLJ3l7 zGGt4Ut;M^j!IPs=n>>yb{n_kzl(N8*t&|o!Y4;@I`a&i_mnmBd4pLWgAaeSh;ngs`r3+-o)c?FYUqU?*e2n9y~t9WJ$V;0w>ag>?W~ zX-}WN0s7ehK^E&w%0mNNlU^K^O*by5l6Yb!P{h_OATFCEfaU$I zDxMRST{fxhyx&jbP5!o>1bw&=z3PrZcEkDIrg`w)S=v4MmF&R7@CG4B8DGQpjFoGJ zRs76-_-3_Z2a<7$kCy?)0k7XK6Yd@js=StrCL3o{!LxP>J%W(Ht;|E5smTmCU zD(%bgm{lG7-pfM(uB(hg>f;yZ2@eqhrrEn%exJ7Ano|9)p}xz;S;Ky|LX|FwiY^=4 zPOeBW>sNz&N2Rjk6d!ioT}0>iqSyAZ1dkJft1Ci2m&N7C1e;m^yNs+g;YQQor%#@N zkFld*r%20mY@f!6jFn^y@p7@rhucROs*B>VH@k+s&wq6A@W80b(v#m&>dR|HlL6}f ztxBtD{nrHn#XglL^{RXs(0__XFO<&dwV|%lt`+*LY;&Q%I8chd>Jyl;1IUBStD{lX z@l1aZq@64D*@;>8N2stMVc|tS=9M~gi6>K@UHF>zh9xhXMB-m~o zaA#f_>u0)OT<<>=RI7|rj|qMQkzZz>=J4a+jeV zraW7PK-CGq*XqVk6!cU2QBhpRS#G3|b4@K^dlLY#U0P)j6?xN_w7*Vxc-*i9$K{j~ zy|xplCkD5wlX@K??ZfE)JdKg3Xw0)?#nazCRd$l_v&z4_0&$P6m#NL#Li)vJWy!ey zYbDEE{As#u;N2_ivTG<(w~y>!7fZkXu3=f@v{WyRAL+#;efOa0F;#|z`^W)Sm9}N* z&$`YY5&)g5&MQ0!Fs@iQj}QW0w0l>}`_sOLovQeZ&tKW^Mp-e=aNUoHJN5we@bH+EKw25XFJSS%0Q5u7pb)43_7RrT=rWM`QF8l*ocn-_SK1YyE% zV~6pQP-^T`c}I%7U+ydVw-w?8E}O*Cb^oG@Ka0wq6DPHu+xy{boYlR(gxnznEo&3& zWjlOKe#@)VS?-2grg=&^G62|4y{plmw*Oh9tMu;3);t8U%e9e8yz}k$lbRzBdrWqC_9GR?9yTCeBvt#mUHe^xNCoOSqla=j!P z`??OTrfvNDSB$5!I?>0BoAZS$gut|Yw#T*IPx~5c1qX<+iRXthoUjWvZ<=yo3&zXqG)~`Dm9fTm+G$csVD;i?UuAKk zi5K~gNQR$^7Eh$~?aV+j&=>ZJ{X&qs{x+z`iot>@UVF}RfK`RHC-O7ZKk0Rc65FT> zoq4Nk9d-`EtY=v{J%&Cldt4I!Yno+gEV+7&q3{!S#5V{9nQJBi_GkQE5=edfE%_p( zxk9XVQsI+?*u88V;qm+}$@$(OI<0xZJ3%FmgyU08yNL6yK0((!ON7IL*$#%ZW3e~2T zT{k#2_Wv3ZTkkaBWs93(kH9kawamMUHxDz6J(rachcU#2$Tw^DjRuw}E@zT3aT7$K z*EYf`6Za^AZ5MV5rw-C3%~?uW@HPnn%Ji{ib=@D;XlojCmC6?GXY8?M2v_9+0bj*` zNk1O#bJDYb{e2x>de_B1G|om|SI^N9{CoKAN^?S#b2MRf5vy`u6yBb9c-_4R1@;B< z9fI}veel3WE}O*Gw!4!m*7_|hcgQ4041Q>g`ApnRbuUd) zO2@Vtq@in1rhM~?znq%+*%is)UAfyzJ_mhO^%_(an?i%v9#_Q8Y4^Kz*jW762^q?c zA!PL&=yNgCmOn&pHL*?pBlP0|!DVF_`N8`H`7gV#j0u;OX}^@~*pBNftVfN8zIx?{=yc%TJvF)E^7{%CpuT+JK`SFyagtXz@Pyn^7STqAYn00Z?`vVLNPyeby5KW$f9jsZSfWUr;5(KnbJsME&$=TSn=jz4#Fp;+{zzJf_$}|!_tq4 z+g19+6Wvv6duX(G5FMA(O~TK3fV!nP`^gqLtLQaJ=qnYV@S1SyAilOQJ6J%O1*uo_ z#$fQw)UdZGnV#z`w$%E2SKQ;FtRDCV(aAO{+^&`NM98ZFo|<`Ra9J&aRT{xB_;NtD%7Qn@=8Pz) z($|ADW_~Su6n8-$TT>u!2pnCr{Zek0{6l7DzFt2RE#osD6BlWCTpjIP=5a%C#lzn| zao_7hT#if##2C;2zrFJSx38$qKA(JmfS{~rrq_pbFk z>rB}*Yu3Ee)}EPj&S{eUj+~0PB_ox~7iX+*nhR8TzkUrA@fdFOgT*emK{>soC@tM7 z?DmRzXco{~UZH?H#ee0vrQA*|)CjK-*dwFh#knacZp%;Sj9o3BP4!rq{)QW_P{b#5 zq>aFZX}S$@BnYi1K3wDGOBy%p!SZtfo43N<~=YR=zwUdq{5l;i%rwQ99Ru9@RTRn!=A-+9pS zo!jUzJ;uo5CCG8|4kgby$Um4=YWwB7>SG*y)IL<{0S}z_j?#Z4&C%4$aRZVsjH(0F z!W=h-ocCdh!fIv!IPS(&&3rTl3kQqNXL43|fE)~G+6br*`7MJTthPi)q%D6hK1B@8 z(jtK|gWOSuBm*nwP3iMI z0oJtHbF&Z|{y8|*aesfk+UvWyy}Ygr%{1i)*cDC5^DOi3);Y5=8!OA1$0jTj2rLRP zfKSTLJOIk1P5qu&PEeyNK0SkMcm)ctewB@q{bx4*(T?bdy64AR4>&0lL^EN z!Ld1e?TR!nE^>@P;EsBJ+nlCNJ9t4j9U1B?v-8Hu4xJQ|k@Zfg_HHr#jyg{IhQ&Zc zhWqhxD&ukumG@kC!wsKPk?V^4#+A|~((}KF2Tnjr&RFAeJ8iLV&eCMudLhHm{c_Gf zu&n%SY7TWTguhRIzCgi|gYhaJPwaJB7`RJH)U#;MU31~qr;aWjJG=zYRnvT1C*v%p z$#{5du^R$4!NYy{0_FQw%H8ZGBWGFBjxn-WowJ+ZK3Hp1Wpc?)P;8so02&t&g^AXKpf4mqI-_9;rw`uWQ+sGOB)8;(K~-#NY!t`b8OMmu6BkxF}-;y4eIwOM# z>wV&b#OoX;<5Ck+8G{I?Oi9G=x7m-jIeOONH8>?oTZyBA881I1v? zo8dI++Gz?OB0Kdh)pIjF-!`Y|^|v7zD$!2s`&aG*m1J`hG#*TSg+o-`_O=2N(hVXd zokMqufOL14NOzY=!_eIz-Q5UC4Bg#1bU1|60N;4u_ulXK2b^`*diJwo@3YTZda`DQ zBb1AEgzuh?M10#HFaxwWtXn)93-RyNJ&mV)p4LRP>M*)M$p$l{E?uq+`j>pYi=an= zu>HIC7<8*Hd6#nYDb1J)CNtfm&Y%HL=k?4ax5=y}?bz{E&#kv??`FRVQ>H4Hun#iq zz9px-@2mqHd}LExod3P%uwkD{>(-3ja~|0JW?o7$kt4In;^WMO*obQ%`g{Cyz?Z>q zEdU_(Lt`|{gP=aT8l8C@*{v!hb3oAM;Fy2sgnpO%9pKt(poJ3i%XQHE^AM?kALQ*O zzwcFF>KlVVE)U+#YuzcV4uld0Vmj19rUa=%$}hFb3xtsulr@ItN(- z5eF2}CqYgj(x%H>(?*m(y*y-?xO0JP!)oyezvb_U#^6NsZL&o zkae{{QlUCWG6=Z32D>OdPz2!Z(51j!>^1t zl=*MR+HBBIvlh|<44fw_`oUY*q#Au7d=H|SQ5sW6MFEF7l`a%Rx4n6pT@K;U(u!RW z*zz|g9O;(1Lf zV-DFtnI|nt8Qk2~XYsNcY^O7&6=ARST(*@3dDvK7gCtnwwYgSi%$%hvS7r7nLSKgg zUkoNfUP*rE>WB*NYbHkZsHUCr%q!w`jF1~NQ$S$W(RJfXzOmHEh`Km+?-X^qAhGWh zJN;lt)fIBLZ@O{q|Dj6^$^y|D@z`A!arWf@+HF>J>Sv0@$>WZ@$v(L7Zi&BY6?WhC zDtOS-fMdkMdF_>dF2Sb!n)!qy>B@B0%$VL6d8?kH?r(cX!ZGPsNZ#vtSb}M5{xB7+9if{1)G;B}zNEM^e3eesSdUUF+_LOT(IpWXYj`F3% z?U~)P9(`n!>Yo2|w^07u&berv$BvD!1D@D!#4e{~Wz)VjP-YNU$v%sf#3)oYQ#U1d#dQs88-O%7iN%4%I` zO2e%`Hv|ALYJLauSI6W_d5v+8DFIk7v2)&VkP&H#60Y`G|H!mBt&m?^E&|N7kcui3 z;2Pm_EXm(#k0N{M5*S!L!SEWfK2ZA0W8Jj?TVKRwC<#-z{^6LEOz>Q zTC*WH{Y;KOK=nav?o?`ho|GNEX622gdyA^0jQJl!ZKFHS3;lT|N?vDOLW@g?(8-_c2L7opM&Zi+Mh?eZOoqf4!v1I0%;CkD6nV#%z8*`1I zTWodgaj=!!3`o6%gwEjoI-hOu(eOyk*A?&!_8-XWpcZxQ9{%MBqKuJ?3UPxnw`1N4D{dW+tOXBbADkUd${y|6+WncE(8wjq zKGU(|JlAX-CkBI-cQY5W!crT41HdK$I{l?rK-g^B7v|6v;H=@qk>9&S@+Ri*(7C8_ zq!<*+(bEt_-x!50A!{)-a$4UB3-Xj*Vb83}Xd9-7w5+yfMZ33ALQPn$c8UWZ78|2~ zvN;3F&Q?FN&}eynhz;T{KX7lWR#@q^@?&4xF6%A64|Gmr^0X1sf9}TTL|II)OlHOg z5#79e>+e*s&orRF?NdnXFM4E~=q&7s+x5<$&Q>cNIEt|Gng14niAKs>tqNY!ujdU=s6IR(tV z0|%hYX7{MTt>9fAGS`mo{!)@#J}JDe)a@={(~p?6HEvVmDJ!_rui^nqzaBJ1u>Ig` zIHT%--Muyu3oIsoXIJ(Z!%q&XM!Mruv4`(k@t09NZFTa}6E3MA`MP^daUVPOoxY`d zL&Uz-(2FdWj?KMm>DO1e^HIAi-tmKWZ{B>X4ll)h#bbGFJLVsN5>nYF%#NgMrxPJr zqZs6TT7cbo1CiEyi#O=f#*5HWlrHo8rVI$Lb>H~j0UufUY)(=iDuUDkQ-9o}KY&Xw z_grq{SMN7heFKGGAwsK>x7ZR?b?@$LQ;kY3M%7splVg!=z)ir{tdS2(TLthr(sP%T zJ*&K2!{209CvZnT%Z|+=nMsaC!ChOji*jW6e^rM>ST76)y-e``?Bi}IG50mwA3?cX zWQ>w!FnM6W@bW_S_m~)hwdKso^H+StGx_5;d}*PBR^8m6jZ%v4|1;}ML^w2q)pKDU zaX|G%xVE{CWsbQFa2xPd#pHp{q{V={`(UiMP5#v@!3~*D;_6uBS3G60vxZ=fJ%MW7 z3H{IzlD*Vg!%{*X``u&k^ZXx@;Fh5`wY$E8bsj~ap!bWY(JzGx`hz9=dsG%nJ;Zbwza%8isrGliBu1zWBjIq=eh8p=mQ^$XyRcc!ke&I`U`W1B}5P!1Nf!G&wi%ag-e}E@X0ToAT1r@x=ht?7^0M!4nL{#z4|0>-lj6Y;aq>;rZejEG z-jL47K0p@uG(T3 z(>~uSU4CjU>#b2KYE^%pG;KZ={!J7&)sP%Y`mMcRubc3g$MZSnyZU~qOnWse>WmDv zn*?jr#T6J3T|s*l6kSmxhlopH?q_hogIalYSv)e0wAX6*RUkKKkS9}2$Xl^~ms5QD zXQj2;^G0}c$VR?4fgh0Rfg`HSz_75D?v9zAtMV*b4xrI6DRargWEEK!LbZt0X*19& zB<5Qj2~D`8F#revsUUhcZ~0{FQ&i9$ILijT`AR>Xve(p^k8<;^xdeziFDfFN zo%SMSk(O@>+Sk)55x5~OdUjENi7xA23#`}QqNh}BXu)A$o+XMQNp_gy)brU?|Dd(t zRB$=aAZAR9HRUPmfx*?f)a0F&Bp~Non&u$q_4+b6?ANi(;mfdSjF7h1iRG<@YJH~+ zxDZ+ni0U_TUcWEi5^UHic7ad(4e~F$n@$+iqixkZfZI$T8kln~<-9X1was>s7jUp( z4gPaY>M&^DCSGGeu}lC09#<=rHMm18KJlKyD=WXY~7(dPUI! z(yu;;f7=Ej(Oq)MMiT4_J3H>$a#B>U`Sib#@3jao^V z=R9+%tygfcJ9N*Z@$uY2Jmw_i*snS_ksY+MXQUq4Pu-V*blK40)S4#HCokj{G4L*{ z)#wUq`@VsBHI&}D@=60iH!hkqKqW6Ed|yW$)3Mg%RA3JKlkSQ9Du6-8VF)z8uEB>o zyIhrsbAi=?l+cZ z3mswNRbO`*{ra;D@A4zw3-PTkkxU3tsrK>UfpnrKM-)m46@vCPEe*L{Ra*1Br!fRF zF&+qa=(8gom42AUoK77Ujk)_4YDaa^%kLTinyH-V~#h_z)d}9!WX;g-MsMcwO6MB+aX~ zQBWERt)v0HP4jubcj!-U0d#~4#8CrCClA6p(B$XrsF!9jtFgLyqH-$!7@rf^E^%qe zy*MapBdx^n?10bObTpe-1{EW7xNcLvtwz3{bJF=@hE$Ztsjku`jy$d*aieZHotvnA zo1@&KZn>dsx3+vf>`YnheFvM;Fv&77D4U8Iv0P;K+EkuxODdi)#Q`X*?gh#el+sjl zCNbV?UY5~O&N)V{(^h_|y7^tPGZ^{w=j@VTj|9iKlB9x8cHb%?-CY5(koOBuZN`M~ z0u!+|Bhxy=JLL&x$+ih1Ub&BLc26#-0FC@yoCX)!$NJKk4`#k!6!#ptC*90)v}SRe zE31ljAFR9E(&P$lUaB?zkmtAi8g^!<-GApXY$RgBaDIGIe{T8|j#w3oLNdJhY4RdX zRiTT=k{zD(#4Rmj+d4TDI2g!aDLCUYl-iJSZf4i$z7c>&1{I~eDmZASo(w_9wO1xj z$3?R~H1Qf72>6cBmajk2Dg^Ph!h*H)`=b9sR2Y3#IW0k8Hbh!Sn31S-qYyr@88x|E zB+#L$gu_X&<%AlSz?`P6ME!%7g{YGIDsIfvrOhWZYto5dds5{o{WIl8FZmDsHSUho zw2<$TKO*#hJHL1qn>)+!5ZgzRf65_box~hIX%#=JaALI~Om2{%EXb%nVG~eYl==FY z)h6Rdl1it4xCsk4J7&~dL(IX1+a^-qM)PB?Re&Xc{UPh0RiYh;ajS)Y4|5t<8J2nY ztrDMkbiD_aLdf?F?1A@B>Ifa0fKkanhO2>60iy27QiHotvRl$<6N1F|qpwK(1yG#z z0dwmm9;;oH8XK7ds;OSoW?uD4B^cL6gWOe^Pq?<8@qR9_!8$2|j{fci5=z)aQgM;GWEWTxOkyj37=W61jHqn159cI1~+PHlxgO6*)#-A6Jyy-GJe zBm|wwwp9BeTLn8T{b-EG>Me#jK*gD~%Z0}JSQ=m&&mNEQ<&rS!SFZc=uFjB>fmG-v zIqQMTj$Y)+sV)67oauHg27myAJZbEix16A`lYOg8Isobx;YblDKH9z2jHh&XGR0nu|D8ET8eZEMZnng~j zR*jBu;P$k7`mz0qC!zMyJkV`0Yt#rw%S{RN739Jh@}lu3mwH2I%(E_jjWZZZ?V0A=QfjF+?{F;q_{k0am@{Inko$+rnQS^#t=GtDpE=76W_1G6|#X z<}XD)>XtXJR^^K9s1T=Aj!x*oukX1ToK+^+WWdKs#8w$pzjw0+f?CTEFh$&jD8hX5 ziJ#}TjJJ;fFgU2)mYckQY0s!7!|L{=Kh70n<7a~X3;H{Ojg)3F8*zO~Sy3RI6l zaKZ|efAaNSzQ6CF90o}Wz9=R%(bCxqVj!i^w1KNn8h0jz=gd8m>f8DHh zbVd!`&H67Ml*H&Id5Q(kiZF_1>OP{=``F?=5oyl8Ftoe`j$9i+uAILBnLq)g@-nDD zO*+Dm@L?GnAhb(Tfa-hXuTi#_{ZfgOLs| zdmF_4vF4_0bCZ)>>HAxP0E5%^ma`Y4&qJO{Aj;?p6>WOEUfJ_^kedEIOPpF(w>6HZ zjkZ&C#AK#6`8?)IizkQT-zWXP#37fZ0SpZ>7==zoJug2hr8$}rk5oYn!mtbEtd`kI zQ4lUWq}0in86MVd<`TK?k>8#7n=Cgh>^{~DEt{-~hmrQCw^e$>lkpVbreE_i>;BgzQO-JsNcw;17yV)`-QQ^}P%m+fGZ~a$y%Dsf13wTeorskC`+pIF^-j;+ z_r}QPWDqU6&(;4j>$L4G-9{$3SPDFI_JUt+WAGnMH*|v#{Y-@BqUMmbLx}Kf2KLyNf`S(#T;6yxZHh3lH^Q@6!dL#OpBIrQTO-Xg$dnJY5dHlv zz{=icBLnGA3m7=*25Twv)&U?Qd)lu2((Jbxgu$HXMCDTNKx^Zn zgy#1OtBzTULM?^>@)9-t5*^G6`}3AT3#k60Kr5P@8Sx~iAv~cFewsk-+LQA(PfRFE zHSR@kTPI!JPeqOs^g7)ewMSp(mY=ItiX^F4LR;xWKU)FXW2v}$N9um?>+()DxSYdn zWOgTt{s$IF)`M#YBmlG#pUBoE%k|^-gA1H-l8U zhwjlEq^m$w2*pp?v80Pv?DZ>$yF#$Z6yuenwH$O2slJohfT0H-1KTn){>}6F8?c@$ z{K1I{Bth+L*9Ol+ej&=)mVUctw0hDZxkR&DQ-EaHVGNw)SD@HNLl&@35NpC09hEu( z#59z82(5%j@P;BC6>~%%C|_MBuj}4{+z|qSXCMy>U>CH_dH-4BfkP>={<9wITI{GD=6N*TS1{yL z`0KB2b}OK}pTZ}zrNZTBoXpIm>-LzbROE51-5Y(@LvuGI+XGHC+lhI#fF(4i zU?bhJLbHn=FY2jN-!b!-Hsc{ikIwl**_MUj*NU5%-yaJU&lztCWym8jVI3@@S0!T!ufrI)s;EJg;HEmtAg~3gX+)R~Fx}@R# z`71B2YSx@{vlxL?mpVrzRC8`e1$1&udhA#=k(Om)V;)s&U$CYWZi0(G;Iwj4XNQSkm-DUr=q_a>B%KQKsSbtw)u?C`%29}woh=#=v=6^l85!|TfU^hU~M8XhH03CKzdY3Cr2sc*qSPFeZ;OR7m5p*s4g&HrqDNfCXbw+2J_6f zRGui&9PsZnW`Zxvt8-=#F6h3bh6u5`B#2BbIllZBZk7^E7;&IFxvNxL<#82Zvp8sb zx%|*QC`9yIRnl|%{q9{B2=VxbNZx@>KT=dTB~OffqRc*OEbe}uPY1c?s>+ z&J71`QHgpRM@T`~l!FH;?IQE3r`SJk0> z?0UbzrqY{#f;nVfXluHodw2XWT?uaJUjBX?SMgUWG>Rh+Gyo3Bobc0&roEG9<#1S$ ze2Na+^HTI~hb9>{Z&Ub54e$d1m|)h=mM#f2qS;F6RfC7eOeXBl*WZ2}$Jmg@mvfy4Rvi*L= zT!im#c;acYB}cNwQ5FyOdI)|)s`~wLp$lp&=P~Vh9>*-U3Sa&87aX75w=mW+zw*R< zBvQ;(j;EeP#z6%6$jl^9rm_ArURePldHv+4F)Ko1%aMk3YT(wvkV4}OdL(K7&D0k2-bk)YEPst%8KbFx0GmYU^l5zh_4 z32HffNm>%zGHQ1so3nc6&`@pRWq0l7mkE>@$wHtSVIIAjzz1+dfmZn{v!u_*`%@zf zN}4^{a+4mMZ0{H#QT;wqE%*+6@&Mu0&z(}8sdpFsFO<(Ytt*;Iuhk6o42HEvikJbX z(IA<42b+68OxqcE_n(!!WgrEMYdg5XDlRRzYp65QeOn#|8MyO{?{WKis!=^Rv)9M^ z+aN2bx1c7}qu8_>S!>Ti-@8$9Fv@;X=aOFv>2TcQ zr#_V`u+zlY&}`}8ywD6=)`N9y>e1R(<&Znj48{r;!kmyLwsyMoLF|g8O6@%AJC8yp zmk#Ba&R{!U4<^x2x`5Fu#9^-kuvbKt(lPyEF1D; z8sUs89^ntYiOT$nagT5&J#yr`)Z5daS}zNq89Xq-g2D%G>lxwY#Vi)J@Bv>)p2|NS z&{Vd=W(b^b%-kncdhjD=sK40-vIm&EA&oj10;VNimAqP$S<( zj@r3B`)ofb^YHzOgF*9gK{E2O^bU)C5LuqW1IK}C`v-=a`?4h1*Iui_&?+z~Q=uVBU%*x`=7{ zJa#g^o9X=_xrG5)_6fTRi7YK@n~|Z?sq$v?**sS+y9rS7nq{gU^K*)aU31c=;2VQz zg*`T&@+;Zw_QXN2BV4!3IT^K>c}{AN#kKB)ZB0|PMF24w(&UhLbJ+#Odeuq3&R_&c zZ2e(OwH=@U(EsGGU1gKVR$o6Ru_t|3 zXfu{4z^3$ztm3?-Xq2<{gdg26&gwl%_cYP)WQ>6gbMoTdPhEfWR4`ia55=t2t<{7B zrv+W+AEBOOunG1GNXJqua#L!0=N1bl~-ze8CW z{^}>1P0;zoWe57Psd|aw?u_Smr*^f%L4(Sc8y8RA>e2W|clP$AGn4g|cF>LEHKBqz zGgE+W-d??)QwmYO-0~L%C*$fC|LhGK=EtBBHdbKzMdWnDsJpH1MfGf|TfV$ z{oFQBwYev&XARWASgRUx`>BNW+E%SaXSm>@BvrDlbIj?c;FM}hk|b5%)Uz!|n0~jF zHE7fPMI>_T!-w?u2V4pU8^@GgKa(f2oPzcd1G!cT&rSwTso5Fom)sSsZlynZsfF@e zGYWEBWRTXBCRLB^K7$%qBkEqM5lE9DeSIY?4z2K2+K#;>VG=%1q0aD$m!E*LuFp2O zvSmo=C5=$!Mj+^yJ>u_J%ElsvcSk9j63Ex;$a$p-#u(Zf6%VUr6&yZ;9&r z@@m|wKLn;ZeSa;;(AMoD+KkF^UX$d%DYY1LefqJ*B0m4&%5r?mG5Ib+)zpDqG~yQs zcQ^Q1m%~Yvkep$^@H}cHmJ(`-lfLGNIgE|*=%tnlHKZ3^jUOu(`1F8+l^3)Z^T({M zCXrqM3w|bQ8ewMe3kzYvj3|#;7|LOvd?ZoIlx08k3^hurSL~UUcAVOG4hg&`?o+9M z{^O?x5JP?+2t$k~G@YD&*8|pLjQ@CRrWQ~SkXdKIRE2pzAxh9K)A5^~dcV&LDMFje zc1$I?fEHrZlaj&<6z|{k?1C2h-?HC03(j`4d$x`}i{K@8F|%dA(;5olU>$mCAMtAY z5rb8Ly6f8pYLB#+1Wnl-4JTaQmXma7ft=p$20PQytfV%JN+vezqCi@#k>iXSzp zmw9$PfJbUF>K@+{E&b7ERt&kK_SL{Hbq+O?P+Lr9D&9MYK#k>w1+q zH7`q2al<;Cr=>n3oX>+r`}_>SAe06F&P zfmdn4s(`px8xMB#{Ps9)@g6AH%5;`;n}XCx<%dR*M~-My$)Dx3=As2S5uepMqm1vA zwqLQMu-CEjPZKaEF_L}kR66orhB5b{VaO5X(SqM;T>vvt;ptag*OLRk3Y|;x^>sB#nux5t4loyd zC@~jt=`_9FvXd$+&DxNg==2l?P26FqE0D3slh8HW6aM^+89p6RUt-ub@>PzfQk!#{ z5FU(g3K|L9t6yN3hRO(yduPe(e5hH6U1?CdzRY_5bmW!px?dFE{ze1KQSWU*CYuyT z4b$Rjo0C%}6X%XCzRRf?LJ)Zi%j~y_6VVRz6K(CFTcP?D&a;&vKkeyew9hS9ogF!R z2C)~V_L#1E!`+pFybJJJNx=NmO~q}c$SU6IlU_cu{-Bj;SGuTNny%#0L{VY`jLGjz z*`?hcqOBz2*-tlzIAH?M&ecA?Ag=K+g9VKTuNc2lXb$=G^0PpDvw{TiTmy5|XorV0 zDfpsuB1L#aqwUE}{MjSQV6ficeTzP8t4Z1lpCl$)g~ULM+tc3QR>twUJ%iCRXaC`h zIbl@Yg@2D5(wo$hv*=Y>_t%TK_}RO*?BS`T5sqr^&sWL3Px<9*W$vBHYo8lbd7JVH zBf6O$f>+zE$kUUrd88^QV>Mb1qWti}6M%nAF1}WKn;%cg=9Q)zRfT?9=aPKY#LVn&SmO8GaI0K#&}6H7#nqaW_`LG3 z@QuMU`j@$AxK!@3WQ;NvFIMmBC6~ADt41Xg1|?+^=tD+K{?V=0+BYX`l{p3j6{mC3 z;0--nv$E6CK1ce;UePa|%dexFbo^>6{xE>=6w>TYyK$zp`?1jb8=Cv`jJLYfLVkX$ z;%akU$m5spv13S;Om}b*x4$s_Dk74ec9?i7FW!yQEdeFC(dc47GP678Y53&xnLoyj zsNt|PO+9Q9UuYyB{WiOe`jH1R8`-P_x zYU+xDT zgn`TyoCRpM6M0zo>Jx7a*#Q~_hb7*3w)5amU>P&R=X&z!5t2z=inwOPVY;4fYD;oR zAtC`Te6&Y;8adTo%XfOZcdFki5q=13V3O$gjJ!}nnoU>IP_W=FQih^5$`-+@zv&^} z6*e+Qp>=?THcW>=zp$1&rhsF&-&7^*Qwr#yZ!pwXTVP! z$}|5oDx^hrPI&pf);wvotUIXi_fPdZ+yP9Sf=9%i;(iQp+m2d4T}1c3H~8|9kn?4S z!r+mP>~d3GKvW!x#_poPABulUGHqxyA~NAJH2M4Sz8!(Fed3N~pl?o)hvFyB-aav{SVJDW(S&eXD`eGk?G`ZH2f8ku|m!9@uOr%etqcw7tXl{Z> z?`=Z-gur#&gcDYCsmD1gQP+uiw2)j;CZ{D^PeUB^yMR5#t2v#jr%G~WI{^&fm+EP@@UT(N5d-M&Tg>yC*jky?K@waXLMi1wD} zIz;$9A-+)W2e!NvlpjlJig-O?K5QB)$WkvJB1g_TYC63geJwgqr<9zDybew;5f8tt9a(Sku4R16<3$2TTi^BJaAN#r&MAja&ix<-nd$61u+K^x0PQn-b9Dg z?#b52i_?xJ$Yc?W$yVnw`exki?j#nGI8;QK*0bX<&1yW-N-!z zN0;QZA0>L>|1==H=<-5~FBPR7ab>uDdsn(OQ`w_VVSekBBYmizYyFZhd!3(0 zBlYcdWYZ*M>s=i>wU=HzdgElN_^qY#RDBh-WO18>*!WN5N1g3%RT{SDR?o3N&lIvz zVPu|gzds%}UXuf;=Og;89NCZgY55JHk`Ugx8-E7gcvlmgkbQr+GYu*cEfTonzNfmn zm4kVpBtJQu5*q2M>_sCe?m9wCFr~uoJ&T3kk*!aJ(s+nByG=z9I`ebXk=^l}oWECN z)lPg33BqN6%T}6{ll~Hzg!T06x^!oQClkBJn-#27ujPCJBj1=id5F%jiw*dX4ESNZ zah7+(|MfNs0$gCaIK`we{0$0~H3c&^zXbvx#u{&`$!@7#Jdve{Ayk)O#~`AagK9Gi zc72kgYyLYVXX73IAa6@oJikF>(#s#%7eW1x`yXjN81KeuyPiIFQ(idqLlv<*)ZRn3 z2W!9AB&@koGX&(SS3Xim&Hp%f3jWV)@k7LNd^FXwe{ftyzlxd`7A*hn(X9>jPqV-w zYf=+C6qUHTlI4pPGZU7lyM7TgP3M}MG1O&F)nG3U_ zY}kJ?&ke6>2{4tBb)%7u`O7xeUh2i0wo3J5pDbSaql*G7=a*!DOu!zi-NEkZ+2M2O z#;`snW%F-DcWxz&oD?(0r}zdbw7$#~ejjxCqb@tkpuZ#XJ_IZn=}>*w zKk~^K;mzNd*Ct@~AbVG)z3g2M?C{)}-Hss6lj(AGl}l1>jIB}-d+p=Ae(1o{TD*AL z0QNpIjyVKE7U>GQSngpzbmY$XXvqx+{bK~eKIv=Vk4ul*)}*nI(@C~jkc!q0t6z5^ z1VB$Fhe*@HTtS4x1J(AIiml~Zflp50YPQ{=)VNE@;JW56BJWzz7-8SgaUgc?e<9H( zx?_Y6x>)$emRqg+4(^?@RcCyJ{bPsynpgs>LvgKP$CBZkRz%#5UkB(kpuLlZMMwoC zB#gmyG67b&0_ktzM|>)n2MKrZN%8(Jj~E484YDUkcWuGjtQ@emy|k%>JO!H|vU#8E zA7ze8`>Nl1h3mWnv3RSsA5G90$+K~*aVB5rH)NrgP)GHLEb6SkYXuXeBmE79tbP@h z`_Ww7$^ZEW!UtA*ENvC!p*Yinh$u~~1DWk0d?+1czdtJ6lG#%Ti#GlvSaOj5qs}g}CuJ+g$@2bL`mQ(u*>ibti|3GZ=uc%BFK_~O=SyNK_^ z_#Lq53O=)j;+ysC%51FcrN(n1(g>cjE`+k;{D(zs9mscQ_grN|oAI@uxwvCG#eBo9 ztpklIo!_g72llLe*m?#!(Y$DyKJW`R5or-=0twM7cmQ-G3zN52a35la4e3ST{{ub3 zK2Bif*I!!)c-3)#97edeRuvpcKafU^7VX>~pedj?X0c?68M|W{>xa*_z=Nv+`SY8KFq7~1Ml)OHDf1McyS(+At=gIlz?bHY7#$Keo5o7va%oGd;F)e*? z5<-)?AE?f>!Lgf{>;l^pG_as^eQ;?>NLI}TAQwD%>m<)N9HT*yc+TLxctZJ3)F>Qc z_O%!NuVCY6Y-7qcN&usNE%*!?vNPJx%*9O2Q_EKBxy$2{HPk?rgt=SZP0s*ZoHQnc zxqy6_-1Exckn;YQaQ5oM+fK(yx@Hq<2b+&%*CNs6uuJ0!q>DZ{|L_k1&L!$qhn9?& z!f&F_N1jU0(Rgj$cTPLP1A5^V*FKV+x?V9`ftS}Fz2zuW?~%tC;jZX4?~FQG=3_?msLNGrq?EOvd%!WU;6ljIVaNKMvpAg|VL%%(+ zNa6ae3O2{8-p%j$m}_*j!)D#zkfQMb1r8mPUl>6dH;0mgmjAH5M^?-@FHl3XlC3%X zi};S+ChDB>Zd5;vQ_PfcM#yZHs@)o%N=LWvApSZ^J3l*;3Iv>pIEl2@HhTl&T<<*E z>K;*%#s6_?F$B;%ZKm1@l_HJcZ@^O5L0JvfSh$N~HbKqUVdW$M27fsxQbF{(@im_k z6pdJGGf8)Y614U9?LSP?HbD*!Z0dc-RX!_0LBfXGwOronbHb3im`e@n2^=x&FqG%b z1y|$aY*P8h11mP=Vq0D2(Lt0n{{cK*k^-$V-7Z795(SP!*S9f@NpK(35#)VsJRocY z4ga{$#agT9%kYRJNyhA_xR>u5u^GuJyZs;Us{M|Q3~%#>_guD8m#2{J$Ji;})0?RB z%9C35y^pp zVU!+)ce#ZxIe)%)}TAAHbR)Hd5<1k%FIYIwQk~v@Xqj-~1=F!SbpzLT`^QnAAAocr>qPs;+MKg>q80c&3(f z0DE(N0GdmKIL~G_GHBmA)Ku3z7n&4lD7G*fI=^^xoy<|JNSS;*1ZaGbF`4y9-A0L`gG?qCK~?C)oZkSE`f51Lz(w27EVtEj z6r`kD>viphm>Y~DA3^gqGKKAfP84GQq;4!^v`;WT1=dz>40SREK^hK!H0P|VLQWOe zjeJGfJxW`H4QYT3?xkOj(rU_g^Bm`EKa7VBgbmj|ynbzhH5m9mmDq4#DoOP=T#}C% zA70Q8hif~E>&5b2c0_psAn^UC${Og5BsAWQJ$WC5FoT~(s;^ZjyaQx?TiN)7zSV|1 zAi;h5m*Qe9FvQE>%#O%Xn+0amq=}wYyweb*_f~@V?+EwX^lLchbY)q8C&o;b!VgvR z()a4@bs%6h%EusP0-|pkmi^4cr%zYbU({o}cRUB3Ve=Dc_UF3**0HiJb z95CZD(7Mw{v!lz+@s_`e$qYDrfbC=pU|UHC8rBGd@?>LW6ZK!G3(29Bx0MqFxzx{< zcTBwpn9jH;o~iWuWm zj7F8KJMGyM0y~|KY)6p@-tBfp+aKb0nkH=yq7%M*F zd`rl1Ecnl`Hp2&EOB3~*d=#aB!yVq=m>Id{&Y}zYxYATcq=Gz7)Qoda5Qa3LS}=%oidJjo=UO|E=BZ{({fbOFESL zD~{E6wN^C^^+aDYpt*Ie>T(iboHtglqVY~m)onV&b*FSx(iE-S!CXX%h?(zFO^EQ$ zFW+yvX7Wnt-=(C$(zgB^8?5_Dl2Xx;x>i!q=t3N7PABn1RiKbWa|EPwAJoXM2y2f>*KIhtM4>uqB?JAhC zmWwJu)gfO@kzq&Q10B5mEWFEU^@3w*I|taT*bRaq>~C@_9-cp)!>O*z5j*X*yvqKc zG{(Qult<0`%Gc_4wB|7hM0HLLGIf@#>ai^dsjH~`aiyk#Q1HgS!ZgUVmV zr9*Hn(D*h!+567cAj$oAYcWRrSC&{1*x=ntuXNyTk}d#Ov`*Qf4ZXtr_h)i_Gz#|# z#OdV7{xktOAbW^U{IPr0+8ewMHPo%}e@ls;w;y3dwXl^ZA=(&LxtmZuz=FIE(IwK9 z^F!0-F6JvHakbjGE#^DkoxnrH2hC|X6ULonP?>pHzZSs$*CuVNznL42h0zS&4E!>J zwOxYO>e5t|6@ca9wLWMoXQ6F!n)LVKymbcu{zQixh(yj>datmN+gd*syJ6{Vgnw!{ z`;Vpc@00jOtn2J)1j++xJN&~0MS5`z|N0_aV9#4An3Xiv`oxq+tB&=8w)&9hp2dik zQAYXI+TN}07{X9Jx3EYbwS$PZ;E74OLmheNpD?27E|!>_Hq~Afw zPX($18J@BF74U~4hDwga*N~Xet=>M||E)eA}>K|WKEZemXY2GJ7 zGmr0A`zOba*eYdr>7iVn>e#tlv2>wePW>R5OrV$EC)eurcgw}iD%hcrqv;*i$=pARV5Bw?@~zgp|$ zO!8l3B;j;O)_&eW+;M*N9$q|?cH=$W#d+abRx-*@tHecI&+RLPi~nyeEM|Q4HvxRC zv=}Os+v6~O{vaCQk> z+k76S`IO@Y%HuxbJvrq|K*T*mXf>eTtWt#l^xmI!yjy(WS++U=i;J}eUh02DVGBaO z`*Dp{&ZEaToTsaWsQBRKa&JU)CPD*hW%Nj=)yVMC9NNvn2h9)mca*QCn(3FV-SiU; z1mKhyFbiY;ANYtRDBNqUxx#HTo>j7-2=GY`FRKRvz{unZUcz{kc~`+pHCL3VZO=PuD8 zuWkl1y_}6dB_F%~eJFK_|Gcl&6zL>-rvnDdn45`vRlm^xWfZ?;PY1nAx&N&-p`g~I z%)>#yaequ=K&YT$R_fY(9)~+r4GmKZO9I(+vFyx2KR%WGtwq>x z%bo62b~oUfdP-KSdKutq;T*%*q~yU`ofr4OH_@YNDq>! z2}k+=^X?IHr8WHMpsTZorbK{*FQ=1Nb_}qqNpV2#sjz~?aTzZ)3KdCzBFq!?oy*ga<`}?jB?9iS9u*rGgl~Y2fR7BRJ zFU|9AC05P)(=Sr2bK_b0x;@2Tm7m^^K6bTV#W=QS`uw{a;6V&*MznIQ*`@3x>2SsJ zZ_uti_rqr2cfRxNo~Y3c&gO4ZPFz;aXWqI0z3WkUdkyHJFqTWQ3q!+xhNMe6Td%mc z`^m2DKP}nH)-Q10T)4GPBHY&Dkujvj2{ivL#~L^0)4BUr+DKbmxbXBx|KqFwfn{XG zIcfJMUdNs%@Lc2NnqVp&aeZar{|k!}Z|;1w@7nq!>=WX5C*FDKb-b?yHcAHymr~^o zQoK6#)gP2h|F-V@3EaYLKH=Q)PWDsFc7+@ht*?Ci_)y``$Ca?s2CE6ICo#U_?nvvTf#kv}Dh>7pf5S0o`6UjZhE+HQe_6p5wzLZ@y9IM$_PLGnLhs@i*eg~I#<;Fam zR=(2W*XP!<%IlUcl?Ll>oOJS;Iqf+-@qu(Nv6qkAYLKG*+P|n=oa2w-=WCKZpUl^F z> Date: Thu, 21 Mar 2013 19:14:49 +0000 Subject: [PATCH 165/296] Fixed logo path --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index cf3f9e6c..231c0928 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -![Alt text](/catch-logo-small.png) +![Logo](catch-logo-small.png) CATCH v0.9 build 27 (integration branch) --------------------------------------------- From b1948ec589999eb02ef76e4ee41565486344813a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 19:16:07 +0000 Subject: [PATCH 166/296] Try full path to logo --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 231c0928..4b0132d9 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -![Logo](catch-logo-small.png) +![Logo](https://github.com/philsquared/Catch/blob/Integration/catch-logo-small.png) CATCH v0.9 build 27 (integration branch) --------------------------------------------- From f82e436372f2b314c7e016bc6d865b3d71ae4e40 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 19:18:18 +0000 Subject: [PATCH 167/296] Try raw domain --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 4b0132d9..c76e619a 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -![Logo](https://github.com/philsquared/Catch/blob/Integration/catch-logo-small.png) +![Logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) CATCH v0.9 build 27 (integration branch) --------------------------------------------- From 22b7921f59161df6b1877be0859a489d64f61bfa Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 19:21:41 +0000 Subject: [PATCH 168/296] Try as not first line --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index c76e619a..72e5e9e0 100644 --- a/README +++ b/README @@ -1,8 +1,8 @@ -![Logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) - CATCH v0.9 build 27 (integration branch) --------------------------------------------- +![Logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) + CATCH is an automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. From 5a269418d1fa635ac319620b1d71ec753cdc40fe Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 19:24:25 +0000 Subject: [PATCH 169/296] Try lowercase chars --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 72e5e9e0..e3f3af8e 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ CATCH v0.9 build 27 (integration branch) --------------------------------------------- -![Logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) +![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) CATCH is an automated test framework for C, C++ and Objective-C. From f433940eb44e4cd1afa1f6b0ba17ac5acb7cf50c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 19:27:11 +0000 Subject: [PATCH 170/296] Try with title --- README | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README b/README index e3f3af8e..9b5ab1c7 100644 --- a/README +++ b/README @@ -1,5 +1,4 @@ -CATCH v0.9 build 27 (integration branch) ---------------------------------------------- +## CATCH v0.9 build 27 (integration branch) ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) From 3757e15ff46452bcc7a18e122b03a746ffc5ecd2 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 19:29:02 +0000 Subject: [PATCH 171/296] Added .md extension --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md From 336de8667a8b8f1115ace848cab0729496afcf44 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 19:34:56 +0000 Subject: [PATCH 172/296] Reformatted README for markdown --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b5ab1c7..5ff4d6a2 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,16 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -CATCH is an automated test framework for C, C++ and Objective-C. +An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. The latest stable version can be found on the Master branch. For documentation see the wiki at: https://github.com/philsquared/Catch/wiki + Issues and bugs can be raised at: https://github.com/philsquared/Catch/issues + For discussion or questions please use: https://groups.google.com/forum/?fromgroups#!forum/catch-forum From bd102824a901e241f374cb43cd839cd8682b55b8 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 19:59:56 +0000 Subject: [PATCH 173/296] More markdown formatting --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5ff4d6a2..761a339c 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,6 @@ An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. The latest stable version can be found on the Master branch. -For documentation see the wiki at: - https://github.com/philsquared/Catch/wiki - -Issues and bugs can be raised at: - https://github.com/philsquared/Catch/issues - -For discussion or questions please use: - https://groups.google.com/forum/?fromgroups#!forum/catch-forum +* For documentation see the wiki at: https://github.com/philsquared/Catch/wiki +* Issues and bugs can be raised at: https://github.com/philsquared/Catch/issues +* For discussion or questions please use: https://groups.google.com/forum/?fromgroups#!forum/catch-forum From f0a2a213ab3a4e95de5c4747f28f777116468a26 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 20:02:45 +0000 Subject: [PATCH 174/296] Moved title back below logo --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 761a339c..1be39d0b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -## CATCH v0.9 build 27 (integration branch) - ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) +## CATCH v0.9 build 27 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. From f155366cf268f97780c329b31854bf9eb63bca91 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 20:48:05 +0000 Subject: [PATCH 175/296] Updated release script for README changes --- generateSingleHeader.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/generateSingleHeader.py b/generateSingleHeader.py index ea16a1b7..ac122d6e 100644 --- a/generateSingleHeader.py +++ b/generateSingleHeader.py @@ -14,7 +14,7 @@ seenHeaders = set([]) catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) rootPath = os.path.join( catchPath, 'include/' ) versionPath = os.path.join( rootPath, "internal/catch_version.hpp" ) -readmePath = os.path.join( catchPath, "README" ) +readmePath = os.path.join( catchPath, "README.md" ) #outputPath = os.path.join( catchPath, 'single_include/catch.hpp' ) bumpVersion = len(sys.argv) < 2 or sys.argv[1] <> "nobump" @@ -82,9 +82,11 @@ class Version: lines.append( line.rstrip() ) f.close() f = open( readmePath, 'w' ) - f.write( 'CATCH v{0}.{1} build {2} ({3} branch)\n'.format( self.majorVersion, self.minorVersion, self.buildNumber, self.branchName ) ) - for line in lines[1:]: - f.write( line + "\n" ) + for line in lines: + if line.startswith( "## CATCH" ): + f.write( '## CATCH v{0}.{1} build {2} ({3} branch)\n'.format( self.majorVersion, self.minorVersion, self.buildNumber, self.branchName ) ) + else: + f.write( line + "\n" ) def generateSingleInclude(): v = Version() From f4254b8622ebeb39dd9d7251ef375328fae30576 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Mar 2013 20:54:47 +0000 Subject: [PATCH 176/296] Moved scripts into their own folder --- approvalTests.py => scripts/approvalTests.py | 8 ++++---- approve.py => scripts/approve.py | 4 ++-- .../generateSingleHeader.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) rename approvalTests.py => scripts/approvalTests.py (80%) rename approve.py => scripts/approve.py (58%) rename generateSingleHeader.py => scripts/generateSingleHeader.py (97%) diff --git a/approvalTests.py b/scripts/approvalTests.py similarity index 80% rename from approvalTests.py rename to scripts/approvalTests.py index c6ede479..1bf114af 100644 --- a/approvalTests.py +++ b/scripts/approvalTests.py @@ -7,14 +7,14 @@ filenameParser = re.compile( r'\s*.*/(.*\..pp)(.*)' ) hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' ) catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) -baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedResults.txt' ) -rawResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/_rawResults.tmp' ) -filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) +baselinesPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/approvedResults.txt' ) +rawResultsPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/_rawResults.tmp' ) +filteredResultsPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/unapprovedResults.txt' ) if len(sys.argv) == 2: cmdPath = sys.argv[1] else: - cmdPath = "projects/XCode4/CatchSelfTest/DerivedData/CatchSelfTest/Build/Products/Debug/CatchSelfTest" + cmdPath = "../projects/XCode4/CatchSelfTest/DerivedData/CatchSelfTest/Build/Products/Debug/CatchSelfTest" f = open( rawResultsPath, 'w' ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console" ], stdout=f, stderr=f ) diff --git a/approve.py b/scripts/approve.py similarity index 58% rename from approve.py rename to scripts/approve.py index 83b25594..25a566b4 100644 --- a/approve.py +++ b/scripts/approve.py @@ -3,8 +3,8 @@ import sys import shutil catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) -baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedResults.txt' ) -filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) +baselinesPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/approvedResults.txt' ) +filteredResultsPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/unapprovedResults.txt' ) if os.path.isfile( filteredResultsPath ): os.remove( baselinesPath ) diff --git a/generateSingleHeader.py b/scripts/generateSingleHeader.py similarity index 97% rename from generateSingleHeader.py rename to scripts/generateSingleHeader.py index ac122d6e..85b24ec6 100644 --- a/generateSingleHeader.py +++ b/scripts/generateSingleHeader.py @@ -12,9 +12,9 @@ commentParser2 = re.compile( r'^\s*\*') blankParser = re.compile( r'^\s*$') seenHeaders = set([]) catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) -rootPath = os.path.join( catchPath, 'include/' ) +rootPath = os.path.join( catchPath, '../include/' ) versionPath = os.path.join( rootPath, "internal/catch_version.hpp" ) -readmePath = os.path.join( catchPath, "README.md" ) +readmePath = os.path.join( catchPath, "../README.md" ) #outputPath = os.path.join( catchPath, 'single_include/catch.hpp' ) bumpVersion = len(sys.argv) < 2 or sys.argv[1] <> "nobump" From 6ba2057abd69beb47f74625b3cc28fb77a32c9af Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 22 Mar 2013 19:00:42 +0000 Subject: [PATCH 177/296] refactored toLower --- include/internal/catch_common.h | 7 ++++++- include/internal/catch_tags.hpp | 8 ++------ include/internal/catch_test_case_info.hpp | 3 ++- include/internal/catch_test_spec.h | 6 ++---- projects/SelfTest/TestMain.cpp | 1 + 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index e06796b8..630277f2 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -80,9 +80,14 @@ namespace Catch { inline bool contains( const std::string& s, const std::string& infix ) { return s.find( infix ) != std::string::npos; } - inline void toLower( std::string& s ) { + inline void toLowerInPlace( std::string& s ) { std::transform( s.begin(), s.end(), s.begin(), ::tolower ); } + inline std::string toLower( std::string const& s ) { + std::string lc = s; + toLowerInPlace( lc ); + return lc; + } struct pluralise { pluralise( std::size_t count, const std::string& label ) diff --git a/include/internal/catch_tags.hpp b/include/internal/catch_tags.hpp index 15c3c3d8..74d6ee4e 100644 --- a/include/internal/catch_tags.hpp +++ b/include/internal/catch_tags.hpp @@ -70,9 +70,7 @@ namespace Catch { private: virtual void acceptTag( const std::string& tag ) { - std::string lcTag = tag; - toLower( lcTag ); - m_tags.insert( lcTag ); + m_tags.insert( toLower( tag ) ); } virtual void acceptChar( char c ) { m_remainder += c; @@ -115,9 +113,7 @@ namespace Catch { typedef std::map TagMap; public: void add( const Tag& tag ) { - std::string tagName = tag.getName(); - toLower( tagName ); - m_tags.insert( std::make_pair( tagName, tag ) ); + m_tags.insert( std::make_pair( toLower( tag.getName() ), tag ) ); } bool empty() const { diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index 6795047d..376a54fa 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -11,6 +11,7 @@ #include "catch_tags.hpp" #include "catch_test_case_info.h" #include "catch_interfaces_testcase.h" +#include "catch_common.h" namespace Catch { @@ -76,7 +77,7 @@ namespace Catch { } bool TestCase::hasTag( const std::string& tag ) const { - return tags.find( tag ) != tags.end(); + return tags.find( toLower( tag ) ) != tags.end(); } bool TestCase::matchesTags( const std::string& tagPattern ) const { TagExpression exp; diff --git a/include/internal/catch_test_spec.h b/include/internal/catch_test_spec.h index fa60ce73..4250637b 100644 --- a/include/internal/catch_test_spec.h +++ b/include/internal/catch_test_spec.h @@ -33,12 +33,10 @@ namespace Catch { public: TestCaseFilter( const std::string& testSpec, IfFilterMatches::DoWhat matchBehaviour = IfFilterMatches::AutoDetectBehaviour ) - : m_stringToMatch( testSpec ), + : m_stringToMatch( toLower( testSpec ) ), m_filterType( matchBehaviour ), m_wildcardPosition( NoWildcard ) { - toLower( m_stringToMatch ); - if( m_filterType == IfFilterMatches::AutoDetectBehaviour ) { if( startsWith( m_stringToMatch, "exclude:" ) ) { m_stringToMatch = m_stringToMatch.substr( 8 ); @@ -79,7 +77,7 @@ namespace Catch { bool isMatch( const TestCase& testCase ) const { std::string name = testCase.getTestCaseInfo().name; - toLower( name ); + toLowerInPlace( name ); switch( m_wildcardPosition ) { case NoWildcard: diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 2b0a9bf7..e6c3830b 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -383,6 +383,7 @@ TEST_CASE( "selftest/tags", "" ) { CHECK( twoTags.getTestCaseInfo().description == "" ); CHECK( twoTags.hasTag( "one" ) ); CHECK( twoTags.hasTag( "two" ) ); + CHECK( twoTags.hasTag( "Two" ) ); CHECK( twoTags.hasTag( "three" ) == false ); CHECK( twoTags.getTags().size() == 2 ); From 2e3c5fa2ade56f7468d02a1ad2d083b15dde4d65 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 25 Mar 2013 08:46:48 +0000 Subject: [PATCH 178/296] Addressed some warnings (mostly MSVC) --- include/internal/catch_evaluate.hpp | 12 +++++++++++- include/internal/catch_running_test.hpp | 3 +++ include/internal/catch_test_spec.h | 2 +- include/internal/catch_version.h | 3 +++ include/reporters/catch_reporter_console.hpp | 1 + projects/SelfTest/ConditionTests.cpp | 3 +++ projects/SelfTest/ExceptionTests.cpp | 3 +++ projects/SelfTest/MessageTests.cpp | 2 +- 8 files changed, 26 insertions(+), 3 deletions(-) diff --git a/include/internal/catch_evaluate.hpp b/include/internal/catch_evaluate.hpp index 7e9d57d0..5971022a 100644 --- a/include/internal/catch_evaluate.hpp +++ b/include/internal/catch_evaluate.hpp @@ -8,6 +8,11 @@ #ifndef TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED #define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4389) // '==' : signed/unsigned mismatch +#endif + namespace Catch { namespace Internal { @@ -28,6 +33,7 @@ namespace Internal { template<> struct OperatorTraits { static const char* getName(){ return "<="; } }; template<> struct OperatorTraits{ static const char* getName(){ return ">="; } }; + // So the compare overloads can be operator agnostic we convey the operator as a template // enum, which is used to specialise an Evaluator for doing the comparison. template @@ -143,8 +149,12 @@ namespace Internal { template bool compare( T* lhs, int rhs ) { return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); } - + } // end of namespace Internal } // end of namespace Catch +#ifdef _MSC_VER +#pragma warning(pop) +#endif + #endif // TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED diff --git a/include/internal/catch_running_test.hpp b/include/internal/catch_running_test.hpp index 88ac27d8..8787f8e8 100644 --- a/include/internal/catch_running_test.hpp +++ b/include/internal/catch_running_test.hpp @@ -102,6 +102,9 @@ namespace Catch { } private: + RunningTest( RunningTest const& ); + void operator=( RunningTest const& ); + const TestCase& m_info; RunStatus m_runStatus; RunningSection m_rootSection; diff --git a/include/internal/catch_test_spec.h b/include/internal/catch_test_spec.h index 4250637b..66839705 100644 --- a/include/internal/catch_test_spec.h +++ b/include/internal/catch_test_spec.h @@ -30,7 +30,7 @@ namespace Catch { WildcardAtEnd = 2, WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd }; - + public: TestCaseFilter( const std::string& testSpec, IfFilterMatches::DoWhat matchBehaviour = IfFilterMatches::AutoDetectBehaviour ) : m_stringToMatch( toLower( testSpec ) ), diff --git a/include/internal/catch_version.h b/include/internal/catch_version.h index 75b6c8f0..fed5d6b6 100644 --- a/include/internal/catch_version.h +++ b/include/internal/catch_version.h @@ -26,6 +26,9 @@ namespace Catch { const unsigned int minorVersion; const unsigned int buildNumber; const std::string branchName; + + private: + void operator=( Version const& ); }; extern Version libraryVersion; diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index ea3ea47a..042dbacc 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -97,6 +97,7 @@ namespace Catch { private: class AssertionPrinter { + void operator= ( AssertionPrinter const& ); public: AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats ) : stream( _stream ), diff --git a/projects/SelfTest/ConditionTests.cpp b/projects/SelfTest/ConditionTests.cpp index aebd123e..b298de1d 100644 --- a/projects/SelfTest/ConditionTests.cpp +++ b/projects/SelfTest/ConditionTests.cpp @@ -210,6 +210,9 @@ TEST_CASE( "./succeeding/conditions/int literals", #pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-conversion" #endif +#ifdef _MSC_VER +#pragma warning(disable:4389) // '==' : signed/unsigned mismatch +#endif TEST_CASE( "./succeeding/conditions//long_to_unsigned_x", "comparisons between int variables" ) diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp index 963af1e5..444328c3 100644 --- a/projects/SelfTest/ExceptionTests.cpp +++ b/projects/SelfTest/ExceptionTests.cpp @@ -107,6 +107,9 @@ TEST_CASE_NORETURN( "./failing/exceptions/custom", "Unexpected custom exceptions { throw CustomException( "custom exception" ); } +#ifdef _MSC_VER +#pragma warning(disable:4702) // unreachable code +#endif TEST_CASE( "./failing/exceptions/custom/nothrow", "Custom exceptions can be translated when testing for nothrow" ) { diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index c36b1060..c5647ff0 100644 --- a/projects/SelfTest/MessageTests.cpp +++ b/projects/SelfTest/MessageTests.cpp @@ -47,7 +47,7 @@ TEST_CASE( "./mixed/message/info/2", "INFO gets logged on failure" ) TEST_CASE( "./failing/message/fail", "FAIL aborts the test" ) { - if( true ) + if( Catch::isTrue( true ) ) FAIL( "This is a " << "failure" ); // This should output the message and abort } From 29426b6359af60d6a49d7d444fbfabdf401ffe14 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 25 Mar 2013 08:47:36 +0000 Subject: [PATCH 179/296] Added vector resize test --- projects/SelfTest/MiscTests.cpp | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index d0b61b0c..edbda6e1 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -292,3 +292,43 @@ TEST_CASE( "second tag", "[tag2]" ) // while ( fgets(line, 199, output) ) // std::cout << line; //} + +TEST_CASE( "vectors can be sized and resized", "[vector]" ) { + + std::vector v( 5 ); + + REQUIRE( v.size() == 5 ); + REQUIRE( v.capacity() >= 5 ); + + SECTION( "resizing bigger changes size and capacity", "" ) { + v.resize( 10 ); + + REQUIRE( v.size() == 10 ); + REQUIRE( v.capacity() >= 10 ); + } + SECTION( "resizing smaller changes size but not capacity", "" ) { + v.resize( 0 ); + + REQUIRE( v.size() == 0 ); + REQUIRE( v.capacity() >= 5 ); + + SECTION( "We can use the 'swap trick' to reset the capacity", "" ) { + std::vector empty; + empty.swap( v ); + + REQUIRE( v.capacity() == 0 ); + } + } + SECTION( "reserving bigger changes capacity but not size", "" ) { + v.reserve( 10 ); + + REQUIRE( v.size() == 5 ); + REQUIRE( v.capacity() >= 10 ); + } + SECTION( "reserving smaller does not change size or capacity", "" ) { + v.reserve( 0 ); + + REQUIRE( v.size() == 5 ); + REQUIRE( v.capacity() >= 5 ); + } +} From 2927c240a13326a978667f9ff5c87ec461089bdc Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 25 Mar 2013 09:20:51 +0000 Subject: [PATCH 180/296] Fixed line wrap bug Added line wrap tests and modified wrap algo to wrap within words using a - --- include/internal/catch_line_wrap.hpp | 10 ++++++-- projects/SelfTest/TestMain.cpp | 35 +++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp index c6e03d20..8a734fd8 100644 --- a/include/internal/catch_line_wrap.hpp +++ b/include/internal/catch_line_wrap.hpp @@ -25,8 +25,14 @@ namespace Catch { for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) { if( pos == width ) { addIndent( os, indent ); - os << paragraph.substr( 0, wrapPoint ) << "\n"; - return recursivelyWrapLine( os, paragraph.substr( wrapPoint+1 ), columns, indent+tab ); + if( paragraph[wrapPoint] == ' ' ) { + os << paragraph.substr( 0, wrapPoint ) << "\n"; + while( paragraph[++wrapPoint] == ' ' ); + } + else { + os << paragraph.substr( 0, --wrapPoint ) << "-\n"; + } + return recursivelyWrapLine( os, paragraph.substr( wrapPoint ), columns, indent+tab ); } if( paragraph[pos] == '\t' ) { tab = pos; diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index e6c3830b..45e002a8 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -10,6 +10,7 @@ #endif #include "catch_self_test.hpp" +#include "catch_line_wrap.h" TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" ) { using namespace Catch; @@ -422,5 +423,37 @@ TEST_CASE( "selftest/tags", "" ) { CHECK( oneTag.matchesTags( "~[hide]" ) == false ); } - +} + +TEST_CASE( "Long strings can be wrapped", "[wrap]" ) { + // guide: 123456789012345678 + std::string testString = "one two three four"; + + SECTION( "No wrapping", "" ) { + CHECK( Catch::wrapLongStrings( testString, 80, 0 ) == testString ); + CHECK( Catch::wrapLongStrings( testString, 18, 0 ) == testString ); + } + SECTION( "Wrapped once", "" ) { + CHECK( Catch::wrapLongStrings( testString, 17, 0 ) == "one two three\nfour" ); + CHECK( Catch::wrapLongStrings( testString, 16, 0 ) == "one two three\nfour" ); + CHECK( Catch::wrapLongStrings( testString, 15, 0 ) == "one two three\nfour" ); + CHECK( Catch::wrapLongStrings( testString, 14, 0 ) == "one two three\nfour" ); + CHECK( Catch::wrapLongStrings( testString, 13, 0 ) == "one two\nthree four" ); + } + SECTION( "Wrapped twice", "" ) { + CHECK( Catch::wrapLongStrings( testString, 9, 0 ) == "one two\nthree\nfour" ); + CHECK( Catch::wrapLongStrings( testString, 8, 0 ) == "one two\nthree\nfour" ); + } + SECTION( "Wrapped three times", "" ) { + CHECK( Catch::wrapLongStrings( testString, 7, 0 ) == "one\ntwo\nthree\nfour" ); + CHECK( Catch::wrapLongStrings( testString, 5, 0 ) == "one\ntwo\nthree\nfour" ); + } + SECTION( "Short wrap", "" ) { + CHECK( Catch::wrapLongStrings( "abcdef", 4, 0 ) == "abc-\ndef" ); + CHECK( Catch::wrapLongStrings( "abcdefg", 4, 0 ) == "abc-\ndefg" ); + CHECK( Catch::wrapLongStrings( "abcdefgh", 4, 0 ) == "abc-\ndef-\ngh" ); + + CHECK( Catch::wrapLongStrings( testString, 4, 0 ) == "one\ntwo\nthr-\nee\nfour" ); + CHECK( Catch::wrapLongStrings( testString, 3, 0 ) == "one\ntwo\nth-\nree\nfo-\nur" ); + } } From c563f6b1be28f9aa88aa34a0467f5c3cb4421352 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 25 Mar 2013 09:24:13 +0000 Subject: [PATCH 181/296] Wrap expr results if they contain newlines --- include/internal/catch_expressionresult_builder.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/internal/catch_expressionresult_builder.hpp b/include/internal/catch_expressionresult_builder.hpp index a0921c9a..c1484fb7 100644 --- a/include/internal/catch_expressionresult_builder.hpp +++ b/include/internal/catch_expressionresult_builder.hpp @@ -82,7 +82,9 @@ namespace Catch { else if( m_exprComponents.op == "matches" ) return m_exprComponents.lhs + " " + m_exprComponents.rhs; else if( m_exprComponents.op != "!" ) { - if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 ) + if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 && + m_exprComponents.lhs.find("\n") == std::string::npos && + m_exprComponents.rhs.find("\n") == std::string::npos ) return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs; else return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs; From 016b063ae83b3c301cc9f0556a0933cc1252a7c0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 25 Mar 2013 09:25:01 +0000 Subject: [PATCH 182/296] Line numbers changed and test added --- .../SelfTest/Baselines/approvedResults.txt | 2117 ++++++++++++----- 1 file changed, 1560 insertions(+), 557 deletions(-) diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index df505ae0..65371a79 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -732,25 +732,25 @@ with expansion: ./succeeding/conditions//long_to_unsigned_x ............................................................................... -ConditionTests.cpp:223: +ConditionTests.cpp:226: PASSED: REQUIRE( long_var == unsigned_char_var ) with expansion: 1 == 1 -ConditionTests.cpp:224: +ConditionTests.cpp:227: PASSED: REQUIRE( long_var == unsigned_short_var ) with expansion: 1 == 1 -ConditionTests.cpp:225: +ConditionTests.cpp:228: PASSED: REQUIRE( long_var == unsigned_int_var ) with expansion: 1 == 1 -ConditionTests.cpp:226: +ConditionTests.cpp:229: PASSED: REQUIRE( long_var == unsigned_long_var ) with expansion: @@ -760,25 +760,25 @@ with expansion: ./succeeding/conditions/const ints to int literal ............................................................................... -ConditionTests.cpp:237: +ConditionTests.cpp:240: PASSED: REQUIRE( unsigned_char_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:238: +ConditionTests.cpp:241: PASSED: REQUIRE( unsigned_short_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:239: +ConditionTests.cpp:242: PASSED: REQUIRE( unsigned_int_var == 1 ) with expansion: 1 == 1 -ConditionTests.cpp:240: +ConditionTests.cpp:243: PASSED: REQUIRE( unsigned_long_var == 1 ) with expansion: @@ -788,37 +788,37 @@ with expansion: ./succeeding/conditions/negative ints ............................................................................... -ConditionTests.cpp:246: +ConditionTests.cpp:249: PASSED: CHECK( ( -1 > 2u ) ) with expansion: true -ConditionTests.cpp:247: +ConditionTests.cpp:250: PASSED: CHECK( -1 > 2u ) with expansion: -1 > 2 -ConditionTests.cpp:249: +ConditionTests.cpp:252: PASSED: CHECK( ( 2u < -1 ) ) with expansion: true -ConditionTests.cpp:250: +ConditionTests.cpp:253: PASSED: CHECK( 2u < -1 ) with expansion: 2 < -1 -ConditionTests.cpp:253: +ConditionTests.cpp:256: PASSED: CHECK( ( minInt > 2u ) ) with expansion: true -ConditionTests.cpp:254: +ConditionTests.cpp:257: PASSED: CHECK( minInt > 2u ) with expansion: @@ -828,7 +828,7 @@ with expansion: ./succeeding/conditions/computed ints ............................................................................... -ConditionTests.cpp:269: +ConditionTests.cpp:272: PASSED: CHECK( 54 == 6*9 ) with expansion: @@ -838,49 +838,49 @@ with expansion: ./succeeding/conditions/ptr ............................................................................... -ConditionTests.cpp:285: +ConditionTests.cpp:288: PASSED: REQUIRE( p == __null ) with expansion: __null == 0 -ConditionTests.cpp:286: +ConditionTests.cpp:289: PASSED: REQUIRE( p == pNULL ) with expansion: __null == __null -ConditionTests.cpp:291: +ConditionTests.cpp:294: PASSED: REQUIRE( p != __null ) with expansion: 0x != 0 -ConditionTests.cpp:294: +ConditionTests.cpp:297: PASSED: REQUIRE( cp != __null ) with expansion: 0x != 0 -ConditionTests.cpp:297: +ConditionTests.cpp:300: PASSED: REQUIRE( cpc != __null ) with expansion: 0x != 0 -ConditionTests.cpp:299: +ConditionTests.cpp:302: PASSED: REQUIRE( returnsNull() == __null ) with expansion: {null string} == 0 -ConditionTests.cpp:300: +ConditionTests.cpp:303: PASSED: REQUIRE( returnsConstNull() == __null ) with expansion: {null string} == 0 -ConditionTests.cpp:302: +ConditionTests.cpp:305: PASSED: REQUIRE( __null != p ) with expansion: @@ -890,43 +890,43 @@ with expansion: ./succeeding/conditions/not ............................................................................... -ConditionTests.cpp:317: +ConditionTests.cpp:320: PASSED: REQUIRE( false == false ) -ConditionTests.cpp:318: +ConditionTests.cpp:321: PASSED: REQUIRE( true == true ) -ConditionTests.cpp:319: +ConditionTests.cpp:322: PASSED: REQUIRE( !false ) with expansion: true -ConditionTests.cpp:320: +ConditionTests.cpp:323: PASSED: REQUIRE_FALSE( !false ) -ConditionTests.cpp:322: +ConditionTests.cpp:325: PASSED: REQUIRE( !falseValue ) with expansion: true -ConditionTests.cpp:323: +ConditionTests.cpp:326: PASSED: REQUIRE_FALSE( !falseValue ) with expansion: !false -ConditionTests.cpp:325: +ConditionTests.cpp:328: PASSED: REQUIRE( !(1 == 2) ) with expansion: true -ConditionTests.cpp:326: +ConditionTests.cpp:329: PASSED: REQUIRE_FALSE( !1 == 2 ) with expansion: @@ -936,36 +936,36 @@ with expansion: ./failing/conditions/not ............................................................................... -ConditionTests.cpp:334: FAILED: +ConditionTests.cpp:337: FAILED: CHECK( false != false ) -ConditionTests.cpp:335: FAILED: +ConditionTests.cpp:338: FAILED: CHECK( true != true ) -ConditionTests.cpp:336: FAILED: +ConditionTests.cpp:339: FAILED: CHECK( !true ) with expansion: false -ConditionTests.cpp:337: FAILED: +ConditionTests.cpp:340: FAILED: CHECK_FALSE( !true ) -ConditionTests.cpp:339: FAILED: +ConditionTests.cpp:342: FAILED: CHECK( !trueValue ) with expansion: false -ConditionTests.cpp:340: FAILED: +ConditionTests.cpp:343: FAILED: CHECK_FALSE( !trueValue ) with expansion: !true -ConditionTests.cpp:342: FAILED: +ConditionTests.cpp:345: FAILED: CHECK( !(1 == 1) ) with expansion: false -ConditionTests.cpp:343: FAILED: +ConditionTests.cpp:346: FAILED: CHECK_FALSE( !1 == 1 ) with expansion: !(1 == 1) @@ -1053,7 +1053,7 @@ due to unexpected exception with message: ./failing/exceptions/custom/nothrow ............................................................................... -ExceptionTests.cpp:113: FAILED: +ExceptionTests.cpp:116: FAILED: REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) due to unexpected exception with message: unexpected custom exception @@ -1062,7 +1062,7 @@ due to unexpected exception with message: ./failing/exceptions/custom/throw ............................................................................... -ExceptionTests.cpp:118: FAILED: +ExceptionTests.cpp:121: FAILED: REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) due to unexpected exception with message: custom exception - not std @@ -1071,7 +1071,7 @@ due to unexpected exception with message: ./failing/exceptions/custom/double ............................................................................... -ExceptionTests.cpp:122: FAILED: +ExceptionTests.cpp:125: FAILED: due to unexpected exception with message: 3.14 @@ -1079,7 +1079,7 @@ due to unexpected exception with message: ./succeeding/exceptions/notimplemented ............................................................................... -ExceptionTests.cpp:133: +ExceptionTests.cpp:136: PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) @@ -2696,6 +2696,183 @@ second tag No assertions in test case, 'second tag' +------------------------------------------------------------------------------- +vectors can be sized and resized +............................................................................... + +MiscTests.cpp:300: +PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +MiscTests.cpp:301: +PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +vectors can be sized and resized + resizing bigger changes size and capacity +............................................................................... + +MiscTests.cpp:306: +PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +MiscTests.cpp:307: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +vectors can be sized and resized +............................................................................... + +MiscTests.cpp:300: +PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +MiscTests.cpp:301: +PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +vectors can be sized and resized + resizing smaller changes size but not capacity +............................................................................... + +MiscTests.cpp:312: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +MiscTests.cpp:313: +PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +vectors can be sized and resized + resizing smaller changes size but not capacity + We can use the 'swap trick' to reset the capacity +............................................................................... + +MiscTests.cpp:319: +PASSED: + REQUIRE( v.capacity() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +vectors can be sized and resized +............................................................................... + +MiscTests.cpp:300: +PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +MiscTests.cpp:301: +PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +vectors can be sized and resized + resizing smaller changes size but not capacity +............................................................................... + +MiscTests.cpp:312: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +MiscTests.cpp:313: +PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +vectors can be sized and resized +............................................................................... + +MiscTests.cpp:300: +PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +MiscTests.cpp:301: +PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +vectors can be sized and resized + reserving bigger changes capacity but not size +............................................................................... + +MiscTests.cpp:325: +PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +MiscTests.cpp:326: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +vectors can be sized and resized +............................................................................... + +MiscTests.cpp:300: +PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +MiscTests.cpp:301: +PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +vectors can be sized and resized + reserving smaller does not change size or capacity +............................................................................... + +MiscTests.cpp:331: +PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +MiscTests.cpp:332: +PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + ------------------------------------------------------------------------------- selftest/main selftest/expected result @@ -3082,13 +3259,13 @@ selftest/main selftest/test counts/succeeding tests ............................................................................... -TestMain.cpp:40: +TestMain.cpp:41: PASSED: CHECK( totals.assertions.passed == 296 ) with expansion: 296 == 296 -TestMain.cpp:41: +TestMain.cpp:42: PASSED: CHECK( totals.assertions.failed == 0 ) with expansion: @@ -3100,13 +3277,13 @@ selftest/main selftest/test counts/failing tests ............................................................................... -TestMain.cpp:47: +TestMain.cpp:48: PASSED: CHECK( totals.assertions.passed == 1 ) with expansion: 1 == 1 -TestMain.cpp:48: +TestMain.cpp:49: PASSED: CHECK( totals.assertions.failed == 73 ) with expansion: @@ -3116,13 +3293,13 @@ with expansion: meta/Misc/Sections ............................................................................... -TestMain.cpp:57: +TestMain.cpp:58: PASSED: CHECK( totals.assertions.passed == 2 ) with expansion: 2 == 2 -TestMain.cpp:58: +TestMain.cpp:59: PASSED: CHECK( totals.assertions.failed == 1 ) with expansion: @@ -3133,29 +3310,29 @@ selftest/parser/2 default ............................................................................... -TestMain.cpp:97: +TestMain.cpp:98: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:99: +TestMain.cpp:100: PASSED: CHECK( config.shouldDebugBreak == false ) with expansion: false == false -TestMain.cpp:100: +TestMain.cpp:101: PASSED: CHECK( config.cutoff == -1 ) with expansion: -1 == -1 -TestMain.cpp:101: +TestMain.cpp:102: PASSED: CHECK( config.allowThrows == true ) with expansion: true == true -TestMain.cpp:102: +TestMain.cpp:103: PASSED: CHECK( config.reporter.empty() ) with expansion: @@ -3167,23 +3344,23 @@ selftest/parser/2 -t/1 ............................................................................... -TestMain.cpp:108: +TestMain.cpp:109: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:110: +TestMain.cpp:111: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:111: +TestMain.cpp:112: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:112: +TestMain.cpp:113: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: @@ -3195,23 +3372,23 @@ selftest/parser/2 -t/exclude:1 ............................................................................... -TestMain.cpp:116: +TestMain.cpp:117: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:118: +TestMain.cpp:119: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:119: +TestMain.cpp:120: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:120: +TestMain.cpp:121: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: @@ -3223,23 +3400,23 @@ selftest/parser/2 --test/1 ............................................................................... -TestMain.cpp:125: +TestMain.cpp:126: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:127: +TestMain.cpp:128: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:128: +TestMain.cpp:129: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:129: +TestMain.cpp:130: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: @@ -3251,23 +3428,23 @@ selftest/parser/2 --test/exclude:1 ............................................................................... -TestMain.cpp:134: +TestMain.cpp:135: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:136: +TestMain.cpp:137: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:137: +TestMain.cpp:138: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:138: +TestMain.cpp:139: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: @@ -3279,23 +3456,23 @@ selftest/parser/2 --test/exclude:2 ............................................................................... -TestMain.cpp:143: +TestMain.cpp:144: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:145: +TestMain.cpp:146: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:146: +TestMain.cpp:147: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:147: +TestMain.cpp:148: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: @@ -3307,29 +3484,29 @@ selftest/parser/2 -t/2 ............................................................................... -TestMain.cpp:152: +TestMain.cpp:153: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:154: +TestMain.cpp:155: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:155: +TestMain.cpp:156: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:156: +TestMain.cpp:157: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true -TestMain.cpp:157: +TestMain.cpp:158: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ) with expansion: @@ -3341,7 +3518,7 @@ selftest/parser/2 -t/0 ............................................................................... -TestMain.cpp:162: +TestMain.cpp:163: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) ) with expansion: @@ -3354,11 +3531,11 @@ selftest/parser/2 -r/console ............................................................................... -TestMain.cpp:169: +TestMain.cpp:170: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:171: +TestMain.cpp:172: PASSED: REQUIRE( config.reporter == "console" ) with expansion: @@ -3370,11 +3547,11 @@ selftest/parser/2 -r/xml ............................................................................... -TestMain.cpp:175: +TestMain.cpp:176: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:177: +TestMain.cpp:178: PASSED: REQUIRE( config.reporter == "xml" ) with expansion: @@ -3386,11 +3563,11 @@ selftest/parser/2 --reporter/junit ............................................................................... -TestMain.cpp:181: +TestMain.cpp:182: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:183: +TestMain.cpp:184: PASSED: REQUIRE( config.reporter == "junit" ) with expansion: @@ -3402,7 +3579,7 @@ selftest/parser/2 -r/error ............................................................................... -TestMain.cpp:187: +TestMain.cpp:188: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) ) with expansion: @@ -3415,11 +3592,11 @@ selftest/parser/2 -b ............................................................................... -TestMain.cpp:194: +TestMain.cpp:195: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:196: +TestMain.cpp:197: PASSED: REQUIRE( config.shouldDebugBreak == true ) with expansion: @@ -3431,11 +3608,11 @@ selftest/parser/2 --break ............................................................................... -TestMain.cpp:200: +TestMain.cpp:201: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:202: +TestMain.cpp:203: PASSED: REQUIRE( config.shouldDebugBreak ) with expansion: @@ -3447,7 +3624,7 @@ selftest/parser/2 -b ............................................................................... -TestMain.cpp:206: +TestMain.cpp:207: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) ) with expansion: @@ -3460,11 +3637,11 @@ selftest/parser/2 -a ............................................................................... -TestMain.cpp:213: +TestMain.cpp:214: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:215: +TestMain.cpp:216: PASSED: REQUIRE( config.cutoff == 1 ) with expansion: @@ -3476,11 +3653,11 @@ selftest/parser/2 -a/2 ............................................................................... -TestMain.cpp:219: +TestMain.cpp:220: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:221: +TestMain.cpp:222: PASSED: REQUIRE( config.cutoff == 2 ) with expansion: @@ -3492,7 +3669,7 @@ selftest/parser/2 -a/error/0 ............................................................................... -TestMain.cpp:225: +TestMain.cpp:226: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: @@ -3505,7 +3682,7 @@ selftest/parser/2 -a/error/non numeric ............................................................................... -TestMain.cpp:229: +TestMain.cpp:230: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: @@ -3518,7 +3695,7 @@ selftest/parser/2 -a/error/two args ............................................................................... -TestMain.cpp:233: +TestMain.cpp:234: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) ) with expansion: @@ -3531,11 +3708,11 @@ selftest/parser/2 -nt ............................................................................... -TestMain.cpp:240: +TestMain.cpp:241: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:242: +TestMain.cpp:243: PASSED: REQUIRE( config.allowThrows == false ) with expansion: @@ -3547,11 +3724,11 @@ selftest/parser/2 --nothrow ............................................................................... -TestMain.cpp:246: +TestMain.cpp:247: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:248: +TestMain.cpp:249: PASSED: REQUIRE( config.allowThrows == false ) with expansion: @@ -3563,17 +3740,17 @@ selftest/parser/2 -o filename ............................................................................... -TestMain.cpp:255: +TestMain.cpp:256: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:257: +TestMain.cpp:258: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: "filename.ext" == "filename.ext" -TestMain.cpp:258: +TestMain.cpp:259: PASSED: REQUIRE( config.stream.empty() ) with expansion: @@ -3585,17 +3762,17 @@ selftest/parser/2 -o %stdout ............................................................................... -TestMain.cpp:262: +TestMain.cpp:263: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:264: +TestMain.cpp:265: PASSED: REQUIRE( config.stream == "stdout" ) with expansion: "stdout" == "stdout" -TestMain.cpp:265: +TestMain.cpp:266: PASSED: REQUIRE( config.outputFilename.empty() ) with expansion: @@ -3607,11 +3784,11 @@ selftest/parser/2 --out ............................................................................... -TestMain.cpp:269: +TestMain.cpp:270: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:271: +TestMain.cpp:272: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: @@ -3623,23 +3800,23 @@ selftest/parser/2 -a -b ............................................................................... -TestMain.cpp:278: +TestMain.cpp:279: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:280: +TestMain.cpp:281: PASSED: CHECK( config.cutoff == 1 ) with expansion: 1 == 1 -TestMain.cpp:281: +TestMain.cpp:282: PASSED: CHECK( config.shouldDebugBreak ) with expansion: true -TestMain.cpp:282: +TestMain.cpp:283: PASSED: CHECK( config.allowThrows == false ) with expansion: @@ -3649,37 +3826,37 @@ with expansion: selftest/test filter ............................................................................... -TestMain.cpp:291: +TestMain.cpp:292: PASSED: CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -TestMain.cpp:292: +TestMain.cpp:293: PASSED: CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:297: +TestMain.cpp:298: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:298: +TestMain.cpp:299: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -TestMain.cpp:300: +TestMain.cpp:301: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ) with expansion: true -TestMain.cpp:301: +TestMain.cpp:302: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ) with expansion: @@ -3689,25 +3866,25 @@ with expansion: selftest/test filters ............................................................................... -TestMain.cpp:312: +TestMain.cpp:313: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -TestMain.cpp:314: +TestMain.cpp:315: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:315: +TestMain.cpp:316: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -TestMain.cpp:316: +TestMain.cpp:317: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ) with expansion: @@ -3717,13 +3894,13 @@ with expansion: selftest/filter/prefix wildcard ............................................................................... -TestMain.cpp:322: +TestMain.cpp:323: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) with expansion: true -TestMain.cpp:323: +TestMain.cpp:324: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) with expansion: @@ -3733,25 +3910,25 @@ with expansion: selftest/filter/wildcard at both ends ............................................................................... -TestMain.cpp:328: +TestMain.cpp:329: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) with expansion: true -TestMain.cpp:329: +TestMain.cpp:330: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ) with expansion: true -TestMain.cpp:330: +TestMain.cpp:331: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ) with expansion: true -TestMain.cpp:331: +TestMain.cpp:332: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ) with expansion: @@ -3761,23 +3938,23 @@ with expansion: selftest/option parsers ............................................................................... -TestMain.cpp:351: +TestMain.cpp:352: PASSED: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) -TestMain.cpp:353: +TestMain.cpp:354: PASSED: REQUIRE( config.filters.size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:354: +TestMain.cpp:355: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:355: +TestMain.cpp:356: PASSED: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: @@ -3788,49 +3965,49 @@ selftest/tags one tag ............................................................................... -TestMain.cpp:369: +TestMain.cpp:370: PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:370: +TestMain.cpp:371: PASSED: CHECK( oneTag.hasTag( "one" ) ) with expansion: true -TestMain.cpp:371: +TestMain.cpp:372: PASSED: CHECK( oneTag.getTags().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:373: +TestMain.cpp:374: PASSED: CHECK( oneTag.matchesTags( p1 ) == true ) with expansion: true == true -TestMain.cpp:374: +TestMain.cpp:375: PASSED: CHECK( oneTag.matchesTags( p2 ) == true ) with expansion: true == true -TestMain.cpp:375: +TestMain.cpp:376: PASSED: CHECK( oneTag.matchesTags( p3 ) == false ) with expansion: false == false -TestMain.cpp:376: +TestMain.cpp:377: PASSED: CHECK( oneTag.matchesTags( p4 ) == false ) with expansion: false == false -TestMain.cpp:377: +TestMain.cpp:378: PASSED: CHECK( oneTag.matchesTags( p5 ) == false ) with expansion: @@ -3841,61 +4018,67 @@ selftest/tags two tags ............................................................................... -TestMain.cpp:383: +TestMain.cpp:384: PASSED: CHECK( twoTags.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:384: +TestMain.cpp:385: PASSED: CHECK( twoTags.hasTag( "one" ) ) with expansion: true -TestMain.cpp:385: +TestMain.cpp:386: PASSED: CHECK( twoTags.hasTag( "two" ) ) with expansion: true -TestMain.cpp:386: +TestMain.cpp:387: +PASSED: + CHECK( twoTags.hasTag( "Two" ) ) +with expansion: + true + +TestMain.cpp:388: PASSED: CHECK( twoTags.hasTag( "three" ) == false ) with expansion: false == false -TestMain.cpp:387: +TestMain.cpp:389: PASSED: CHECK( twoTags.getTags().size() == 2 ) with expansion: 2 == 2 -TestMain.cpp:389: +TestMain.cpp:391: PASSED: CHECK( twoTags.matchesTags( p1 ) == true ) with expansion: true == true -TestMain.cpp:390: +TestMain.cpp:392: PASSED: CHECK( twoTags.matchesTags( p2 ) == true ) with expansion: true == true -TestMain.cpp:391: +TestMain.cpp:393: PASSED: CHECK( twoTags.matchesTags( p3 ) == true ) with expansion: true == true -TestMain.cpp:392: +TestMain.cpp:394: PASSED: CHECK( twoTags.matchesTags( p4 ) == true ) with expansion: true == true -TestMain.cpp:393: +TestMain.cpp:395: PASSED: CHECK( twoTags.matchesTags( p5 ) == true ) with expansion: @@ -3906,25 +4089,25 @@ selftest/tags one tag with characters either side ............................................................................... -TestMain.cpp:399: +TestMain.cpp:401: PASSED: CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) with expansion: "1234" == "1234" -TestMain.cpp:400: +TestMain.cpp:402: PASSED: CHECK( oneTagWithExtras.hasTag( "one" ) ) with expansion: true -TestMain.cpp:401: +TestMain.cpp:403: PASSED: CHECK( oneTagWithExtras.hasTag( "two" ) == false ) with expansion: false == false -TestMain.cpp:402: +TestMain.cpp:404: PASSED: CHECK( oneTagWithExtras.getTags().size() == 1 ) with expansion: @@ -3935,19 +4118,19 @@ selftest/tags start of a tag, but not closed ............................................................................... -TestMain.cpp:409: +TestMain.cpp:411: PASSED: CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) with expansion: "[one" == "[one" -TestMain.cpp:410: +TestMain.cpp:412: PASSED: CHECK( oneTagOpen.hasTag( "one" ) == false ) with expansion: false == false -TestMain.cpp:411: +TestMain.cpp:413: PASSED: CHECK( oneTagOpen.getTags().size() == 0 ) with expansion: @@ -3958,30 +4141,239 @@ selftest/tags hidden ............................................................................... -TestMain.cpp:417: +TestMain.cpp:419: PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:418: +TestMain.cpp:420: PASSED: CHECK( oneTag.hasTag( "hide" ) ) with expansion: true -TestMain.cpp:419: +TestMain.cpp:421: PASSED: CHECK( oneTag.isHidden() ) with expansion: true -TestMain.cpp:421: +TestMain.cpp:423: PASSED: CHECK( oneTag.matchesTags( "~[hide]" ) == false ) with expansion: false == false +------------------------------------------------------------------------------- +Long strings can be wrapped + No wrapping +............................................................................... + +TestMain.cpp:433: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 80, 0 ) == testString ) +with expansion: + "one two three four" + == + "one two three four" + +TestMain.cpp:434: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 18, 0 ) == testString ) +with expansion: + "one two three four" + == + "one two three four" + +------------------------------------------------------------------------------- +Long strings can be wrapped + Wrapped once +............................................................................... + +TestMain.cpp:437: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 17, 0 ) == "one two three\nfour" ) +with expansion: + "one two three + four" + == + "one two three + four" + +TestMain.cpp:438: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 16, 0 ) == "one two three\nfour" ) +with expansion: + "one two three + four" + == + "one two three + four" + +TestMain.cpp:439: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 15, 0 ) == "one two three\nfour" ) +with expansion: + "one two three + four" + == + "one two three + four" + +TestMain.cpp:440: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 14, 0 ) == "one two three\nfour" ) +with expansion: + "one two three + four" + == + "one two three + four" + +TestMain.cpp:441: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 13, 0 ) == "one two\nthree four" ) +with expansion: + "one two + three four" + == + "one two + three four" + +------------------------------------------------------------------------------- +Long strings can be wrapped + Wrapped twice +............................................................................... + +TestMain.cpp:444: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 9, 0 ) == "one two\nthree\nfour" ) +with expansion: + "one two + three + four" + == + "one two + three + four" + +TestMain.cpp:445: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 8, 0 ) == "one two\nthree\nfour" ) +with expansion: + "one two + three + four" + == + "one two + three + four" + +------------------------------------------------------------------------------- +Long strings can be wrapped + Wrapped three times +............................................................................... + +TestMain.cpp:448: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 7, 0 ) == "one\ntwo\nthree\nfour" ) +with expansion: + "one + two + three + four" + == + "one + two + three + four" + +TestMain.cpp:449: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 5, 0 ) == "one\ntwo\nthree\nfour" ) +with expansion: + "one + two + three + four" + == + "one + two + three + four" + +------------------------------------------------------------------------------- +Long strings can be wrapped + Short wrap +............................................................................... + +TestMain.cpp:452: +PASSED: + CHECK( Catch::wrapLongStrings( "abcdef", 4, 0 ) == "abc-\ndef" ) +with expansion: + "abc- + def" + == + "abc- + def" + +TestMain.cpp:453: +PASSED: + CHECK( Catch::wrapLongStrings( "abcdefg", 4, 0 ) == "abc-\ndefg" ) +with expansion: + "abc- + defg" + == + "abc- + defg" + +TestMain.cpp:454: +PASSED: + CHECK( Catch::wrapLongStrings( "abcdefgh", 4, 0 ) == "abc-\ndef-\ngh" ) +with expansion: + "abc- + def- + gh" + == + "abc- + def- + gh" + +TestMain.cpp:456: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 4, 0 ) == "one\ntwo\nthr-\nee\nfour" ) +with expansion: + "one + two + thr- + ee + four" + == + "one + two + thr- + ee + four" + +TestMain.cpp:457: +PASSED: + CHECK( Catch::wrapLongStrings( testString, 3, 0 ) == "one\ntwo\nth-\nree\nfo-\nur" ) +with expansion: + "one + two + th- + ree + fo- + ur" + == + "one + two + th- + ree + fo- + ur" + ------------------------------------------------------------------------------- ./succeeding/Tricky/std::pair ............................................................................... @@ -4312,7 +4704,7 @@ with message: no assertions =============================================================================== -104 test cases - 47 failed (628 assertions - 104 failed) +106 test cases - 47 failed (666 assertions - 104 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -4607,7 +4999,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -4756,16 +5148,10 @@ ConditionTests.cpp:174 -ConditionTests.cpp:334 +ConditionTests.cpp:337 -ConditionTests.cpp:335 - - -ConditionTests.cpp:336 - - -ConditionTests.cpp:337 +ConditionTests.cpp:338 ConditionTests.cpp:339 @@ -4776,9 +5162,15 @@ ConditionTests.cpp:340 ConditionTests.cpp:342 - + ConditionTests.cpp:343 + +ConditionTests.cpp:345 + + +ConditionTests.cpp:346 + @@ -4815,17 +5207,17 @@ ExceptionTests.cpp:106 -ExceptionTests.cpp:113 +ExceptionTests.cpp:116 -ExceptionTests.cpp:118 +ExceptionTests.cpp:121 -ExceptionTests.cpp:122 +ExceptionTests.cpp:125 @@ -4990,6 +5382,7 @@ MiscTests.cpp:278 + Message from section one @@ -5012,6 +5405,7 @@ An error + @@ -6054,7 +6448,7 @@ ConditionTests.cpp" line="202"> -ConditionTests.cpp" line="223"> +ConditionTests.cpp" line="226"> long_var == unsigned_char_var @@ -6062,7 +6456,7 @@ ConditionTests.cpp" line="223"> 1 == 1 -ConditionTests.cpp" line="224"> +ConditionTests.cpp" line="227"> long_var == unsigned_short_var @@ -6070,7 +6464,7 @@ ConditionTests.cpp" line="224"> 1 == 1 -ConditionTests.cpp" line="225"> +ConditionTests.cpp" line="228"> long_var == unsigned_int_var @@ -6078,7 +6472,7 @@ ConditionTests.cpp" line="225"> 1 == 1 -ConditionTests.cpp" line="226"> +ConditionTests.cpp" line="229"> long_var == unsigned_long_var @@ -6089,7 +6483,7 @@ ConditionTests.cpp" line="226"> -ConditionTests.cpp" line="237"> +ConditionTests.cpp" line="240"> unsigned_char_var == 1 @@ -6097,7 +6491,7 @@ ConditionTests.cpp" line="237"> 1 == 1 -ConditionTests.cpp" line="238"> +ConditionTests.cpp" line="241"> unsigned_short_var == 1 @@ -6105,7 +6499,7 @@ ConditionTests.cpp" line="238"> 1 == 1 -ConditionTests.cpp" line="239"> +ConditionTests.cpp" line="242"> unsigned_int_var == 1 @@ -6113,7 +6507,7 @@ ConditionTests.cpp" line="239"> 1 == 1 -ConditionTests.cpp" line="240"> +ConditionTests.cpp" line="243"> unsigned_long_var == 1 @@ -6124,7 +6518,7 @@ ConditionTests.cpp" line="240"> -ConditionTests.cpp" line="246"> +ConditionTests.cpp" line="249"> ( -1 > 2u ) @@ -6132,7 +6526,7 @@ ConditionTests.cpp" line="246"> true -ConditionTests.cpp" line="247"> +ConditionTests.cpp" line="250"> -1 > 2u @@ -6140,7 +6534,7 @@ ConditionTests.cpp" line="247"> -1 > 2 -ConditionTests.cpp" line="249"> +ConditionTests.cpp" line="252"> ( 2u < -1 ) @@ -6148,7 +6542,7 @@ ConditionTests.cpp" line="249"> true -ConditionTests.cpp" line="250"> +ConditionTests.cpp" line="253"> 2u < -1 @@ -6156,7 +6550,7 @@ ConditionTests.cpp" line="250"> 2 < -1 -ConditionTests.cpp" line="253"> +ConditionTests.cpp" line="256"> ( minInt > 2u ) @@ -6164,7 +6558,7 @@ ConditionTests.cpp" line="253"> true -ConditionTests.cpp" line="254"> +ConditionTests.cpp" line="257"> minInt > 2u @@ -6175,7 +6569,7 @@ ConditionTests.cpp" line="254"> -ConditionTests.cpp" line="269"> +ConditionTests.cpp" line="272"> 54 == 6*9 @@ -6186,7 +6580,7 @@ ConditionTests.cpp" line="269"> -ConditionTests.cpp" line="285"> +ConditionTests.cpp" line="288"> p == __null @@ -6194,7 +6588,7 @@ ConditionTests.cpp" line="285"> __null == 0 -ConditionTests.cpp" line="286"> +ConditionTests.cpp" line="289"> p == pNULL @@ -6202,7 +6596,7 @@ ConditionTests.cpp" line="286"> __null == __null -ConditionTests.cpp" line="291"> +ConditionTests.cpp" line="294"> p != __null @@ -6210,7 +6604,7 @@ ConditionTests.cpp" line="291"> 0x != 0 -ConditionTests.cpp" line="294"> +ConditionTests.cpp" line="297"> cp != __null @@ -6218,7 +6612,7 @@ ConditionTests.cpp" line="294"> 0x != 0 -ConditionTests.cpp" line="297"> +ConditionTests.cpp" line="300"> cpc != __null @@ -6226,7 +6620,7 @@ ConditionTests.cpp" line="297"> 0x != 0 -ConditionTests.cpp" line="299"> +ConditionTests.cpp" line="302"> returnsNull() == __null @@ -6234,7 +6628,7 @@ ConditionTests.cpp" line="299"> {null string} == 0 -ConditionTests.cpp" line="300"> +ConditionTests.cpp" line="303"> returnsConstNull() == __null @@ -6242,7 +6636,7 @@ ConditionTests.cpp" line="300"> {null string} == 0 -ConditionTests.cpp" line="302"> +ConditionTests.cpp" line="305"> __null != p @@ -6253,41 +6647,25 @@ ConditionTests.cpp" line="302"> -ConditionTests.cpp" line="317"> - - false == false - - - false == false - - -ConditionTests.cpp" line="318"> - - true == true - - - true == true - - -ConditionTests.cpp" line="319"> - - !false - - - true - - ConditionTests.cpp" line="320"> - !false + false == false - !false + false == false + + +ConditionTests.cpp" line="321"> + + true == true + + + true == true ConditionTests.cpp" line="322"> - !falseValue + !false true @@ -6295,7 +6673,7 @@ ConditionTests.cpp" line="322"> ConditionTests.cpp" line="323"> - !falseValue + !false !false @@ -6303,13 +6681,29 @@ ConditionTests.cpp" line="323"> ConditionTests.cpp" line="325"> - !(1 == 2) + !falseValue true ConditionTests.cpp" line="326"> + + !falseValue + + + !false + + +ConditionTests.cpp" line="328"> + + !(1 == 2) + + + true + + +ConditionTests.cpp" line="329"> !1 == 2 @@ -6320,41 +6714,25 @@ ConditionTests.cpp" line="326"> -ConditionTests.cpp" line="334"> - - false != false - - - false != false - - -ConditionTests.cpp" line="335"> - - true != true - - - true != true - - -ConditionTests.cpp" line="336"> - - !true - - - false - - ConditionTests.cpp" line="337"> - !true + false != false - !true + false != false + + +ConditionTests.cpp" line="338"> + + true != true + + + true != true ConditionTests.cpp" line="339"> - !trueValue + !true false @@ -6362,7 +6740,7 @@ ConditionTests.cpp" line="339"> ConditionTests.cpp" line="340"> - !trueValue + !true !true @@ -6370,13 +6748,29 @@ ConditionTests.cpp" line="340"> ConditionTests.cpp" line="342"> - !(1 == 1) + !trueValue false ConditionTests.cpp" line="343"> + + !trueValue + + + !true + + +ConditionTests.cpp" line="345"> + + !(1 == 1) + + + false + + +ConditionTests.cpp" line="346"> !1 == 1 @@ -6493,41 +6887,41 @@ ExceptionTests.cpp" line="106"> -ExceptionTests.cpp" line="113"> +ExceptionTests.cpp" line="116"> throw CustomException( "unexpected custom exception" ) throw CustomException( "unexpected custom exception" ) -ExceptionTests.cpp" line="113"> +ExceptionTests.cpp" line="116"> unexpected custom exception -ExceptionTests.cpp" line="118"> +ExceptionTests.cpp" line="121"> throw CustomException( "custom exception - not std" ) throw CustomException( "custom exception - not std" ) -ExceptionTests.cpp" line="118"> +ExceptionTests.cpp" line="121"> custom exception - not std -ExceptionTests.cpp" line="122"> +ExceptionTests.cpp" line="125"> 3.14 -ExceptionTests.cpp" line="133"> +ExceptionTests.cpp" line="136"> thisFunctionNotImplemented( 7 ) @@ -8438,6 +8832,195 @@ MiscTests.cpp" line="269"> + +MiscTests.cpp" line="300"> + + v.size() == 5 + + + 5 == 5 + + +MiscTests.cpp" line="301"> + + v.capacity() >= 5 + + + 5 >= 5 + + +
+MiscTests.cpp" line="306"> + + v.size() == 10 + + + 10 == 10 + + +MiscTests.cpp" line="307"> + + v.capacity() >= 10 + + + 10 >= 10 + + + +
+MiscTests.cpp" line="300"> + + v.size() == 5 + + + 5 == 5 + + +MiscTests.cpp" line="301"> + + v.capacity() >= 5 + + + 5 >= 5 + + +
+MiscTests.cpp" line="312"> + + v.size() == 0 + + + 0 == 0 + + +MiscTests.cpp" line="313"> + + v.capacity() >= 5 + + + 5 >= 5 + + +
+MiscTests.cpp" line="319"> + + v.capacity() == 0 + + + 0 == 0 + + + +
+ +
+MiscTests.cpp" line="300"> + + v.size() == 5 + + + 5 == 5 + + +MiscTests.cpp" line="301"> + + v.capacity() >= 5 + + + 5 >= 5 + + +
+MiscTests.cpp" line="312"> + + v.size() == 0 + + + 0 == 0 + + +MiscTests.cpp" line="313"> + + v.capacity() >= 5 + + + 5 >= 5 + + + +
+MiscTests.cpp" line="300"> + + v.size() == 5 + + + 5 == 5 + + +MiscTests.cpp" line="301"> + + v.capacity() >= 5 + + + 5 >= 5 + + +
+MiscTests.cpp" line="325"> + + v.size() == 5 + + + 5 == 5 + + +MiscTests.cpp" line="326"> + + v.capacity() >= 10 + + + 10 >= 10 + + + +
+MiscTests.cpp" line="300"> + + v.size() == 5 + + + 5 == 5 + + +MiscTests.cpp" line="301"> + + v.capacity() >= 5 + + + 5 >= 5 + + +
+MiscTests.cpp" line="331"> + + v.size() == 5 + + + 5 == 5 + + +MiscTests.cpp" line="332"> + + v.capacity() >= 5 + + + 5 >= 5 + + + +
+ +
@@ -8456,7 +9039,7 @@ MiscTests.cpp" line="269">
-TestMain.cpp" line="40"> +TestMain.cpp" line="41"> totals.assertions.passed == 296 @@ -8464,7 +9047,7 @@ TestMain.cpp" line="40"> 296 == 296 -TestMain.cpp" line="41"> +TestMain.cpp" line="42"> totals.assertions.failed == 0 @@ -8478,7 +9061,7 @@ TestMain.cpp" line="41">
-TestMain.cpp" line="47"> +TestMain.cpp" line="48"> totals.assertions.passed == 1 @@ -8486,7 +9069,7 @@ TestMain.cpp" line="47"> 1 == 1 -TestMain.cpp" line="48"> +TestMain.cpp" line="49"> totals.assertions.failed == 73 @@ -8501,7 +9084,7 @@ TestMain.cpp" line="48"> -TestMain.cpp" line="57"> +TestMain.cpp" line="58"> totals.assertions.passed == 2 @@ -8509,7 +9092,7 @@ TestMain.cpp" line="57"> 2 == 2 -TestMain.cpp" line="58"> +TestMain.cpp" line="59"> totals.assertions.failed == 1 @@ -8521,7 +9104,7 @@ TestMain.cpp" line="58">
-TestMain.cpp" line="97"> +TestMain.cpp" line="98"> parseIntoConfig( argv, config ) @@ -8529,7 +9112,7 @@ TestMain.cpp" line="97"> parseIntoConfig( argv, config ) -TestMain.cpp" line="99"> +TestMain.cpp" line="100"> config.shouldDebugBreak == false @@ -8537,7 +9120,7 @@ TestMain.cpp" line="99"> false == false -TestMain.cpp" line="100"> +TestMain.cpp" line="101"> config.cutoff == -1 @@ -8545,7 +9128,7 @@ TestMain.cpp" line="100"> -1 == -1 -TestMain.cpp" line="101"> +TestMain.cpp" line="102"> config.allowThrows == true @@ -8553,7 +9136,7 @@ TestMain.cpp" line="101"> true == true -TestMain.cpp" line="102"> +TestMain.cpp" line="103"> config.reporter.empty() @@ -8565,7 +9148,7 @@ TestMain.cpp" line="102">
-TestMain.cpp" line="108"> +TestMain.cpp" line="109"> parseIntoConfig( argv, config ) @@ -8573,7 +9156,7 @@ TestMain.cpp" line="108"> parseIntoConfig( argv, config ) -TestMain.cpp" line="110"> +TestMain.cpp" line="111"> config.filters.size() == 1 @@ -8581,7 +9164,7 @@ TestMain.cpp" line="110"> 1 == 1 -TestMain.cpp" line="111"> +TestMain.cpp" line="112"> config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false @@ -8589,7 +9172,7 @@ TestMain.cpp" line="111"> false == false -TestMain.cpp" line="112"> +TestMain.cpp" line="113"> config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) @@ -8603,7 +9186,7 @@ TestMain.cpp" line="112">
-TestMain.cpp" line="116"> +TestMain.cpp" line="117"> parseIntoConfig( argv, config ) @@ -8611,7 +9194,7 @@ TestMain.cpp" line="116"> parseIntoConfig( argv, config ) -TestMain.cpp" line="118"> +TestMain.cpp" line="119"> config.filters.size() == 1 @@ -8619,7 +9202,7 @@ TestMain.cpp" line="118"> 1 == 1 -TestMain.cpp" line="119"> +TestMain.cpp" line="120"> config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false @@ -8627,7 +9210,7 @@ TestMain.cpp" line="119"> false == false -TestMain.cpp" line="120"> +TestMain.cpp" line="121"> config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) @@ -8641,7 +9224,7 @@ TestMain.cpp" line="120">
-TestMain.cpp" line="125"> +TestMain.cpp" line="126"> parseIntoConfig( argv, config ) @@ -8649,7 +9232,7 @@ TestMain.cpp" line="125"> parseIntoConfig( argv, config ) -TestMain.cpp" line="127"> +TestMain.cpp" line="128"> config.filters.size() == 1 @@ -8657,7 +9240,7 @@ TestMain.cpp" line="127"> 1 == 1 -TestMain.cpp" line="128"> +TestMain.cpp" line="129"> config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false @@ -8665,7 +9248,7 @@ TestMain.cpp" line="128"> false == false -TestMain.cpp" line="129"> +TestMain.cpp" line="130"> config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) @@ -8679,7 +9262,7 @@ TestMain.cpp" line="129">
-TestMain.cpp" line="134"> +TestMain.cpp" line="135"> parseIntoConfig( argv, config ) @@ -8687,7 +9270,7 @@ TestMain.cpp" line="134"> parseIntoConfig( argv, config ) -TestMain.cpp" line="136"> +TestMain.cpp" line="137"> config.filters.size() == 1 @@ -8695,7 +9278,7 @@ TestMain.cpp" line="136"> 1 == 1 -TestMain.cpp" line="137"> +TestMain.cpp" line="138"> config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false @@ -8703,7 +9286,7 @@ TestMain.cpp" line="137"> false == false -TestMain.cpp" line="138"> +TestMain.cpp" line="139"> config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) @@ -8717,7 +9300,7 @@ TestMain.cpp" line="138">
-TestMain.cpp" line="143"> +TestMain.cpp" line="144"> parseIntoConfig( argv, config ) @@ -8725,7 +9308,7 @@ TestMain.cpp" line="143"> parseIntoConfig( argv, config ) -TestMain.cpp" line="145"> +TestMain.cpp" line="146"> config.filters.size() == 1 @@ -8733,7 +9316,7 @@ TestMain.cpp" line="145"> 1 == 1 -TestMain.cpp" line="146"> +TestMain.cpp" line="147"> config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false @@ -8741,7 +9324,7 @@ TestMain.cpp" line="146"> false == false -TestMain.cpp" line="147"> +TestMain.cpp" line="148"> config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) @@ -8755,7 +9338,7 @@ TestMain.cpp" line="147">
-TestMain.cpp" line="152"> +TestMain.cpp" line="153"> parseIntoConfig( argv, config ) @@ -8763,7 +9346,7 @@ TestMain.cpp" line="152"> parseIntoConfig( argv, config ) -TestMain.cpp" line="154"> +TestMain.cpp" line="155"> config.filters.size() == 1 @@ -8771,7 +9354,7 @@ TestMain.cpp" line="154"> 1 == 1 -TestMain.cpp" line="155"> +TestMain.cpp" line="156"> config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false @@ -8779,7 +9362,7 @@ TestMain.cpp" line="155"> false == false -TestMain.cpp" line="156"> +TestMain.cpp" line="157"> config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) @@ -8787,7 +9370,7 @@ TestMain.cpp" line="156"> true -TestMain.cpp" line="157"> +TestMain.cpp" line="158"> config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) @@ -8801,7 +9384,7 @@ TestMain.cpp" line="157">
-TestMain.cpp" line="162"> +TestMain.cpp" line="163"> parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) @@ -8818,7 +9401,7 @@ TestMain.cpp" line="162">
-TestMain.cpp" line="169"> +TestMain.cpp" line="170"> parseIntoConfig( argv, config ) @@ -8826,7 +9409,7 @@ TestMain.cpp" line="169"> parseIntoConfig( argv, config ) -TestMain.cpp" line="171"> +TestMain.cpp" line="172"> config.reporter == "console" @@ -8840,7 +9423,7 @@ TestMain.cpp" line="171">
-TestMain.cpp" line="175"> +TestMain.cpp" line="176"> parseIntoConfig( argv, config ) @@ -8848,7 +9431,7 @@ TestMain.cpp" line="175"> parseIntoConfig( argv, config ) -TestMain.cpp" line="177"> +TestMain.cpp" line="178"> config.reporter == "xml" @@ -8862,7 +9445,7 @@ TestMain.cpp" line="177">
-TestMain.cpp" line="181"> +TestMain.cpp" line="182"> parseIntoConfig( argv, config ) @@ -8870,7 +9453,7 @@ TestMain.cpp" line="181"> parseIntoConfig( argv, config ) -TestMain.cpp" line="183"> +TestMain.cpp" line="184"> config.reporter == "junit" @@ -8884,7 +9467,7 @@ TestMain.cpp" line="183">
-TestMain.cpp" line="187"> +TestMain.cpp" line="188"> parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) @@ -8901,7 +9484,7 @@ TestMain.cpp" line="187">
-TestMain.cpp" line="194"> +TestMain.cpp" line="195"> parseIntoConfig( argv, config ) @@ -8909,7 +9492,7 @@ TestMain.cpp" line="194"> parseIntoConfig( argv, config ) -TestMain.cpp" line="196"> +TestMain.cpp" line="197"> config.shouldDebugBreak == true @@ -8923,7 +9506,7 @@ TestMain.cpp" line="196">
-TestMain.cpp" line="200"> +TestMain.cpp" line="201"> parseIntoConfig( argv, config ) @@ -8931,7 +9514,7 @@ TestMain.cpp" line="200"> parseIntoConfig( argv, config ) -TestMain.cpp" line="202"> +TestMain.cpp" line="203"> config.shouldDebugBreak @@ -8945,7 +9528,7 @@ TestMain.cpp" line="202">
-TestMain.cpp" line="206"> +TestMain.cpp" line="207"> parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) @@ -8962,7 +9545,7 @@ TestMain.cpp" line="206">
-TestMain.cpp" line="213"> +TestMain.cpp" line="214"> parseIntoConfig( argv, config ) @@ -8970,7 +9553,7 @@ TestMain.cpp" line="213"> parseIntoConfig( argv, config ) -TestMain.cpp" line="215"> +TestMain.cpp" line="216"> config.cutoff == 1 @@ -8984,7 +9567,7 @@ TestMain.cpp" line="215">
-TestMain.cpp" line="219"> +TestMain.cpp" line="220"> parseIntoConfig( argv, config ) @@ -8992,7 +9575,7 @@ TestMain.cpp" line="219"> parseIntoConfig( argv, config ) -TestMain.cpp" line="221"> +TestMain.cpp" line="222"> config.cutoff == 2 @@ -9006,7 +9589,7 @@ TestMain.cpp" line="221">
-TestMain.cpp" line="225"> +TestMain.cpp" line="226"> parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) @@ -9020,7 +9603,7 @@ TestMain.cpp" line="225">
-TestMain.cpp" line="229"> +TestMain.cpp" line="230"> parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) @@ -9034,7 +9617,7 @@ TestMain.cpp" line="229">
-TestMain.cpp" line="233"> +TestMain.cpp" line="234"> parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) @@ -9051,7 +9634,7 @@ TestMain.cpp" line="233">
-TestMain.cpp" line="240"> +TestMain.cpp" line="241"> parseIntoConfig( argv, config ) @@ -9059,7 +9642,7 @@ TestMain.cpp" line="240"> parseIntoConfig( argv, config ) -TestMain.cpp" line="242"> +TestMain.cpp" line="243"> config.allowThrows == false @@ -9073,7 +9656,7 @@ TestMain.cpp" line="242">
-TestMain.cpp" line="246"> +TestMain.cpp" line="247"> parseIntoConfig( argv, config ) @@ -9081,7 +9664,7 @@ TestMain.cpp" line="246"> parseIntoConfig( argv, config ) -TestMain.cpp" line="248"> +TestMain.cpp" line="249"> config.allowThrows == false @@ -9098,7 +9681,7 @@ TestMain.cpp" line="248">
-TestMain.cpp" line="255"> +TestMain.cpp" line="256"> parseIntoConfig( argv, config ) @@ -9106,7 +9689,7 @@ TestMain.cpp" line="255"> parseIntoConfig( argv, config ) -TestMain.cpp" line="257"> +TestMain.cpp" line="258"> config.outputFilename == "filename.ext" @@ -9114,7 +9697,7 @@ TestMain.cpp" line="257"> "filename.ext" == "filename.ext" -TestMain.cpp" line="258"> +TestMain.cpp" line="259"> config.stream.empty() @@ -9128,7 +9711,7 @@ TestMain.cpp" line="258">
-TestMain.cpp" line="262"> +TestMain.cpp" line="263"> parseIntoConfig( argv, config ) @@ -9136,7 +9719,7 @@ TestMain.cpp" line="262"> parseIntoConfig( argv, config ) -TestMain.cpp" line="264"> +TestMain.cpp" line="265"> config.stream == "stdout" @@ -9144,7 +9727,7 @@ TestMain.cpp" line="264"> "stdout" == "stdout" -TestMain.cpp" line="265"> +TestMain.cpp" line="266"> config.outputFilename.empty() @@ -9158,7 +9741,7 @@ TestMain.cpp" line="265">
-TestMain.cpp" line="269"> +TestMain.cpp" line="270"> parseIntoConfig( argv, config ) @@ -9166,7 +9749,7 @@ TestMain.cpp" line="269"> parseIntoConfig( argv, config ) -TestMain.cpp" line="271"> +TestMain.cpp" line="272"> config.outputFilename == "filename.ext" @@ -9183,7 +9766,7 @@ TestMain.cpp" line="271">
-TestMain.cpp" line="278"> +TestMain.cpp" line="279"> parseIntoConfig( argv, config ) @@ -9191,7 +9774,7 @@ TestMain.cpp" line="278"> parseIntoConfig( argv, config ) -TestMain.cpp" line="280"> +TestMain.cpp" line="281"> config.cutoff == 1 @@ -9199,7 +9782,7 @@ TestMain.cpp" line="280"> 1 == 1 -TestMain.cpp" line="281"> +TestMain.cpp" line="282"> config.shouldDebugBreak @@ -9207,7 +9790,7 @@ TestMain.cpp" line="281"> true -TestMain.cpp" line="282"> +TestMain.cpp" line="283"> config.allowThrows == false @@ -9222,7 +9805,7 @@ TestMain.cpp" line="282"> -TestMain.cpp" line="291"> +TestMain.cpp" line="292"> matchAny.shouldInclude( fakeTestCase( "any" ) ) @@ -9230,7 +9813,7 @@ TestMain.cpp" line="291"> true -TestMain.cpp" line="292"> +TestMain.cpp" line="293"> matchNone.shouldInclude( fakeTestCase( "any" ) ) == false @@ -9238,7 +9821,7 @@ TestMain.cpp" line="292"> false == false -TestMain.cpp" line="297"> +TestMain.cpp" line="298"> matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false @@ -9246,7 +9829,7 @@ TestMain.cpp" line="297"> false == false -TestMain.cpp" line="298"> +TestMain.cpp" line="299"> matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) @@ -9254,7 +9837,7 @@ TestMain.cpp" line="298"> true -TestMain.cpp" line="300"> +TestMain.cpp" line="301"> matchHidden.shouldInclude( fakeTestCase( "./any" ) ) @@ -9262,7 +9845,7 @@ TestMain.cpp" line="300"> true -TestMain.cpp" line="301"> +TestMain.cpp" line="302"> matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false @@ -9273,7 +9856,7 @@ TestMain.cpp" line="301"> -TestMain.cpp" line="312"> +TestMain.cpp" line="313"> matchHidden.shouldInclude( fakeTestCase( "./something" ) ) @@ -9281,7 +9864,7 @@ TestMain.cpp" line="312"> true -TestMain.cpp" line="314"> +TestMain.cpp" line="315"> filters.shouldInclude( fakeTestCase( "any" ) ) == false @@ -9289,7 +9872,7 @@ TestMain.cpp" line="314"> false == false -TestMain.cpp" line="315"> +TestMain.cpp" line="316"> filters.shouldInclude( fakeTestCase( "./something" ) ) @@ -9297,7 +9880,7 @@ TestMain.cpp" line="315"> true -TestMain.cpp" line="316"> +TestMain.cpp" line="317"> filters.shouldInclude( fakeTestCase( "./anything" ) ) == false @@ -9308,7 +9891,7 @@ TestMain.cpp" line="316"> -TestMain.cpp" line="322"> +TestMain.cpp" line="323"> matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) @@ -9316,7 +9899,7 @@ TestMain.cpp" line="322"> true -TestMain.cpp" line="323"> +TestMain.cpp" line="324"> matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false @@ -9327,7 +9910,7 @@ TestMain.cpp" line="323"> -TestMain.cpp" line="328"> +TestMain.cpp" line="329"> matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) @@ -9335,7 +9918,7 @@ TestMain.cpp" line="328"> true -TestMain.cpp" line="329"> +TestMain.cpp" line="330"> matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) @@ -9343,7 +9926,7 @@ TestMain.cpp" line="329"> true -TestMain.cpp" line="330"> +TestMain.cpp" line="331"> matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) @@ -9351,7 +9934,7 @@ TestMain.cpp" line="330"> true -TestMain.cpp" line="331"> +TestMain.cpp" line="332"> matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false @@ -9362,7 +9945,7 @@ TestMain.cpp" line="331"> -TestMain.cpp" line="351"> +TestMain.cpp" line="352"> opt.parseIntoConfig( parser, config ) @@ -9370,7 +9953,7 @@ TestMain.cpp" line="351"> opt.parseIntoConfig( parser, config ) -TestMain.cpp" line="353"> +TestMain.cpp" line="354"> config.filters.size() == 1 @@ -9378,7 +9961,7 @@ TestMain.cpp" line="353"> 1 == 1 -TestMain.cpp" line="354"> +TestMain.cpp" line="355"> config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false @@ -9386,7 +9969,7 @@ TestMain.cpp" line="354"> false == false -TestMain.cpp" line="355"> +TestMain.cpp" line="356"> config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) @@ -9398,7 +9981,7 @@ TestMain.cpp" line="355">
-TestMain.cpp" line="369"> +TestMain.cpp" line="370"> oneTag.getTestCaseInfo().description == "" @@ -9406,7 +9989,7 @@ TestMain.cpp" line="369"> "" == "" -TestMain.cpp" line="370"> +TestMain.cpp" line="371"> oneTag.hasTag( "one" ) @@ -9414,7 +9997,7 @@ TestMain.cpp" line="370"> true -TestMain.cpp" line="371"> +TestMain.cpp" line="372"> oneTag.getTags().size() == 1 @@ -9422,7 +10005,7 @@ TestMain.cpp" line="371"> 1 == 1 -TestMain.cpp" line="373"> +TestMain.cpp" line="374"> oneTag.matchesTags( p1 ) == true @@ -9430,7 +10013,7 @@ TestMain.cpp" line="373"> true == true -TestMain.cpp" line="374"> +TestMain.cpp" line="375"> oneTag.matchesTags( p2 ) == true @@ -9438,7 +10021,7 @@ TestMain.cpp" line="374"> true == true -TestMain.cpp" line="375"> +TestMain.cpp" line="376"> oneTag.matchesTags( p3 ) == false @@ -9446,7 +10029,7 @@ TestMain.cpp" line="375"> false == false -TestMain.cpp" line="376"> +TestMain.cpp" line="377"> oneTag.matchesTags( p4 ) == false @@ -9454,7 +10037,7 @@ TestMain.cpp" line="376"> false == false -TestMain.cpp" line="377"> +TestMain.cpp" line="378"> oneTag.matchesTags( p5 ) == false @@ -9465,7 +10048,7 @@ TestMain.cpp" line="377">
-TestMain.cpp" line="383"> +TestMain.cpp" line="384"> twoTags.getTestCaseInfo().description == "" @@ -9473,7 +10056,7 @@ TestMain.cpp" line="383"> "" == "" -TestMain.cpp" line="384"> +TestMain.cpp" line="385"> twoTags.hasTag( "one" ) @@ -9481,7 +10064,7 @@ TestMain.cpp" line="384"> true -TestMain.cpp" line="385"> +TestMain.cpp" line="386"> twoTags.hasTag( "two" ) @@ -9489,7 +10072,15 @@ TestMain.cpp" line="385"> true -TestMain.cpp" line="386"> +TestMain.cpp" line="387"> + + twoTags.hasTag( "Two" ) + + + true + + +TestMain.cpp" line="388"> twoTags.hasTag( "three" ) == false @@ -9497,7 +10088,7 @@ TestMain.cpp" line="386"> false == false -TestMain.cpp" line="387"> +TestMain.cpp" line="389"> twoTags.getTags().size() == 2 @@ -9505,7 +10096,7 @@ TestMain.cpp" line="387"> 2 == 2 -TestMain.cpp" line="389"> +TestMain.cpp" line="391"> twoTags.matchesTags( p1 ) == true @@ -9513,7 +10104,7 @@ TestMain.cpp" line="389"> true == true -TestMain.cpp" line="390"> +TestMain.cpp" line="392"> twoTags.matchesTags( p2 ) == true @@ -9521,7 +10112,7 @@ TestMain.cpp" line="390"> true == true -TestMain.cpp" line="391"> +TestMain.cpp" line="393"> twoTags.matchesTags( p3 ) == true @@ -9529,7 +10120,7 @@ TestMain.cpp" line="391"> true == true -TestMain.cpp" line="392"> +TestMain.cpp" line="394"> twoTags.matchesTags( p4 ) == true @@ -9537,7 +10128,7 @@ TestMain.cpp" line="392"> true == true -TestMain.cpp" line="393"> +TestMain.cpp" line="395"> twoTags.matchesTags( p5 ) == true @@ -9545,10 +10136,10 @@ TestMain.cpp" line="393"> true == true - +
-TestMain.cpp" line="399"> +TestMain.cpp" line="401"> oneTagWithExtras.getTestCaseInfo().description == "1234" @@ -9556,7 +10147,7 @@ TestMain.cpp" line="399"> "1234" == "1234" -TestMain.cpp" line="400"> +TestMain.cpp" line="402"> oneTagWithExtras.hasTag( "one" ) @@ -9564,7 +10155,7 @@ TestMain.cpp" line="400"> true -TestMain.cpp" line="401"> +TestMain.cpp" line="403"> oneTagWithExtras.hasTag( "two" ) == false @@ -9572,7 +10163,7 @@ TestMain.cpp" line="401"> false == false -TestMain.cpp" line="402"> +TestMain.cpp" line="404"> oneTagWithExtras.getTags().size() == 1 @@ -9583,7 +10174,7 @@ TestMain.cpp" line="402">
-TestMain.cpp" line="409"> +TestMain.cpp" line="411"> oneTagOpen.getTestCaseInfo().description == "[one" @@ -9591,7 +10182,7 @@ TestMain.cpp" line="409"> "[one" == "[one" -TestMain.cpp" line="410"> +TestMain.cpp" line="412"> oneTagOpen.hasTag( "one" ) == false @@ -9599,7 +10190,7 @@ TestMain.cpp" line="410"> false == false -TestMain.cpp" line="411"> +TestMain.cpp" line="413"> oneTagOpen.getTags().size() == 0 @@ -9610,7 +10201,7 @@ TestMain.cpp" line="411">
-TestMain.cpp" line="417"> +TestMain.cpp" line="419"> oneTag.getTestCaseInfo().description == "" @@ -9618,7 +10209,7 @@ TestMain.cpp" line="417"> "" == "" -TestMain.cpp" line="418"> +TestMain.cpp" line="420"> oneTag.hasTag( "hide" ) @@ -9626,7 +10217,7 @@ TestMain.cpp" line="418"> true -TestMain.cpp" line="419"> +TestMain.cpp" line="421"> oneTag.isHidden() @@ -9634,7 +10225,7 @@ TestMain.cpp" line="419"> true -TestMain.cpp" line="421"> +TestMain.cpp" line="423"> oneTag.matchesTags( "~[hide]" ) == false @@ -9646,6 +10237,240 @@ TestMain.cpp" line="421">
+ +
+TestMain.cpp" line="433"> + + Catch::wrapLongStrings( testString, 80, 0 ) == testString + + + "one two three four" +== +"one two three four" + + +TestMain.cpp" line="434"> + + Catch::wrapLongStrings( testString, 18, 0 ) == testString + + + "one two three four" +== +"one two three four" + + + +
+
+TestMain.cpp" line="437"> + + Catch::wrapLongStrings( testString, 17, 0 ) == "one two three\nfour" + + + "one two three +four" +== +"one two three +four" + + +TestMain.cpp" line="438"> + + Catch::wrapLongStrings( testString, 16, 0 ) == "one two three\nfour" + + + "one two three +four" +== +"one two three +four" + + +TestMain.cpp" line="439"> + + Catch::wrapLongStrings( testString, 15, 0 ) == "one two three\nfour" + + + "one two three +four" +== +"one two three +four" + + +TestMain.cpp" line="440"> + + Catch::wrapLongStrings( testString, 14, 0 ) == "one two three\nfour" + + + "one two three +four" +== +"one two three +four" + + +TestMain.cpp" line="441"> + + Catch::wrapLongStrings( testString, 13, 0 ) == "one two\nthree four" + + + "one two +three four" +== +"one two +three four" + + + +
+
+TestMain.cpp" line="444"> + + Catch::wrapLongStrings( testString, 9, 0 ) == "one two\nthree\nfour" + + + "one two +three +four" +== +"one two +three +four" + + +TestMain.cpp" line="445"> + + Catch::wrapLongStrings( testString, 8, 0 ) == "one two\nthree\nfour" + + + "one two +three +four" +== +"one two +three +four" + + + +
+
+TestMain.cpp" line="448"> + + Catch::wrapLongStrings( testString, 7, 0 ) == "one\ntwo\nthree\nfour" + + + "one +two +three +four" +== +"one +two +three +four" + + +TestMain.cpp" line="449"> + + Catch::wrapLongStrings( testString, 5, 0 ) == "one\ntwo\nthree\nfour" + + + "one +two +three +four" +== +"one +two +three +four" + + + +
+
+TestMain.cpp" line="452"> + + Catch::wrapLongStrings( "abcdef", 4, 0 ) == "abc-\ndef" + + + "abc- +def" +== +"abc- +def" + + +TestMain.cpp" line="453"> + + Catch::wrapLongStrings( "abcdefg", 4, 0 ) == "abc-\ndefg" + + + "abc- +defg" +== +"abc- +defg" + + +TestMain.cpp" line="454"> + + Catch::wrapLongStrings( "abcdefgh", 4, 0 ) == "abc-\ndef-\ngh" + + + "abc- +def- +gh" +== +"abc- +def- +gh" + + +TestMain.cpp" line="456"> + + Catch::wrapLongStrings( testString, 4, 0 ) == "one\ntwo\nthr-\nee\nfour" + + + "one +two +thr- +ee +four" +== +"one +two +thr- +ee +four" + + +TestMain.cpp" line="457"> + + Catch::wrapLongStrings( testString, 3, 0 ) == "one\ntwo\nth-\nree\nfo-\nur" + + + "one +two +th- +ree +fo- +ur" +== +"one +two +th- +ree +fo- +ur" + + + +
+ +
TrickyTests.cpp" line="37"> @@ -9977,9 +10802,9 @@ BDDTests.cpp" line="23">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -10155,63 +10980,63 @@ ConditionTests.cpp:202: (std::numeric_limits::max)() > ul succeed [Finished: './succeeding/conditions/int literals' All tests passed (13 assertions in 1 test case)] [Running: ./succeeding/conditions//long_to_unsigned_x] -ConditionTests.cpp:223: long_var == unsigned_char_var succeeded for: 1 == 1 -ConditionTests.cpp:224: long_var == unsigned_short_var succeeded for: 1 == 1 -ConditionTests.cpp:225: long_var == unsigned_int_var succeeded for: 1 == 1 -ConditionTests.cpp:226: long_var == unsigned_long_var succeeded for: 1 == 1 +ConditionTests.cpp:226: long_var == unsigned_char_var succeeded for: 1 == 1 +ConditionTests.cpp:227: long_var == unsigned_short_var succeeded for: 1 == 1 +ConditionTests.cpp:228: long_var == unsigned_int_var succeeded for: 1 == 1 +ConditionTests.cpp:229: 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/const ints to int literal] -ConditionTests.cpp:237: unsigned_char_var == 1 succeeded for: 1 == 1 -ConditionTests.cpp:238: unsigned_short_var == 1 succeeded for: 1 == 1 -ConditionTests.cpp:239: unsigned_int_var == 1 succeeded for: 1 == 1 -ConditionTests.cpp:240: unsigned_long_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:240: unsigned_char_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:241: unsigned_short_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:242: unsigned_int_var == 1 succeeded for: 1 == 1 +ConditionTests.cpp:243: unsigned_long_var == 1 succeeded for: 1 == 1 [Finished: './succeeding/conditions/const ints to int literal' All tests passed (4 assertions in 1 test case)] [Running: ./succeeding/conditions/negative ints] -ConditionTests.cpp:246: ( -1 > 2u ) succeeded for: true -ConditionTests.cpp:247: -1 > 2u succeeded for: -1 > 2 -ConditionTests.cpp:249: ( 2u < -1 ) succeeded for: true -ConditionTests.cpp:250: 2u < -1 succeeded for: 2 < -1 -ConditionTests.cpp:253: ( minInt > 2u ) succeeded for: true -ConditionTests.cpp:254: minInt > 2u succeeded for: -2147483648 > 2 +ConditionTests.cpp:249: ( -1 > 2u ) succeeded for: true +ConditionTests.cpp:250: -1 > 2u succeeded for: -1 > 2 +ConditionTests.cpp:252: ( 2u < -1 ) succeeded for: true +ConditionTests.cpp:253: 2u < -1 succeeded for: 2 < -1 +ConditionTests.cpp:256: ( minInt > 2u ) succeeded for: true +ConditionTests.cpp:257: 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] -ConditionTests.cpp:269: 54 == 6*9 succeeded for: 54 == 54 +ConditionTests.cpp:272: 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] -ConditionTests.cpp:285: p == __null succeeded for: __null == 0 -ConditionTests.cpp:286: p == pNULL succeeded for: __null == __null -ConditionTests.cpp:291: p != __null succeeded for: 0x != 0 -ConditionTests.cpp:294: cp != __null succeeded for: 0x != 0 -ConditionTests.cpp:297: cpc != __null succeeded for: 0x != 0 -ConditionTests.cpp:299: returnsNull() == __null succeeded for: {null string} == 0 -ConditionTests.cpp:300: returnsConstNull() == __null succeeded for: {null string} == 0 -ConditionTests.cpp:302: __null != p succeeded for: 0 != 0x +ConditionTests.cpp:288: p == __null succeeded for: __null == 0 +ConditionTests.cpp:289: p == pNULL succeeded for: __null == __null +ConditionTests.cpp:294: p != __null succeeded for: 0x != 0 +ConditionTests.cpp:297: cp != __null succeeded for: 0x != 0 +ConditionTests.cpp:300: cpc != __null succeeded for: 0x != 0 +ConditionTests.cpp:302: returnsNull() == __null succeeded for: {null string} == 0 +ConditionTests.cpp:303: returnsConstNull() == __null succeeded for: {null string} == 0 +ConditionTests.cpp:305: __null != p succeeded for: 0 != 0x [Finished: './succeeding/conditions/ptr' All tests passed (8 assertions in 1 test case)] [Running: ./succeeding/conditions/not] -ConditionTests.cpp:317: false == false succeeded -ConditionTests.cpp:318: true == true succeeded -ConditionTests.cpp:319: !false succeeded for: true -ConditionTests.cpp:320: !false succeeded -ConditionTests.cpp:322: !falseValue succeeded for: true -ConditionTests.cpp:323: !falseValue succeeded for: !false -ConditionTests.cpp:325: !(1 == 2) succeeded for: true -ConditionTests.cpp:326: !1 == 2 succeeded for: !(1 == 2) +ConditionTests.cpp:320: false == false succeeded +ConditionTests.cpp:321: true == true succeeded +ConditionTests.cpp:322: !false succeeded for: true +ConditionTests.cpp:323: !false succeeded +ConditionTests.cpp:325: !falseValue succeeded for: true +ConditionTests.cpp:326: !falseValue succeeded for: !false +ConditionTests.cpp:328: !(1 == 2) succeeded for: true +ConditionTests.cpp:329: !1 == 2 succeeded for: !(1 == 2) [Finished: './succeeding/conditions/not' All tests passed (8 assertions in 1 test case)] [Running: ./failing/conditions/not] -ConditionTests.cpp:334: false != false failed -ConditionTests.cpp:335: true != true failed -ConditionTests.cpp:336: !true failed for: false -ConditionTests.cpp:337: !true failed -ConditionTests.cpp:339: !trueValue failed for: false -ConditionTests.cpp:340: !trueValue failed for: !true -ConditionTests.cpp:342: !(1 == 1) failed for: false -ConditionTests.cpp:343: !1 == 1 failed for: !(1 == 1) +ConditionTests.cpp:337: false != false failed +ConditionTests.cpp:338: true != true failed +ConditionTests.cpp:339: !true failed for: false +ConditionTests.cpp:340: !true failed +ConditionTests.cpp:342: !trueValue failed for: false +ConditionTests.cpp:343: !trueValue failed for: !true +ConditionTests.cpp:345: !(1 == 1) failed for: false +ConditionTests.cpp:346: !1 == 1 failed for: !(1 == 1) [Finished: './failing/conditions/not' 1 test case failed (All 8 assertions failed)] [Running: ./succeeding/exceptions/explicit] @@ -10254,19 +11079,19 @@ ExceptionTests.cpp:106: Unexpected exception with message: 'custom exception' [Finished: './failing/exceptions/custom' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/custom/nothrow] -ExceptionTests.cpp:113: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' +ExceptionTests.cpp:116: 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] -ExceptionTests.cpp:118: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' +ExceptionTests.cpp:121: 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] -ExceptionTests.cpp:122: Unexpected exception with message: '3.14' +ExceptionTests.cpp:125: Unexpected exception with message: '3.14' [Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] [Running: ./succeeding/exceptions/notimplemented] -ExceptionTests.cpp:133: thisFunctionNotImplemented( 7 ) succeeded +ExceptionTests.cpp:136: thisFunctionNotImplemented( 7 ) succeeded [Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/generators/1] @@ -10741,6 +11566,48 @@ No assertions in test case, 'second tag' [Finished: 'second tag' 1 test case failed (1 assertion failed)] +[Running: vectors can be sized and resized] +MiscTests.cpp:300: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:301: v.capacity() >= 5 succeeded for: 5 >= 5 +[Started section: 'resizing bigger changes size and capacity'] +MiscTests.cpp:306: v.size() == 10 succeeded for: 10 == 10 +MiscTests.cpp:307: v.capacity() >= 10 succeeded for: 10 >= 10 +[End of section: 'resizing bigger changes size and capacity' All 2 assertions passed] + +MiscTests.cpp:300: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:301: v.capacity() >= 5 succeeded for: 5 >= 5 +[Started section: 'resizing smaller changes size but not capacity'] +MiscTests.cpp:312: v.size() == 0 succeeded for: 0 == 0 +MiscTests.cpp:313: v.capacity() >= 5 succeeded for: 5 >= 5 +[Started section: 'We can use the 'swap trick' to reset the capacity'] +MiscTests.cpp:319: v.capacity() == 0 succeeded for: 0 == 0 +[End of section: 'We can use the 'swap trick' to reset the capacity' 1 assertion passed] + +[End of section: 'resizing smaller changes size but not capacity' All 3 assertions passed] + +MiscTests.cpp:300: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:301: v.capacity() >= 5 succeeded for: 5 >= 5 +[Started section: 'resizing smaller changes size but not capacity'] +MiscTests.cpp:312: v.size() == 0 succeeded for: 0 == 0 +MiscTests.cpp:313: v.capacity() >= 5 succeeded for: 5 >= 5 +[End of section: 'resizing smaller changes size but not capacity' All 2 assertions passed] + +MiscTests.cpp:300: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:301: v.capacity() >= 5 succeeded for: 5 >= 5 +[Started section: 'reserving bigger changes capacity but not size'] +MiscTests.cpp:325: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:326: v.capacity() >= 10 succeeded for: 10 >= 10 +[End of section: 'reserving bigger changes capacity but not size' All 2 assertions passed] + +MiscTests.cpp:300: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:301: v.capacity() >= 5 succeeded for: 5 >= 5 +[Started section: 'reserving smaller does not change size or capacity'] +MiscTests.cpp:331: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:332: v.capacity() >= 5 succeeded for: 5 >= 5 +[End of section: 'reserving smaller does not change size or capacity' All 2 assertions passed] + +[Finished: 'vectors can be sized and resized' All tests passed (21 assertions in 1 test case)] + [Running: selftest/main] [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/failing tests'] @@ -10908,16 +11775,16 @@ Some information An error [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/succeeding tests'] -TestMain.cpp:40: totals.assertions.passed == 296 succeeded for: 296 == 296 -TestMain.cpp:41: totals.assertions.failed == 0 succeeded for: 0 == 0 +TestMain.cpp:41: totals.assertions.passed == 296 succeeded for: 296 == 296 +TestMain.cpp:42: totals.assertions.failed == 0 succeeded for: 0 == 0 [End of section: 'selftest/test counts/succeeding tests' All 2 assertions passed] [End of section: 'selftest/test counts' All 2 assertions passed] [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/failing tests'] -TestMain.cpp:47: totals.assertions.passed == 1 succeeded for: 1 == 1 -TestMain.cpp:48: totals.assertions.failed == 73 succeeded for: 73 == 73 +TestMain.cpp:48: totals.assertions.passed == 1 succeeded for: 1 == 1 +TestMain.cpp:49: totals.assertions.failed == 73 succeeded for: 73 == 73 [End of section: 'selftest/test counts/failing tests' All 2 assertions passed] [End of section: 'selftest/test counts' All 2 assertions passed] @@ -10925,83 +11792,83 @@ TestMain.cpp:48: totals.assertions.failed == 73 succeeded for: 73 == 73 [Finished: 'selftest/main' All tests passed (76 assertions in 1 test case)] [Running: meta/Misc/Sections] -TestMain.cpp:57: totals.assertions.passed == 2 succeeded for: 2 == 2 -TestMain.cpp:58: totals.assertions.failed == 1 succeeded for: 1 == 1 +TestMain.cpp:58: totals.assertions.passed == 2 succeeded for: 2 == 2 +TestMain.cpp:59: totals.assertions.failed == 1 succeeded for: 1 == 1 [Finished: 'meta/Misc/Sections' All tests passed (2 assertions in 1 test case)] [Running: selftest/parser/2] [Started section: 'default'] -TestMain.cpp:97: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:99: config.shouldDebugBreak == false succeeded for: false == false -TestMain.cpp:100: config.cutoff == -1 succeeded for: -1 == -1 -TestMain.cpp:101: config.allowThrows == true succeeded for: true == true -TestMain.cpp:102: config.reporter.empty() succeeded for: true +TestMain.cpp:98: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:100: config.shouldDebugBreak == false succeeded for: false == false +TestMain.cpp:101: config.cutoff == -1 succeeded for: -1 == -1 +TestMain.cpp:102: config.allowThrows == true succeeded for: true == true +TestMain.cpp:103: config.reporter.empty() succeeded for: true [End of section: 'default' All 5 assertions passed] [Started section: 'test lists'] [Started section: '-t/1'] -TestMain.cpp:108: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:110: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:111: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:112: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:109: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:111: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:112: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:113: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [End of section: '-t/1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '-t/exclude:1'] -TestMain.cpp:116: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:118: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:119: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:120: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:117: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:119: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:120: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:121: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '-t/exclude:1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '--test/1'] -TestMain.cpp:125: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:127: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:128: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:129: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:126: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:128: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:129: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:130: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [End of section: '--test/1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '--test/exclude:1'] -TestMain.cpp:134: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:136: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:137: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:138: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:135: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:137: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:138: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:139: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '--test/exclude:1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '--test/exclude:2'] -TestMain.cpp:143: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:145: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:146: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:147: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:144: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:146: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:147: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:148: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '--test/exclude:2' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '-t/2'] -TestMain.cpp:152: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:154: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:155: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:156: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -TestMain.cpp:157: config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true +TestMain.cpp:153: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:155: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:156: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:157: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:158: config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true [End of section: '-t/2' All 5 assertions passed] [End of section: 'test lists' All 5 assertions passed] [Started section: 'test lists'] [Started section: '-t/0'] -TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: +TestMain.cpp:163: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" [End of section: '-t/0' 1 assertion passed] @@ -11009,31 +11876,31 @@ TestMain.cpp:162: parseIntoConfigAndReturnError( argv, config ) Contains( "at le [Started section: 'reporter'] [Started section: '-r/console'] -TestMain.cpp:169: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:171: config.reporter == "console" succeeded for: "console" == "console" +TestMain.cpp:170: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:172: config.reporter == "console" succeeded for: "console" == "console" [End of section: '-r/console' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '-r/xml'] -TestMain.cpp:175: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:177: config.reporter == "xml" succeeded for: "xml" == "xml" +TestMain.cpp:176: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:178: config.reporter == "xml" succeeded for: "xml" == "xml" [End of section: '-r/xml' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '--reporter/junit'] -TestMain.cpp:181: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:183: config.reporter == "junit" succeeded for: "junit" == "junit" +TestMain.cpp:182: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:184: config.reporter == "junit" succeeded for: "junit" == "junit" [End of section: '--reporter/junit' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '-r/error'] -TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: +TestMain.cpp:188: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" [End of section: '-r/error' 1 assertion passed] @@ -11041,23 +11908,23 @@ TestMain.cpp:187: parseIntoConfigAndReturnError( argv, config ) Contains( "1 arg [Started section: 'debugger'] [Started section: '-b'] -TestMain.cpp:194: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:196: config.shouldDebugBreak == true succeeded for: true == true +TestMain.cpp:195: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:197: config.shouldDebugBreak == true succeeded for: true == true [End of section: '-b' All 2 assertions passed] [End of section: 'debugger' All 2 assertions passed] [Started section: 'debugger'] [Started section: '--break'] -TestMain.cpp:200: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:202: config.shouldDebugBreak succeeded for: true +TestMain.cpp:201: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:203: config.shouldDebugBreak succeeded for: true [End of section: '--break' All 2 assertions passed] [End of section: 'debugger' All 2 assertions passed] [Started section: 'debugger'] [Started section: '-b'] -TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: +TestMain.cpp:207: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" [End of section: '-b' 1 assertion passed] @@ -11065,23 +11932,23 @@ TestMain.cpp:206: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arg [Started section: 'abort'] [Started section: '-a'] -TestMain.cpp:213: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:215: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:214: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:216: config.cutoff == 1 succeeded for: 1 == 1 [End of section: '-a' All 2 assertions passed] [End of section: 'abort' All 2 assertions passed] [Started section: 'abort'] [Started section: '-a/2'] -TestMain.cpp:219: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:221: config.cutoff == 2 succeeded for: 2 == 2 +TestMain.cpp:220: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:222: config.cutoff == 2 succeeded for: 2 == 2 [End of section: '-a/2' All 2 assertions passed] [End of section: 'abort' All 2 assertions passed] [Started section: 'abort'] [Started section: '-a/error/0'] -TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +TestMain.cpp:226: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" [End of section: '-a/error/0' 1 assertion passed] @@ -11089,7 +11956,7 @@ TestMain.cpp:225: parseIntoConfigAndReturnError( argv, config ) Contains( "great [Started section: 'abort'] [Started section: '-a/error/non numeric'] -TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +TestMain.cpp:230: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" [End of section: '-a/error/non numeric' 1 assertion passed] @@ -11097,7 +11964,7 @@ TestMain.cpp:229: parseIntoConfigAndReturnError( argv, config ) Contains( "great [Started section: 'abort'] [Started section: '-a/error/two args'] -TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: +TestMain.cpp:234: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" [End of section: '-a/error/two args' 1 assertion passed] @@ -11105,52 +11972,52 @@ TestMain.cpp:233: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and [Started section: 'nothrow'] [Started section: '-nt'] -TestMain.cpp:240: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:242: config.allowThrows == false succeeded for: false == false +TestMain.cpp:241: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:243: config.allowThrows == false succeeded for: false == false [End of section: '-nt' All 2 assertions passed] [End of section: 'nothrow' All 2 assertions passed] [Started section: 'nothrow'] [Started section: '--nothrow'] -TestMain.cpp:246: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:248: config.allowThrows == false succeeded for: false == false +TestMain.cpp:247: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:249: config.allowThrows == false succeeded for: false == false [End of section: '--nothrow' All 2 assertions passed] [End of section: 'nothrow' All 2 assertions passed] [Started section: 'streams'] [Started section: '-o filename'] -TestMain.cpp:255: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:257: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -TestMain.cpp:258: config.stream.empty() succeeded for: true +TestMain.cpp:256: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:258: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:259: config.stream.empty() succeeded for: true [End of section: '-o filename' All 3 assertions passed] [End of section: 'streams' All 3 assertions passed] [Started section: 'streams'] [Started section: '-o %stdout'] -TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:264: config.stream == "stdout" succeeded for: "stdout" == "stdout" -TestMain.cpp:265: config.outputFilename.empty() succeeded for: true +TestMain.cpp:263: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:265: config.stream == "stdout" succeeded for: "stdout" == "stdout" +TestMain.cpp:266: config.outputFilename.empty() succeeded for: true [End of section: '-o %stdout' All 3 assertions passed] [End of section: 'streams' All 3 assertions passed] [Started section: 'streams'] [Started section: '--out'] -TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:271: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:270: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:272: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" [End of section: '--out' All 2 assertions passed] [End of section: 'streams' All 2 assertions passed] [Started section: 'combinations'] [Started section: '-a -b'] -TestMain.cpp:278: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:280: config.cutoff == 1 succeeded for: 1 == 1 -TestMain.cpp:281: config.shouldDebugBreak succeeded for: true -TestMain.cpp:282: config.allowThrows == false succeeded for: false == false +TestMain.cpp:279: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:281: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:282: config.shouldDebugBreak succeeded for: true +TestMain.cpp:283: config.allowThrows == false succeeded for: false == false [End of section: '-a -b' All 4 assertions passed] [End of section: 'combinations' All 4 assertions passed] @@ -11158,86 +12025,222 @@ TestMain.cpp:282: config.allowThrows == false succeeded for: false == false [Finished: 'selftest/parser/2' All tests passed (66 assertions in 1 test case)] [Running: selftest/test filter] -TestMain.cpp:291: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -TestMain.cpp:292: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:297: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:298: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -TestMain.cpp:300: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true -TestMain.cpp:301: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false +TestMain.cpp:292: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:293: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:298: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:299: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:301: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true +TestMain.cpp:302: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false [Finished: 'selftest/test filter' All tests passed (6 assertions in 1 test case)] [Running: selftest/test filters] -TestMain.cpp:312: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -TestMain.cpp:314: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -TestMain.cpp:316: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false +TestMain.cpp:313: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:316: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:317: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false [Finished: 'selftest/test filters' All tests passed (4 assertions in 1 test case)] [Running: selftest/filter/prefix wildcard] -TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -TestMain.cpp:323: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false +TestMain.cpp:323: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:324: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/prefix wildcard' All tests passed (2 assertions in 1 test case)] [Running: selftest/filter/wildcard at both ends] -TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true -TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true -TestMain.cpp:331: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false +TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true +TestMain.cpp:331: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true +TestMain.cpp:332: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/wildcard at both ends' All tests passed (4 assertions in 1 test case)] [Running: selftest/option parsers] -TestMain.cpp:351: opt.parseIntoConfig( parser, config ) succeeded -TestMain.cpp:353: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:354: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:355: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:352: opt.parseIntoConfig( parser, config ) succeeded +TestMain.cpp:354: config.filters.size() == 1 succeeded for: 1 == 1 +TestMain.cpp:355: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:356: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [Finished: 'selftest/option parsers' All tests passed (4 assertions in 1 test case)] [Running: selftest/tags] [Started section: 'one tag'] -TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:370: oneTag.hasTag( "one" ) succeeded for: true -TestMain.cpp:371: oneTag.getTags().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:373: oneTag.matchesTags( p1 ) == true succeeded for: true == true -TestMain.cpp:374: oneTag.matchesTags( p2 ) == true succeeded for: true == true -TestMain.cpp:375: oneTag.matchesTags( p3 ) == false succeeded for: false == false -TestMain.cpp:376: oneTag.matchesTags( p4 ) == false succeeded for: false == false -TestMain.cpp:377: oneTag.matchesTags( p5 ) == false succeeded for: false == false +TestMain.cpp:370: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:371: oneTag.hasTag( "one" ) succeeded for: true +TestMain.cpp:372: oneTag.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:374: oneTag.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:375: oneTag.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:376: oneTag.matchesTags( p3 ) == false succeeded for: false == false +TestMain.cpp:377: oneTag.matchesTags( p4 ) == false succeeded for: false == false +TestMain.cpp:378: oneTag.matchesTags( p5 ) == false succeeded for: false == false [End of section: 'one tag' All 8 assertions passed] [Started section: 'two tags'] -TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:384: twoTags.hasTag( "one" ) succeeded for: true -TestMain.cpp:385: twoTags.hasTag( "two" ) succeeded for: true -TestMain.cpp:386: twoTags.hasTag( "three" ) == false succeeded for: false == false -TestMain.cpp:387: twoTags.getTags().size() == 2 succeeded for: 2 == 2 -TestMain.cpp:389: twoTags.matchesTags( p1 ) == true succeeded for: true == true -TestMain.cpp:390: twoTags.matchesTags( p2 ) == true succeeded for: true == true -TestMain.cpp:391: twoTags.matchesTags( p3 ) == true succeeded for: true == true -TestMain.cpp:392: twoTags.matchesTags( p4 ) == true succeeded for: true == true -TestMain.cpp:393: twoTags.matchesTags( p5 ) == true succeeded for: true == true -[End of section: 'two tags' All 10 assertions passed] +TestMain.cpp:384: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:385: twoTags.hasTag( "one" ) succeeded for: true +TestMain.cpp:386: twoTags.hasTag( "two" ) succeeded for: true +TestMain.cpp:387: twoTags.hasTag( "Two" ) succeeded for: true +TestMain.cpp:388: twoTags.hasTag( "three" ) == false succeeded for: false == false +TestMain.cpp:389: twoTags.getTags().size() == 2 succeeded for: 2 == 2 +TestMain.cpp:391: twoTags.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:392: twoTags.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:393: twoTags.matchesTags( p3 ) == true succeeded for: true == true +TestMain.cpp:394: twoTags.matchesTags( p4 ) == true succeeded for: true == true +TestMain.cpp:395: twoTags.matchesTags( p5 ) == true succeeded for: true == true +[End of section: 'two tags' All 11 assertions passed] [Started section: 'one tag with characters either side'] -TestMain.cpp:399: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" -TestMain.cpp:400: oneTagWithExtras.hasTag( "one" ) succeeded for: true -TestMain.cpp:401: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false -TestMain.cpp:402: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:401: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" +TestMain.cpp:402: oneTagWithExtras.hasTag( "one" ) succeeded for: true +TestMain.cpp:403: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false +TestMain.cpp:404: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 [End of section: 'one tag with characters either side' All 4 assertions passed] [Started section: 'start of a tag, but not closed'] -TestMain.cpp:409: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" -TestMain.cpp:410: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false -TestMain.cpp:411: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 +TestMain.cpp:411: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" +TestMain.cpp:412: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false +TestMain.cpp:413: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 [End of section: 'start of a tag, but not closed' All 3 assertions passed] [Started section: 'hidden'] -TestMain.cpp:417: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:418: oneTag.hasTag( "hide" ) succeeded for: true -TestMain.cpp:419: oneTag.isHidden() succeeded for: true -TestMain.cpp:421: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false +TestMain.cpp:419: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:420: oneTag.hasTag( "hide" ) succeeded for: true +TestMain.cpp:421: oneTag.isHidden() succeeded for: true +TestMain.cpp:423: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false [End of section: 'hidden' All 4 assertions passed] -[Finished: 'selftest/tags' All tests passed (29 assertions in 1 test case)] +[Finished: 'selftest/tags' All tests passed (30 assertions in 1 test case)] + +[Running: Long strings can be wrapped] +[Started section: 'No wrapping'] +TestMain.cpp:433: Catch::wrapLongStrings( testString, 80, 0 ) == testString succeeded for: + "one two three four" +== +"one two three four" +TestMain.cpp:434: Catch::wrapLongStrings( testString, 18, 0 ) == testString succeeded for: + "one two three four" +== +"one two three four" +[End of section: 'No wrapping' All 2 assertions passed] + +[Started section: 'Wrapped once'] +TestMain.cpp:437: Catch::wrapLongStrings( testString, 17, 0 ) == "one two three\nfour" succeeded for: + "one two three +four" +== +"one two three +four" +TestMain.cpp:438: Catch::wrapLongStrings( testString, 16, 0 ) == "one two three\nfour" succeeded for: + "one two three +four" +== +"one two three +four" +TestMain.cpp:439: Catch::wrapLongStrings( testString, 15, 0 ) == "one two three\nfour" succeeded for: + "one two three +four" +== +"one two three +four" +TestMain.cpp:440: Catch::wrapLongStrings( testString, 14, 0 ) == "one two three\nfour" succeeded for: + "one two three +four" +== +"one two three +four" +TestMain.cpp:441: Catch::wrapLongStrings( testString, 13, 0 ) == "one two\nthree four" succeeded for: + "one two +three four" +== +"one two +three four" +[End of section: 'Wrapped once' All 5 assertions passed] + +[Started section: 'Wrapped twice'] +TestMain.cpp:444: Catch::wrapLongStrings( testString, 9, 0 ) == "one two\nthree\nfour" succeeded for: + "one two +three +four" +== +"one two +three +four" +TestMain.cpp:445: Catch::wrapLongStrings( testString, 8, 0 ) == "one two\nthree\nfour" succeeded for: + "one two +three +four" +== +"one two +three +four" +[End of section: 'Wrapped twice' All 2 assertions passed] + +[Started section: 'Wrapped three times'] +TestMain.cpp:448: Catch::wrapLongStrings( testString, 7, 0 ) == "one\ntwo\nthree\nfour" succeeded for: + "one +two +three +four" +== +"one +two +three +four" +TestMain.cpp:449: Catch::wrapLongStrings( testString, 5, 0 ) == "one\ntwo\nthree\nfour" succeeded for: + "one +two +three +four" +== +"one +two +three +four" +[End of section: 'Wrapped three times' All 2 assertions passed] + +[Started section: 'Short wrap'] +TestMain.cpp:452: Catch::wrapLongStrings( "abcdef", 4, 0 ) == "abc-\ndef" succeeded for: "abc- +def" +== +"abc- +def" +TestMain.cpp:453: Catch::wrapLongStrings( "abcdefg", 4, 0 ) == "abc-\ndefg" succeeded for: "abc- +defg" +== +"abc- +defg" +TestMain.cpp:454: Catch::wrapLongStrings( "abcdefgh", 4, 0 ) == "abc-\ndef-\ngh" succeeded for: "abc- +def- +gh" +== +"abc- +def- +gh" +TestMain.cpp:456: Catch::wrapLongStrings( testString, 4, 0 ) == "one\ntwo\nthr-\nee\nfour" succeeded for: + "one +two +thr- +ee +four" +== +"one +two +thr- +ee +four" +TestMain.cpp:457: Catch::wrapLongStrings( testString, 3, 0 ) == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: + "one +two +th- +ree +fo- +ur" +== +"one +two +th- +ree +fo- +ur" +[End of section: 'Short wrap' All 5 assertions passed] + +[Finished: 'Long strings can be wrapped' All tests passed (16 assertions in 1 test case)] [Running: ./succeeding/Tricky/std::pair] TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: std::pair( 1, 2 ) == std::pair( 1, 2 ) @@ -11374,10 +12377,10 @@ VariadicMacrosTests.cpp:26: succeeded [End of section: 'Section with one argument' 1 assertion passed] [Finished: 'Variadic macros' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 47 of 104 test cases failed (104 of 628 assertions failed)] +[End of group: '~dummy'. 47 of 106 test cases failed (104 of 666 assertions failed)] -[Testing completed. 47 of 104 test cases failed (104 of 628 assertions failed)] +[Testing completed. 47 of 106 test cases failed (104 of 666 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] From dd26e889b528a8275e4a2395f896dec211103ea6 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 25 Mar 2013 09:25:31 +0000 Subject: [PATCH 183/296] Build 28 --- README.md | 2 +- include/internal/catch_list.hpp | 4 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 63 ++++++++++++++++++++---------- 4 files changed, 47 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 1be39d0b..329c4592 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 27 (integration branch) +## CATCH v0.9 build 28 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 50fce992..af53992c 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -45,9 +45,9 @@ namespace Catch { if( matchesFilters( config.filters, *it ) ) { matchedTests++; // !TBD: consider listAs() - std::cout << "\t" << it->getTestCaseInfo().name << "\n"; + std::cout << " " << it->getTestCaseInfo().name << "\n"; if( ( config.listSpec & List::TestNames ) != List::TestNames ) - std::cout << "\t\t '" << it->getTestCaseInfo().description << "'\n"; + std::cout << " '" << it->getTestCaseInfo().description << "'\n"; } } if( config.filters.empty() ) diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 9f8a669f..9e61b30e 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 27, "integration" ); + Version libraryVersion( 0, 9, 28, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 28baa440..3027eba8 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 27 (integration branch) - * Generated: 2013-03-21 08:59:28.031778 + * CATCH v0.9 build 28 (integration branch) + * Generated: 2013-03-25 09:25:14.678493 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -107,9 +107,14 @@ namespace Catch { inline bool contains( const std::string& s, const std::string& infix ) { return s.find( infix ) != std::string::npos; } - inline void toLower( std::string& s ) { + inline void toLowerInPlace( std::string& s ) { std::transform( s.begin(), s.end(), s.begin(), ::tolower ); } + inline std::string toLower( std::string const& s ) { + std::string lc = s; + toLowerInPlace( lc ); + return lc; + } struct pluralise { pluralise( std::size_t count, const std::string& label ) @@ -825,6 +830,11 @@ namespace Catch { // #included from: catch_evaluate.hpp #define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4389) // '==' : signed/unsigned mismatch +#endif + namespace Catch { namespace Internal { @@ -964,6 +974,10 @@ namespace Internal { } // end of namespace Internal } // end of namespace Catch +#ifdef _MSC_VER +#pragma warning(pop) +#endif + namespace Catch { // Wraps the (stringised versions of) the lhs, operator and rhs of an expression - as well as @@ -1507,9 +1521,7 @@ namespace Catch { private: virtual void acceptTag( const std::string& tag ) { - std::string lcTag = tag; - toLower( lcTag ); - m_tags.insert( lcTag ); + m_tags.insert( toLower( tag ) ); } virtual void acceptChar( char c ) { m_remainder += c; @@ -1552,9 +1564,7 @@ namespace Catch { typedef std::map TagMap; public: void add( const Tag& tag ) { - std::string tagName = tag.getName(); - toLower( tagName ); - m_tags.insert( std::make_pair( tagName, tag ) ); + m_tags.insert( std::make_pair( toLower( tag.getName() ), tag ) ); } bool empty() const { @@ -1652,12 +1662,10 @@ namespace Catch { public: TestCaseFilter( const std::string& testSpec, IfFilterMatches::DoWhat matchBehaviour = IfFilterMatches::AutoDetectBehaviour ) - : m_stringToMatch( testSpec ), + : m_stringToMatch( toLower( testSpec ) ), m_filterType( matchBehaviour ), m_wildcardPosition( NoWildcard ) { - toLower( m_stringToMatch ); - if( m_filterType == IfFilterMatches::AutoDetectBehaviour ) { if( startsWith( m_stringToMatch, "exclude:" ) ) { m_stringToMatch = m_stringToMatch.substr( 8 ); @@ -1698,7 +1706,7 @@ namespace Catch { bool isMatch( const TestCase& testCase ) const { std::string name = testCase.getTestCaseInfo().name; - toLower( name ); + toLowerInPlace( name ); switch( m_wildcardPosition ) { case NoWildcard: @@ -4172,9 +4180,9 @@ namespace Catch { if( matchesFilters( config.filters, *it ) ) { matchedTests++; // !TBD: consider listAs() - std::cout << "\t" << it->getTestCaseInfo().name << "\n"; + std::cout << " " << it->getTestCaseInfo().name << "\n"; if( ( config.listSpec & List::TestNames ) != List::TestNames ) - std::cout << "\t\t '" << it->getTestCaseInfo().description << "'\n"; + std::cout << " '" << it->getTestCaseInfo().description << "'\n"; } } if( config.filters.empty() ) @@ -4392,6 +4400,9 @@ namespace Catch { } private: + RunningTest( RunningTest const& ); + void operator=( RunningTest const& ); + const TestCase& m_info; RunStatus m_runStatus; RunningSection m_rootSection; @@ -4729,6 +4740,9 @@ namespace Catch { const unsigned int minorVersion; const unsigned int buildNumber; const std::string branchName; + + private: + void operator=( Version const& ); }; extern Version libraryVersion; @@ -5778,7 +5792,9 @@ namespace Catch { else if( m_exprComponents.op == "matches" ) return m_exprComponents.lhs + " " + m_exprComponents.rhs; else if( m_exprComponents.op != "!" ) { - if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 ) + if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 && + m_exprComponents.lhs.find("\n") == std::string::npos && + m_exprComponents.rhs.find("\n") == std::string::npos ) return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs; else return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs; @@ -5856,7 +5872,7 @@ namespace Catch { } bool TestCase::hasTag( const std::string& tag ) const { - return tags.find( tag ) != tags.end(); + return tags.find( toLower( tag ) ) != tags.end(); } bool TestCase::matchesTags( const std::string& tagPattern ) const { TagExpression exp; @@ -5903,7 +5919,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 27, "integration" ); + Version libraryVersion( 0, 9, 28, "integration" ); } // #included from: catch_line_wrap.hpp @@ -5924,8 +5940,14 @@ namespace Catch { for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) { if( pos == width ) { addIndent( os, indent ); - os << paragraph.substr( 0, wrapPoint ) << "\n"; - return recursivelyWrapLine( os, paragraph.substr( wrapPoint+1 ), columns, indent+tab ); + if( paragraph[wrapPoint] == ' ' ) { + os << paragraph.substr( 0, wrapPoint ) << "\n"; + while( paragraph[++wrapPoint] == ' ' ); + } + else { + os << paragraph.substr( 0, --wrapPoint ) << "-\n"; + } + return recursivelyWrapLine( os, paragraph.substr( wrapPoint ), columns, indent+tab ); } if( paragraph[pos] == '\t' ) { tab = pos; @@ -7071,6 +7093,7 @@ namespace Catch { private: class AssertionPrinter { + void operator= ( AssertionPrinter const& ); public: AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats ) : stream( _stream ), From b052bd729af9f46b378c7e9ffc3f74f81b5cbb93 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 27 Mar 2013 19:08:16 +0000 Subject: [PATCH 184/296] Refactored string wrapper - to be much more flexible (writes to vector) - fixed a couple of bugs --- include/catch_runner.hpp | 2 +- include/internal/catch_line_wrap.h | 32 +- include/internal/catch_line_wrap.hpp | 121 ++- include/reporters/catch_reporter_console.hpp | 11 +- .../SelfTest/Baselines/approvedResults.txt | 871 +++++++++++++----- projects/SelfTest/TestMain.cpp | 85 +- 6 files changed, 806 insertions(+), 316 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index edceeccb..6d63b878 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -161,7 +161,7 @@ namespace Catch { displayedSpecificOption = true; std::cout << "\n" << opt.optionNames() << " " << opt.argsSynopsis() << "\n\n" << opt.optionSummary() << "\n\n" - << wrapLongStrings( opt.optionDescription(), 80, 2 ) << "\n" << std::endl; + << LineWrapper().setIndent( 2 ).wrap( opt.optionDescription() ).toString() << "\n" << std::endl; } } diff --git a/include/internal/catch_line_wrap.h b/include/internal/catch_line_wrap.h index 1197fb0b..e08dada1 100644 --- a/include/internal/catch_line_wrap.h +++ b/include/internal/catch_line_wrap.h @@ -9,11 +9,39 @@ #define TWOBLUECUBES_CATCH_LINE_WRAP_H_INCLUDED #include +#include namespace Catch { - void wrapLongStrings( std::ostream& stream, const std::string& str, std::size_t columns, std::size_t indent = 0 ); - std::string wrapLongStrings( const std::string& str, std::size_t columns, std::size_t indent = 0 ); + class LineWrapper { + public: + LineWrapper( std::size_t _indent, std::size_t _right ); + LineWrapper( std::size_t _right ); + LineWrapper(); + + LineWrapper& setIndent( std::size_t _indent ); + LineWrapper& setRight( std::size_t _right ); + + LineWrapper& wrap( std::string const& _str ); + + std::ostream& intoStream( std::ostream& stream ) const; + std::string toString() const; + + typedef std::vector::const_iterator const_iterator; + + const_iterator begin() const { return lines.begin(); } + const_iterator end() const { return lines.end(); } + + private: + void wrapInternal( std::string const& _str ); + void addLine( const std::string& _line ); + + std::string indent; + std::size_t right; + std::size_t nextTab; + std::size_t tab; + std::vector lines; + }; } // end namespace Catch diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp index 8a734fd8..bb8247d9 100644 --- a/include/internal/catch_line_wrap.hpp +++ b/include/internal/catch_line_wrap.hpp @@ -12,60 +12,91 @@ namespace Catch { - namespace { - inline void addIndent( std::ostream& os, std::size_t indent ) { - while( indent-- > 0 ) - os << ' '; - } - - inline void recursivelyWrapLine( std::ostream& os, std::string paragraph, std::size_t columns, std::size_t indent ) { - std::size_t width = columns-indent; - std::size_t tab = 0; - std::size_t wrapPoint = width; - for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) { - if( pos == width ) { - addIndent( os, indent ); - if( paragraph[wrapPoint] == ' ' ) { - os << paragraph.substr( 0, wrapPoint ) << "\n"; - while( paragraph[++wrapPoint] == ' ' ); - } - else { - os << paragraph.substr( 0, --wrapPoint ) << "-\n"; - } - return recursivelyWrapLine( os, paragraph.substr( wrapPoint ), columns, indent+tab ); + + LineWrapper::LineWrapper( std::size_t _indent, std::size_t _right ) + : indent( _indent, ' ' ), + right( _right ), + nextTab( 0 ), + tab( 0 ) + {} + LineWrapper::LineWrapper( std::size_t _right ) + : right( _right ), + nextTab( 0 ), + tab( 0 ) + {} + LineWrapper::LineWrapper() + : right( CATCH_CONFIG_CONSOLE_WIDTH-1 ), + nextTab( 0 ), + tab( 0 ) + {} + + LineWrapper& LineWrapper::setIndent( std::size_t _indent ) { + indent = std::string( _indent, ' ' ); + return *this; + } + LineWrapper& LineWrapper::setRight( std::size_t _right ) { + right = _right; + return *this; + } + LineWrapper& LineWrapper::wrap( std::string const& _str ) { + nextTab = tab = 0; + wrapInternal( _str ); + return *this; + } + void LineWrapper::wrapInternal( std::string const& _str ) { + std::size_t width = right - indent.size(); + std::size_t wrapPoint = width-tab; + for( std::size_t pos = 0; pos < _str.size(); ++pos ) { + if( _str[pos] == '\n' ) + { + addLine( _str.substr( 0, pos ) ); + nextTab = tab = 0; + return wrapInternal( _str.substr( pos+1 ) ); + } + if( pos == width-tab ) { + if( _str[wrapPoint] == ' ' ) { + addLine( _str.substr( 0, wrapPoint ) ); + while( _str[++wrapPoint] == ' ' ); } - if( paragraph[pos] == '\t' ) { - tab = pos; - paragraph = paragraph.substr( 0, tab ) + paragraph.substr( tab+1 ); - pos--; - } - else if( paragraph[pos] == ' ' ) { - wrapPoint = pos; + else { + addLine( _str.substr( 0, --wrapPoint ) + '-' ); } + return wrapInternal( _str.substr( wrapPoint ) ); + } + if( _str[pos] == '\t' ) { + nextTab = pos; + std::string withoutTab = _str.substr( 0, nextTab ) + _str.substr( nextTab+1 ); + return wrapInternal( withoutTab ); + } + else if( _str[pos] == ' ' ) { + wrapPoint = pos; } - addIndent( os, indent ); - os << paragraph; } + addLine( _str ); } - void wrapLongStrings( std::ostream& stream, const std::string& str, std::size_t columns, std::size_t indent ) { - std::string::size_type pos = 0; - std::string::size_type newline = str.find_first_of( '\n' ); - while( newline != std::string::npos ) { - std::string paragraph = str.substr( pos, newline-pos ); - recursivelyWrapLine( stream, paragraph, columns, indent ); - stream << "\n"; - pos = newline+1; - newline = str.find_first_of( '\n', pos ); + std::ostream& LineWrapper::intoStream( std::ostream& stream ) const { + for( const_iterator it = begin(), itEnd = end(); + it != itEnd; ++it ) { + if( it != begin() ) + stream << "\n"; + stream << *it; } - if( pos != str.size() ) - recursivelyWrapLine( stream, str.substr( pos, str.size()-pos ), columns, indent ); + return stream; } - - std::string wrapLongStrings( const std::string& str, std::size_t columns, std::size_t indent ) { + std::string LineWrapper::toString() const { std::ostringstream oss; - wrapLongStrings( oss, str, columns, indent ); - return oss.str(); + intoStream( oss ); + return oss.str(); + } + + void LineWrapper::addLine( const std::string& _line ) { + if( tab > 0 ) + lines.push_back( indent + std::string( tab, ' ' ) + _line ); + else + lines.push_back( indent + _line ); + if( nextTab > 0 ) + tab = nextTab; } } // end namespace Catch diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 042dbacc..b621aa6e 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -211,7 +211,7 @@ namespace Catch { if( result.hasExpandedExpression() ) { stream << "with expansion:\n"; TextColour colourGuard( TextColour::ReconstructedExpression ); - stream << wrapLongStrings( result.getExpandedExpression() ) << "\n"; + stream << LineWrapper().setIndent(2).wrap( result.getExpandedExpression() ).toString() << "\n"; } } void printMessage() const { @@ -219,8 +219,9 @@ namespace Catch { stream << messageLabel << ":" << "\n"; for( std::vector::const_iterator it = messages.begin(), itEnd = messages.end(); it != itEnd; - ++it ) { - stream << wrapLongStrings( it->message ) << "\n"; + ++it ) { + LineWrapper().setIndent(2).wrap( it->message ).intoStream( stream ); + stream << "\n"; } } void printSourceInfo() const { @@ -228,10 +229,6 @@ namespace Catch { stream << result.getSourceInfo() << ": "; } - static std::string wrapLongStrings( std::string const& _string ){ - return Catch::wrapLongStrings( _string, CATCH_CONFIG_CONSOLE_WIDTH-1, 2 ); - } - std::ostream& stream; AssertionStats const& stats; AssertionResult const& result; diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 65371a79..43fd126a 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b27 (integration) host application. +CatchSelfTest is a CATCH v0.9 b28 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4167,20 +4167,21 @@ with expansion: ------------------------------------------------------------------------------- Long strings can be wrapped + plain string No wrapping ............................................................................... -TestMain.cpp:433: +TestMain.cpp:435: PASSED: - CHECK( Catch::wrapLongStrings( testString, 80, 0 ) == testString ) + CHECK( Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" == "one two three four" -TestMain.cpp:434: +TestMain.cpp:436: PASSED: - CHECK( Catch::wrapLongStrings( testString, 18, 0 ) == testString ) + CHECK( Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" == @@ -4188,32 +4189,13 @@ with expansion: ------------------------------------------------------------------------------- Long strings can be wrapped + plain string Wrapped once ............................................................................... -TestMain.cpp:437: -PASSED: - CHECK( Catch::wrapLongStrings( testString, 17, 0 ) == "one two three\nfour" ) -with expansion: - "one two three - four" - == - "one two three - four" - -TestMain.cpp:438: -PASSED: - CHECK( Catch::wrapLongStrings( testString, 16, 0 ) == "one two three\nfour" ) -with expansion: - "one two three - four" - == - "one two three - four" - TestMain.cpp:439: PASSED: - CHECK( Catch::wrapLongStrings( testString, 15, 0 ) == "one two three\nfour" ) + CHECK( Catch::LineWrapper( 17 ).wrap( testString ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4223,7 +4205,7 @@ with expansion: TestMain.cpp:440: PASSED: - CHECK( Catch::wrapLongStrings( testString, 14, 0 ) == "one two three\nfour" ) + CHECK( Catch::LineWrapper( 16 ).wrap( testString ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4233,7 +4215,27 @@ with expansion: TestMain.cpp:441: PASSED: - CHECK( Catch::wrapLongStrings( testString, 13, 0 ) == "one two\nthree four" ) + CHECK( Catch::LineWrapper( 15 ).wrap( testString ).toString() == "one two three\nfour" ) +with expansion: + "one two three + four" + == + "one two three + four" + +TestMain.cpp:442: +PASSED: + CHECK( Catch::LineWrapper( 14 ).wrap( testString ).toString() == "one two three\nfour" ) +with expansion: + "one two three + four" + == + "one two three + four" + +TestMain.cpp:443: +PASSED: + CHECK( Catch::LineWrapper( 13 ).wrap( testString ).toString() == "one two\nthree four" ) with expansion: "one two three four" @@ -4243,12 +4245,13 @@ with expansion: ------------------------------------------------------------------------------- Long strings can be wrapped + plain string Wrapped twice ............................................................................... -TestMain.cpp:444: +TestMain.cpp:446: PASSED: - CHECK( Catch::wrapLongStrings( testString, 9, 0 ) == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4258,9 +4261,9 @@ with expansion: three four" -TestMain.cpp:445: +TestMain.cpp:447: PASSED: - CHECK( Catch::wrapLongStrings( testString, 8, 0 ) == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4272,12 +4275,13 @@ with expansion: ------------------------------------------------------------------------------- Long strings can be wrapped + plain string Wrapped three times ............................................................................... -TestMain.cpp:448: +TestMain.cpp:450: PASSED: - CHECK( Catch::wrapLongStrings( testString, 7, 0 ) == "one\ntwo\nthree\nfour" ) + CHECK( Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4289,9 +4293,9 @@ with expansion: three four" -TestMain.cpp:449: +TestMain.cpp:451: PASSED: - CHECK( Catch::wrapLongStrings( testString, 5, 0 ) == "one\ntwo\nthree\nfour" ) + CHECK( Catch::LineWrapper( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4305,44 +4309,45 @@ with expansion: ------------------------------------------------------------------------------- Long strings can be wrapped + plain string Short wrap ............................................................................... -TestMain.cpp:452: -PASSED: - CHECK( Catch::wrapLongStrings( "abcdef", 4, 0 ) == "abc-\ndef" ) -with expansion: - "abc- - def" - == - "abc- - def" - -TestMain.cpp:453: -PASSED: - CHECK( Catch::wrapLongStrings( "abcdefg", 4, 0 ) == "abc-\ndefg" ) -with expansion: - "abc- - defg" - == - "abc- - defg" - TestMain.cpp:454: PASSED: - CHECK( Catch::wrapLongStrings( "abcdefgh", 4, 0 ) == "abc-\ndef-\ngh" ) + CHECK( Catch::LineWrapper( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" ) with expansion: "abc- - def- - gh" + def" == "abc- - def- - gh" + def" + +TestMain.cpp:455: +PASSED: + CHECK( Catch::LineWrapper( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" ) +with expansion: + "abc- + defg" + == + "abc- + defg" TestMain.cpp:456: PASSED: - CHECK( Catch::wrapLongStrings( testString, 4, 0 ) == "one\ntwo\nthr-\nee\nfour" ) + CHECK( Catch::LineWrapper( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" ) +with expansion: + "abc- + def- + gh" + == + "abc- + def- + gh" + +TestMain.cpp:458: +PASSED: + CHECK( Catch::LineWrapper( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" ) with expansion: "one two @@ -4356,9 +4361,9 @@ with expansion: ee four" -TestMain.cpp:457: +TestMain.cpp:459: PASSED: - CHECK( Catch::wrapLongStrings( testString, 3, 0 ) == "one\ntwo\nth-\nree\nfo-\nur" ) + CHECK( Catch::LineWrapper( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ) with expansion: "one two @@ -4374,6 +4379,136 @@ with expansion: fo- ur" +------------------------------------------------------------------------------- +Long strings can be wrapped + With newlines + No wrapping +............................................................................... + +TestMain.cpp:469: +PASSED: + CHECK( Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString ) +with expansion: + "one two + three four" + == + "one two + three four" + +TestMain.cpp:470: +PASSED: + CHECK( Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString ) +with expansion: + "one two + three four" + == + "one two + three four" + +TestMain.cpp:471: +PASSED: + CHECK( Catch::LineWrapper( 10 ).wrap( testString ).toString() == testString ) +with expansion: + "one two + three four" + == + "one two + three four" + +------------------------------------------------------------------------------- +Long strings can be wrapped + With newlines + Trailing newline +............................................................................... + +TestMain.cpp:474: +PASSED: + CHECK( Catch::LineWrapper( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) +with expansion: + "abcdef + " + == + "abcdef + " + +TestMain.cpp:475: +PASSED: + CHECK( Catch::LineWrapper( 6 ).wrap( "abcdef" ).toString() == "abcdef" ) +with expansion: + "abcdef" == "abcdef" + +TestMain.cpp:476: +PASSED: + CHECK( Catch::LineWrapper( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) +with expansion: + "abcdef + " + == + "abcdef + " + +------------------------------------------------------------------------------- +Long strings can be wrapped + With newlines + Wrapped once +............................................................................... + +TestMain.cpp:479: +PASSED: + CHECK( Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) +with expansion: + "one two + three + four" + == + "one two + three + four" + +TestMain.cpp:480: +PASSED: + CHECK( Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) +with expansion: + "one two + three + four" + == + "one two + three + four" + +TestMain.cpp:481: +PASSED: + CHECK( Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ) +with expansion: + "one two + three + four" + == + "one two + three + four" + +------------------------------------------------------------------------------- +Long strings can be wrapped + With newlines + Wrapped twice +............................................................................... + +TestMain.cpp:484: +PASSED: + CHECK( Catch::LineWrapper( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) +with expansion: + "one + two + three + four" + == + "one + two + three + four" + ------------------------------------------------------------------------------- ./succeeding/Tricky/std::pair ............................................................................... @@ -4704,11 +4839,11 @@ with message: no assertions =============================================================================== -106 test cases - 47 failed (666 assertions - 104 failed) +106 test cases - 47 failed (676 assertions - 104 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b27 (integration) host application. +CatchSelfTest is a CATCH v0.9 b28 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -4999,7 +5134,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -10238,130 +10373,140 @@ TestMain.cpp" line="423"> -
-TestMain.cpp" line="433"> - - Catch::wrapLongStrings( testString, 80, 0 ) == testString - - - "one two three four" +
+
+TestMain.cpp" line="435"> + + Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString + + + "one two three four" == "one two three four" - - -TestMain.cpp" line="434"> - - Catch::wrapLongStrings( testString, 18, 0 ) == testString - - - "one two three four" + + +TestMain.cpp" line="436"> + + Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString + + + "one two three four" == "one two three four" - - + + + +
-
-TestMain.cpp" line="437"> - - Catch::wrapLongStrings( testString, 17, 0 ) == "one two three\nfour" - - - "one two three -four" -== -"one two three -four" - - -TestMain.cpp" line="438"> - - Catch::wrapLongStrings( testString, 16, 0 ) == "one two three\nfour" - - - "one two three -four" -== -"one two three -four" - - +
+
TestMain.cpp" line="439"> - - Catch::wrapLongStrings( testString, 15, 0 ) == "one two three\nfour" - - - "one two three + + Catch::LineWrapper( 17 ).wrap( testString ).toString() == "one two three\nfour" + + + "one two three four" == "one two three four" - - + + TestMain.cpp" line="440"> - - Catch::wrapLongStrings( testString, 14, 0 ) == "one two three\nfour" - - - "one two three + + Catch::LineWrapper( 16 ).wrap( testString ).toString() == "one two three\nfour" + + + "one two three four" == "one two three four" - - + + TestMain.cpp" line="441"> - - Catch::wrapLongStrings( testString, 13, 0 ) == "one two\nthree four" - - - "one two + + Catch::LineWrapper( 15 ).wrap( testString ).toString() == "one two three\nfour" + + + "one two three +four" +== +"one two three +four" + + +TestMain.cpp" line="442"> + + Catch::LineWrapper( 14 ).wrap( testString ).toString() == "one two three\nfour" + + + "one two three +four" +== +"one two three +four" + + +TestMain.cpp" line="443"> + + Catch::LineWrapper( 13 ).wrap( testString ).toString() == "one two\nthree four" + + + "one two three four" == "one two three four" - - + + + +
-
-TestMain.cpp" line="444"> - - Catch::wrapLongStrings( testString, 9, 0 ) == "one two\nthree\nfour" - - - "one two +
+
+TestMain.cpp" line="446"> + + Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" + + + "one two three four" == "one two three four" - - -TestMain.cpp" line="445"> - - Catch::wrapLongStrings( testString, 8, 0 ) == "one two\nthree\nfour" - - - "one two + + +TestMain.cpp" line="447"> + + Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" + + + "one two three four" == "one two three four" - - + + + +
-
-TestMain.cpp" line="448"> - - Catch::wrapLongStrings( testString, 7, 0 ) == "one\ntwo\nthree\nfour" - - - "one +
+
+TestMain.cpp" line="450"> + + Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + + + "one two three four" @@ -10370,14 +10515,14 @@ four" two three four" - - -TestMain.cpp" line="449"> - - Catch::wrapLongStrings( testString, 5, 0 ) == "one\ntwo\nthree\nfour" - - - "one + + +TestMain.cpp" line="451"> + + Catch::LineWrapper( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + + + "one two three four" @@ -10386,55 +10531,58 @@ four" two three four" - - + + + +
-
-TestMain.cpp" line="452"> - - Catch::wrapLongStrings( "abcdef", 4, 0 ) == "abc-\ndef" - - - "abc- -def" -== -"abc- -def" - - -TestMain.cpp" line="453"> - - Catch::wrapLongStrings( "abcdefg", 4, 0 ) == "abc-\ndefg" - - - "abc- -defg" -== -"abc- -defg" - - +
+
TestMain.cpp" line="454"> - - Catch::wrapLongStrings( "abcdefgh", 4, 0 ) == "abc-\ndef-\ngh" - - - "abc- + + Catch::LineWrapper( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" + + + "abc- +def" +== +"abc- +def" + + +TestMain.cpp" line="455"> + + Catch::LineWrapper( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" + + + "abc- +defg" +== +"abc- +defg" + + +TestMain.cpp" line="456"> + + Catch::LineWrapper( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" + + + "abc- def- gh" == "abc- def- gh" - - -TestMain.cpp" line="456"> - - Catch::wrapLongStrings( testString, 4, 0 ) == "one\ntwo\nthr-\nee\nfour" - - - "one + + +TestMain.cpp" line="458"> + + Catch::LineWrapper( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" + + + "one two thr- ee @@ -10445,14 +10593,14 @@ two thr- ee four" - - -TestMain.cpp" line="457"> - - Catch::wrapLongStrings( testString, 3, 0 ) == "one\ntwo\nth-\nree\nfo-\nur" - - - "one + + +TestMain.cpp" line="459"> + + Catch::LineWrapper( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" + + + "one two th- ree @@ -10465,10 +10613,165 @@ th- ree fo- ur" - - + + + +
+
+ +
+
+
+TestMain.cpp" line="469"> + + Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString + + + "one two +three four" +== +"one two +three four" + + +TestMain.cpp" line="470"> + + Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString + + + "one two +three four" +== +"one two +three four" + + +TestMain.cpp" line="471"> + + Catch::LineWrapper( 10 ).wrap( testString ).toString() == testString + + + "one two +three four" +== +"one two +three four" + + + +
+ +
+
+
+TestMain.cpp" line="474"> + + Catch::LineWrapper( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" + + + "abcdef +" +== +"abcdef +" + + +TestMain.cpp" line="475"> + + Catch::LineWrapper( 6 ).wrap( "abcdef" ).toString() == "abcdef" + + + "abcdef" == "abcdef" + + +TestMain.cpp" line="476"> + + Catch::LineWrapper( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" + + + "abcdef +" +== +"abcdef +" + + + +
+ +
+
+
+TestMain.cpp" line="479"> + + Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" + + + "one two +three +four" +== +"one two +three +four" + + +TestMain.cpp" line="480"> + + Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" + + + "one two +three +four" +== +"one two +three +four" + + +TestMain.cpp" line="481"> + + Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" + + + "one two +three +four" +== +"one two +three +four" + + + +
+ +
+
+
+TestMain.cpp" line="484"> + + Catch::LineWrapper( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + + + "one +two +three +four" +== +"one +two +three +four" + + + +
+ +
@@ -10802,9 +11105,9 @@ BDDTests.cpp" line="23">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -12108,43 +12411,47 @@ TestMain.cpp:423: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false [Finished: 'selftest/tags' All tests passed (30 assertions in 1 test case)] [Running: Long strings can be wrapped] +[Started section: 'plain string'] [Started section: 'No wrapping'] -TestMain.cpp:433: Catch::wrapLongStrings( testString, 80, 0 ) == testString succeeded for: +TestMain.cpp:435: Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:434: Catch::wrapLongStrings( testString, 18, 0 ) == testString succeeded for: +TestMain.cpp:436: Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString succeeded for: "one two three four" == "one two three four" [End of section: 'No wrapping' All 2 assertions passed] +[End of section: 'plain string' All 2 assertions passed] + +[Started section: 'plain string'] [Started section: 'Wrapped once'] -TestMain.cpp:437: Catch::wrapLongStrings( testString, 17, 0 ) == "one two three\nfour" succeeded for: +TestMain.cpp:439: Catch::LineWrapper( 17 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:438: Catch::wrapLongStrings( testString, 16, 0 ) == "one two three\nfour" succeeded for: +TestMain.cpp:440: Catch::LineWrapper( 16 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:439: Catch::wrapLongStrings( testString, 15, 0 ) == "one two three\nfour" succeeded for: +TestMain.cpp:441: Catch::LineWrapper( 15 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:440: Catch::wrapLongStrings( testString, 14, 0 ) == "one two three\nfour" succeeded for: +TestMain.cpp:442: Catch::LineWrapper( 14 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:441: Catch::wrapLongStrings( testString, 13, 0 ) == "one two\nthree four" succeeded for: +TestMain.cpp:443: Catch::LineWrapper( 13 ).wrap( testString ).toString() == "one two\nthree four" succeeded for: "one two three four" == @@ -12152,8 +12459,11 @@ three four" three four" [End of section: 'Wrapped once' All 5 assertions passed] +[End of section: 'plain string' All 5 assertions passed] + +[Started section: 'plain string'] [Started section: 'Wrapped twice'] -TestMain.cpp:444: Catch::wrapLongStrings( testString, 9, 0 ) == "one two\nthree\nfour" succeeded for: +TestMain.cpp:446: Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -12161,7 +12471,7 @@ four" "one two three four" -TestMain.cpp:445: Catch::wrapLongStrings( testString, 8, 0 ) == "one two\nthree\nfour" succeeded for: +TestMain.cpp:447: Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -12171,8 +12481,11 @@ three four" [End of section: 'Wrapped twice' All 2 assertions passed] +[End of section: 'plain string' All 2 assertions passed] + +[Started section: 'plain string'] [Started section: 'Wrapped three times'] -TestMain.cpp:448: Catch::wrapLongStrings( testString, 7, 0 ) == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:450: Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -12182,7 +12495,7 @@ four" two three four" -TestMain.cpp:449: Catch::wrapLongStrings( testString, 5, 0 ) == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:451: Catch::LineWrapper( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -12194,25 +12507,28 @@ three four" [End of section: 'Wrapped three times' All 2 assertions passed] +[End of section: 'plain string' All 2 assertions passed] + +[Started section: 'plain string'] [Started section: 'Short wrap'] -TestMain.cpp:452: Catch::wrapLongStrings( "abcdef", 4, 0 ) == "abc-\ndef" succeeded for: "abc- +TestMain.cpp:454: Catch::LineWrapper( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" succeeded for: "abc- def" == "abc- def" -TestMain.cpp:453: Catch::wrapLongStrings( "abcdefg", 4, 0 ) == "abc-\ndefg" succeeded for: "abc- +TestMain.cpp:455: Catch::LineWrapper( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" succeeded for: "abc- defg" == "abc- defg" -TestMain.cpp:454: Catch::wrapLongStrings( "abcdefgh", 4, 0 ) == "abc-\ndef-\ngh" succeeded for: "abc- +TestMain.cpp:456: Catch::LineWrapper( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- def- gh" == "abc- def- gh" -TestMain.cpp:456: Catch::wrapLongStrings( testString, 4, 0 ) == "one\ntwo\nthr-\nee\nfour" succeeded for: +TestMain.cpp:458: Catch::LineWrapper( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: "one two thr- @@ -12224,7 +12540,7 @@ two thr- ee four" -TestMain.cpp:457: Catch::wrapLongStrings( testString, 3, 0 ) == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: +TestMain.cpp:459: Catch::LineWrapper( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: "one two th- @@ -12240,7 +12556,96 @@ fo- ur" [End of section: 'Short wrap' All 5 assertions passed] -[Finished: 'Long strings can be wrapped' All tests passed (16 assertions in 1 test case)] +[End of section: 'plain string' All 5 assertions passed] + +[Started section: 'With newlines'] +[Started section: 'No wrapping'] +TestMain.cpp:469: Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString succeeded for: + "one two +three four" +== +"one two +three four" +TestMain.cpp:470: Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString succeeded for: + "one two +three four" +== +"one two +three four" +TestMain.cpp:471: Catch::LineWrapper( 10 ).wrap( testString ).toString() == testString succeeded for: + "one two +three four" +== +"one two +three four" +[End of section: 'No wrapping' All 3 assertions passed] + +[End of section: 'With newlines' All 3 assertions passed] + +[Started section: 'With newlines'] +[Started section: 'Trailing newline'] +TestMain.cpp:474: Catch::LineWrapper( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef +" +== +"abcdef +" +TestMain.cpp:475: Catch::LineWrapper( 6 ).wrap( "abcdef" ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" +TestMain.cpp:476: Catch::LineWrapper( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef +" +== +"abcdef +" +[End of section: 'Trailing newline' All 3 assertions passed] + +[End of section: 'With newlines' All 3 assertions passed] + +[Started section: 'With newlines'] +[Started section: 'Wrapped once'] +TestMain.cpp:479: Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: + "one two +three +four" +== +"one two +three +four" +TestMain.cpp:480: Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: + "one two +three +four" +== +"one two +three +four" +TestMain.cpp:481: Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: + "one two +three +four" +== +"one two +three +four" +[End of section: 'Wrapped once' All 3 assertions passed] + +[End of section: 'With newlines' All 3 assertions passed] + +[Started section: 'With newlines'] +[Started section: 'Wrapped twice'] +TestMain.cpp:484: Catch::LineWrapper( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: + "one +two +three +four" +== +"one +two +three +four" +[End of section: 'Wrapped twice' 1 assertion passed] + +[End of section: 'With newlines' 1 assertion passed] + +[Finished: 'Long strings can be wrapped' All tests passed (26 assertions in 1 test case)] [Running: ./succeeding/Tricky/std::pair] TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: std::pair( 1, 2 ) == std::pair( 1, 2 ) @@ -12377,10 +12782,10 @@ VariadicMacrosTests.cpp:26: succeeded [End of section: 'Section with one argument' 1 assertion passed] [Finished: 'Variadic macros' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 47 of 106 test cases failed (104 of 666 assertions failed)] +[End of group: '~dummy'. 47 of 106 test cases failed (104 of 676 assertions failed)] -[Testing completed. 47 of 106 test cases failed (104 of 666 assertions failed)] +[Testing completed. 47 of 106 test cases failed (104 of 676 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 45e002a8..9f1e3d4d 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -426,34 +426,63 @@ TEST_CASE( "selftest/tags", "" ) { } TEST_CASE( "Long strings can be wrapped", "[wrap]" ) { - // guide: 123456789012345678 - std::string testString = "one two three four"; - - SECTION( "No wrapping", "" ) { - CHECK( Catch::wrapLongStrings( testString, 80, 0 ) == testString ); - CHECK( Catch::wrapLongStrings( testString, 18, 0 ) == testString ); - } - SECTION( "Wrapped once", "" ) { - CHECK( Catch::wrapLongStrings( testString, 17, 0 ) == "one two three\nfour" ); - CHECK( Catch::wrapLongStrings( testString, 16, 0 ) == "one two three\nfour" ); - CHECK( Catch::wrapLongStrings( testString, 15, 0 ) == "one two three\nfour" ); - CHECK( Catch::wrapLongStrings( testString, 14, 0 ) == "one two three\nfour" ); - CHECK( Catch::wrapLongStrings( testString, 13, 0 ) == "one two\nthree four" ); - } - SECTION( "Wrapped twice", "" ) { - CHECK( Catch::wrapLongStrings( testString, 9, 0 ) == "one two\nthree\nfour" ); - CHECK( Catch::wrapLongStrings( testString, 8, 0 ) == "one two\nthree\nfour" ); - } - SECTION( "Wrapped three times", "" ) { - CHECK( Catch::wrapLongStrings( testString, 7, 0 ) == "one\ntwo\nthree\nfour" ); - CHECK( Catch::wrapLongStrings( testString, 5, 0 ) == "one\ntwo\nthree\nfour" ); - } - SECTION( "Short wrap", "" ) { - CHECK( Catch::wrapLongStrings( "abcdef", 4, 0 ) == "abc-\ndef" ); - CHECK( Catch::wrapLongStrings( "abcdefg", 4, 0 ) == "abc-\ndefg" ); - CHECK( Catch::wrapLongStrings( "abcdefgh", 4, 0 ) == "abc-\ndef-\ngh" ); - CHECK( Catch::wrapLongStrings( testString, 4, 0 ) == "one\ntwo\nthr-\nee\nfour" ); - CHECK( Catch::wrapLongStrings( testString, 3, 0 ) == "one\ntwo\nth-\nree\nfo-\nur" ); + SECTION( "plain string", "" ) { + // guide: 123456789012345678 + std::string testString = "one two three four"; + + SECTION( "No wrapping", "" ) { + CHECK( Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString ); + CHECK( Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString ); + } + SECTION( "Wrapped once", "" ) { + CHECK( Catch::LineWrapper( 17 ).wrap( testString ).toString() == "one two three\nfour" ); + CHECK( Catch::LineWrapper( 16 ).wrap( testString ).toString() == "one two three\nfour" ); + CHECK( Catch::LineWrapper( 15 ).wrap( testString ).toString() == "one two three\nfour" ); + CHECK( Catch::LineWrapper( 14 ).wrap( testString ).toString() == "one two three\nfour" ); + CHECK( Catch::LineWrapper( 13 ).wrap( testString ).toString() == "one two\nthree four" ); + } + SECTION( "Wrapped twice", "" ) { + CHECK( Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + CHECK( Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + } + SECTION( "Wrapped three times", "" ) { + CHECK( Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); + CHECK( Catch::LineWrapper( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); + } + SECTION( "Short wrap", "" ) { + CHECK( Catch::LineWrapper( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" ); + CHECK( Catch::LineWrapper( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" ); + CHECK( Catch::LineWrapper( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" ); + + CHECK( Catch::LineWrapper( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" ); + CHECK( Catch::LineWrapper( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ); + } } + + SECTION( "With newlines", "" ) { + + // guide: 1234567890123456789 + std::string testString = "one two\nthree four"; + + SECTION( "No wrapping" , "" ) { + CHECK( Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString ); + CHECK( Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString ); + CHECK( Catch::LineWrapper( 10 ).wrap( testString ).toString() == testString ); + } + SECTION( "Trailing newline" , "" ) { + CHECK( Catch::LineWrapper( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ); + CHECK( Catch::LineWrapper( 6 ).wrap( "abcdef" ).toString() == "abcdef" ); + CHECK( Catch::LineWrapper( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ); + } + SECTION( "Wrapped once", "" ) { + CHECK( Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + CHECK( Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + CHECK( Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + } + SECTION( "Wrapped twice", "" ) { + CHECK( Catch::LineWrapper( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); + } + } + } From 9e8abc33e7a4e8c0d0b69a3fd827ce92c31da951 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 27 Mar 2013 23:36:58 +0000 Subject: [PATCH 185/296] Simplified StringWrapper - by changing intoStream to << overload - and removing redundant ctor --- include/catch_runner.hpp | 2 +- include/internal/catch_line_wrap.h | 6 +++--- include/internal/catch_line_wrap.hpp | 21 +++++++------------- include/reporters/catch_reporter_console.hpp | 5 ++--- 4 files changed, 13 insertions(+), 21 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 6d63b878..ef9c5975 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -161,7 +161,7 @@ namespace Catch { displayedSpecificOption = true; std::cout << "\n" << opt.optionNames() << " " << opt.argsSynopsis() << "\n\n" << opt.optionSummary() << "\n\n" - << LineWrapper().setIndent( 2 ).wrap( opt.optionDescription() ).toString() << "\n" << std::endl; + << LineWrapper().setIndent( 2 ).wrap( opt.optionDescription() ) << "\n" << std::endl; } } diff --git a/include/internal/catch_line_wrap.h b/include/internal/catch_line_wrap.h index e08dada1..ab024bcb 100644 --- a/include/internal/catch_line_wrap.h +++ b/include/internal/catch_line_wrap.h @@ -15,7 +15,6 @@ namespace Catch { class LineWrapper { public: - LineWrapper( std::size_t _indent, std::size_t _right ); LineWrapper( std::size_t _right ); LineWrapper(); @@ -23,14 +22,15 @@ namespace Catch { LineWrapper& setRight( std::size_t _right ); LineWrapper& wrap( std::string const& _str ); - - std::ostream& intoStream( std::ostream& stream ) const; + std::string toString() const; typedef std::vector::const_iterator const_iterator; const_iterator begin() const { return lines.begin(); } const_iterator end() const { return lines.end(); } + + friend std::ostream& operator << ( std::ostream& _stream, LineWrapper const& _lineWrapper ); private: void wrapInternal( std::string const& _str ); diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp index bb8247d9..1d8bcc75 100644 --- a/include/internal/catch_line_wrap.hpp +++ b/include/internal/catch_line_wrap.hpp @@ -12,13 +12,6 @@ namespace Catch { - - LineWrapper::LineWrapper( std::size_t _indent, std::size_t _right ) - : indent( _indent, ' ' ), - right( _right ), - nextTab( 0 ), - tab( 0 ) - {} LineWrapper::LineWrapper( std::size_t _right ) : right( _right ), nextTab( 0 ), @@ -75,18 +68,18 @@ namespace Catch { addLine( _str ); } - std::ostream& LineWrapper::intoStream( std::ostream& stream ) const { - for( const_iterator it = begin(), itEnd = end(); + std::ostream& operator << ( std::ostream& _stream, LineWrapper const& _lineWrapper ) { + for( LineWrapper::const_iterator it = _lineWrapper.begin(), itEnd = _lineWrapper.end(); it != itEnd; ++it ) { - if( it != begin() ) - stream << "\n"; - stream << *it; + if( it != _lineWrapper.begin() ) + _stream << "\n"; + _stream << *it; } - return stream; + return _stream; } std::string LineWrapper::toString() const { std::ostringstream oss; - intoStream( oss ); + oss << *this; return oss.str(); } diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index b621aa6e..b5ce9ee2 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -211,7 +211,7 @@ namespace Catch { if( result.hasExpandedExpression() ) { stream << "with expansion:\n"; TextColour colourGuard( TextColour::ReconstructedExpression ); - stream << LineWrapper().setIndent(2).wrap( result.getExpandedExpression() ).toString() << "\n"; + stream << LineWrapper().setIndent(2).wrap( result.getExpandedExpression() ) << "\n"; } } void printMessage() const { @@ -220,8 +220,7 @@ namespace Catch { for( std::vector::const_iterator it = messages.begin(), itEnd = messages.end(); it != itEnd; ++it ) { - LineWrapper().setIndent(2).wrap( it->message ).intoStream( stream ); - stream << "\n"; + stream << LineWrapper().setIndent(2).wrap( it->message ) << "\n"; } } void printSourceInfo() const { From 15fd03260839d667df0dac008cbe40e83f451fb5 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 28 Mar 2013 22:13:31 +0000 Subject: [PATCH 186/296] Use new line wrapper to show test case list, with tags, in columns --- include/catch.hpp | 10 +-- include/catch_runner.hpp | 2 +- include/internal/catch_line_wrap.h | 6 +- include/internal/catch_line_wrap.hpp | 19 ++-- include/internal/catch_list.hpp | 104 +++++++++++++++------- include/internal/catch_test_case_info.h | 1 + include/internal/catch_test_case_info.hpp | 10 ++- projects/SelfTest/TestMain.cpp | 61 +++++++------ 8 files changed, 137 insertions(+), 76 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index 7a95541c..9240467a 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -174,11 +174,11 @@ #else #define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) #endif -#define GIVEN( desc ) SECTION( "Given: " desc, "" ) -#define WHEN( desc ) SECTION( " When: " desc, "" ) -#define AND_WHEN( desc ) SECTION( " And: " desc, "" ) -#define THEN( desc ) SECTION( " Then: " desc, "" ) -#define AND_THEN( desc ) SECTION( " And: " desc, "" ) +#define GIVEN( desc ) SECTION( " Given: " desc, "" ) +#define WHEN( desc ) SECTION( " When: " desc, "" ) +#define AND_WHEN( desc ) SECTION( "And when: " desc, "" ) +#define THEN( desc ) SECTION( " Then: " desc, "" ) +#define AND_THEN( desc ) SECTION( " And: " desc, "" ) using Catch::Detail::Approx; diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index ef9c5975..30ed6be1 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -124,7 +124,7 @@ namespace Catch { // Handle list request if( config.listSpec != List::None ) { - List( config ); + list( config ); Catch::cleanUp(); return 0; } diff --git a/include/internal/catch_line_wrap.h b/include/internal/catch_line_wrap.h index ab024bcb..0ec49cdb 100644 --- a/include/internal/catch_line_wrap.h +++ b/include/internal/catch_line_wrap.h @@ -15,7 +15,6 @@ namespace Catch { class LineWrapper { public: - LineWrapper( std::size_t _right ); LineWrapper(); LineWrapper& setIndent( std::size_t _indent ); @@ -29,17 +28,22 @@ namespace Catch { const_iterator begin() const { return lines.begin(); } const_iterator end() const { return lines.end(); } + std::size_t size() const { return lines.size(); } + std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } friend std::ostream& operator << ( std::ostream& _stream, LineWrapper const& _lineWrapper ); private: void wrapInternal( std::string const& _str ); void addLine( const std::string& _line ); + bool isWrapPoint( char c ); std::string indent; std::size_t right; std::size_t nextTab; std::size_t tab; + std::string wrappableChars; + int recursionCount; std::vector lines; }; diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp index 1d8bcc75..a51e98a8 100644 --- a/include/internal/catch_line_wrap.hpp +++ b/include/internal/catch_line_wrap.hpp @@ -12,15 +12,12 @@ namespace Catch { - LineWrapper::LineWrapper( std::size_t _right ) - : right( _right ), - nextTab( 0 ), - tab( 0 ) - {} LineWrapper::LineWrapper() : right( CATCH_CONFIG_CONSOLE_WIDTH-1 ), nextTab( 0 ), - tab( 0 ) + tab( 0 ), + wrappableChars( " [({.," ), + recursionCount( 0 ) {} LineWrapper& LineWrapper::setIndent( std::size_t _indent ) { @@ -36,7 +33,12 @@ namespace Catch { wrapInternal( _str ); return *this; } + bool LineWrapper::isWrapPoint( char c ) { + return wrappableChars.find( c ) != std::string::npos; + } void LineWrapper::wrapInternal( std::string const& _str ) { + assert( ++recursionCount < 100 ); + std::size_t width = right - indent.size(); std::size_t wrapPoint = width-tab; for( std::size_t pos = 0; pos < _str.size(); ++pos ) { @@ -51,6 +53,9 @@ namespace Catch { addLine( _str.substr( 0, wrapPoint ) ); while( _str[++wrapPoint] == ' ' ); } + else if( isWrapPoint( _str[wrapPoint] ) ) { + addLine( _str.substr( 0, wrapPoint ) ); + } else { addLine( _str.substr( 0, --wrapPoint ) + '-' ); } @@ -61,7 +66,7 @@ namespace Catch { std::string withoutTab = _str.substr( 0, nextTab ) + _str.substr( nextTab+1 ); return wrapInternal( withoutTab ); } - else if( _str[pos] == ' ' ) { + else if( isWrapPoint( _str[pos] ) ) { wrapPoint = pos; } } diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index af53992c..f7f0c657 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -9,7 +9,10 @@ #define TWOBLUECUBES_CATCH_LIST_HPP_INCLUDED #include "catch_commandline.hpp" +#include "catch_line_wrap.h" + #include +#include namespace Catch { inline bool matchesFilters( const std::vector& filters, const TestCase& testCase ) { @@ -20,47 +23,80 @@ namespace Catch { return false; return true; } - inline void List( const ConfigData& config ) { - - if( config.listSpec & List::Reports ) { - std::cout << "Available reports:\n"; - IReporterRegistry::FactoryMap::const_iterator it = getRegistryHub().getReporterRegistry().getFactories().begin(); - IReporterRegistry::FactoryMap::const_iterator itEnd = getRegistryHub().getReporterRegistry().getFactories().end(); - for(; it != itEnd; ++it ) { - // !TBD: consider listAs() - std::cout << "\t" << it->first << "\n\t\t'" << it->second->getDescription() << "'\n"; - } - std::cout << std::endl; + + inline void listTests( const ConfigData& config ) { + if( config.filters.empty() ) + std::cout << "All available test cases:\n"; + else + std::cout << "Matching test cases:\n"; + std::vector const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests(); + std::vector::const_iterator it = allTests.begin(), itEnd = allTests.end(); + + // First pass - get max tags + std::size_t maxTagLen = 0; + std::size_t maxNameLen = 0; + for(; it != itEnd; ++it ) { + maxTagLen = (std::max)( it->getTestCaseInfo().tagsAsString.size(), maxTagLen ); + maxNameLen = (std::max)( it->getTestCaseInfo().name.size(), maxNameLen ); } - if( config.listSpec & List::Tests ) { - if( config.filters.empty() ) - std::cout << "All available test cases:\n"; + // Try to fit everything in. If not shrink tag column first, down to 30 + // then shrink name column until it all fits (strings will be wrapped within column) + while( maxTagLen + maxNameLen > CATCH_CONFIG_CONSOLE_WIDTH-5 ) { + if( maxTagLen > 30 ) + --maxTagLen; else - std::cout << "Matching test cases:\n"; - std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); - std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); - std::size_t matchedTests = 0; - for(; it != itEnd; ++it ) { - if( matchesFilters( config.filters, *it ) ) { - matchedTests++; - // !TBD: consider listAs() - std::cout << " " << it->getTestCaseInfo().name << "\n"; - if( ( config.listSpec & List::TestNames ) != List::TestNames ) - std::cout << " '" << it->getTestCaseInfo().description << "'\n"; + --maxNameLen; + } + + std::size_t matchedTests = 0; + for( it = allTests.begin(); it != itEnd; ++it ) { + if( matchesFilters( config.filters, *it ) ) { + matchedTests++; + // !TBD: consider listAs() + LineWrapper nameWrapper; + nameWrapper.setRight( maxNameLen ).setIndent( 2 ).wrap( it->getTestCaseInfo().name ); + + LineWrapper tagsWrapper; + tagsWrapper.setRight( maxTagLen ).wrap( it->getTestCaseInfo().tagsAsString ); + + for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) { + std::string nameCol; + if( i < nameWrapper.size() ) + nameCol = nameWrapper[i]; + else + nameCol = " ..."; + std::cout << nameCol << " " << std::string( maxNameLen - nameCol.size(), ' ' ); + if( i < tagsWrapper.size() ) + std::cout << tagsWrapper[i]; + std::cout << "\n"; } } - if( config.filters.empty() ) - std::cout << pluralise( matchedTests, "test case" ) << std::endl; - else - std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; } - - if( ( config.listSpec & List::All ) == 0 ) { - std::ostringstream oss; - oss << "Unknown list type"; - throw std::domain_error( oss.str() ); + if( config.filters.empty() ) + std::cout << pluralise( matchedTests, "test case" ) << std::endl; + else + std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; + } + + inline void listReporters( const ConfigData& /*config*/ ) { + std::cout << "Available reports:\n"; + IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); + IReporterRegistry::FactoryMap::const_iterator it = factories.begin(), itEnd = factories.end(); + for(; it != itEnd; ++it ) { + // !TBD: consider listAs() + std::cout << "\t" << it->first << "\n\t\t'" << it->second->getDescription() << "'\n"; } + std::cout << std::endl; + } + + inline void list( const ConfigData& config ) { + if( config.listSpec & List::Tests ) + listTests( config ); + else if( config.listSpec & List::Reports ) + listReporters( config ); + else + throw std::logic_error( "Unknown list type" ); } } // end namespace Catch diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h index f84106a7..fde9748a 100644 --- a/include/internal/catch_test_case_info.h +++ b/include/internal/catch_test_case_info.h @@ -36,6 +36,7 @@ namespace Catch { std::string className; std::string description; std::set tags; + std::string tagsAsString; SourceLineInfo lineInfo; bool isHidden; }; diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index 376a54fa..a5412b6f 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -44,15 +44,21 @@ namespace Catch { tags( _tags ), lineInfo( _lineInfo ), isHidden( _isHidden ) - {} + { + std::ostringstream oss; + for( std::set::const_iterator it = _tags.begin(), itEnd = _tags.end(); it != itEnd; ++it ) + oss << "[" << *it << "]"; + tagsAsString = oss.str(); + } TestCaseInfo::TestCaseInfo( const TestCaseInfo& other ) : name( other.name ), className( other.className ), description( other.description ), tags( other.tags ), + tagsAsString( other.tagsAsString ), lineInfo( other.lineInfo ), - isHidden( other.isHidden ) + isHidden( other.isHidden ) {} TestCase::TestCase( ITestCase* testCase, const TestCaseInfo& info ) : TestCaseInfo( info ), test( testCase ) {} diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 9f1e3d4d..ad363d6a 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -432,31 +432,40 @@ TEST_CASE( "Long strings can be wrapped", "[wrap]" ) { std::string testString = "one two three four"; SECTION( "No wrapping", "" ) { - CHECK( Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString ); - CHECK( Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString ); + CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ); + CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ); } SECTION( "Wrapped once", "" ) { - CHECK( Catch::LineWrapper( 17 ).wrap( testString ).toString() == "one two three\nfour" ); - CHECK( Catch::LineWrapper( 16 ).wrap( testString ).toString() == "one two three\nfour" ); - CHECK( Catch::LineWrapper( 15 ).wrap( testString ).toString() == "one two three\nfour" ); - CHECK( Catch::LineWrapper( 14 ).wrap( testString ).toString() == "one two three\nfour" ); - CHECK( Catch::LineWrapper( 13 ).wrap( testString ).toString() == "one two\nthree four" ); + CHECK( Catch::LineWrapper().setRight( 17 ).wrap( testString ).toString() == "one two three\nfour" ); + CHECK( Catch::LineWrapper().setRight( 16 ).wrap( testString ).toString() == "one two three\nfour" ); + CHECK( Catch::LineWrapper().setRight( 15 ).wrap( testString ).toString() == "one two three\nfour" ); + CHECK( Catch::LineWrapper().setRight( 14 ).wrap( testString ).toString() == "one two three\nfour" ); + CHECK( Catch::LineWrapper().setRight( 13 ).wrap( testString ).toString() == "one two\nthree four" ); } SECTION( "Wrapped twice", "" ) { - CHECK( Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ); - CHECK( Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ); } SECTION( "Wrapped three times", "" ) { - CHECK( Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); - CHECK( Catch::LineWrapper( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); + CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); + CHECK( Catch::LineWrapper().setRight( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); } SECTION( "Short wrap", "" ) { - CHECK( Catch::LineWrapper( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" ); - CHECK( Catch::LineWrapper( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" ); - CHECK( Catch::LineWrapper( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" ); + CHECK( Catch::LineWrapper().setRight( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" ); + CHECK( Catch::LineWrapper().setRight( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" ); + CHECK( Catch::LineWrapper().setRight( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" ); - CHECK( Catch::LineWrapper( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" ); - CHECK( Catch::LineWrapper( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ); + CHECK( Catch::LineWrapper().setRight( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" ); + CHECK( Catch::LineWrapper().setRight( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ); + } + SECTION( "As container", "" ) { + Catch::LineWrapper wrapper; + wrapper.setRight( 7 ).wrap( testString ); + CHECK( wrapper.size() == 4 ); + CHECK( wrapper[0] == "one" ); + CHECK( wrapper[1] == "two" ); + CHECK( wrapper[2] == "three" ); + CHECK( wrapper[3] == "four" ); } } @@ -466,22 +475,22 @@ TEST_CASE( "Long strings can be wrapped", "[wrap]" ) { std::string testString = "one two\nthree four"; SECTION( "No wrapping" , "" ) { - CHECK( Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString ); - CHECK( Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString ); - CHECK( Catch::LineWrapper( 10 ).wrap( testString ).toString() == testString ); + CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ); + CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ); + CHECK( Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString ); } SECTION( "Trailing newline" , "" ) { - CHECK( Catch::LineWrapper( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ); - CHECK( Catch::LineWrapper( 6 ).wrap( "abcdef" ).toString() == "abcdef" ); - CHECK( Catch::LineWrapper( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ); + CHECK( Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ); + CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" ); + CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ); } SECTION( "Wrapped once", "" ) { - CHECK( Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ); - CHECK( Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ); - CHECK( Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ); } SECTION( "Wrapped twice", "" ) { - CHECK( Catch::LineWrapper( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); + CHECK( Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); } } From d0df295c25e1967b9bf94cf234a47a80c47b0369 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 28 Mar 2013 22:13:57 +0000 Subject: [PATCH 187/296] Added vector resizing example to BDD tests --- .../CatchSelfTest/CatchSelfTest/BDDTests.cpp | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index 900fb8ee..161d8b09 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -25,3 +25,37 @@ SCENARIO( "Do that thing with the thing", "[Tags]" ) { } } } + +SCENARIO( "Vector resizing affects size and capacity", "[vector][bdd][size][capacity]" ) { + GIVEN( "an empty vector" ) { + std::vector v; + REQUIRE( v.size() == 0 ); + + WHEN( "it is made larger" ) { + v.resize( 10 ); + THEN( "the size and capacity go up" ) { + REQUIRE( v.size() == 10 ); + REQUIRE( v.capacity() >= 10 ); + + AND_WHEN( "it is made smaller again" ) { + v.resize( 5 ); + THEN( "the size goes down but the capacity stays the same" ) { + REQUIRE( v.size() == 5 ); + REQUIRE( v.capacity() >= 10 ); + } + } + } + } + + WHEN( "we reserve more space" ) { + v.reserve( 10 ); + THEN( "The capacity is increased but the size remains the same" ) { + REQUIRE( v.capacity() >= 10 ); + REQUIRE( v.size() == 0 ); + } + } + } +} + +SCENARIO( "This is a really long scenario name to see how the list command deals with wrapping", "[very long tags][lots][long][tags][verbose]" ) { +} From e324d2829d632febf346d1df698da5557c99cf6c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 29 Mar 2013 11:42:10 +0000 Subject: [PATCH 188/296] Added -l tags - which lists available tags. - also improved formatting of -l for tests --- include/internal/catch_commandline.hpp | 18 +- include/internal/catch_config.hpp | 5 +- include/internal/catch_line_wrap.h | 1 + include/internal/catch_line_wrap.hpp | 2 +- include/internal/catch_list.hpp | 70 +- .../SelfTest/Baselines/approvedResults.txt | 756 +++++++++++++++--- .../CatchSelfTest/CatchSelfTest/BDDTests.cpp | 5 +- 7 files changed, 710 insertions(+), 147 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 7558e257..4c32d7f3 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -322,7 +322,8 @@ namespace Catch { m_optionNames.push_back( "--list" ); } virtual std::string argsSynopsis() const { - return "[all | tests | reporters [xml]]"; +// return "[all | tests | reporters | tags [xml]]"; + return "[all | tests | reporters | tags]"; } virtual std::string optionSummary() const { return "Lists available tests or reporters"; @@ -331,29 +332,32 @@ namespace Catch { virtual std::string optionDescription() const { return "With no arguments this option will list all registered tests - one per line.\n" - "Supplying the xml argument formats the list as an xml document (which may be useful for " - "consumption by other tools).\n" +// "Supplying the xml argument formats the list as an xml document (which may be useful for " +// "consumption by other tools).\n" "Supplying the tests or reporters lists tests or reporters respectively - with descriptions.\n" "\n" "Examples:\n" "\n" " -l\n" " -l tests\n" + " -l tags\n" " -l reporters xml\n" - " -l xml"; + ;//" -l xml"; } virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { - config.listSpec = List::TestNames; + config.listSpec = List::Tests; if( cmd.argsCount() >= 1 ) { if( cmd[0] == "all" ) config.listSpec = List::All; else if( cmd[0] == "tests" ) config.listSpec = List::Tests; + else if( cmd[0] == "tags" ) + config.listSpec = List::Tags; else if( cmd[0] == "reporters" ) config.listSpec = List::Reports; else - cmd.raiseError( "Expected [tests] or [reporters]" ); + cmd.raiseError( "Expected tests, reporters or tags" ); } if( cmd.argsCount() >= 2 ) { if( cmd[1] == "xml" ) @@ -361,7 +365,7 @@ namespace Catch { else if( cmd[1] == "text" ) config.listSpec = static_cast( config.listSpec | List::AsText ); else - cmd.raiseError( "Expected [xml] or [text]" ); + cmd.raiseError( "Expected xml or text" ); } } }; diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 1ef3fff6..0e5de388 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -34,9 +34,8 @@ namespace Catch { Reports = 1, Tests = 2, - All = 3, - - TestNames = 6, + Tags = 4, + All = Reports | Tests | Tags, WhatMask = 0xf, diff --git a/include/internal/catch_line_wrap.h b/include/internal/catch_line_wrap.h index 0ec49cdb..7cd08055 100644 --- a/include/internal/catch_line_wrap.h +++ b/include/internal/catch_line_wrap.h @@ -28,6 +28,7 @@ namespace Catch { const_iterator begin() const { return lines.begin(); } const_iterator end() const { return lines.end(); } + std::string const& last() const { return lines.back(); } std::size_t size() const { return lines.size(); } std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp index a51e98a8..9c6f3019 100644 --- a/include/internal/catch_line_wrap.hpp +++ b/include/internal/catch_line_wrap.hpp @@ -66,7 +66,7 @@ namespace Catch { std::string withoutTab = _str.substr( 0, nextTab ) + _str.substr( nextTab+1 ); return wrapInternal( withoutTab ); } - else if( isWrapPoint( _str[pos] ) ) { + else if( pos > 0 && isWrapPoint( _str[pos] ) ) { wrapPoint = pos; } } diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index f7f0c657..458c3a21 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -36,8 +36,10 @@ namespace Catch { std::size_t maxTagLen = 0; std::size_t maxNameLen = 0; for(; it != itEnd; ++it ) { - maxTagLen = (std::max)( it->getTestCaseInfo().tagsAsString.size(), maxTagLen ); - maxNameLen = (std::max)( it->getTestCaseInfo().name.size(), maxNameLen ); + if( matchesFilters( config.filters, *it ) ) { + maxTagLen = (std::max)( it->getTestCaseInfo().tagsAsString.size(), maxTagLen ); + maxNameLen = (std::max)( it->getTestCaseInfo().name.size(), maxNameLen ); + } } // Try to fit everything in. If not shrink tag column first, down to 30 @@ -66,9 +68,13 @@ namespace Catch { nameCol = nameWrapper[i]; else nameCol = " ..."; - std::cout << nameCol << " " << std::string( maxNameLen - nameCol.size(), ' ' ); - if( i < tagsWrapper.size() ) - std::cout << tagsWrapper[i]; + std::cout << nameCol; + if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) { + if( i == 0 ) + std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " " << tagsWrapper[i]; + else + std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " " << tagsWrapper[i]; + } std::cout << "\n"; } } @@ -78,6 +84,54 @@ namespace Catch { else std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; } + + inline void listTags( const ConfigData& config ) { + if( config.filters.empty() ) + std::cout << "All available tags:\n"; + else + std::cout << "Matching tags:\n"; + std::vector const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests(); + std::vector::const_iterator it = allTests.begin(), itEnd = allTests.end(); + + std::map tagCounts; + + std::size_t maxTagLen = 0; + + for(; it != itEnd; ++it ) { + if( matchesFilters( config.filters, *it ) ) { + for( std::set::const_iterator tagIt = it->getTestCaseInfo().tags.begin(), + tagItEnd = it->getTestCaseInfo().tags.end(); + tagIt != tagItEnd; + ++tagIt ) { + std::string tagName = "[" + *tagIt + "]"; + maxTagLen = (std::max)( maxTagLen, tagName.size() ); + std::map::iterator countIt = tagCounts.find( tagName ); + if( countIt == tagCounts.end() ) + tagCounts.insert( std::make_pair( tagName, 1 ) ); + else + countIt->second++; + } + } + } + maxTagLen +=2; + if( maxTagLen > CATCH_CONFIG_CONSOLE_WIDTH-10 ) + maxTagLen = CATCH_CONFIG_CONSOLE_WIDTH-10; + + for( std::map::const_iterator countIt = tagCounts.begin(), countItEnd = tagCounts.end(); + countIt != countItEnd; + ++countIt ) { + LineWrapper wrapper; + wrapper.setIndent(2).setRight( maxTagLen ).wrap( countIt->first ); + + std::cout << wrapper; + if( maxTagLen > wrapper.last().size() ) + std::cout << std::string( maxTagLen - wrapper.last().size(), '.' ); + std::cout << ".. " + << countIt->second + << "\n"; + } + std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; + } inline void listReporters( const ConfigData& /*config*/ ) { std::cout << "Available reports:\n"; @@ -93,9 +147,11 @@ namespace Catch { inline void list( const ConfigData& config ) { if( config.listSpec & List::Tests ) listTests( config ); - else if( config.listSpec & List::Reports ) + if( config.listSpec & List::Tags ) + listTags( config ); + if( config.listSpec & List::Reports ) listReporters( config ); - else + if( ( config.listSpec & List::All ) == 0 ) throw std::logic_error( "Unknown list type" ); } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 43fd126a..cc251b7e 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -3673,8 +3673,8 @@ TestMain.cpp:226: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: - "Error while parsing arguments. threshold must be a number greater than - zero. Arguments were: 0" contains: "greater than zero" + "Error while parsing arguments. threshold must be a number greater than zero + . Arguments were: 0" contains: "greater than zero" ------------------------------------------------------------------------------- selftest/parser/2 @@ -3686,8 +3686,8 @@ TestMain.cpp:230: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: - "Error while parsing arguments. threshold must be a number greater than - zero. Arguments were: oops" contains: "greater than zero" + "Error while parsing arguments. threshold must be a number greater than zero + . Arguments were: oops" contains: "greater than zero" ------------------------------------------------------------------------------- selftest/parser/2 @@ -4173,7 +4173,7 @@ Long strings can be wrapped TestMain.cpp:435: PASSED: - CHECK( Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString ) + CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" == @@ -4181,7 +4181,7 @@ with expansion: TestMain.cpp:436: PASSED: - CHECK( Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString ) + CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" == @@ -4195,7 +4195,7 @@ Long strings can be wrapped TestMain.cpp:439: PASSED: - CHECK( Catch::LineWrapper( 17 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Catch::LineWrapper().setRight( 17 ).wrap( testString ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4205,7 +4205,7 @@ with expansion: TestMain.cpp:440: PASSED: - CHECK( Catch::LineWrapper( 16 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Catch::LineWrapper().setRight( 16 ).wrap( testString ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4215,7 +4215,7 @@ with expansion: TestMain.cpp:441: PASSED: - CHECK( Catch::LineWrapper( 15 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Catch::LineWrapper().setRight( 15 ).wrap( testString ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4225,7 +4225,7 @@ with expansion: TestMain.cpp:442: PASSED: - CHECK( Catch::LineWrapper( 14 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Catch::LineWrapper().setRight( 14 ).wrap( testString ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4235,7 +4235,7 @@ with expansion: TestMain.cpp:443: PASSED: - CHECK( Catch::LineWrapper( 13 ).wrap( testString ).toString() == "one two\nthree four" ) + CHECK( Catch::LineWrapper().setRight( 13 ).wrap( testString ).toString() == "one two\nthree four" ) with expansion: "one two three four" @@ -4251,7 +4251,7 @@ Long strings can be wrapped TestMain.cpp:446: PASSED: - CHECK( Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4263,7 +4263,7 @@ with expansion: TestMain.cpp:447: PASSED: - CHECK( Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4281,7 +4281,7 @@ Long strings can be wrapped TestMain.cpp:450: PASSED: - CHECK( Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4295,7 +4295,7 @@ with expansion: TestMain.cpp:451: PASSED: - CHECK( Catch::LineWrapper( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4315,7 +4315,7 @@ Long strings can be wrapped TestMain.cpp:454: PASSED: - CHECK( Catch::LineWrapper( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" ) + CHECK( Catch::LineWrapper().setRight( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" ) with expansion: "abc- def" @@ -4325,7 +4325,7 @@ with expansion: TestMain.cpp:455: PASSED: - CHECK( Catch::LineWrapper( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" ) + CHECK( Catch::LineWrapper().setRight( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" ) with expansion: "abc- defg" @@ -4335,7 +4335,7 @@ with expansion: TestMain.cpp:456: PASSED: - CHECK( Catch::LineWrapper( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" ) + CHECK( Catch::LineWrapper().setRight( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" ) with expansion: "abc- def- @@ -4347,7 +4347,7 @@ with expansion: TestMain.cpp:458: PASSED: - CHECK( Catch::LineWrapper( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" ) + CHECK( Catch::LineWrapper().setRight( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" ) with expansion: "one two @@ -4363,7 +4363,7 @@ with expansion: TestMain.cpp:459: PASSED: - CHECK( Catch::LineWrapper( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ) + CHECK( Catch::LineWrapper().setRight( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ) with expansion: "one two @@ -4379,15 +4379,51 @@ with expansion: fo- ur" +------------------------------------------------------------------------------- +Long strings can be wrapped + plain string + As container +............................................................................... + +TestMain.cpp:464: +PASSED: + CHECK( wrapper.size() == 4 ) +with expansion: + 4 == 4 + +TestMain.cpp:465: +PASSED: + CHECK( wrapper[0] == "one" ) +with expansion: + "one" == "one" + +TestMain.cpp:466: +PASSED: + CHECK( wrapper[1] == "two" ) +with expansion: + "two" == "two" + +TestMain.cpp:467: +PASSED: + CHECK( wrapper[2] == "three" ) +with expansion: + "three" == "three" + +TestMain.cpp:468: +PASSED: + CHECK( wrapper[3] == "four" ) +with expansion: + "four" == "four" + ------------------------------------------------------------------------------- Long strings can be wrapped With newlines No wrapping ............................................................................... -TestMain.cpp:469: +TestMain.cpp:478: PASSED: - CHECK( Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString ) + CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" @@ -4395,9 +4431,9 @@ with expansion: "one two three four" -TestMain.cpp:470: +TestMain.cpp:479: PASSED: - CHECK( Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString ) + CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" @@ -4405,9 +4441,9 @@ with expansion: "one two three four" -TestMain.cpp:471: +TestMain.cpp:480: PASSED: - CHECK( Catch::LineWrapper( 10 ).wrap( testString ).toString() == testString ) + CHECK( Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" @@ -4421,9 +4457,9 @@ Long strings can be wrapped Trailing newline ............................................................................... -TestMain.cpp:474: +TestMain.cpp:483: PASSED: - CHECK( Catch::LineWrapper( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) + CHECK( Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) with expansion: "abcdef " @@ -4431,15 +4467,15 @@ with expansion: "abcdef " -TestMain.cpp:475: +TestMain.cpp:484: PASSED: - CHECK( Catch::LineWrapper( 6 ).wrap( "abcdef" ).toString() == "abcdef" ) + CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" ) with expansion: "abcdef" == "abcdef" -TestMain.cpp:476: +TestMain.cpp:485: PASSED: - CHECK( Catch::LineWrapper( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) + CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) with expansion: "abcdef " @@ -4453,9 +4489,9 @@ Long strings can be wrapped Wrapped once ............................................................................... -TestMain.cpp:479: +TestMain.cpp:488: PASSED: - CHECK( Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4465,9 +4501,9 @@ with expansion: three four" -TestMain.cpp:480: +TestMain.cpp:489: PASSED: - CHECK( Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4477,9 +4513,9 @@ with expansion: three four" -TestMain.cpp:481: +TestMain.cpp:490: PASSED: - CHECK( Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4495,9 +4531,9 @@ Long strings can be wrapped Wrapped twice ............................................................................... -TestMain.cpp:484: +TestMain.cpp:493: PASSED: - CHECK( Catch::LineWrapper( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4785,9 +4821,9 @@ with expansion: ------------------------------------------------------------------------------- Scenario: Do that thing with the thing - Given: This stuff exists - When: I do this - Then: it should do this + Given: This stuff exists + When: I do this + Then: it should do this ............................................................................... BDDTests.cpp:21: @@ -4798,10 +4834,10 @@ with expansion: ------------------------------------------------------------------------------- Scenario: Do that thing with the thing - Given: This stuff exists - When: I do this - Then: it should do this - And: do that + Given: This stuff exists + When: I do this + Then: it should do this + And: do that ............................................................................... BDDTests.cpp:23: @@ -4810,6 +4846,165 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +............................................................................... + +BDDTests.cpp:32: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: it is made larger + Then: the size and capacity go up +............................................................................... + +BDDTests.cpp:37: +PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +BDDTests.cpp:38: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: it is made larger + Then: the size and capacity go up + And when: it is made smaller again + Then: the size goes down but the capacity stays the same +............................................................................... + +BDDTests.cpp:43: +PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +BDDTests.cpp:44: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +............................................................................... + +BDDTests.cpp:32: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: it is made larger + Then: the size and capacity go up +............................................................................... + +BDDTests.cpp:37: +PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +BDDTests.cpp:38: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +............................................................................... + +BDDTests.cpp:32: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: it is made larger + Then: the size and capacity go up +............................................................................... + +BDDTests.cpp:37: +PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +BDDTests.cpp:38: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +............................................................................... + +BDDTests.cpp:32: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +............................................................................... + +BDDTests.cpp:32: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: we reserve more space + Then: The capacity is increased but the size remains the same +............................................................................... + +BDDTests.cpp:53: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +BDDTests.cpp:54: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: This is a really long scenario name to see how the list command deals with wrapping +............................................................................... + + +No assertions in test case, 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' + ------------------------------------------------------------------------------- Anonymous test case 1 ............................................................................... @@ -4839,7 +5034,7 @@ with message: no assertions =============================================================================== -106 test cases - 47 failed (676 assertions - 104 failed) +108 test cases - 48 failed (697 assertions - 105 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -5134,7 +5329,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -5574,6 +5769,8 @@ TrickyTests.cpp:106 + + @@ -10377,7 +10574,7 @@ TestMain.cpp" line="423">
TestMain.cpp" line="435"> - Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString + Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString "one two three four" @@ -10387,7 +10584,7 @@ TestMain.cpp" line="435"> TestMain.cpp" line="436"> - Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString + Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString "one two three four" @@ -10403,7 +10600,7 @@ TestMain.cpp" line="436">
TestMain.cpp" line="439"> - Catch::LineWrapper( 17 ).wrap( testString ).toString() == "one two three\nfour" + Catch::LineWrapper().setRight( 17 ).wrap( testString ).toString() == "one two three\nfour" "one two three @@ -10415,7 +10612,7 @@ four" TestMain.cpp" line="440"> - Catch::LineWrapper( 16 ).wrap( testString ).toString() == "one two three\nfour" + Catch::LineWrapper().setRight( 16 ).wrap( testString ).toString() == "one two three\nfour" "one two three @@ -10427,7 +10624,7 @@ four" TestMain.cpp" line="441"> - Catch::LineWrapper( 15 ).wrap( testString ).toString() == "one two three\nfour" + Catch::LineWrapper().setRight( 15 ).wrap( testString ).toString() == "one two three\nfour" "one two three @@ -10439,7 +10636,7 @@ four" TestMain.cpp" line="442"> - Catch::LineWrapper( 14 ).wrap( testString ).toString() == "one two three\nfour" + Catch::LineWrapper().setRight( 14 ).wrap( testString ).toString() == "one two three\nfour" "one two three @@ -10451,7 +10648,7 @@ four" TestMain.cpp" line="443"> - Catch::LineWrapper( 13 ).wrap( testString ).toString() == "one two\nthree four" + Catch::LineWrapper().setRight( 13 ).wrap( testString ).toString() == "one two\nthree four" "one two @@ -10469,7 +10666,7 @@ three four"
TestMain.cpp" line="446"> - Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" + Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" "one two @@ -10483,7 +10680,7 @@ four" TestMain.cpp" line="447"> - Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" + Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" "one two @@ -10503,7 +10700,7 @@ four"
TestMain.cpp" line="450"> - Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" "one @@ -10519,7 +10716,7 @@ four" TestMain.cpp" line="451"> - Catch::LineWrapper( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + Catch::LineWrapper().setRight( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" "one @@ -10541,7 +10738,7 @@ four"
TestMain.cpp" line="454"> - Catch::LineWrapper( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" + Catch::LineWrapper().setRight( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" "abc- @@ -10553,7 +10750,7 @@ def" TestMain.cpp" line="455"> - Catch::LineWrapper( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" + Catch::LineWrapper().setRight( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" "abc- @@ -10565,7 +10762,7 @@ defg" TestMain.cpp" line="456"> - Catch::LineWrapper( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" + Catch::LineWrapper().setRight( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" "abc- @@ -10579,7 +10776,7 @@ gh" TestMain.cpp" line="458"> - Catch::LineWrapper( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" + Catch::LineWrapper().setRight( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" "one @@ -10597,7 +10794,7 @@ four" TestMain.cpp" line="459"> - Catch::LineWrapper( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" + Catch::LineWrapper().setRight( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" "one @@ -10619,14 +10816,60 @@ ur"
+
+
+TestMain.cpp" line="464"> + + wrapper.size() == 4 + + + 4 == 4 + + +TestMain.cpp" line="465"> + + wrapper[0] == "one" + + + "one" == "one" + + +TestMain.cpp" line="466"> + + wrapper[1] == "two" + + + "two" == "two" + + +TestMain.cpp" line="467"> + + wrapper[2] == "three" + + + "three" == "three" + + +TestMain.cpp" line="468"> + + wrapper[3] == "four" + + + "four" == "four" + + + +
+ +
-TestMain.cpp" line="469"> +TestMain.cpp" line="478"> - Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString + Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString "one two @@ -10636,9 +10879,9 @@ three four" three four" -TestMain.cpp" line="470"> +TestMain.cpp" line="479"> - Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString + Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString "one two @@ -10648,9 +10891,9 @@ three four" three four" -TestMain.cpp" line="471"> +TestMain.cpp" line="480"> - Catch::LineWrapper( 10 ).wrap( testString ).toString() == testString + Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString "one two @@ -10666,9 +10909,9 @@ three four"
-TestMain.cpp" line="474"> +TestMain.cpp" line="483"> - Catch::LineWrapper( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" + Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" "abcdef @@ -10678,17 +10921,17 @@ TestMain.cpp" line="474"> " -TestMain.cpp" line="475"> +TestMain.cpp" line="484"> - Catch::LineWrapper( 6 ).wrap( "abcdef" ).toString() == "abcdef" + Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" "abcdef" == "abcdef" -TestMain.cpp" line="476"> +TestMain.cpp" line="485"> - Catch::LineWrapper( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" + Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" "abcdef @@ -10704,9 +10947,9 @@ TestMain.cpp" line="476">
-TestMain.cpp" line="479"> +TestMain.cpp" line="488"> - Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" + Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" "one two @@ -10718,9 +10961,9 @@ three four" -TestMain.cpp" line="480"> +TestMain.cpp" line="489"> - Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" + Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" "one two @@ -10732,9 +10975,9 @@ three four" -TestMain.cpp" line="481"> +TestMain.cpp" line="490"> - Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" + Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" "one two @@ -10752,9 +10995,9 @@ four"
-TestMain.cpp" line="484"> +TestMain.cpp" line="493"> - Catch::LineWrapper( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" "one @@ -11063,9 +11306,9 @@ TrickyTests.cpp" line="335"> -
-
-
+
+
+
BDDTests.cpp" line="21"> itDoesThis() @@ -11074,7 +11317,7 @@ BDDTests.cpp" line="21"> true -
+
BDDTests.cpp" line="23"> itDoesThat() @@ -11093,6 +11336,183 @@ BDDTests.cpp" line="23">
+ +
+BDDTests.cpp" line="32"> + + v.size() == 0 + + + 0 == 0 + + +
+
+BDDTests.cpp" line="37"> + + v.size() == 10 + + + 10 == 10 + + +BDDTests.cpp" line="38"> + + v.capacity() >= 10 + + + 10 >= 10 + + +
+
+BDDTests.cpp" line="43"> + + v.size() == 5 + + + 5 == 5 + + +BDDTests.cpp" line="44"> + + v.capacity() >= 10 + + + 10 >= 10 + + + +
+ +
+ +
+ +
+ +
+
+BDDTests.cpp" line="32"> + + v.size() == 0 + + + 0 == 0 + + +
+
+BDDTests.cpp" line="37"> + + v.size() == 10 + + + 10 == 10 + + +BDDTests.cpp" line="38"> + + v.capacity() >= 10 + + + 10 >= 10 + + +
+ +
+ +
+ +
+ +
+
+BDDTests.cpp" line="32"> + + v.size() == 0 + + + 0 == 0 + + +
+
+BDDTests.cpp" line="37"> + + v.size() == 10 + + + 10 == 10 + + +BDDTests.cpp" line="38"> + + v.capacity() >= 10 + + + 10 >= 10 + + + +
+ +
+ +
+
+BDDTests.cpp" line="32"> + + v.size() == 0 + + + 0 == 0 + + +
+ +
+ +
+
+BDDTests.cpp" line="32"> + + v.size() == 0 + + + 0 == 0 + + +
+
+BDDTests.cpp" line="53"> + + v.capacity() >= 10 + + + 10 >= 10 + + +BDDTests.cpp" line="54"> + + v.size() == 0 + + + 0 == 0 + + + +
+ +
+ +
+ +
+ + + @@ -11105,9 +11525,9 @@ BDDTests.cpp" line="23">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -12413,11 +12833,11 @@ TestMain.cpp:423: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false [Running: Long strings can be wrapped] [Started section: 'plain string'] [Started section: 'No wrapping'] -TestMain.cpp:435: Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:435: Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:436: Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:436: Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString succeeded for: "one two three four" == "one two three four" @@ -12427,31 +12847,31 @@ TestMain.cpp:436: Catch::LineWrapper( 18 ).wrap( testString ).toString() == test [Started section: 'plain string'] [Started section: 'Wrapped once'] -TestMain.cpp:439: Catch::LineWrapper( 17 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:439: Catch::LineWrapper().setRight( 17 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:440: Catch::LineWrapper( 16 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:440: Catch::LineWrapper().setRight( 16 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:441: Catch::LineWrapper( 15 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:441: Catch::LineWrapper().setRight( 15 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:442: Catch::LineWrapper( 14 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:442: Catch::LineWrapper().setRight( 14 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:443: Catch::LineWrapper( 13 ).wrap( testString ).toString() == "one two\nthree four" succeeded for: +TestMain.cpp:443: Catch::LineWrapper().setRight( 13 ).wrap( testString ).toString() == "one two\nthree four" succeeded for: "one two three four" == @@ -12463,7 +12883,7 @@ three four" [Started section: 'plain string'] [Started section: 'Wrapped twice'] -TestMain.cpp:446: Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:446: Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -12471,7 +12891,7 @@ four" "one two three four" -TestMain.cpp:447: Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:447: Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -12485,7 +12905,7 @@ four" [Started section: 'plain string'] [Started section: 'Wrapped three times'] -TestMain.cpp:450: Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:450: Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -12495,7 +12915,7 @@ four" two three four" -TestMain.cpp:451: Catch::LineWrapper( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:451: Catch::LineWrapper().setRight( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -12511,24 +12931,24 @@ four" [Started section: 'plain string'] [Started section: 'Short wrap'] -TestMain.cpp:454: Catch::LineWrapper( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" succeeded for: "abc- +TestMain.cpp:454: Catch::LineWrapper().setRight( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" succeeded for: "abc- def" == "abc- def" -TestMain.cpp:455: Catch::LineWrapper( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" succeeded for: "abc- +TestMain.cpp:455: Catch::LineWrapper().setRight( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" succeeded for: "abc- defg" == "abc- defg" -TestMain.cpp:456: Catch::LineWrapper( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- +TestMain.cpp:456: Catch::LineWrapper().setRight( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- def- gh" == "abc- def- gh" -TestMain.cpp:458: Catch::LineWrapper( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: +TestMain.cpp:458: Catch::LineWrapper().setRight( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: "one two thr- @@ -12540,7 +12960,7 @@ two thr- ee four" -TestMain.cpp:459: Catch::LineWrapper( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: +TestMain.cpp:459: Catch::LineWrapper().setRight( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: "one two th- @@ -12558,21 +12978,32 @@ ur" [End of section: 'plain string' All 5 assertions passed] +[Started section: 'plain string'] +[Started section: 'As container'] +TestMain.cpp:464: wrapper.size() == 4 succeeded for: 4 == 4 +TestMain.cpp:465: wrapper[0] == "one" succeeded for: "one" == "one" +TestMain.cpp:466: wrapper[1] == "two" succeeded for: "two" == "two" +TestMain.cpp:467: wrapper[2] == "three" succeeded for: "three" == "three" +TestMain.cpp:468: wrapper[3] == "four" succeeded for: "four" == "four" +[End of section: 'As container' All 5 assertions passed] + +[End of section: 'plain string' All 5 assertions passed] + [Started section: 'With newlines'] [Started section: 'No wrapping'] -TestMain.cpp:469: Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:478: Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:470: Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:479: Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:471: Catch::LineWrapper( 10 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:480: Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString succeeded for: "one two three four" == @@ -12584,13 +13015,13 @@ three four" [Started section: 'With newlines'] [Started section: 'Trailing newline'] -TestMain.cpp:474: Catch::LineWrapper( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:483: Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef " -TestMain.cpp:475: Catch::LineWrapper( 6 ).wrap( "abcdef" ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" -TestMain.cpp:476: Catch::LineWrapper( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:484: Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" +TestMain.cpp:485: Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef @@ -12601,7 +13032,7 @@ TestMain.cpp:476: Catch::LineWrapper( 6 ).wrap( "abcdef\n" ).toString() == "abcd [Started section: 'With newlines'] [Started section: 'Wrapped once'] -TestMain.cpp:479: Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:488: Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -12609,7 +13040,7 @@ four" "one two three four" -TestMain.cpp:480: Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:489: Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -12617,7 +13048,7 @@ four" "one two three four" -TestMain.cpp:481: Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:490: Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -12631,7 +13062,7 @@ four" [Started section: 'With newlines'] [Started section: 'Wrapped twice'] -TestMain.cpp:484: Catch::LineWrapper( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:493: Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -12645,7 +13076,7 @@ four" [End of section: 'With newlines' 1 assertion passed] -[Finished: 'Long strings can be wrapped' All tests passed (26 assertions in 1 test case)] +[Finished: 'Long strings can be wrapped' All tests passed (31 assertions in 1 test case)] [Running: ./succeeding/Tricky/std::pair] TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: std::pair( 1, 2 ) == std::pair( 1, 2 ) @@ -12749,22 +13180,91 @@ TrickyTests.cpp:335: Catch::isTrue( true ) succeeded for: true [Finished: 'Assertions then sections' All tests passed (6 assertions in 1 test case)] [Running: Scenario: Do that thing with the thing] -[Started section: 'Given: This stuff exists'] -[Started section: ' When: I do this'] -[Started section: ' Then: it should do this'] +[Started section: ' Given: This stuff exists'] +[Started section: ' When: I do this'] +[Started section: ' Then: it should do this'] BDDTests.cpp:21: itDoesThis() succeeded for: true -[Started section: ' And: do that'] +[Started section: ' And: do that'] BDDTests.cpp:23: itDoesThat() succeeded for: true -[End of section: ' And: do that' 1 assertion passed] +[End of section: ' And: do that' 1 assertion passed] -[End of section: ' Then: it should do this' All 2 assertions passed] +[End of section: ' Then: it should do this' All 2 assertions passed] -[End of section: ' When: I do this' All 2 assertions passed] +[End of section: ' When: I do this' All 2 assertions passed] -[End of section: 'Given: This stuff exists' All 2 assertions passed] +[End of section: ' Given: This stuff exists' All 2 assertions passed] [Finished: 'Scenario: Do that thing with the thing' All tests passed (2 assertions in 1 test case)] +[Running: Scenario: Vector resizing affects size and capacity] +[Started section: ' Given: an empty vector'] +BDDTests.cpp:32: v.size() == 0 succeeded for: 0 == 0 +[Started section: ' When: it is made larger'] +[Started section: ' Then: the size and capacity go up'] +BDDTests.cpp:37: v.size() == 10 succeeded for: 10 == 10 +BDDTests.cpp:38: v.capacity() >= 10 succeeded for: 10 >= 10 +[Started section: 'And when: it is made smaller again'] +[Started section: ' Then: the size goes down but the capacity stays the same'] +BDDTests.cpp:43: v.size() == 5 succeeded for: 5 == 5 +BDDTests.cpp:44: v.capacity() >= 10 succeeded for: 10 >= 10 +[End of section: ' Then: the size goes down but the capacity stays the same' All 2 assertions passed] + +[End of section: 'And when: it is made smaller again' All 2 assertions passed] + +[End of section: ' Then: the size and capacity go up' All 4 assertions passed] + +[End of section: ' When: it is made larger' All 4 assertions passed] + +[End of section: ' Given: an empty vector' All 5 assertions passed] + +[Started section: ' Given: an empty vector'] +BDDTests.cpp:32: v.size() == 0 succeeded for: 0 == 0 +[Started section: ' When: it is made larger'] +[Started section: ' Then: the size and capacity go up'] +BDDTests.cpp:37: v.size() == 10 succeeded for: 10 == 10 +BDDTests.cpp:38: v.capacity() >= 10 succeeded for: 10 >= 10 +[End of section: ' Then: the size and capacity go up' All 2 assertions passed] + +[End of section: ' When: it is made larger' All 2 assertions passed] + +[End of section: ' Given: an empty vector' All 3 assertions passed] + +[Started section: ' Given: an empty vector'] +BDDTests.cpp:32: v.size() == 0 succeeded for: 0 == 0 +[Started section: ' When: it is made larger'] +[Started section: ' Then: the size and capacity go up'] +BDDTests.cpp:37: v.size() == 10 succeeded for: 10 == 10 +BDDTests.cpp:38: v.capacity() >= 10 succeeded for: 10 >= 10 +[End of section: ' Then: the size and capacity go up' All 2 assertions passed] + +[End of section: ' When: it is made larger' All 2 assertions passed] + +[End of section: ' Given: an empty vector' All 3 assertions passed] + +[Started section: ' Given: an empty vector'] +BDDTests.cpp:32: v.size() == 0 succeeded for: 0 == 0 +[End of section: ' Given: an empty vector' 1 assertion passed] + +[Started section: ' Given: an empty vector'] +BDDTests.cpp:32: v.size() == 0 succeeded for: 0 == 0 +[Started section: ' When: we reserve more space'] +[Started section: ' Then: The capacity is increased but the size remains the same'] +BDDTests.cpp:53: v.capacity() >= 10 succeeded for: 10 >= 10 +BDDTests.cpp:54: v.size() == 0 succeeded for: 0 == 0 +[End of section: ' Then: The capacity is increased but the size remains the same' All 2 assertions passed] + +[End of section: ' When: we reserve more space' All 2 assertions passed] + +[End of section: ' Given: an empty vector' All 3 assertions passed] + +[Finished: 'Scenario: Vector resizing affects size and capacity' All tests passed (15 assertions in 1 test case)] + +[Running: Scenario: This is a really long scenario name to see how the list command deals with wrapping] + +No assertions in test case, 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' + +[Finished: 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' 1 test case failed (1 assertion failed)] + [Running: Anonymous test case 1] VariadicMacrosTests.cpp:14: succeeded [with message: anonymous test case] @@ -12782,10 +13282,10 @@ VariadicMacrosTests.cpp:26: succeeded [End of section: 'Section with one argument' 1 assertion passed] [Finished: 'Variadic macros' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 47 of 106 test cases failed (104 of 676 assertions failed)] +[End of group: '~dummy'. 48 of 108 test cases failed (105 of 697 assertions failed)] -[Testing completed. 47 of 106 test cases failed (104 of 676 assertions failed)] +[Testing completed. 48 of 108 test cases failed (105 of 697 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index 161d8b09..bdde0333 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -57,5 +57,8 @@ SCENARIO( "Vector resizing affects size and capacity", "[vector][bdd][size][capa } } -SCENARIO( "This is a really long scenario name to see how the list command deals with wrapping", "[very long tags][lots][long][tags][verbose]" ) { +SCENARIO( "This is a really long scenario name to see how the list command deals with wrapping", + "[very long tags][lots][long][tags][verbose]" + "[one very long tag name that should cause line wrapping writing out using the list command]" + "[anotherReallyLongTagNameButThisOneHasNoObviousWrapPointsSoShouldSplitWithinAWordUsingADashCharacter]" ) { } From 38f7eef6feeaf65b7b65e49da74ffc2c5cc19398 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 29 Mar 2013 13:44:33 +0000 Subject: [PATCH 189/296] build 29 --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 388 ++++++++++++++++++++--------- 3 files changed, 275 insertions(+), 117 deletions(-) diff --git a/README.md b/README.md index 329c4592..71360025 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 28 (integration branch) +## CATCH v0.9 build 29 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 9e61b30e..d271e4c7 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 28, "integration" ); + Version libraryVersion( 0, 9, 29, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 3027eba8..c78dc5d2 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 28 (integration branch) - * Generated: 2013-03-25 09:25:14.678493 + * CATCH v0.9 build 29 (integration branch) + * Generated: 2013-03-29 13:43:27.058903 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -1417,6 +1417,7 @@ namespace Catch { std::string className; std::string description; std::set tags; + std::string tagsAsString; SourceLineInfo lineInfo; bool isHidden; }; @@ -1917,9 +1918,8 @@ namespace Catch { Reports = 1, Tests = 2, - All = 3, - - TestNames = 6, + Tags = 4, + All = Reports | Tests | Tags, WhatMask = 0xf, @@ -3786,7 +3786,8 @@ namespace Catch { m_optionNames.push_back( "--list" ); } virtual std::string argsSynopsis() const { - return "[all | tests | reporters [xml]]"; +// return "[all | tests | reporters | tags [xml]]"; + return "[all | tests | reporters | tags]"; } virtual std::string optionSummary() const { return "Lists available tests or reporters"; @@ -3795,29 +3796,32 @@ namespace Catch { virtual std::string optionDescription() const { return "With no arguments this option will list all registered tests - one per line.\n" - "Supplying the xml argument formats the list as an xml document (which may be useful for " - "consumption by other tools).\n" +// "Supplying the xml argument formats the list as an xml document (which may be useful for " +// "consumption by other tools).\n" "Supplying the tests or reporters lists tests or reporters respectively - with descriptions.\n" "\n" "Examples:\n" "\n" " -l\n" " -l tests\n" + " -l tags\n" " -l reporters xml\n" - " -l xml"; + ;//" -l xml"; } virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { - config.listSpec = List::TestNames; + config.listSpec = List::Tests; if( cmd.argsCount() >= 1 ) { if( cmd[0] == "all" ) config.listSpec = List::All; else if( cmd[0] == "tests" ) config.listSpec = List::Tests; + else if( cmd[0] == "tags" ) + config.listSpec = List::Tags; else if( cmd[0] == "reporters" ) config.listSpec = List::Reports; else - cmd.raiseError( "Expected [tests] or [reporters]" ); + cmd.raiseError( "Expected tests, reporters or tags" ); } if( cmd.argsCount() >= 2 ) { if( cmd[1] == "xml" ) @@ -3825,7 +3829,7 @@ namespace Catch { else if( cmd[1] == "text" ) config.listSpec = static_cast( config.listSpec | List::AsText ); else - cmd.raiseError( "Expected [xml] or [text]" ); + cmd.raiseError( "Expected xml or text" ); } } }; @@ -4144,7 +4148,53 @@ namespace Catch { // #included from: internal/catch_list.hpp #define TWOBLUECUBES_CATCH_LIST_HPP_INCLUDED +// #included from: catch_line_wrap.h +#define TWOBLUECUBES_CATCH_LINE_WRAP_H_INCLUDED + +#include +#include + +namespace Catch { + + class LineWrapper { + public: + LineWrapper(); + + LineWrapper& setIndent( std::size_t _indent ); + LineWrapper& setRight( std::size_t _right ); + + LineWrapper& wrap( std::string const& _str ); + + std::string toString() const; + + typedef std::vector::const_iterator const_iterator; + + const_iterator begin() const { return lines.begin(); } + const_iterator end() const { return lines.end(); } + std::string const& last() const { return lines.back(); } + std::size_t size() const { return lines.size(); } + std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } + + friend std::ostream& operator << ( std::ostream& _stream, LineWrapper const& _lineWrapper ); + + private: + void wrapInternal( std::string const& _str ); + void addLine( const std::string& _line ); + bool isWrapPoint( char c ); + + std::string indent; + std::size_t right; + std::size_t nextTab; + std::size_t tab; + std::string wrappableChars; + int recursionCount; + std::vector lines; + }; + +} // end namespace Catch + #include +#include namespace Catch { inline bool matchesFilters( const std::vector& filters, const TestCase& testCase ) { @@ -4155,47 +4205,136 @@ namespace Catch { return false; return true; } - inline void List( const ConfigData& config ) { - if( config.listSpec & List::Reports ) { - std::cout << "Available reports:\n"; - IReporterRegistry::FactoryMap::const_iterator it = getRegistryHub().getReporterRegistry().getFactories().begin(); - IReporterRegistry::FactoryMap::const_iterator itEnd = getRegistryHub().getReporterRegistry().getFactories().end(); - for(; it != itEnd; ++it ) { - // !TBD: consider listAs() - std::cout << "\t" << it->first << "\n\t\t'" << it->second->getDescription() << "'\n"; + inline void listTests( const ConfigData& config ) { + if( config.filters.empty() ) + std::cout << "All available test cases:\n"; + else + std::cout << "Matching test cases:\n"; + std::vector const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests(); + std::vector::const_iterator it = allTests.begin(), itEnd = allTests.end(); + + // First pass - get max tags + std::size_t maxTagLen = 0; + std::size_t maxNameLen = 0; + for(; it != itEnd; ++it ) { + if( matchesFilters( config.filters, *it ) ) { + maxTagLen = (std::max)( it->getTestCaseInfo().tagsAsString.size(), maxTagLen ); + maxNameLen = (std::max)( it->getTestCaseInfo().name.size(), maxNameLen ); } - std::cout << std::endl; } - if( config.listSpec & List::Tests ) { - if( config.filters.empty() ) - std::cout << "All available test cases:\n"; + // Try to fit everything in. If not shrink tag column first, down to 30 + // then shrink name column until it all fits (strings will be wrapped within column) + while( maxTagLen + maxNameLen > CATCH_CONFIG_CONSOLE_WIDTH-5 ) { + if( maxTagLen > 30 ) + --maxTagLen; else - std::cout << "Matching test cases:\n"; - std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); - std::vector::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end(); - std::size_t matchedTests = 0; - for(; it != itEnd; ++it ) { - if( matchesFilters( config.filters, *it ) ) { - matchedTests++; - // !TBD: consider listAs() - std::cout << " " << it->getTestCaseInfo().name << "\n"; - if( ( config.listSpec & List::TestNames ) != List::TestNames ) - std::cout << " '" << it->getTestCaseInfo().description << "'\n"; + --maxNameLen; + } + + std::size_t matchedTests = 0; + for( it = allTests.begin(); it != itEnd; ++it ) { + if( matchesFilters( config.filters, *it ) ) { + matchedTests++; + // !TBD: consider listAs() + LineWrapper nameWrapper; + nameWrapper.setRight( maxNameLen ).setIndent( 2 ).wrap( it->getTestCaseInfo().name ); + + LineWrapper tagsWrapper; + tagsWrapper.setRight( maxTagLen ).wrap( it->getTestCaseInfo().tagsAsString ); + + for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) { + std::string nameCol; + if( i < nameWrapper.size() ) + nameCol = nameWrapper[i]; + else + nameCol = " ..."; + std::cout << nameCol; + if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) { + if( i == 0 ) + std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " " << tagsWrapper[i]; + else + std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " " << tagsWrapper[i]; + } + std::cout << "\n"; } } - if( config.filters.empty() ) - std::cout << pluralise( matchedTests, "test case" ) << std::endl; - else - std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; } + if( config.filters.empty() ) + std::cout << pluralise( matchedTests, "test case" ) << std::endl; + else + std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; + } - if( ( config.listSpec & List::All ) == 0 ) { - std::ostringstream oss; - oss << "Unknown list type"; - throw std::domain_error( oss.str() ); + inline void listTags( const ConfigData& config ) { + if( config.filters.empty() ) + std::cout << "All available tags:\n"; + else + std::cout << "Matching tags:\n"; + std::vector const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests(); + std::vector::const_iterator it = allTests.begin(), itEnd = allTests.end(); + + std::map tagCounts; + + std::size_t maxTagLen = 0; + + for(; it != itEnd; ++it ) { + if( matchesFilters( config.filters, *it ) ) { + for( std::set::const_iterator tagIt = it->getTestCaseInfo().tags.begin(), + tagItEnd = it->getTestCaseInfo().tags.end(); + tagIt != tagItEnd; + ++tagIt ) { + std::string tagName = "[" + *tagIt + "]"; + maxTagLen = (std::max)( maxTagLen, tagName.size() ); + std::map::iterator countIt = tagCounts.find( tagName ); + if( countIt == tagCounts.end() ) + tagCounts.insert( std::make_pair( tagName, 1 ) ); + else + countIt->second++; + } + } } + maxTagLen +=2; + if( maxTagLen > CATCH_CONFIG_CONSOLE_WIDTH-10 ) + maxTagLen = CATCH_CONFIG_CONSOLE_WIDTH-10; + + for( std::map::const_iterator countIt = tagCounts.begin(), countItEnd = tagCounts.end(); + countIt != countItEnd; + ++countIt ) { + LineWrapper wrapper; + wrapper.setIndent(2).setRight( maxTagLen ).wrap( countIt->first ); + + std::cout << wrapper; + if( maxTagLen > wrapper.last().size() ) + std::cout << std::string( maxTagLen - wrapper.last().size(), '.' ); + std::cout << ".. " + << countIt->second + << "\n"; + } + std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; + } + + inline void listReporters( const ConfigData& /*config*/ ) { + std::cout << "Available reports:\n"; + IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); + IReporterRegistry::FactoryMap::const_iterator it = factories.begin(), itEnd = factories.end(); + for(; it != itEnd; ++it ) { + // !TBD: consider listAs() + std::cout << "\t" << it->first << "\n\t\t'" << it->second->getDescription() << "'\n"; + } + std::cout << std::endl; + } + + inline void list( const ConfigData& config ) { + if( config.listSpec & List::Tests ) + listTests( config ); + if( config.listSpec & List::Tags ) + listTags( config ); + if( config.listSpec & List::Reports ) + listReporters( config ); + if( ( config.listSpec & List::All ) == 0 ) + throw std::logic_error( "Unknown list type" ); } } // end namespace Catch @@ -4748,18 +4887,6 @@ namespace Catch { extern Version libraryVersion; } -// #included from: internal/catch_line_wrap.h -#define TWOBLUECUBES_CATCH_LINE_WRAP_H_INCLUDED - -#include - -namespace Catch { - - void wrapLongStrings( std::ostream& stream, const std::string& str, std::size_t columns, std::size_t indent = 0 ); - std::string wrapLongStrings( const std::string& str, std::size_t columns, std::size_t indent = 0 ); - -} // end namespace Catch - #include #include #include @@ -4869,7 +4996,7 @@ namespace Catch { // Handle list request if( config.listSpec != List::None ) { - List( config ); + list( config ); Catch::cleanUp(); return 0; } @@ -4906,7 +5033,7 @@ namespace Catch { displayedSpecificOption = true; std::cout << "\n" << opt.optionNames() << " " << opt.argsSynopsis() << "\n\n" << opt.optionSummary() << "\n\n" - << wrapLongStrings( opt.optionDescription(), 80, 2 ) << "\n" << std::endl; + << LineWrapper().setIndent( 2 ).wrap( opt.optionDescription() ) << "\n" << std::endl; } } @@ -5839,13 +5966,19 @@ namespace Catch { tags( _tags ), lineInfo( _lineInfo ), isHidden( _isHidden ) - {} + { + std::ostringstream oss; + for( std::set::const_iterator it = _tags.begin(), itEnd = _tags.end(); it != itEnd; ++it ) + oss << "[" << *it << "]"; + tagsAsString = oss.str(); + } TestCaseInfo::TestCaseInfo( const TestCaseInfo& other ) : name( other.name ), className( other.className ), description( other.description ), tags( other.tags ), + tagsAsString( other.tagsAsString ), lineInfo( other.lineInfo ), isHidden( other.isHidden ) {} @@ -5919,7 +6052,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 28, "integration" ); + Version libraryVersion( 0, 9, 29, "integration" ); } // #included from: catch_line_wrap.hpp @@ -5927,62 +6060,91 @@ namespace Catch { namespace Catch { - namespace { - inline void addIndent( std::ostream& os, std::size_t indent ) { - while( indent-- > 0 ) - os << ' '; - } + LineWrapper::LineWrapper() + : right( CATCH_CONFIG_CONSOLE_WIDTH-1 ), + nextTab( 0 ), + tab( 0 ), + wrappableChars( " [({.," ), + recursionCount( 0 ) + {} - inline void recursivelyWrapLine( std::ostream& os, std::string paragraph, std::size_t columns, std::size_t indent ) { - std::size_t width = columns-indent; - std::size_t tab = 0; - std::size_t wrapPoint = width; - for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) { - if( pos == width ) { - addIndent( os, indent ); - if( paragraph[wrapPoint] == ' ' ) { - os << paragraph.substr( 0, wrapPoint ) << "\n"; - while( paragraph[++wrapPoint] == ' ' ); - } - else { - os << paragraph.substr( 0, --wrapPoint ) << "-\n"; - } - return recursivelyWrapLine( os, paragraph.substr( wrapPoint ), columns, indent+tab ); - } - if( paragraph[pos] == '\t' ) { - tab = pos; - paragraph = paragraph.substr( 0, tab ) + paragraph.substr( tab+1 ); - pos--; - } - else if( paragraph[pos] == ' ' ) { - wrapPoint = pos; - } + LineWrapper& LineWrapper::setIndent( std::size_t _indent ) { + indent = std::string( _indent, ' ' ); + return *this; + } + LineWrapper& LineWrapper::setRight( std::size_t _right ) { + right = _right; + return *this; + } + LineWrapper& LineWrapper::wrap( std::string const& _str ) { + nextTab = tab = 0; + wrapInternal( _str ); + return *this; + } + bool LineWrapper::isWrapPoint( char c ) { + return wrappableChars.find( c ) != std::string::npos; + } + void LineWrapper::wrapInternal( std::string const& _str ) { + assert( ++recursionCount < 100 ); + + std::size_t width = right - indent.size(); + std::size_t wrapPoint = width-tab; + for( std::size_t pos = 0; pos < _str.size(); ++pos ) { + if( _str[pos] == '\n' ) + { + addLine( _str.substr( 0, pos ) ); + nextTab = tab = 0; + return wrapInternal( _str.substr( pos+1 ) ); + } + if( pos == width-tab ) { + if( _str[wrapPoint] == ' ' ) { + addLine( _str.substr( 0, wrapPoint ) ); + while( _str[++wrapPoint] == ' ' ); + } + else if( isWrapPoint( _str[wrapPoint] ) ) { + addLine( _str.substr( 0, wrapPoint ) ); + } + else { + addLine( _str.substr( 0, --wrapPoint ) + '-' ); + } + return wrapInternal( _str.substr( wrapPoint ) ); + } + if( _str[pos] == '\t' ) { + nextTab = pos; + std::string withoutTab = _str.substr( 0, nextTab ) + _str.substr( nextTab+1 ); + return wrapInternal( withoutTab ); + } + else if( pos > 0 && isWrapPoint( _str[pos] ) ) { + wrapPoint = pos; } - addIndent( os, indent ); - os << paragraph; } + addLine( _str ); } - void wrapLongStrings( std::ostream& stream, const std::string& str, std::size_t columns, std::size_t indent ) { - std::string::size_type pos = 0; - std::string::size_type newline = str.find_first_of( '\n' ); - while( newline != std::string::npos ) { - std::string paragraph = str.substr( pos, newline-pos ); - recursivelyWrapLine( stream, paragraph, columns, indent ); - stream << "\n"; - pos = newline+1; - newline = str.find_first_of( '\n', pos ); + std::ostream& operator << ( std::ostream& _stream, LineWrapper const& _lineWrapper ) { + for( LineWrapper::const_iterator it = _lineWrapper.begin(), itEnd = _lineWrapper.end(); + it != itEnd; ++it ) { + if( it != _lineWrapper.begin() ) + _stream << "\n"; + _stream << *it; } - if( pos != str.size() ) - recursivelyWrapLine( stream, str.substr( pos, str.size()-pos ), columns, indent ); + return _stream; } - - std::string wrapLongStrings( const std::string& str, std::size_t columns, std::size_t indent ) { + std::string LineWrapper::toString() const { std::ostringstream oss; - wrapLongStrings( oss, str, columns, indent ); + oss << *this; return oss.str(); } + void LineWrapper::addLine( const std::string& _line ) { + if( tab > 0 ) + lines.push_back( indent + std::string( tab, ' ' ) + _line ); + else + lines.push_back( indent + _line ); + if( nextTab > 0 ) + tab = nextTab; + } + } // end namespace Catch // #included from: catch_message.hpp @@ -7207,7 +7369,7 @@ namespace Catch { if( result.hasExpandedExpression() ) { stream << "with expansion:\n"; TextColour colourGuard( TextColour::ReconstructedExpression ); - stream << wrapLongStrings( result.getExpandedExpression() ) << "\n"; + stream << LineWrapper().setIndent(2).wrap( result.getExpandedExpression() ) << "\n"; } } void printMessage() const { @@ -7216,7 +7378,7 @@ namespace Catch { for( std::vector::const_iterator it = messages.begin(), itEnd = messages.end(); it != itEnd; ++it ) { - stream << wrapLongStrings( it->message ) << "\n"; + stream << LineWrapper().setIndent(2).wrap( it->message ) << "\n"; } } void printSourceInfo() const { @@ -7224,10 +7386,6 @@ namespace Catch { stream << result.getSourceInfo() << ": "; } - static std::string wrapLongStrings( std::string const& _string ){ - return Catch::wrapLongStrings( _string, CATCH_CONFIG_CONSOLE_WIDTH-1, 2 ); - } - std::ostream& stream; AssertionStats const& stats; AssertionResult const& result; @@ -7599,11 +7757,11 @@ int main (int argc, char * const argv[]) { #else #define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) #endif -#define GIVEN( desc ) SECTION( "Given: " desc, "" ) -#define WHEN( desc ) SECTION( " When: " desc, "" ) -#define AND_WHEN( desc ) SECTION( " And: " desc, "" ) -#define THEN( desc ) SECTION( " Then: " desc, "" ) -#define AND_THEN( desc ) SECTION( " And: " desc, "" ) +#define GIVEN( desc ) SECTION( " Given: " desc, "" ) +#define WHEN( desc ) SECTION( " When: " desc, "" ) +#define AND_WHEN( desc ) SECTION( "And when: " desc, "" ) +#define THEN( desc ) SECTION( " Then: " desc, "" ) +#define AND_THEN( desc ) SECTION( " And: " desc, "" ) using Catch::Detail::Approx; From 9d15d36748d5dc0de93bd6919f17ef8a48b5c2ca Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 29 Mar 2013 21:39:02 +0000 Subject: [PATCH 190/296] Changed Xcode search paths for easier sharing of projects with Windows --- projects/SelfTest/TestMain.cpp | 2 +- .../CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index ad363d6a..18b9c727 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -10,7 +10,7 @@ #endif #include "catch_self_test.hpp" -#include "catch_line_wrap.h" +#include "internal/catch_line_wrap.h" TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" ) { using namespace Catch; diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 2e8a5d58..114da60b 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -494,7 +494,6 @@ 4A6D0C28149B3D3B00DB3EAA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; @@ -536,13 +535,13 @@ MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/../../../include\""; }; name = Debug; }; 4A6D0C29149B3D3B00DB3EAA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; @@ -577,6 +576,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/../../../include\""; }; name = Release; }; From c7e602f3f2119b3579171af2c7d8cb4facd88a8b Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 29 Mar 2013 21:39:43 +0000 Subject: [PATCH 191/296] Added SecondaryText colour enum - slightly refactored ConsoleColour as well --- include/internal/catch_console_colour.hpp | 4 +- .../internal/catch_console_colour_impl.hpp | 81 +++++++++---------- 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/include/internal/catch_console_colour.hpp b/include/internal/catch_console_colour.hpp index c508a64b..cd7032a7 100644 --- a/include/internal/catch_console_colour.hpp +++ b/include/internal/catch_console_colour.hpp @@ -24,7 +24,9 @@ namespace Catch { Success, OriginalExpression, - ReconstructedExpression + ReconstructedExpression, + + SecondaryText }; virtual void set( Colours colour ) = 0; diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index b54eab4d..2a1e677c 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -18,21 +18,23 @@ namespace { using namespace Catch; WORD mapConsoleColour( IConsoleColourCodes::Colours colour ) { + enum Win32Colours { + Grey = FOREGROUND_INTENSITY, + BrightRed = FOREGROUND_RED | FOREGROUND_INTENSITY, + BrightGreen = FOREGROUND_GREEN | FOREGROUND_INTENSITY, + DarkGreen = FOREGROUND_GREEN, + Turquoise = FOREGROUND_BLUE | FOREGROUND_GREEN, + Yellow = FOREGROUND_RED | FOREGROUND_GREEN + }; switch( colour ) { - case IConsoleColourCodes::FileName: - return FOREGROUND_INTENSITY; // greyed out - case IConsoleColourCodes::ResultError: - return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red - case IConsoleColourCodes::ResultSuccess: - return FOREGROUND_GREEN | FOREGROUND_INTENSITY; // bright green - case IConsoleColourCodes::Error: - return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red - case IConsoleColourCodes::Success: - return FOREGROUND_GREEN; // dark green - case IConsoleColourCodes::OriginalExpression: - return FOREGROUND_BLUE | FOREGROUND_GREEN; // turquoise - case IConsoleColourCodes::ReconstructedExpression: - return FOREGROUND_RED | FOREGROUND_GREEN; // greeny-yellow + case IConsoleColourCodes::FileName: return Grey; + case IConsoleColourCodes::ResultError: return BrightRed; + case IConsoleColourCodes::ResultSuccess: return BrightGreen; + case IConsoleColourCodes::Error: return BrightRed; + case IConsoleColourCodes::Success: return DarkGreen; + case IConsoleColourCodes::OriginalExpression: return Turquoise; + case IConsoleColourCodes::ReconstructedExpression: return Yellow; + case IConsoleColourCodes::SecondaryText: return Grey; default: return 0; } } @@ -80,40 +82,37 @@ namespace { // use POSIX/ ANSI console terminal codes // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) // https://github.com/philsquared/Catch/pull/131 - + + const char* WhiteOrNormal = "[0m"; + const char* BoldRed = "[1;31m"; + const char* BoldGreen = "[1;32m"; + const char* Green = "[0;32m"; + const char* Cyan = "[0;36m"; + const char* Yellow = "[0;33m"; + const char* LightGrey = "[0;37m"; + struct AnsiConsoleColourCodes : IConsoleColourCodes { ~AnsiConsoleColourCodes() { set( None ); } - void set( Colours colour ) { - const char colourEscape = '\033'; + const char* escapeCodeForColour( Colours colour ) { switch( colour ) { - case FileName: - std::cout << colourEscape << "[0m"; // white/ normal - break; - case ResultError: - std::cout << colourEscape << "[1;31m"; // bold red - break; - case ResultSuccess: - std::cout << colourEscape << "[1;32m"; // bold green - break; - case Error: - std::cout << colourEscape << "[1;31m"; // bold red - break; - case Success: - std::cout << colourEscape << "[0;32m"; // green - break; - case OriginalExpression: - std::cout << colourEscape << "[0;36m"; // cyan - break; - case ReconstructedExpression: - std::cout << colourEscape << "[0;33m"; // yellow - break; - case None: - std::cout << colourEscape << "[0m"; // reset - } + case FileName: return WhiteOrNormal; + case ResultError: return BoldRed; + case ResultSuccess: return BoldGreen; + case Error: return BoldRed; + case Success: return Green; + case OriginalExpression: return Cyan; + case ReconstructedExpression: return Yellow; + case SecondaryText: return LightGrey; + case None: return WhiteOrNormal; + } + } + + void set( Colours colour ) { + std::cout << '\033' << escapeCodeForColour( colour ); } }; From 2a17ef908112577c03011c6da36db7ced473148d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 29 Mar 2013 21:55:19 +0000 Subject: [PATCH 192/296] Use SecondaryText code in lists --- .../internal/catch_console_colour_impl.hpp | 1 + include/internal/catch_list.hpp | 39 ++++++++++++++----- include/reporters/catch_reporter_console.hpp | 1 + 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 2a1e677c..939b0097 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -90,6 +90,7 @@ namespace { const char* Cyan = "[0;36m"; const char* Yellow = "[0;33m"; const char* LightGrey = "[0;37m"; +// const char* DarkGrey = "[1;30m"; struct AnsiConsoleColourCodes : IConsoleColourCodes { diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 458c3a21..762447f3 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -10,6 +10,7 @@ #include "catch_commandline.hpp" #include "catch_line_wrap.h" +#include "catch_console_colour.hpp" #include #include @@ -63,17 +64,31 @@ namespace Catch { tagsWrapper.setRight( maxTagLen ).wrap( it->getTestCaseInfo().tagsAsString ); for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) { + TextColour::Colours colour = TextColour::None; + if( it->getTestCaseInfo().isHidden ) + colour = TextColour::SecondaryText; std::string nameCol; - if( i < nameWrapper.size() ) + if( i < nameWrapper.size() ) { nameCol = nameWrapper[i]; - else + } + else { nameCol = " ..."; - std::cout << nameCol; + colour = TextColour::SecondaryText; + } + + { + TextColour colourGuard( colour ); + std::cout << nameCol; + } if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) { - if( i == 0 ) - std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " " << tagsWrapper[i]; - else - std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " " << tagsWrapper[i]; + if( i == 0 ) { + TextColour colourGuard( TextColour::SecondaryText ); + std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " "; + } + else { + std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " "; + } + std::cout << tagsWrapper[i]; } std::cout << "\n"; } @@ -124,10 +139,14 @@ namespace Catch { wrapper.setIndent(2).setRight( maxTagLen ).wrap( countIt->first ); std::cout << wrapper; + std::size_t dots = 2; if( maxTagLen > wrapper.last().size() ) - std::cout << std::string( maxTagLen - wrapper.last().size(), '.' ); - std::cout << ".. " - << countIt->second + dots += maxTagLen - wrapper.last().size(); + { + TextColour colourGuard( TextColour::SecondaryText ); + std::cout << std::string( dots, '.' ); + } + std::cout << countIt->second << "\n"; } std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index b5ce9ee2..0be6b6c3 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -253,6 +253,7 @@ namespace Catch { } void lazyPrintRunInfo() { stream << "\n" << getTildes() << "\n"; + TextColour colour( TextColour::SecondaryText ); stream << testRunInfo->name << " is a CATCH v" << libraryVersion.majorVersion << "." << libraryVersion.minorVersion << " b" From 67e9f01d387fcfca2de625040d6ed887bed52032 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 1 Apr 2013 10:30:36 +0100 Subject: [PATCH 193/296] Added some more wrap chars --- include/internal/catch_line_wrap.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp index 9c6f3019..bd41d69a 100644 --- a/include/internal/catch_line_wrap.hpp +++ b/include/internal/catch_line_wrap.hpp @@ -16,7 +16,7 @@ namespace Catch { : right( CATCH_CONFIG_CONSOLE_WIDTH-1 ), nextTab( 0 ), tab( 0 ), - wrappableChars( " [({.," ), + wrappableChars( " [({.,/|\\" ), recursionCount( 0 ) {} From 2c90533a264d6a61b3557966c481f183805a95b0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 1 Apr 2013 11:25:54 +0100 Subject: [PATCH 194/296] More formatting/ colour tweaks --- include/internal/catch_common.h | 2 +- include/internal/catch_console_colour.hpp | 3 ++- .../internal/catch_console_colour_impl.hpp | 18 +++++++------ include/reporters/catch_reporter_console.hpp | 25 +++++++++++-------- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 630277f2..d6627878 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -127,7 +127,7 @@ namespace Catch { inline std::ostream& operator << ( std::ostream& os, const SourceLineInfo& info ) { #ifndef __GNUG__ - os << info.file << "(" << info.line << "):"; + os << info.file << "(" << info.line << ")"; #else os << info.file << ":" << info.line; #endif diff --git a/include/internal/catch_console_colour.hpp b/include/internal/catch_console_colour.hpp index cd7032a7..930738dc 100644 --- a/include/internal/catch_console_colour.hpp +++ b/include/internal/catch_console_colour.hpp @@ -26,7 +26,8 @@ namespace Catch { OriginalExpression, ReconstructedExpression, - SecondaryText + SecondaryText, + Headers }; virtual void set( Colours colour ) = 0; diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 939b0097..d00d969e 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -22,8 +22,9 @@ namespace { Grey = FOREGROUND_INTENSITY, BrightRed = FOREGROUND_RED | FOREGROUND_INTENSITY, BrightGreen = FOREGROUND_GREEN | FOREGROUND_INTENSITY, + BrightWhite = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY, DarkGreen = FOREGROUND_GREEN, - Turquoise = FOREGROUND_BLUE | FOREGROUND_GREEN, + Cyan = FOREGROUND_BLUE | FOREGROUND_GREEN, Yellow = FOREGROUND_RED | FOREGROUND_GREEN }; switch( colour ) { @@ -32,9 +33,10 @@ namespace { case IConsoleColourCodes::ResultSuccess: return BrightGreen; case IConsoleColourCodes::Error: return BrightRed; case IConsoleColourCodes::Success: return DarkGreen; - case IConsoleColourCodes::OriginalExpression: return Turquoise; + case IConsoleColourCodes::OriginalExpression: return Cyan; case IConsoleColourCodes::ReconstructedExpression: return Yellow; case IConsoleColourCodes::SecondaryText: return Grey; + case IConsoleColourCodes::Headers: return 0; default: return 0; } } @@ -84,8 +86,9 @@ namespace { // https://github.com/philsquared/Catch/pull/131 const char* WhiteOrNormal = "[0m"; - const char* BoldRed = "[1;31m"; - const char* BoldGreen = "[1;32m"; + const char* BrightRed = "[1;31m"; + const char* BrightGreen = "[1;32m"; +// const char* BrightWhite = "[1;37m"; const char* Green = "[0;32m"; const char* Cyan = "[0;36m"; const char* Yellow = "[0;33m"; @@ -101,13 +104,14 @@ namespace { const char* escapeCodeForColour( Colours colour ) { switch( colour ) { case FileName: return WhiteOrNormal; - case ResultError: return BoldRed; - case ResultSuccess: return BoldGreen; - case Error: return BoldRed; + case ResultError: return BrightRed; + case ResultSuccess: return BrightGreen; + case Error: return BrightRed; case Success: return Green; case OriginalExpression: return Cyan; case ReconstructedExpression: return Yellow; case SecondaryText: return LightGrey; + case Headers: return WhiteOrNormal; case None: return WhiteOrNormal; } } diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 0be6b6c3..b210bf2d 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -271,15 +271,13 @@ namespace Catch { unusedGroupInfo.reset(); } } - void lazyPrintTestCaseInfo() { - if( !currentSectionInfo ) { - printClosedHeader( unusedTestCaseInfo->name ); - stream << std::endl; - } - } void printTestCaseAndSectionHeader() { - printOpenHeader( unusedTestCaseInfo->name ); + printOpenHeader( unusedTestCaseInfo->name, + currentSectionInfo + ? currentSectionInfo->lineInfo + : unusedTestCaseInfo->lineInfo ); if( currentSectionInfo ) { + TextColour colourGuard( TextColour::Headers ); std::vector sections; for( ThreadedSectionInfo* section = currentSectionInfo.get(); section; @@ -300,9 +298,16 @@ namespace Catch { printOpenHeader( _name ); stream << getDots() << "\n"; } - void printOpenHeader( std::string const& _name ) { - stream << getDashes() << "\n" - << _name << "\n"; + void printOpenHeader( std::string const& _name, SourceLineInfo const& _lineInfo = SourceLineInfo() ) { + stream << getDashes() << "\n"; + if( !_lineInfo.empty() ){ + TextColour colourGuard( TextColour::FileName ); + stream << _lineInfo << "\n\n"; + } + { + TextColour colourGuard( TextColour::Headers ); + stream << _name << "\n"; + } } void printTotals( const Totals& totals ) { From 5c7d3d75cca38e9032b36726afde0bfa29a3ad4b Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 1 Apr 2013 11:27:10 +0100 Subject: [PATCH 195/296] build 30 --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 404 +++++++++++++++++- single_include/catch.hpp | 231 +++++----- 4 files changed, 535 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index 71360025..13e70dde 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 29 (integration branch) +## CATCH v0.9 build 30 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index d271e4c7..046d4b9b 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 29, "integration" ); + Version libraryVersion( 0, 9, 30, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index cc251b7e..bd8e6d8f 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,9 +1,11 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b28 (integration) host application. +CatchSelfTest is a CATCH v0.9 b30 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- +ApproxTests.cpp:16 + ./succeeding/Approx/simple ............................................................................... @@ -44,6 +46,8 @@ with expansion: Approx( 1.23 ) != 1.24 ------------------------------------------------------------------------------- +ApproxTests.cpp:34 + ./succeeding/Approx/epsilon ............................................................................... @@ -60,6 +64,8 @@ with expansion: 1.23 == Approx( 1.231 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:47 + ./succeeding/Approx/float ............................................................................... @@ -76,6 +82,8 @@ with expansion: 0 == Approx( 0 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:58 + ./succeeding/Approx/int ............................................................................... @@ -88,6 +96,8 @@ PASSED: REQUIRE( 0 == Approx( 0 ) ) ------------------------------------------------------------------------------- +ApproxTests.cpp:69 + ./succeeding/Approx/mixed ............................................................................... @@ -122,6 +132,8 @@ with expansion: 1.234 == Approx( 1.234 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:87 + ./succeeding/Approx/custom ............................................................................... @@ -174,6 +186,8 @@ with expansion: Approx( 1.23 ) != 1.25 ------------------------------------------------------------------------------- +ApproxTests.cpp:108 + Approximate PI ............................................................................... @@ -190,6 +204,8 @@ with expansion: 3.142857142857143 != Approx( 3.141 ) ------------------------------------------------------------------------------- +ClassTests.cpp:34 + ./succeeding/TestClass/succeedingCase ............................................................................... @@ -200,6 +216,8 @@ with expansion: "hello" == "hello" ------------------------------------------------------------------------------- +ClassTests.cpp:35 + ./failing/TestClass/failingCase ............................................................................... @@ -209,6 +227,8 @@ with expansion: "hello" == "world" ------------------------------------------------------------------------------- +ClassTests.cpp:45 + ./succeeding/Fixture/succeedingCase ............................................................................... @@ -219,6 +239,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +ClassTests.cpp:53 + ./failing/Fixture/failingCase ............................................................................... @@ -228,6 +250,8 @@ with expansion: 1 == 2 ------------------------------------------------------------------------------- +ConditionTests.cpp:47 + ./succeeding/conditions/equality ............................................................................... @@ -274,6 +298,8 @@ with expansion: 1.3 == Approx( 1.3 ) ------------------------------------------------------------------------------- +ConditionTests.cpp:67 + ./failing/conditions/equality ............................................................................... @@ -343,6 +369,8 @@ with expansion: 1.3 == Approx( 1.301 ) ------------------------------------------------------------------------------- +ConditionTests.cpp:89 + ./succeeding/conditions/inequality ............................................................................... @@ -413,6 +441,8 @@ with expansion: 5 != 6 ------------------------------------------------------------------------------- +ConditionTests.cpp:107 + ./failing/conditions/inequality ............................................................................... @@ -442,6 +472,8 @@ with expansion: 5 != 5 ------------------------------------------------------------------------------- +ConditionTests.cpp:120 + ./succeeding/conditions/ordered ............................................................................... @@ -548,6 +580,8 @@ with expansion: "hello" > "a" ------------------------------------------------------------------------------- +ConditionTests.cpp:148 + ./failing/conditions/ordered ............................................................................... @@ -647,6 +681,8 @@ with expansion: "hello" <= "a" ------------------------------------------------------------------------------- +ConditionTests.cpp:179 + ./succeeding/conditions/int literals ............................................................................... @@ -729,6 +765,8 @@ with expansion: 0x > 4 ------------------------------------------------------------------------------- +ConditionTests.cpp:218 + ./succeeding/conditions//long_to_unsigned_x ............................................................................... @@ -757,6 +795,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +ConditionTests.cpp:233 + ./succeeding/conditions/const ints to int literal ............................................................................... @@ -785,6 +825,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +ConditionTests.cpp:247 + ./succeeding/conditions/negative ints ............................................................................... @@ -825,6 +867,8 @@ with expansion: -2147483648 > 2 ------------------------------------------------------------------------------- +ConditionTests.cpp:270 + ./succeeding/conditions/computed ints ............................................................................... @@ -835,6 +879,8 @@ with expansion: 54 == 54 ------------------------------------------------------------------------------- +ConditionTests.cpp:283 + ./succeeding/conditions/ptr ............................................................................... @@ -887,6 +933,8 @@ with expansion: 0 != 0x ------------------------------------------------------------------------------- +ConditionTests.cpp:316 + ./succeeding/conditions/not ............................................................................... @@ -933,6 +981,8 @@ with expansion: !(1 == 2) ------------------------------------------------------------------------------- +ConditionTests.cpp:333 + ./failing/conditions/not ............................................................................... @@ -971,6 +1021,8 @@ with expansion: !(1 == 1) ------------------------------------------------------------------------------- +ExceptionTests.cpp:33 + ./succeeding/exceptions/explicit ............................................................................... @@ -987,6 +1039,8 @@ PASSED: REQUIRE_THROWS( thisThrows() ) ------------------------------------------------------------------------------- +ExceptionTests.cpp:41 + ./failing/exceptions/explicit ............................................................................... @@ -1005,6 +1059,8 @@ due to unexpected exception with message: expected exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:48 + ./failing/exceptions/implicit ............................................................................... @@ -1013,6 +1069,8 @@ due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:54 + ./failing/exceptions/implicit/2 ............................................................................... @@ -1026,6 +1084,8 @@ due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:62 + ./failing/exceptions/implicit/3 section name ............................................................................... @@ -1035,6 +1095,8 @@ due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:69 + ./succeeding/exceptions/implicit ............................................................................... @@ -1042,6 +1104,8 @@ due to unexpected exception with message: No assertions in test case, './succeeding/exceptions/implicit' ------------------------------------------------------------------------------- +ExceptionTests.cpp:106 + ./failing/exceptions/custom ............................................................................... @@ -1050,6 +1114,8 @@ due to unexpected exception with message: custom exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:114 + ./failing/exceptions/custom/nothrow ............................................................................... @@ -1059,6 +1125,8 @@ due to unexpected exception with message: unexpected custom exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:119 + ./failing/exceptions/custom/throw ............................................................................... @@ -1068,6 +1136,8 @@ due to unexpected exception with message: custom exception - not std ------------------------------------------------------------------------------- +ExceptionTests.cpp:125 + ./failing/exceptions/custom/double ............................................................................... @@ -1076,6 +1146,8 @@ due to unexpected exception with message: 3.14 ------------------------------------------------------------------------------- +ExceptionTests.cpp:134 + ./succeeding/exceptions/notimplemented ............................................................................... @@ -1084,6 +1156,8 @@ PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) ------------------------------------------------------------------------------- +GeneratorTests.cpp:19 + ./succeeding/generators/1 ............................................................................... @@ -1952,6 +2026,8 @@ with expansion: 214 == 214 ------------------------------------------------------------------------------- +GeneratorTests.cpp:32 + ./succeeding/generators/2 ............................................................................... @@ -1968,6 +2044,8 @@ with expansion: 2 == 2 ------------------------------------------------------------------------------- +MessageTests.cpp:11 + ./succeeding/message ............................................................................... @@ -1980,6 +2058,8 @@ warning: No assertions in test case, './succeeding/message' ------------------------------------------------------------------------------- +MessageTests.cpp:16 + ./succeeding/succeed ............................................................................... @@ -1989,6 +2069,8 @@ with message: this is a success ------------------------------------------------------------------------------- +MessageTests.cpp:21 + ./failing/message/info/1 ............................................................................... @@ -2001,6 +2083,8 @@ with messages: so should this ------------------------------------------------------------------------------- +MessageTests.cpp:29 + ./mixed/message/info/2 ............................................................................... @@ -2035,6 +2119,8 @@ with message: but not this ------------------------------------------------------------------------------- +MessageTests.cpp:48 + ./failing/message/fail ............................................................................... @@ -2043,6 +2129,8 @@ explicitly with message: This is a failure ------------------------------------------------------------------------------- +MessageTests.cpp:56 + ./failing/message/sections one ............................................................................... @@ -2052,6 +2140,8 @@ explicitly with message: Message from section one ------------------------------------------------------------------------------- +MessageTests.cpp:61 + ./failing/message/sections two ............................................................................... @@ -2062,6 +2152,8 @@ explicitly with message: Message from section one ------------------------------------------------------------------------------- +MessageTests.cpp:69 + ./succeeding/message/sections/stdout one ............................................................................... @@ -2071,6 +2163,8 @@ No assertions in section, 'one' Message from section two ------------------------------------------------------------------------------- +MessageTests.cpp:74 + ./succeeding/message/sections/stdout two ............................................................................... @@ -2079,6 +2173,8 @@ Message from section two No assertions in section, 'two' ------------------------------------------------------------------------------- +MessageTests.cpp:80 + ./mixed/message/scoped ............................................................................... @@ -2181,6 +2277,8 @@ with messages: i := 10 ------------------------------------------------------------------------------- +MessageTests.cpp:90 + ./succeeding/nofail ............................................................................... @@ -2192,6 +2290,8 @@ FAILED - but was ok: No assertions in test case, './succeeding/nofail' ------------------------------------------------------------------------------- +MessageTests.cpp:95 + just info ............................................................................... @@ -2199,6 +2299,8 @@ just info No assertions in test case, 'just info' ------------------------------------------------------------------------------- +MessageTests.cpp:99 + just failure ............................................................................... @@ -2207,6 +2309,8 @@ explicitly with message: Previous info should not be seen ------------------------------------------------------------------------------- +MiscTests.cpp:19 + ./succeeding/Misc/Sections s1 ............................................................................... @@ -2224,6 +2328,8 @@ with expansion: 2 != 1 ------------------------------------------------------------------------------- +MiscTests.cpp:25 + ./succeeding/Misc/Sections s2 ............................................................................... @@ -2235,6 +2341,8 @@ with expansion: 1 != 2 ------------------------------------------------------------------------------- +MiscTests.cpp:36 + ./succeeding/Misc/Sections/nested s1 ............................................................................... @@ -2252,6 +2360,8 @@ with expansion: 2 != 1 ------------------------------------------------------------------------------- +MiscTests.cpp:41 + ./succeeding/Misc/Sections/nested s1 s2 @@ -2264,6 +2374,8 @@ with expansion: 1 != 2 ------------------------------------------------------------------------------- +MiscTests.cpp:55 + ./mixed/Misc/Sections/nested2 s1 s2 @@ -2275,6 +2387,8 @@ with expansion: 1 == 2 ------------------------------------------------------------------------------- +MiscTests.cpp:60 + ./mixed/Misc/Sections/nested2 s1 s3 @@ -2287,6 +2401,8 @@ with expansion: 1 != 2 ------------------------------------------------------------------------------- +MiscTests.cpp:64 + ./mixed/Misc/Sections/nested2 s1 s4 @@ -2299,6 +2415,8 @@ with expansion: 1 < 2 ------------------------------------------------------------------------------- +MiscTests.cpp:75 + ./Sections/nested/a/b c d (leaf) @@ -2308,6 +2426,8 @@ with expansion: No assertions in section, 'd (leaf)' ------------------------------------------------------------------------------- +MiscTests.cpp:79 + ./Sections/nested/a/b c e (leaf) @@ -2317,6 +2437,8 @@ No assertions in section, 'd (leaf)' No assertions in section, 'e (leaf)' ------------------------------------------------------------------------------- +MiscTests.cpp:84 + ./Sections/nested/a/b f (leaf) ............................................................................... @@ -2325,6 +2447,8 @@ No assertions in section, 'e (leaf)' No assertions in section, 'f (leaf)' ------------------------------------------------------------------------------- +MiscTests.cpp:97 + ./mixed/Misc/Sections/loops s1 ............................................................................... @@ -2335,6 +2459,8 @@ with expansion: 0 > 1 ------------------------------------------------------------------------------- +MiscTests.cpp:104 + ./mixed/Misc/loops ............................................................................... @@ -2399,6 +2525,8 @@ with message: Some information An error ------------------------------------------------------------------------------- +MiscTests.cpp:115 + ./succeeding/Misc/stdout,stderr ............................................................................... @@ -2406,6 +2534,8 @@ An error No assertions in test case, './succeeding/Misc/stdout,stderr' ------------------------------------------------------------------------------- +MiscTests.cpp:127 + ./succeeding/Misc/null strings ............................................................................... @@ -2422,6 +2552,8 @@ with expansion: {null string} == {null string} ------------------------------------------------------------------------------- +MiscTests.cpp:133 + ./failing/info ............................................................................... @@ -2432,6 +2564,8 @@ with messages: i := 7 ------------------------------------------------------------------------------- +MiscTests.cpp:149 + ./succeeding/checkedif ............................................................................... @@ -2448,6 +2582,8 @@ with expansion: true ------------------------------------------------------------------------------- +MiscTests.cpp:154 + ./failing/checkedif ............................................................................... @@ -2462,6 +2598,8 @@ with expansion: false ------------------------------------------------------------------------------- +MiscTests.cpp:167 + ./succeeding/checkedelse ............................................................................... @@ -2478,6 +2616,8 @@ with expansion: true ------------------------------------------------------------------------------- +MiscTests.cpp:172 + ./failing/checkedelse ............................................................................... @@ -2492,6 +2632,8 @@ with expansion: false ------------------------------------------------------------------------------- +MiscTests.cpp:179 + ./misc/xmlentitycheck embedded xml ............................................................................... @@ -2500,6 +2642,8 @@ with expansion: No assertions in section, 'embedded xml' ------------------------------------------------------------------------------- +MiscTests.cpp:183 + ./misc/xmlentitycheck encoded chars ............................................................................... @@ -2508,6 +2652,8 @@ No assertions in section, 'embedded xml' No assertions in section, 'encoded chars' ------------------------------------------------------------------------------- +MiscTests.cpp:189 + ./manual/onechar ............................................................................... @@ -2517,6 +2663,8 @@ with message: 3 ------------------------------------------------------------------------------- +MiscTests.cpp:195 + ./succeeding/atomic if ............................................................................... @@ -2527,6 +2675,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +MiscTests.cpp:210 + ./succeeding/matchers ............................................................................... @@ -2555,6 +2705,8 @@ with expansion: "this string contains 'abc' as a substring" ends with: "substring" ------------------------------------------------------------------------------- +MiscTests.cpp:219 + ./failing/matchers/Contains ............................................................................... @@ -2564,6 +2716,8 @@ with expansion: "this string contains 'abc' as a substring" contains: "not there" ------------------------------------------------------------------------------- +MiscTests.cpp:224 + ./failing/matchers/StartsWith ............................................................................... @@ -2573,6 +2727,8 @@ with expansion: "this string contains 'abc' as a substring" starts with: "string" ------------------------------------------------------------------------------- +MiscTests.cpp:229 + ./failing/matchers/EndsWith ............................................................................... @@ -2582,6 +2738,8 @@ with expansion: "this string contains 'abc' as a substring" ends with: "this" ------------------------------------------------------------------------------- +MiscTests.cpp:234 + ./failing/matchers/Equals ............................................................................... @@ -2591,6 +2749,8 @@ with expansion: "this string contains 'abc' as a substring" equals: "something else" ------------------------------------------------------------------------------- +MiscTests.cpp:242 + ./succeeding/matchers/AllOf ............................................................................... @@ -2602,6 +2762,8 @@ with expansion: contains: "abc" ) ------------------------------------------------------------------------------- +MiscTests.cpp:246 + ./succeeding/matchers/AnyOf ............................................................................... @@ -2620,6 +2782,8 @@ with expansion: contains: "string" ) ------------------------------------------------------------------------------- +MiscTests.cpp:252 + ./succeeding/matchers/Equals ............................................................................... @@ -2631,6 +2795,8 @@ with expansion: 'abc' as a substring" ------------------------------------------------------------------------------- +MiscTests.cpp:263 + example/factorial ............................................................................... @@ -2665,6 +2831,8 @@ with expansion: 0x == 3628800 ------------------------------------------------------------------------------- +MiscTests.cpp:272 + empty ............................................................................... @@ -2672,6 +2840,8 @@ empty No assertions in test case, 'empty' ------------------------------------------------------------------------------- +MiscTests.cpp:276 + Nice descriptive name ............................................................................... @@ -2683,6 +2853,8 @@ warning: No assertions in test case, 'Nice descriptive name' ------------------------------------------------------------------------------- +MiscTests.cpp:280 + first tag ............................................................................... @@ -2690,6 +2862,8 @@ first tag No assertions in test case, 'first tag' ------------------------------------------------------------------------------- +MiscTests.cpp:283 + second tag ............................................................................... @@ -2697,6 +2871,8 @@ second tag No assertions in test case, 'second tag' ------------------------------------------------------------------------------- +MiscTests.cpp:296 + vectors can be sized and resized ............................................................................... @@ -2713,6 +2889,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:303 + vectors can be sized and resized resizing bigger changes size and capacity ............................................................................... @@ -2730,6 +2908,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +MiscTests.cpp:296 + vectors can be sized and resized ............................................................................... @@ -2746,6 +2926,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:309 + vectors can be sized and resized resizing smaller changes size but not capacity ............................................................................... @@ -2763,6 +2945,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:315 + vectors can be sized and resized resizing smaller changes size but not capacity We can use the 'swap trick' to reset the capacity @@ -2775,6 +2959,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +MiscTests.cpp:296 + vectors can be sized and resized ............................................................................... @@ -2791,6 +2977,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:309 + vectors can be sized and resized resizing smaller changes size but not capacity ............................................................................... @@ -2808,6 +2996,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:296 + vectors can be sized and resized ............................................................................... @@ -2824,6 +3014,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:322 + vectors can be sized and resized reserving bigger changes capacity but not size ............................................................................... @@ -2841,6 +3033,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +MiscTests.cpp:296 + vectors can be sized and resized ............................................................................... @@ -2857,6 +3051,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:328 + vectors can be sized and resized reserving smaller does not change size or capacity ............................................................................... @@ -2874,6 +3070,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +TestMain.cpp:23 + selftest/main selftest/expected result selftest/expected result/failing tests @@ -3010,6 +3208,8 @@ with message: Tests failed, as expected ------------------------------------------------------------------------------- +TestMain.cpp:28 + selftest/main selftest/expected result selftest/expected result/succeeding tests @@ -3254,6 +3454,8 @@ Message from section two Some information An error ------------------------------------------------------------------------------- +TestMain.cpp:39 + selftest/main selftest/test counts selftest/test counts/succeeding tests @@ -3272,6 +3474,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +TestMain.cpp:46 + selftest/main selftest/test counts selftest/test counts/failing tests @@ -3290,6 +3494,8 @@ with expansion: 73 == 73 ------------------------------------------------------------------------------- +TestMain.cpp:54 + meta/Misc/Sections ............................................................................... @@ -3306,6 +3512,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +TestMain.cpp:96 + selftest/parser/2 default ............................................................................... @@ -3339,6 +3547,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:107 + selftest/parser/2 test lists -t/1 @@ -3367,6 +3577,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:115 + selftest/parser/2 test lists -t/exclude:1 @@ -3395,6 +3607,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:124 + selftest/parser/2 test lists --test/1 @@ -3423,6 +3637,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:133 + selftest/parser/2 test lists --test/exclude:1 @@ -3451,6 +3667,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:142 + selftest/parser/2 test lists --test/exclude:2 @@ -3479,6 +3697,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:151 + selftest/parser/2 test lists -t/2 @@ -3513,6 +3733,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:161 + selftest/parser/2 test lists -t/0 @@ -3526,6 +3748,8 @@ with expansion: least 1" ------------------------------------------------------------------------------- +TestMain.cpp:168 + selftest/parser/2 reporter -r/console @@ -3542,6 +3766,8 @@ with expansion: "console" == "console" ------------------------------------------------------------------------------- +TestMain.cpp:174 + selftest/parser/2 reporter -r/xml @@ -3558,6 +3784,8 @@ with expansion: "xml" == "xml" ------------------------------------------------------------------------------- +TestMain.cpp:180 + selftest/parser/2 reporter --reporter/junit @@ -3574,6 +3802,8 @@ with expansion: "junit" == "junit" ------------------------------------------------------------------------------- +TestMain.cpp:186 + selftest/parser/2 reporter -r/error @@ -3587,6 +3817,8 @@ with expansion: two" contains: "1 argument" ------------------------------------------------------------------------------- +TestMain.cpp:193 + selftest/parser/2 debugger -b @@ -3603,6 +3835,8 @@ with expansion: true == true ------------------------------------------------------------------------------- +TestMain.cpp:199 + selftest/parser/2 debugger --break @@ -3619,6 +3853,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:205 + selftest/parser/2 debugger -b @@ -3632,6 +3868,8 @@ with expansion: unexpected" contains: "0 arguments" ------------------------------------------------------------------------------- +TestMain.cpp:212 + selftest/parser/2 abort -a @@ -3648,6 +3886,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +TestMain.cpp:218 + selftest/parser/2 abort -a/2 @@ -3664,6 +3904,8 @@ with expansion: 2 == 2 ------------------------------------------------------------------------------- +TestMain.cpp:224 + selftest/parser/2 abort -a/error/0 @@ -3677,6 +3919,8 @@ with expansion: . Arguments were: 0" contains: "greater than zero" ------------------------------------------------------------------------------- +TestMain.cpp:228 + selftest/parser/2 abort -a/error/non numeric @@ -3690,6 +3934,8 @@ with expansion: . Arguments were: oops" contains: "greater than zero" ------------------------------------------------------------------------------- +TestMain.cpp:232 + selftest/parser/2 abort -a/error/two args @@ -3703,6 +3949,8 @@ with expansion: were: 1 2" contains: "0 and 1 argument" ------------------------------------------------------------------------------- +TestMain.cpp:239 + selftest/parser/2 nothrow -nt @@ -3719,6 +3967,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:245 + selftest/parser/2 nothrow --nothrow @@ -3735,6 +3985,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:254 + selftest/parser/2 streams -o filename @@ -3757,6 +4009,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:261 + selftest/parser/2 streams -o %stdout @@ -3779,6 +4033,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:268 + selftest/parser/2 streams --out @@ -3795,6 +4051,8 @@ with expansion: "filename.ext" == "filename.ext" ------------------------------------------------------------------------------- +TestMain.cpp:277 + selftest/parser/2 combinations -a -b @@ -3823,6 +4081,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:288 + selftest/test filter ............................................................................... @@ -3863,6 +4123,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:305 + selftest/test filters ............................................................................... @@ -3891,6 +4153,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:320 + selftest/filter/prefix wildcard ............................................................................... @@ -3907,6 +4171,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:326 + selftest/filter/wildcard at both ends ............................................................................... @@ -3935,6 +4201,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:341 + selftest/option parsers ............................................................................... @@ -3961,6 +4229,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:367 + selftest/tags one tag ............................................................................... @@ -4014,6 +4284,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:381 + selftest/tags two tags ............................................................................... @@ -4085,6 +4357,8 @@ with expansion: true == true ------------------------------------------------------------------------------- +TestMain.cpp:398 + selftest/tags one tag with characters either side ............................................................................... @@ -4114,6 +4388,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +TestMain.cpp:407 + selftest/tags start of a tag, but not closed ............................................................................... @@ -4137,6 +4413,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +TestMain.cpp:416 + selftest/tags hidden ............................................................................... @@ -4166,6 +4444,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:434 + Long strings can be wrapped plain string No wrapping @@ -4188,6 +4468,8 @@ with expansion: "one two three four" ------------------------------------------------------------------------------- +TestMain.cpp:438 + Long strings can be wrapped plain string Wrapped once @@ -4244,6 +4526,8 @@ with expansion: three four" ------------------------------------------------------------------------------- +TestMain.cpp:445 + Long strings can be wrapped plain string Wrapped twice @@ -4274,6 +4558,8 @@ with expansion: four" ------------------------------------------------------------------------------- +TestMain.cpp:449 + Long strings can be wrapped plain string Wrapped three times @@ -4308,6 +4594,8 @@ with expansion: four" ------------------------------------------------------------------------------- +TestMain.cpp:453 + Long strings can be wrapped plain string Short wrap @@ -4380,6 +4668,8 @@ with expansion: ur" ------------------------------------------------------------------------------- +TestMain.cpp:461 + Long strings can be wrapped plain string As container @@ -4416,6 +4706,8 @@ with expansion: "four" == "four" ------------------------------------------------------------------------------- +TestMain.cpp:477 + Long strings can be wrapped With newlines No wrapping @@ -4452,6 +4744,8 @@ with expansion: three four" ------------------------------------------------------------------------------- +TestMain.cpp:482 + Long strings can be wrapped With newlines Trailing newline @@ -4484,6 +4778,8 @@ with expansion: " ------------------------------------------------------------------------------- +TestMain.cpp:487 + Long strings can be wrapped With newlines Wrapped once @@ -4526,6 +4822,8 @@ with expansion: four" ------------------------------------------------------------------------------- +TestMain.cpp:492 + Long strings can be wrapped With newlines Wrapped twice @@ -4546,6 +4844,8 @@ with expansion: four" ------------------------------------------------------------------------------- +TrickyTests.cpp:32 + ./succeeding/Tricky/std::pair ............................................................................... @@ -4556,6 +4856,8 @@ with expansion: std::pair( 1, 2 ) == std::pair( 1, 2 ) ------------------------------------------------------------------------------- +TrickyTests.cpp:46 + ./inprogress/failing/Tricky/trailing expression ............................................................................... @@ -4568,6 +4870,8 @@ warning: No assertions in test case, './inprogress/failing/Tricky/trailing expression' ------------------------------------------------------------------------------- +TrickyTests.cpp:62 + ./inprogress/failing/Tricky/compound lhs ............................................................................... @@ -4580,6 +4884,8 @@ warning: No assertions in test case, './inprogress/failing/Tricky/compound lhs' ------------------------------------------------------------------------------- +TrickyTests.cpp:88 + ./failing/Tricky/non streamable type ............................................................................... @@ -4594,6 +4900,8 @@ with expansion: {?} == {?} ------------------------------------------------------------------------------- +TrickyTests.cpp:104 + ./failing/string literals ............................................................................... @@ -4603,6 +4911,8 @@ with expansion: "first" == "second" ------------------------------------------------------------------------------- +TrickyTests.cpp:115 + ./succeeding/side-effects ............................................................................... @@ -4619,6 +4929,8 @@ with expansion: 8 == 8 ------------------------------------------------------------------------------- +TrickyTests.cpp:183 + ./succeeding/koenig ............................................................................... @@ -4629,6 +4941,8 @@ with expansion: 0x == {?} ------------------------------------------------------------------------------- +TrickyTests.cpp:209 + ./succeeding/non-const== ............................................................................... @@ -4639,6 +4953,8 @@ with expansion: {?} == 1 ------------------------------------------------------------------------------- +TrickyTests.cpp:222 + ./succeeding/enum/bits ............................................................................... @@ -4649,6 +4965,8 @@ with expansion: 0x == 3221225472 ------------------------------------------------------------------------------- +TrickyTests.cpp:236 + ./succeeding/boolean member ............................................................................... @@ -4659,6 +4977,8 @@ with expansion: 0x != 0 ------------------------------------------------------------------------------- +TrickyTests.cpp:257 + ./succeeding/unimplemented static bool compare to true ............................................................................... @@ -4676,6 +4996,8 @@ with expansion: true == true ------------------------------------------------------------------------------- +TrickyTests.cpp:262 + ./succeeding/unimplemented static bool compare to false ............................................................................... @@ -4693,6 +5015,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TrickyTests.cpp:268 + ./succeeding/unimplemented static bool negation ............................................................................... @@ -4704,6 +5028,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:273 + ./succeeding/unimplemented static bool double negation ............................................................................... @@ -4715,6 +5041,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:278 + ./succeeding/unimplemented static bool direct ............................................................................... @@ -4732,6 +5060,8 @@ with expansion: !false ------------------------------------------------------------------------------- +TrickyTests.cpp:308 + ./succeeding/SafeBool ............................................................................... @@ -4754,6 +5084,8 @@ with expansion: !false ------------------------------------------------------------------------------- +TrickyTests.cpp:318 + Assertions then sections ............................................................................... @@ -4764,6 +5096,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:325 + Assertions then sections A section ............................................................................... @@ -4775,6 +5109,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:329 + Assertions then sections A section Another section @@ -4787,6 +5123,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:318 + Assertions then sections ............................................................................... @@ -4797,6 +5135,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:325 + Assertions then sections A section ............................................................................... @@ -4808,6 +5148,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:333 + Assertions then sections A section Another other section @@ -4820,6 +5162,8 @@ with expansion: true ------------------------------------------------------------------------------- +BDDTests.cpp:19 + Scenario: Do that thing with the thing Given: This stuff exists When: I do this @@ -4833,6 +5177,8 @@ with expansion: true ------------------------------------------------------------------------------- +BDDTests.cpp:22 + Scenario: Do that thing with the thing Given: This stuff exists When: I do this @@ -4847,6 +5193,8 @@ with expansion: true ------------------------------------------------------------------------------- +BDDTests.cpp:30 + Scenario: Vector resizing affects size and capacity Given: an empty vector ............................................................................... @@ -4858,6 +5206,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:36 + Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger @@ -4877,6 +5227,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +BDDTests.cpp:42 + Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger @@ -4898,6 +5250,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +BDDTests.cpp:30 + Scenario: Vector resizing affects size and capacity Given: an empty vector ............................................................................... @@ -4909,6 +5263,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:36 + Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger @@ -4928,6 +5284,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +BDDTests.cpp:30 + Scenario: Vector resizing affects size and capacity Given: an empty vector ............................................................................... @@ -4939,6 +5297,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:36 + Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger @@ -4958,6 +5318,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +BDDTests.cpp:30 + Scenario: Vector resizing affects size and capacity Given: an empty vector ............................................................................... @@ -4969,6 +5331,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:30 + Scenario: Vector resizing affects size and capacity Given: an empty vector ............................................................................... @@ -4980,6 +5344,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:52 + Scenario: Vector resizing affects size and capacity Given: an empty vector When: we reserve more space @@ -4999,6 +5365,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:63 + Scenario: This is a really long scenario name to see how the list command deals with wrapping ............................................................................... @@ -5006,6 +5374,8 @@ Scenario: This is a really long scenario name to see how the list command deals No assertions in test case, 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' ------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:12 + Anonymous test case 1 ............................................................................... @@ -5015,6 +5385,8 @@ with message: anonymous test case ------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:17 + Test case with one argument ............................................................................... @@ -5024,6 +5396,8 @@ with message: no assertions ------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:24 + Variadic macros Section with one argument ............................................................................... @@ -5038,10 +5412,12 @@ with message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b28 (integration) host application. +CatchSelfTest is a CATCH v0.9 b30 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- +ApproxTests.cpp:16 + ./succeeding/Approx/simple ............................................................................... @@ -5082,6 +5458,8 @@ with expansion: Approx( 1.23 ) != 1.24 ------------------------------------------------------------------------------- +ApproxTests.cpp:34 + ./succeeding/Approx/epsilon ............................................................................... @@ -5098,6 +5476,8 @@ with expansion: 1.23 == Approx( 1.231 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:47 + ./succeeding/Approx/float ............................................................................... @@ -5114,6 +5494,8 @@ with expansion: 0 == Approx( 0 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:58 + ./succeeding/Approx/int ............................................................................... @@ -5126,6 +5508,8 @@ PASSED: REQUIRE( 0 == Approx( 0 ) ) ------------------------------------------------------------------------------- +ApproxTests.cpp:69 + ./succeeding/Approx/mixed ............................................................................... @@ -5160,6 +5544,8 @@ with expansion: 1.234 == Approx( 1.234 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:87 + ./succeeding/Approx/custom ............................................................................... @@ -5212,6 +5598,8 @@ with expansion: Approx( 1.23 ) != 1.25 ------------------------------------------------------------------------------- +ApproxTests.cpp:108 + Approximate PI ............................................................................... @@ -5228,6 +5616,8 @@ with expansion: 3.142857142857143 != Approx( 3.141 ) ------------------------------------------------------------------------------- +ClassTests.cpp:34 + ./succeeding/TestClass/succeedingCase ............................................................................... @@ -5238,6 +5628,8 @@ with expansion: "hello" == "hello" ------------------------------------------------------------------------------- +ClassTests.cpp:35 + ./failing/TestClass/failingCase ............................................................................... @@ -5247,6 +5639,8 @@ with expansion: "hello" == "world" ------------------------------------------------------------------------------- +ClassTests.cpp:45 + ./succeeding/Fixture/succeedingCase ............................................................................... @@ -5257,6 +5651,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +ClassTests.cpp:53 + ./failing/Fixture/failingCase ............................................................................... @@ -5266,6 +5662,8 @@ with expansion: 1 == 2 ------------------------------------------------------------------------------- +ConditionTests.cpp:47 + ./succeeding/conditions/equality ............................................................................... @@ -5312,6 +5710,8 @@ with expansion: 1.3 == Approx( 1.3 ) ------------------------------------------------------------------------------- +ConditionTests.cpp:67 + ./failing/conditions/equality ............................................................................... diff --git a/single_include/catch.hpp b/single_include/catch.hpp index c78dc5d2..240d77d1 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 29 (integration branch) - * Generated: 2013-03-29 13:43:27.058903 + * CATCH v0.9 build 30 (integration branch) + * Generated: 2013-04-01 11:26:11.785709 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -154,7 +154,7 @@ namespace Catch { inline std::ostream& operator << ( std::ostream& os, const SourceLineInfo& info ) { #ifndef __GNUG__ - os << info.file << "(" << info.line << "):"; + os << info.file << "(" << info.line << ")"; #else os << info.file << ":" << info.line; #endif @@ -4193,6 +4193,44 @@ namespace Catch { } // end namespace Catch +// #included from: catch_console_colour.hpp +#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED + +namespace Catch { + + struct IConsoleColourCodes : NonCopyable { + enum Colours { + None, + + FileName, + ResultError, + ResultSuccess, + + Error, + Success, + + OriginalExpression, + ReconstructedExpression, + + SecondaryText, + Headers + }; + + virtual void set( Colours colour ) = 0; + }; + + class TextColour : public IConsoleColourCodes { + public: + TextColour( Colours colour = None ); + void set( Colours colour ); + ~TextColour(); + + private: + IConsoleColourCodes* m_impl; + }; + +} // end namespace Catch + #include #include @@ -4245,17 +4283,31 @@ namespace Catch { tagsWrapper.setRight( maxTagLen ).wrap( it->getTestCaseInfo().tagsAsString ); for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) { + TextColour::Colours colour = TextColour::None; + if( it->getTestCaseInfo().isHidden ) + colour = TextColour::SecondaryText; std::string nameCol; - if( i < nameWrapper.size() ) + if( i < nameWrapper.size() ) { nameCol = nameWrapper[i]; - else + } + else { nameCol = " ..."; - std::cout << nameCol; + colour = TextColour::SecondaryText; + } + + { + TextColour colourGuard( colour ); + std::cout << nameCol; + } if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) { - if( i == 0 ) - std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " " << tagsWrapper[i]; - else - std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " " << tagsWrapper[i]; + if( i == 0 ) { + TextColour colourGuard( TextColour::SecondaryText ); + std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " "; + } + else { + std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " "; + } + std::cout << tagsWrapper[i]; } std::cout << "\n"; } @@ -4306,10 +4358,14 @@ namespace Catch { wrapper.setIndent(2).setRight( maxTagLen ).wrap( countIt->first ); std::cout << wrapper; + std::size_t dots = 2; if( maxTagLen > wrapper.last().size() ) - std::cout << std::string( maxTagLen - wrapper.last().size(), '.' ); - std::cout << ".. " - << countIt->second + dots += maxTagLen - wrapper.last().size(); + { + TextColour colourGuard( TextColour::SecondaryText ); + std::cout << std::string( dots, '.' ); + } + std::cout << countIt->second << "\n"; } std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; @@ -5514,41 +5570,6 @@ namespace Catch { // #included from: catch_console_colour_impl.hpp #define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED -// #included from: catch_console_colour.hpp -#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED - -namespace Catch { - - struct IConsoleColourCodes : NonCopyable { - enum Colours { - None, - - FileName, - ResultError, - ResultSuccess, - - Error, - Success, - - OriginalExpression, - ReconstructedExpression - }; - - virtual void set( Colours colour ) = 0; - }; - - class TextColour : public IConsoleColourCodes { - public: - TextColour( Colours colour = None ); - void set( Colours colour ); - ~TextColour(); - - private: - IConsoleColourCodes* m_impl; - }; - -} // end namespace Catch - #if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// #include @@ -5557,21 +5578,25 @@ namespace { using namespace Catch; WORD mapConsoleColour( IConsoleColourCodes::Colours colour ) { + enum Win32Colours { + Grey = FOREGROUND_INTENSITY, + BrightRed = FOREGROUND_RED | FOREGROUND_INTENSITY, + BrightGreen = FOREGROUND_GREEN | FOREGROUND_INTENSITY, + BrightWhite = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY, + DarkGreen = FOREGROUND_GREEN, + Cyan = FOREGROUND_BLUE | FOREGROUND_GREEN, + Yellow = FOREGROUND_RED | FOREGROUND_GREEN + }; switch( colour ) { - case IConsoleColourCodes::FileName: - return FOREGROUND_INTENSITY; // greyed out - case IConsoleColourCodes::ResultError: - return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red - case IConsoleColourCodes::ResultSuccess: - return FOREGROUND_GREEN | FOREGROUND_INTENSITY; // bright green - case IConsoleColourCodes::Error: - return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red - case IConsoleColourCodes::Success: - return FOREGROUND_GREEN; // dark green - case IConsoleColourCodes::OriginalExpression: - return FOREGROUND_BLUE | FOREGROUND_GREEN; // turquoise - case IConsoleColourCodes::ReconstructedExpression: - return FOREGROUND_RED | FOREGROUND_GREEN; // greeny-yellow + case IConsoleColourCodes::FileName: return Grey; + case IConsoleColourCodes::ResultError: return BrightRed; + case IConsoleColourCodes::ResultSuccess: return BrightGreen; + case IConsoleColourCodes::Error: return BrightRed; + case IConsoleColourCodes::Success: return DarkGreen; + case IConsoleColourCodes::OriginalExpression: return Cyan; + case IConsoleColourCodes::ReconstructedExpression: return Yellow; + case IConsoleColourCodes::SecondaryText: return Grey; + case IConsoleColourCodes::Headers: return 0; default: return 0; } } @@ -5620,39 +5645,39 @@ namespace { // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) // https://github.com/philsquared/Catch/pull/131 + const char* WhiteOrNormal = "[0m"; + const char* BrightRed = "[1;31m"; + const char* BrightGreen = "[1;32m"; +// const char* BrightWhite = "[1;37m"; + const char* Green = "[0;32m"; + const char* Cyan = "[0;36m"; + const char* Yellow = "[0;33m"; + const char* LightGrey = "[0;37m"; +// const char* DarkGrey = "[1;30m"; + struct AnsiConsoleColourCodes : IConsoleColourCodes { ~AnsiConsoleColourCodes() { set( None ); } - void set( Colours colour ) { - const char colourEscape = '\033'; + const char* escapeCodeForColour( Colours colour ) { switch( colour ) { - case FileName: - std::cout << colourEscape << "[0m"; // white/ normal - break; - case ResultError: - std::cout << colourEscape << "[1;31m"; // bold red - break; - case ResultSuccess: - std::cout << colourEscape << "[1;32m"; // bold green - break; - case Error: - std::cout << colourEscape << "[1;31m"; // bold red - break; - case Success: - std::cout << colourEscape << "[0;32m"; // green - break; - case OriginalExpression: - std::cout << colourEscape << "[0;36m"; // cyan - break; - case ReconstructedExpression: - std::cout << colourEscape << "[0;33m"; // yellow - break; - case None: - std::cout << colourEscape << "[0m"; // reset - } + case FileName: return WhiteOrNormal; + case ResultError: return BrightRed; + case ResultSuccess: return BrightGreen; + case Error: return BrightRed; + case Success: return Green; + case OriginalExpression: return Cyan; + case ReconstructedExpression: return Yellow; + case SecondaryText: return LightGrey; + case Headers: return WhiteOrNormal; + case None: return WhiteOrNormal; + } + } + + void set( Colours colour ) { + std::cout << '\033' << escapeCodeForColour( colour ); } }; @@ -6052,7 +6077,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 29, "integration" ); + Version libraryVersion( 0, 9, 30, "integration" ); } // #included from: catch_line_wrap.hpp @@ -6064,7 +6089,7 @@ namespace Catch { : right( CATCH_CONFIG_CONSOLE_WIDTH-1 ), nextTab( 0 ), tab( 0 ), - wrappableChars( " [({.," ), + wrappableChars( " [({.,/|\\" ), recursionCount( 0 ) {} @@ -7411,6 +7436,7 @@ namespace Catch { } void lazyPrintRunInfo() { stream << "\n" << getTildes() << "\n"; + TextColour colour( TextColour::SecondaryText ); stream << testRunInfo->name << " is a CATCH v" << libraryVersion.majorVersion << "." << libraryVersion.minorVersion << " b" @@ -7428,15 +7454,13 @@ namespace Catch { unusedGroupInfo.reset(); } } - void lazyPrintTestCaseInfo() { - if( !currentSectionInfo ) { - printClosedHeader( unusedTestCaseInfo->name ); - stream << std::endl; - } - } void printTestCaseAndSectionHeader() { - printOpenHeader( unusedTestCaseInfo->name ); + printOpenHeader( unusedTestCaseInfo->name, + currentSectionInfo + ? currentSectionInfo->lineInfo + : unusedTestCaseInfo->lineInfo ); if( currentSectionInfo ) { + TextColour colourGuard( TextColour::Headers ); std::vector sections; for( ThreadedSectionInfo* section = currentSectionInfo.get(); section; @@ -7457,9 +7481,16 @@ namespace Catch { printOpenHeader( _name ); stream << getDots() << "\n"; } - void printOpenHeader( std::string const& _name ) { - stream << getDashes() << "\n" - << _name << "\n"; + void printOpenHeader( std::string const& _name, SourceLineInfo const& _lineInfo = SourceLineInfo() ) { + stream << getDashes() << "\n"; + if( !_lineInfo.empty() ){ + TextColour colourGuard( TextColour::FileName ); + stream << _lineInfo << "\n\n"; + } + { + TextColour colourGuard( TextColour::Headers ); + stream << _name << "\n"; + } } void printTotals( const Totals& totals ) { From a3703faa0a04d99ad9f041e20fed48f6c04da69a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 5 Apr 2013 07:47:36 +0100 Subject: [PATCH 196/296] First cut of new Colour class (to replace TextColour) --- include/internal/catch_console_colour.hpp | 46 +++++++ .../internal/catch_console_colour_impl.hpp | 109 +++++++++++++++- include/internal/catch_list.hpp | 6 +- include/reporters/catch_reporter_basic.hpp | 2 +- projects/SelfTest/TestMain.cpp | 118 ++++++++++++++++++ .../CatchSelfTest.xcodeproj/project.pbxproj | 4 +- 6 files changed, 275 insertions(+), 10 deletions(-) diff --git a/include/internal/catch_console_colour.hpp b/include/internal/catch_console_colour.hpp index 930738dc..4811a683 100644 --- a/include/internal/catch_console_colour.hpp +++ b/include/internal/catch_console_colour.hpp @@ -12,6 +12,52 @@ namespace Catch { + namespace Detail { + struct IColourImpl; + } + + struct Colour { + enum Code { + None = 0, + + White, + Red, + Green, + Blue, + Cyan, + Yellow, + Grey, + + Bright = 0x10, + + BrightRed = Bright | Red, + BrightGreen = Bright | Green, + LightGrey = Bright | Grey, + BrightWhite = Bright | White, + + // By intention + FileName = Grey, + ResultError = BrightRed, + ResultSuccess = BrightGreen, + + Error = BrightRed, + Success = Green, + + OriginalExpression = Cyan, + ReconstructedExpression = Yellow, + + SecondaryText = Grey, + Headers = White + }; + + Colour( Code _colourCode ); + ~Colour(); + static void use( Code _colourCode ); + + private: + static Detail::IColourImpl* impl; + }; + struct IConsoleColourCodes : NonCopyable { enum Colours { None, diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index d00d969e..6c5ca588 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -10,13 +10,60 @@ #include "catch_console_colour.hpp" +namespace Catch { namespace Detail { + struct IColourImpl { + virtual ~IColourImpl() {} + virtual void use( Colour::Code _colourCode ) = 0; + }; +}} + #if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// #include +namespace Catch { namespace { - using namespace Catch; + class Win32ColourImpl : public Detail::IColourImpl { + public: + Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) ) + { + CONSOLE_SCREEN_BUFFER_INFO csbiInfo; + GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo ); + originalAttributes = csbiInfo.wAttributes; + } + ~Win32ColourImpl() { + use( Colour::None ); + } + + virtual void use( Colour::Code _colourCode ) { + switch( _colourCode ) { + case Colour::None: return setTextAttribute( originalAttributes ); + case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); + case Colour::Red: return setTextAttribute( FOREGROUND_RED ); + case Colour::Green: return setTextAttribute( FOREGROUND_GREEN ); + case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE ); + case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN ); + case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN ); + case Colour::Grey: return setTextAttribute( 0 ); + + case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY ); + case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED ); + case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN ); + case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); + + case Colour::Bright: throw std::logic_error( "not a colour" ); + } + } + + private: + void setTextAttribute( WORD _textAttribute ) { + SetConsoleTextAttribute( stdoutHandle, _textAttribute ); + } + HANDLE stdoutHandle; + WORD originalAttributes; + }; + WORD mapConsoleColour( IConsoleColourCodes::Colours colour ) { enum Win32Colours { Grey = FOREGROUND_INTENSITY, @@ -71,15 +118,48 @@ namespace { } typedef WindowsConsoleColourCodes PlatformConsoleColourCodes; + Win32ColourImpl platformColourImpl; } // end anon namespace +} // end namespace Catch #else // Not Windows - assumed to be POSIX compatible ////////////////////////// #include +namespace Catch { namespace { - using namespace Catch; + + class PosixColourImpl : public Detail::IColourImpl { + public: + PosixColourImpl() { + use( Colour::None ); + } + + virtual void use( Colour::Code _colourCode ) { + switch( _colourCode ) { + case Colour::None: + case Colour::White: return setColour( "[0m" ); + case Colour::Red: return setColour( "[0;31m" ); + case Colour::Green: return setColour( "[0;32m" ); + case Colour::Blue: return setColour( "[0:34m" ); + case Colour::Cyan: return setColour( "[0;36m" ); + case Colour::Yellow: return setColour( "[0;33m" ); + case Colour::Grey: return setColour( "[1;30m" ); + + case Colour::LightGrey: return setColour( "[0;37m" ); + case Colour::BrightRed: return setColour( "[1;31m" ); + case Colour::BrightGreen: return setColour( "[1;33m" ); + case Colour::BrightWhite: return setColour( "[1;37m" ); + + case Colour::Bright: throw std::logic_error( "not a colour" ); + } + } + private: + void setColour( const char* _escapeCode ) { + std::cout << '\033' << _escapeCode; + } + }; // use POSIX/ ANSI console terminal codes // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) @@ -126,19 +206,40 @@ namespace { } typedef AnsiConsoleColourCodes PlatformConsoleColourCodes; + PosixColourImpl platformColourImpl; -} // namespace Catch +} // end anon namespace +} // end namespace Catch #endif // not Windows namespace { - struct NoConsoleColourCodes : IConsoleColourCodes { + struct NoConsoleColourCodes : Catch::IConsoleColourCodes { void set( Colours ) {} }; } namespace Catch { + namespace { + struct NoColourImpl : Detail::IColourImpl { + void use( Colour::Code ) {} + }; + NoColourImpl noColourImpl; + static const bool shouldUseColour = shouldUseColourForPlatform() && + !isDebuggerActive(); + } + + Colour::Colour( Code _colourCode ){ use( _colourCode ); } + Colour::~Colour(){ use( None ); } + void Colour::use( Code _colourCode ) { + impl->use( _colourCode ); + } + + Detail::IColourImpl* Colour::impl = shouldUseColour + ? static_cast( &platformColourImpl ) + : static_cast( &noColourImpl ); + TextColour::TextColour( Colours colour ) : m_impl( NULL ) { static bool s_shouldUseColour = shouldUseColourForPlatform() && !isDebuggerActive(); diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 762447f3..61fd64f9 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -118,7 +118,7 @@ namespace Catch { tagItEnd = it->getTestCaseInfo().tags.end(); tagIt != tagItEnd; ++tagIt ) { - std::string tagName = "[" + *tagIt + "]"; + std::string tagName = *tagIt; maxTagLen = (std::max)( maxTagLen, tagName.size() ); std::map::iterator countIt = tagCounts.find( tagName ); if( countIt == tagCounts.end() ) @@ -128,7 +128,7 @@ namespace Catch { } } } - maxTagLen +=2; + maxTagLen +=4; if( maxTagLen > CATCH_CONFIG_CONSOLE_WIDTH-10 ) maxTagLen = CATCH_CONFIG_CONSOLE_WIDTH-10; @@ -136,7 +136,7 @@ namespace Catch { countIt != countItEnd; ++countIt ) { LineWrapper wrapper; - wrapper.setIndent(2).setRight( maxTagLen ).wrap( countIt->first ); + wrapper.setIndent(2).setRight( maxTagLen ).wrap( "[" + countIt->first + "]" ); std::cout << wrapper; std::size_t dots = 2; diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index b13f84f4..15c79908 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -64,7 +64,7 @@ namespace Catch { m_config.stream() << "No tests ran"; } else if( totals.assertions.failed ) { - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); ReportCounts( "test case", totals.testCases, allPrefix ); if( totals.testCases.failed > 0 ) { m_config.stream() << " ("; diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 18b9c727..579caae5 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -495,3 +495,121 @@ TEST_CASE( "Long strings can be wrapped", "[wrap]" ) { } } + +using namespace Catch; + +class ColourString { +public: + + struct ColourIndex { + ColourIndex( Colour::Code _colour, std::size_t _fromIndex, std::size_t _toIndex ) + : colour( _colour ), + fromIndex( _fromIndex ), + toIndex( _toIndex ) + {} + + Colour::Code colour; + std::size_t fromIndex; + std::size_t toIndex; + }; + + ColourString( std::string const& _string ) + : string( _string ) + {} + ColourString( std::string const& _string, std::vector const& _colours ) + : string( _string ), colours( _colours ) + {} + + ColourString& addColour( Colour::Code colour, int _index ) { + colours.push_back( ColourIndex( colour, + resolveRelativeIndex( _index ), + resolveRelativeIndex( _index )+1 ) ); + return *this; + } + ColourString& addColour( Colour::Code colour, int _fromIndex, int _toIndex ) { + colours.push_back( ColourIndex( colour, + resolveRelativeIndex(_fromIndex), + resolveLastRelativeIndex( _toIndex ) ) ); + return *this; + } + + void writeToStream( std::ostream& _stream ) const { + std::size_t last = 0; + for( std::size_t i = 0; i < colours.size(); ++i ) { + ColourIndex const& index = colours[i]; + if( index.fromIndex > last ) + _stream << string.substr( last, index.fromIndex-last ); + { + Colour colourGuard( index.colour ); + _stream << string.substr( index.fromIndex, index.toIndex-index.fromIndex ); + } + last = index.toIndex; + } + if( last < string.size() ) + _stream << string.substr( last ); + } + friend std::ostream& operator << ( std::ostream& _stream, ColourString const& _colourString ) { + _colourString.writeToStream( _stream ); + return _stream; + } + +private: + + std::size_t resolveLastRelativeIndex( int _index ) { + std::size_t index = resolveRelativeIndex( _index ); + return index == 0 ? string.size() : index; + } + std::size_t resolveRelativeIndex( int _index ) { + return static_cast( _index >= 0 + ? _index + : static_cast( string.size() )+_index ); + } + std::string string; + std::vector colours; +}; + +class Text +{ +public: + Text( std::string const& _string ) : originalString( _string ) { + } + Text( char const* const _string ) : originalString( _string ) { + } + + friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { + _text.print( _stream ); + return _stream; + } + +private: + void process() const { + + } + void print( std::ostream& stream ) const { + stream << originalString; + } + + std::string originalString; +// std::vector< +}; + +TEST_CASE( "Strings can be rendered with colour", "[colour]" ) { +// Text text = "`red`This is in red. `green` this is in green"; +// std::cout << text << std::endl; + + { + ColourString cs( "hello" ); + cs .addColour( Colour::Red, 0 ) + .addColour( Colour::Green, -1 ); + + std::cout << cs << std::endl; + } + + { + ColourString cs( "hello" ); + cs .addColour( Colour::Blue, 1, -2 ); + + std::cout << cs << std::endl; + } + +} diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 114da60b..8f799bb5 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -138,8 +138,8 @@ 4A9D84B315599AC900FBB209 /* catch_expressionresult_builder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_expressionresult_builder.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 4AA7B8B4165428BA003155F6 /* catch_version.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = catch_version.hpp; path = ../../../../include/internal/catch_version.hpp; sourceTree = ""; }; 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 = ""; }; + 4AB1C73514F97BDA00F31DF7 /* catch_console_colour_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_console_colour_impl.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + 4AB1C73714F97C1300F31DF7 /* catch_console_colour.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_console_colour.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 4AB3D99C1616216500C9A0F8 /* catch_interfaces_testcase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_interfaces_testcase.cpp; path = ../../../SelfTest/SurrogateCpps/catch_interfaces_testcase.cpp; sourceTree = ""; }; 4AB3D99F1616219100C9A0F8 /* catch_interfaces_config.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_interfaces_config.cpp; path = ../../../SelfTest/SurrogateCpps/catch_interfaces_config.cpp; sourceTree = ""; }; 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 = ""; }; From f186a912d4c530004c2206848a247ca0244fed8d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 5 Apr 2013 07:59:28 +0100 Subject: [PATCH 197/296] Switched TextColour out for Colour - Removed TextColour --- include/internal/catch_console_colour.hpp | 38 +----- .../internal/catch_console_colour_impl.hpp | 121 +----------------- include/internal/catch_list.hpp | 12 +- include/reporters/catch_reporter_basic.hpp | 40 +++--- include/reporters/catch_reporter_console.hpp | 44 +++---- 5 files changed, 57 insertions(+), 198 deletions(-) diff --git a/include/internal/catch_console_colour.hpp b/include/internal/catch_console_colour.hpp index 4811a683..1febc5f7 100644 --- a/include/internal/catch_console_colour.hpp +++ b/include/internal/catch_console_colour.hpp @@ -36,7 +36,7 @@ namespace Catch { BrightWhite = Bright | White, // By intention - FileName = Grey, + FileName = LightGrey, ResultError = BrightRed, ResultSuccess = BrightGreen, @@ -46,48 +46,20 @@ namespace Catch { OriginalExpression = Cyan, ReconstructedExpression = Yellow, - SecondaryText = Grey, + SecondaryText = LightGrey, Headers = White }; + // Use constructed object for RAII guard Colour( Code _colourCode ); ~Colour(); + + // Use static method for one-shot changes static void use( Code _colourCode ); private: static Detail::IColourImpl* impl; }; - - struct IConsoleColourCodes : NonCopyable { - enum Colours { - None, - - FileName, - ResultError, - ResultSuccess, - - Error, - Success, - - OriginalExpression, - ReconstructedExpression, - - SecondaryText, - Headers - }; - - virtual void set( Colours colour ) = 0; - }; - - class TextColour : public IConsoleColourCodes { - public: - TextColour( Colours colour = None ); - void set( Colours colour ); - ~TextColour(); - - private: - IConsoleColourCodes* m_impl; - }; } // end namespace Catch diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 6c5ca588..188e36d9 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -64,60 +64,10 @@ namespace { WORD originalAttributes; }; - WORD mapConsoleColour( IConsoleColourCodes::Colours colour ) { - enum Win32Colours { - Grey = FOREGROUND_INTENSITY, - BrightRed = FOREGROUND_RED | FOREGROUND_INTENSITY, - BrightGreen = FOREGROUND_GREEN | FOREGROUND_INTENSITY, - BrightWhite = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY, - DarkGreen = FOREGROUND_GREEN, - Cyan = FOREGROUND_BLUE | FOREGROUND_GREEN, - Yellow = FOREGROUND_RED | FOREGROUND_GREEN - }; - switch( colour ) { - case IConsoleColourCodes::FileName: return Grey; - case IConsoleColourCodes::ResultError: return BrightRed; - case IConsoleColourCodes::ResultSuccess: return BrightGreen; - case IConsoleColourCodes::Error: return BrightRed; - case IConsoleColourCodes::Success: return DarkGreen; - case IConsoleColourCodes::OriginalExpression: return Cyan; - case IConsoleColourCodes::ReconstructedExpression: return Yellow; - case IConsoleColourCodes::SecondaryText: return Grey; - case IConsoleColourCodes::Headers: return 0; - default: return 0; - } - } - - struct WindowsConsoleColourCodes : IConsoleColourCodes { - - WindowsConsoleColourCodes() - : hStdout( GetStdHandle(STD_OUTPUT_HANDLE) ), - wOldColorAttrs( 0 ) - { - GetConsoleScreenBufferInfo( hStdout, &csbiInfo ); - wOldColorAttrs = csbiInfo.wAttributes; - } - - ~WindowsConsoleColourCodes() { - SetConsoleTextAttribute( hStdout, wOldColorAttrs ); - } - - void set( Colours colour ) { - WORD consoleColour = mapConsoleColour( colour ); - if( consoleColour > 0 ) - SetConsoleTextAttribute( hStdout, consoleColour ); - } - - HANDLE hStdout; - CONSOLE_SCREEN_BUFFER_INFO csbiInfo; - WORD wOldColorAttrs; - }; - inline bool shouldUseColourForPlatform() { return true; } - typedef WindowsConsoleColourCodes PlatformConsoleColourCodes; Win32ColourImpl platformColourImpl; } // end anon namespace @@ -130,6 +80,10 @@ namespace { namespace Catch { namespace { + // use POSIX/ ANSI console terminal codes + // Thanks to Adam Strzelecki for original contribution + // (http://github.com/nanoant) + // https://github.com/philsquared/Catch/pull/131 class PosixColourImpl : public Detail::IColourImpl { public: PosixColourImpl() { @@ -161,51 +115,10 @@ namespace { } }; - // use POSIX/ ANSI console terminal codes - // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) - // https://github.com/philsquared/Catch/pull/131 - - const char* WhiteOrNormal = "[0m"; - const char* BrightRed = "[1;31m"; - const char* BrightGreen = "[1;32m"; -// const char* BrightWhite = "[1;37m"; - const char* Green = "[0;32m"; - const char* Cyan = "[0;36m"; - const char* Yellow = "[0;33m"; - const char* LightGrey = "[0;37m"; -// const char* DarkGrey = "[1;30m"; - - struct AnsiConsoleColourCodes : IConsoleColourCodes { - - ~AnsiConsoleColourCodes() { - set( None ); - } - - const char* escapeCodeForColour( Colours colour ) { - switch( colour ) { - case FileName: return WhiteOrNormal; - case ResultError: return BrightRed; - case ResultSuccess: return BrightGreen; - case Error: return BrightRed; - case Success: return Green; - case OriginalExpression: return Cyan; - case ReconstructedExpression: return Yellow; - case SecondaryText: return LightGrey; - case Headers: return WhiteOrNormal; - case None: return WhiteOrNormal; - } - } - - void set( Colours colour ) { - std::cout << '\033' << escapeCodeForColour( colour ); - } - }; - inline bool shouldUseColourForPlatform() { return isatty( fileno(stdout) ); } - typedef AnsiConsoleColourCodes PlatformConsoleColourCodes; PosixColourImpl platformColourImpl; } // end anon namespace @@ -213,12 +126,6 @@ namespace { #endif // not Windows -namespace { - struct NoConsoleColourCodes : Catch::IConsoleColourCodes { - void set( Colours ) {} - }; -} - namespace Catch { namespace { @@ -240,26 +147,6 @@ namespace Catch { ? static_cast( &platformColourImpl ) : static_cast( &noColourImpl ); - TextColour::TextColour( Colours colour ) : m_impl( NULL ) { - static bool s_shouldUseColour = shouldUseColourForPlatform() && - !isDebuggerActive(); - if( s_shouldUseColour ) - m_impl = new PlatformConsoleColourCodes(); - else - m_impl = new NoConsoleColourCodes(); - - if( colour ) - set( colour ); - } - - TextColour::~TextColour() { - delete m_impl; - } - - void TextColour::set( Colours colour ) { - m_impl->set( colour ); - } - } // end namespace Catch #endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 61fd64f9..c0a44081 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -64,25 +64,25 @@ namespace Catch { tagsWrapper.setRight( maxTagLen ).wrap( it->getTestCaseInfo().tagsAsString ); for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) { - TextColour::Colours colour = TextColour::None; + Colour::Code colour = Colour::None; if( it->getTestCaseInfo().isHidden ) - colour = TextColour::SecondaryText; + colour = Colour::SecondaryText; std::string nameCol; if( i < nameWrapper.size() ) { nameCol = nameWrapper[i]; } else { nameCol = " ..."; - colour = TextColour::SecondaryText; + colour = Colour::SecondaryText; } { - TextColour colourGuard( colour ); + Colour colourGuard( colour ); std::cout << nameCol; } if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) { if( i == 0 ) { - TextColour colourGuard( TextColour::SecondaryText ); + Colour colourGuard( Colour::SecondaryText ); std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " "; } else { @@ -143,7 +143,7 @@ namespace Catch { if( maxTagLen > wrapper.last().size() ) dots += maxTagLen - wrapper.last().size(); { - TextColour colourGuard( TextColour::SecondaryText ); + Colour colourGuard( Colour::SecondaryText ); std::cout << std::string( dots, '.' ); } std::cout << countIt->second diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 15c79908..13a4481f 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -73,7 +73,7 @@ namespace Catch { } } else { - TextColour colour( TextColour::ResultSuccess ); + Colour colour( Colour::ResultSuccess ); m_config.stream() << allPrefix << "tests passed (" << pluralise( totals.assertions.passed, "assertion" ) << " in " << pluralise( totals.testCases.passed, "test case" ) << ")"; @@ -130,12 +130,12 @@ namespace Catch { virtual void NoAssertionsInSection( const std::string& sectionName ) { startSpansLazily(); - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); m_config.stream() << "\nNo assertions in section, '" << sectionName << "'\n" << std::endl; } virtual void NoAssertionsInTestCase( const std::string& testName ) { startSpansLazily(); - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); m_config.stream() << "\nNo assertions in test case, '" << testName << "'\n" << std::endl; } @@ -146,11 +146,11 @@ namespace Catch { m_config.stream() << "[End of section: '" << sectionName << "' "; if( assertions.failed ) { - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); ReportCounts( "assertion", assertions); } else { - TextColour colour( TextColour::ResultSuccess ); + Colour colour( Colour::ResultSuccess ); m_config.stream() << ( assertions.passed > 1 ? "All " : "" ) << pluralise( assertions.passed, "assertion" ) << " passed" ; } @@ -166,22 +166,22 @@ namespace Catch { startSpansLazily(); if( !assertionResult.getSourceInfo().empty() ) { - TextColour colour( TextColour::FileName ); + Colour colour( Colour::FileName ); m_config.stream() << assertionResult.getSourceInfo() << ": "; } if( assertionResult.hasExpression() ) { - TextColour colour( TextColour::OriginalExpression ); + Colour colour( Colour::OriginalExpression ); m_config.stream() << assertionResult.getExpression(); if( assertionResult.succeeded() ) { - TextColour successColour( TextColour::Success ); + Colour successColour( Colour::Success ); m_config.stream() << " succeeded"; } else { - TextColour errorColour( TextColour::Error ); + Colour errorColour( Colour::Error ); m_config.stream() << " failed"; if( assertionResult.isOk() ) { - TextColour okAnywayColour( TextColour::Success ); + Colour okAnywayColour( Colour::Success ); m_config.stream() << " - but was ok"; } } @@ -189,7 +189,7 @@ namespace Catch { switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: { - TextColour colour( TextColour::Error ); + Colour colour( Colour::Error ); if( assertionResult.hasExpression() ) m_config.stream() << " with unexpected"; else @@ -199,7 +199,7 @@ namespace Catch { break; case ResultWas::DidntThrowException: { - TextColour colour( TextColour::Error ); + Colour colour( Colour::Error ); if( assertionResult.hasExpression() ) m_config.stream() << " because no exception was thrown where one was expected"; else @@ -208,19 +208,19 @@ namespace Catch { break; case ResultWas::Info: { - TextColour colour( TextColour::ReconstructedExpression ); + Colour colour( Colour::ReconstructedExpression ); streamVariableLengthText( "info", assertionResult.getMessage() ); } break; case ResultWas::Warning: { - TextColour colour( TextColour::ReconstructedExpression ); + Colour colour( Colour::ReconstructedExpression ); streamVariableLengthText( "warning", assertionResult.getMessage() ); } break; case ResultWas::ExplicitFailure: { - TextColour colour( TextColour::Error ); + Colour colour( Colour::Error ); m_config.stream() << "failed with message: '" << assertionResult.getMessage() << "'"; } break; @@ -231,21 +231,21 @@ namespace Catch { case ResultWas::Exception: if( !assertionResult.hasExpression() ) { if( assertionResult.succeeded() ) { - TextColour colour( TextColour::Success ); + Colour colour( Colour::Success ); m_config.stream() << " succeeded"; } else { - TextColour colour( TextColour::Error ); + Colour colour( Colour::Error ); m_config.stream() << " failed"; if( assertionResult.isOk() ) { - TextColour okAnywayColour( TextColour::Success ); + Colour okAnywayColour( Colour::Success ); m_config.stream() << " - but was ok"; } } } if( assertionResult.hasMessage() ) { m_config.stream() << "\n"; - TextColour colour( TextColour::ReconstructedExpression ); + Colour colour( Colour::ReconstructedExpression ); streamVariableLengthText( "with message", assertionResult.getMessage() ); } break; @@ -258,7 +258,7 @@ namespace Catch { if( assertionResult.getExpandedExpression().size() < 70 ) m_config.stream() << "\t"; } - TextColour colour( TextColour::ReconstructedExpression ); + Colour colour( Colour::ReconstructedExpression ); m_config.stream() << assertionResult.getExpandedExpression(); } m_config.stream() << std::endl; diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index b210bf2d..f1a798f3 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -60,7 +60,7 @@ namespace Catch { virtual void sectionEnded( SectionStats const& _sectionStats ) { if( _sectionStats.missingAssertions ) { lazyPrint(); - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; } m_headerPrinted = false; @@ -71,7 +71,7 @@ namespace Catch { if( _testCaseStats.missingAssertions ) { lazyPrint(); - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl; } StreamingReporterBase::testCaseEnded( _testCaseStats ); @@ -103,13 +103,13 @@ namespace Catch { : stream( _stream ), stats( _stats ), result( _stats.assertionResult ), - colour( TextColour::None ), + colour( Colour::None ), message( result.getMessage() ), messages( _stats.infoMessages ) { switch( result.getResultType() ) { case ResultWas::Ok: - colour = TextColour::Success; + colour = Colour::Success; passOrFail = "PASSED"; //if( result.hasMessage() ) if( _stats.infoMessages.size() == 1 ) @@ -119,11 +119,11 @@ namespace Catch { break; case ResultWas::ExpressionFailed: if( result.isOk() ) { - colour = TextColour::Success; + colour = Colour::Success; passOrFail = "FAILED - but was ok"; } else { - colour = TextColour::Error; + colour = Colour::Error; passOrFail = "FAILED"; } if( _stats.infoMessages.size() == 1 ) @@ -132,12 +132,12 @@ namespace Catch { messageLabel = "with messages"; break; case ResultWas::ThrewException: - colour = TextColour::Error; + colour = Colour::Error; passOrFail = "FAILED"; messageLabel = "due to unexpected exception with message"; break; case ResultWas::DidntThrowException: - colour = TextColour::Error; + colour = Colour::Error; passOrFail = "FAILED"; messageLabel = "because no exception was thrown where one was expected"; break; @@ -149,7 +149,7 @@ namespace Catch { break; case ResultWas::ExplicitFailure: passOrFail = "FAILED"; - colour = TextColour::Error; + colour = Colour::Error; if( _stats.infoMessages.size() == 1 ) messageLabel = "explicitly with message"; if( _stats.infoMessages.size() > 1 ) @@ -157,7 +157,7 @@ namespace Catch { break; case ResultWas::Exception: passOrFail = "FAILED"; - colour = TextColour::Error; + colour = Colour::Error; if( _stats.infoMessages.size() == 1 ) messageLabel = "with message"; if( _stats.infoMessages.size() > 1 ) @@ -168,7 +168,7 @@ namespace Catch { case ResultWas::Unknown: case ResultWas::FailureBit: passOrFail = "** internal error **"; - colour = TextColour::Error; + colour = Colour::Error; break; } } @@ -191,13 +191,13 @@ namespace Catch { private: void printResultType() const { if( !passOrFail.empty() ) { - TextColour colourGuard( colour ); + Colour colourGuard( colour ); stream << passOrFail << ":\n"; } } void printOriginalExpression() const { if( result.hasExpression() ) { - TextColour colourGuard( TextColour::OriginalExpression ); + Colour colourGuard( Colour::OriginalExpression ); stream << " "; if( !result.getTestMacroName().empty() ) stream << result.getTestMacroName() << "( "; @@ -210,7 +210,7 @@ namespace Catch { void printReconstructedExpression() const { if( result.hasExpandedExpression() ) { stream << "with expansion:\n"; - TextColour colourGuard( TextColour::ReconstructedExpression ); + Colour colourGuard( Colour::ReconstructedExpression ); stream << LineWrapper().setIndent(2).wrap( result.getExpandedExpression() ) << "\n"; } } @@ -224,14 +224,14 @@ namespace Catch { } } void printSourceInfo() const { - TextColour colourGuard( TextColour::FileName ); + Colour colourGuard( Colour::FileName ); stream << result.getSourceInfo() << ": "; } std::ostream& stream; AssertionStats const& stats; AssertionResult const& result; - TextColour::Colours colour; + Colour::Code colour; std::string passOrFail; std::string messageLabel; std::string message; @@ -253,7 +253,7 @@ namespace Catch { } void lazyPrintRunInfo() { stream << "\n" << getTildes() << "\n"; - TextColour colour( TextColour::SecondaryText ); + Colour colour( Colour::SecondaryText ); stream << testRunInfo->name << " is a CATCH v" << libraryVersion.majorVersion << "." << libraryVersion.minorVersion << " b" @@ -277,7 +277,7 @@ namespace Catch { ? currentSectionInfo->lineInfo : unusedTestCaseInfo->lineInfo ); if( currentSectionInfo ) { - TextColour colourGuard( TextColour::Headers ); + Colour colourGuard( Colour::Headers ); std::vector sections; for( ThreadedSectionInfo* section = currentSectionInfo.get(); section; @@ -301,11 +301,11 @@ namespace Catch { void printOpenHeader( std::string const& _name, SourceLineInfo const& _lineInfo = SourceLineInfo() ) { stream << getDashes() << "\n"; if( !_lineInfo.empty() ){ - TextColour colourGuard( TextColour::FileName ); + Colour colourGuard( Colour::FileName ); stream << _lineInfo << "\n\n"; } { - TextColour colourGuard( TextColour::Headers ); + Colour colourGuard( Colour::Headers ); stream << _name << "\n"; } } @@ -315,7 +315,7 @@ namespace Catch { stream << "No tests ran"; } else if( totals.assertions.failed ) { - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); printCounts( "test case", totals.testCases ); if( totals.testCases.failed > 0 ) { stream << " ("; @@ -324,7 +324,7 @@ namespace Catch { } } else { - TextColour colour( TextColour::ResultSuccess ); + Colour colour( Colour::ResultSuccess ); stream << "All tests passed (" << pluralise( totals.assertions.passed, "assertion" ) << " in " << pluralise( totals.testCases.passed, "test case" ) << ")"; From 4746caacaf3821d39543838d2a4b10b1d9dc94d8 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 5 Apr 2013 20:55:57 +0100 Subject: [PATCH 198/296] LineWrapper can indent first line differently to subsequent lines - use this to wrap Given/ When/ Then with indent after the : --- .../internal/catch_console_colour_impl.hpp | 9 +- include/internal/catch_line_wrap.h | 7 +- include/internal/catch_line_wrap.hpp | 29 +- include/reporters/catch_reporter_console.hpp | 19 +- .../CatchSelfTest => SelfTest}/BDDTests.cpp | 4 + .../SelfTest/Baselines/approvedResults.txt | 329 ++++++++++++------ projects/SelfTest/TestMain.cpp | 8 + .../TestCatch/TestCatch/TestCatch.vcproj | 12 + .../CatchSelfTest.xcodeproj/project.pbxproj | 8 +- 9 files changed, 294 insertions(+), 131 deletions(-) rename projects/{XCode4/CatchSelfTest/CatchSelfTest => SelfTest}/BDDTests.cpp (85%) diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 188e36d9..938a5363 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -32,10 +32,7 @@ namespace { GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo ); originalAttributes = csbiInfo.wAttributes; } - ~Win32ColourImpl() { - use( Colour::None ); - } - + virtual void use( Colour::Code _colourCode ) { switch( _colourCode ) { case Colour::None: return setTextAttribute( originalAttributes ); @@ -86,10 +83,6 @@ namespace { // https://github.com/philsquared/Catch/pull/131 class PosixColourImpl : public Detail::IColourImpl { public: - PosixColourImpl() { - use( Colour::None ); - } - virtual void use( Colour::Code _colourCode ) { switch( _colourCode ) { case Colour::None: diff --git a/include/internal/catch_line_wrap.h b/include/internal/catch_line_wrap.h index 7cd08055..cfd31df8 100644 --- a/include/internal/catch_line_wrap.h +++ b/include/internal/catch_line_wrap.h @@ -18,7 +18,9 @@ namespace Catch { LineWrapper(); LineWrapper& setIndent( std::size_t _indent ); + LineWrapper& setInitialIndent( std::size_t _initalIndent ); LineWrapper& setRight( std::size_t _right ); + LineWrapper& setTabChar( char _tabChar ); LineWrapper& wrap( std::string const& _str ); @@ -38,12 +40,15 @@ namespace Catch { void wrapInternal( std::string const& _str ); void addLine( const std::string& _line ); bool isWrapPoint( char c ); + std::size_t getCurrentIndent() const; - std::string indent; std::size_t right; std::size_t nextTab; std::size_t tab; + std::size_t indent; + std::size_t initialIndent; std::string wrappableChars; + char tabChar; int recursionCount; std::vector lines; }; diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp index bd41d69a..05e9143b 100644 --- a/include/internal/catch_line_wrap.hpp +++ b/include/internal/catch_line_wrap.hpp @@ -16,12 +16,19 @@ namespace Catch { : right( CATCH_CONFIG_CONSOLE_WIDTH-1 ), nextTab( 0 ), tab( 0 ), + indent( 0 ), + initialIndent( (std::size_t)-1 ), // use indent by default wrappableChars( " [({.,/|\\" ), + tabChar( '\t' ), recursionCount( 0 ) {} LineWrapper& LineWrapper::setIndent( std::size_t _indent ) { - indent = std::string( _indent, ' ' ); + indent = _indent; + return *this; + } + LineWrapper& LineWrapper::setInitialIndent( std::size_t _initialIndent ) { + initialIndent = _initialIndent; return *this; } LineWrapper& LineWrapper::setRight( std::size_t _right ) { @@ -33,13 +40,17 @@ namespace Catch { wrapInternal( _str ); return *this; } + LineWrapper& LineWrapper::setTabChar( char _tabChar ) { + tabChar = _tabChar; + return *this; + } bool LineWrapper::isWrapPoint( char c ) { return wrappableChars.find( c ) != std::string::npos; } void LineWrapper::wrapInternal( std::string const& _str ) { assert( ++recursionCount < 100 ); - std::size_t width = right - indent.size(); + std::size_t width = right - getCurrentIndent(); std::size_t wrapPoint = width-tab; for( std::size_t pos = 0; pos < _str.size(); ++pos ) { if( _str[pos] == '\n' ) @@ -61,7 +72,7 @@ namespace Catch { } return wrapInternal( _str.substr( wrapPoint ) ); } - if( _str[pos] == '\t' ) { + if( _str[pos] == tabChar ) { nextTab = pos; std::string withoutTab = _str.substr( 0, nextTab ) + _str.substr( nextTab+1 ); return wrapInternal( withoutTab ); @@ -89,14 +100,18 @@ namespace Catch { } void LineWrapper::addLine( const std::string& _line ) { - if( tab > 0 ) - lines.push_back( indent + std::string( tab, ' ' ) + _line ); - else - lines.push_back( indent + _line ); + lines.push_back( std::string( tab + getCurrentIndent(), ' ' ) + _line ); if( nextTab > 0 ) tab = nextTab; } + std::size_t LineWrapper::getCurrentIndent() const + { + return (initialIndent != (std::size_t)-1 && lines.empty() ) + ? initialIndent + : indent; + } + } // end namespace Catch #endif // TWOBLUECUBES_CATCH_LINE_WRAP_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index f1a798f3..cb50436d 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -288,7 +288,8 @@ namespace Catch { if( !sections.empty() ) { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) - stream << " " << (*it)->name << "\n"; + printUserString( (*it)->name, 2 ); + } } stream << getDots() << "\n" << std::endl; @@ -306,10 +307,24 @@ namespace Catch { } { Colour colourGuard( Colour::Headers ); - stream << _name << "\n"; + printUserString( _name ); } } + // if string has a : in first line will set indent to follow it on + // subsequent lines + void printUserString( std::string const& _string, std::size_t indent = 0 ) { + std::size_t i = _string.find( ": " ); + if( i != std::string::npos ) + i+=2; + else + i = 0; + stream << LineWrapper() + .setIndent( indent+i) + .setInitialIndent( indent ) + .wrap( _string ) << "\n"; + } + void printTotals( const Totals& totals ) { if( totals.assertions.total() == 0 ) { stream << "No tests ran"; diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/SelfTest/BDDTests.cpp similarity index 85% rename from projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp rename to projects/SelfTest/BDDTests.cpp index bdde0333..4220c820 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/SelfTest/BDDTests.cpp @@ -61,4 +61,8 @@ SCENARIO( "This is a really long scenario name to see how the list command dea "[very long tags][lots][long][tags][verbose]" "[one very long tag name that should cause line wrapping writing out using the list command]" "[anotherReallyLongTagNameButThisOneHasNoObviousWrapPointsSoShouldSplitWithinAWordUsingADashCharacter]" ) { + GIVEN( "A section name that is so long that it cannot fit in a single console width" ) + WHEN( "The test headers are printed as part of the normal running of the scenario" ) + THEN( "The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent" ) + SUCCEED("boo!"); } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index bd8e6d8f..a4af322e 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -4706,14 +4706,34 @@ with expansion: "four" == "four" ------------------------------------------------------------------------------- -TestMain.cpp:477 +TestMain.cpp:470 + +Long strings can be wrapped + plain string + Indent first line differently +............................................................................... + +TestMain.cpp:475: +PASSED: + CHECK( Catch::LineWrapper() .setRight( 10 ) .setIndent( 4 ) .setInitialIndent( 1 ) .wrap( testString ).toString() == " one two\n three\n four" ) +with expansion: + " one two + three + four" + == + " one two + three + four" + +------------------------------------------------------------------------------- +TestMain.cpp:485 Long strings can be wrapped With newlines No wrapping ............................................................................... -TestMain.cpp:478: +TestMain.cpp:486: PASSED: CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ) with expansion: @@ -4723,7 +4743,7 @@ with expansion: "one two three four" -TestMain.cpp:479: +TestMain.cpp:487: PASSED: CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ) with expansion: @@ -4733,7 +4753,7 @@ with expansion: "one two three four" -TestMain.cpp:480: +TestMain.cpp:488: PASSED: CHECK( Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString ) with expansion: @@ -4744,14 +4764,14 @@ with expansion: three four" ------------------------------------------------------------------------------- -TestMain.cpp:482 +TestMain.cpp:490 Long strings can be wrapped With newlines Trailing newline ............................................................................... -TestMain.cpp:483: +TestMain.cpp:491: PASSED: CHECK( Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) with expansion: @@ -4761,13 +4781,13 @@ with expansion: "abcdef " -TestMain.cpp:484: +TestMain.cpp:492: PASSED: CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" ) with expansion: "abcdef" == "abcdef" -TestMain.cpp:485: +TestMain.cpp:493: PASSED: CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) with expansion: @@ -4778,14 +4798,14 @@ with expansion: " ------------------------------------------------------------------------------- -TestMain.cpp:487 +TestMain.cpp:495 Long strings can be wrapped With newlines Wrapped once ............................................................................... -TestMain.cpp:488: +TestMain.cpp:496: PASSED: CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4797,7 +4817,7 @@ with expansion: three four" -TestMain.cpp:489: +TestMain.cpp:497: PASSED: CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4809,7 +4829,7 @@ with expansion: three four" -TestMain.cpp:490: +TestMain.cpp:498: PASSED: CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4822,14 +4842,14 @@ with expansion: four" ------------------------------------------------------------------------------- -TestMain.cpp:492 +TestMain.cpp:500 Long strings can be wrapped With newlines Wrapped twice ............................................................................... -TestMain.cpp:493: +TestMain.cpp:501: PASSED: CHECK( Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) with expansion: @@ -4843,6 +4863,17 @@ with expansion: three four" +hello +hello +------------------------------------------------------------------------------- +TestMain.cpp:604 + +Strings can be rendered with colour +............................................................................... + + +No assertions in test case, 'Strings can be rendered with colour' + ------------------------------------------------------------------------------- TrickyTests.cpp:32 @@ -5161,6 +5192,40 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:12 + +Anonymous test case 1 +............................................................................... + +VariadicMacrosTests.cpp:14: +PASSED: +with message: + anonymous test case + +------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:17 + +Test case with one argument +............................................................................... + +VariadicMacrosTests.cpp:19: +PASSED: +with message: + no assertions + +------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:24 + +Variadic macros + Section with one argument +............................................................................... + +VariadicMacrosTests.cpp:26: +PASSED: +with message: + no assertions + ------------------------------------------------------------------------------- BDDTests.cpp:19 @@ -5365,50 +5430,25 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -BDDTests.cpp:63 +BDDTests.cpp:66 -Scenario: This is a really long scenario name to see how the list command deals with wrapping +Scenario: This is a really long scenario name to see how the list command + deals with wrapping + Given: A section name that is so long that it cannot fit in a single + console width + When: The test headers are printed as part of the normal running of the + scenario + Then: The, deliberately very long and overly verbose (you see what I did + there?) section names must wrap, along with an indent ............................................................................... - -No assertions in test case, 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' - -------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:12 - -Anonymous test case 1 -............................................................................... - -VariadicMacrosTests.cpp:14: +BDDTests.cpp:67: PASSED: with message: - anonymous test case - -------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:17 - -Test case with one argument -............................................................................... - -VariadicMacrosTests.cpp:19: -PASSED: -with message: - no assertions - -------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:24 - -Variadic macros - Section with one argument -............................................................................... - -VariadicMacrosTests.cpp:26: -PASSED: -with message: - no assertions + boo! =============================================================================== -108 test cases - 48 failed (697 assertions - 105 failed) +109 test cases - 48 failed (699 assertions - 105 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -5729,7 +5769,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -6136,6 +6176,12 @@ An error + + +hello +hello + + @@ -6168,12 +6214,12 @@ TrickyTests.cpp:106 - - - + + + Message from section one @@ -6187,6 +6233,9 @@ Some information Message from section one Message from section two Some information + +hello +hello An error @@ -11262,12 +11311,32 @@ TestMain.cpp" line="468">
+
+
+TestMain.cpp" line="475"> + + Catch::LineWrapper() .setRight( 10 ) .setIndent( 4 ) .setInitialIndent( 1 ) .wrap( testString ).toString() == " one two\n three\n four" + + + " one two + three + four" +== +" one two + three + four" + + + +
+ +
-TestMain.cpp" line="478"> +TestMain.cpp" line="486"> Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString @@ -11279,7 +11348,7 @@ three four" three four" -TestMain.cpp" line="479"> +TestMain.cpp" line="487"> Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString @@ -11291,7 +11360,7 @@ three four" three four" -TestMain.cpp" line="480"> +TestMain.cpp" line="488"> Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString @@ -11309,7 +11378,7 @@ three four"
-TestMain.cpp" line="483"> +TestMain.cpp" line="491"> Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" @@ -11321,7 +11390,7 @@ TestMain.cpp" line="483"> " -TestMain.cpp" line="484"> +TestMain.cpp" line="492"> Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" @@ -11329,7 +11398,7 @@ TestMain.cpp" line="484"> "abcdef" == "abcdef" -TestMain.cpp" line="485"> +TestMain.cpp" line="493"> Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" @@ -11347,7 +11416,7 @@ TestMain.cpp" line="485">
-TestMain.cpp" line="488"> +TestMain.cpp" line="496"> Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" @@ -11361,7 +11430,7 @@ three four" -TestMain.cpp" line="489"> +TestMain.cpp" line="497"> Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" @@ -11375,7 +11444,7 @@ three four" -TestMain.cpp" line="490"> +TestMain.cpp" line="498"> Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" @@ -11395,7 +11464,7 @@ four"
-TestMain.cpp" line="493"> +TestMain.cpp" line="501"> Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" @@ -11417,6 +11486,9 @@ four"
+ + + TrickyTests.cpp" line="37"> @@ -11705,6 +11777,18 @@ TrickyTests.cpp" line="335">
+ + + + + + + +
+ +
+ +
@@ -11911,23 +11995,20 @@ BDDTests.cpp" line="54"> - - - - - - - - - -
+
+
+
+ +
+ +
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -13389,21 +13470,35 @@ TestMain.cpp:468: wrapper[3] == "four" succeeded for: "four" == "four" [End of section: 'plain string' All 5 assertions passed] +[Started section: 'plain string'] +[Started section: 'Indent first line differently'] +TestMain.cpp:475: Catch::LineWrapper() .setRight( 10 ) .setIndent( 4 ) .setInitialIndent( 1 ) .wrap( testString ).toString() == " one two\n three\n four" succeeded for: + " one two + three + four" +== +" one two + three + four" +[End of section: 'Indent first line differently' 1 assertion passed] + +[End of section: 'plain string' 1 assertion passed] + [Started section: 'With newlines'] [Started section: 'No wrapping'] -TestMain.cpp:478: Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:486: Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:479: Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:487: Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:480: Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:488: Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString succeeded for: "one two three four" == @@ -13415,13 +13510,13 @@ three four" [Started section: 'With newlines'] [Started section: 'Trailing newline'] -TestMain.cpp:483: Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:491: Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef " -TestMain.cpp:484: Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" -TestMain.cpp:485: Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:492: Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" +TestMain.cpp:493: Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef @@ -13432,7 +13527,7 @@ TestMain.cpp:485: Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString [Started section: 'With newlines'] [Started section: 'Wrapped once'] -TestMain.cpp:488: Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:496: Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -13440,7 +13535,7 @@ four" "one two three four" -TestMain.cpp:489: Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:497: Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -13448,7 +13543,7 @@ four" "one two three four" -TestMain.cpp:490: Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:498: Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -13462,7 +13557,7 @@ four" [Started section: 'With newlines'] [Started section: 'Wrapped twice'] -TestMain.cpp:493: Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:501: Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -13476,7 +13571,15 @@ four" [End of section: 'With newlines' 1 assertion passed] -[Finished: 'Long strings can be wrapped' All tests passed (31 assertions in 1 test case)] +[Finished: 'Long strings can be wrapped' All tests passed (32 assertions in 1 test case)] +hello +hello + +[Running: Strings can be rendered with colour] + +No assertions in test case, 'Strings can be rendered with colour' + +[Finished: 'Strings can be rendered with colour' 1 test case failed (1 assertion failed)] [Running: ./succeeding/Tricky/std::pair] TrickyTests.cpp:37: (std::pair( 1, 2 )) == aNicePair succeeded for: std::pair( 1, 2 ) == std::pair( 1, 2 ) @@ -13579,6 +13682,24 @@ TrickyTests.cpp:335: Catch::isTrue( true ) succeeded for: true [Finished: 'Assertions then sections' All tests passed (6 assertions in 1 test case)] +[Running: Anonymous test case 1] +VariadicMacrosTests.cpp:14: succeeded +[with message: anonymous test case] +[Finished: 'Anonymous test case 1' All tests passed (1 assertion in 1 test case)] + +[Running: Test case with one argument] +VariadicMacrosTests.cpp:19: succeeded +[with message: no assertions] +[Finished: 'Test case with one argument' All tests passed (1 assertion in 1 test case)] + +[Running: Variadic macros] +[Started section: 'Section with one argument'] +VariadicMacrosTests.cpp:26: succeeded +[with message: no assertions] +[End of section: 'Section with one argument' 1 assertion passed] + +[Finished: 'Variadic macros' All tests passed (1 assertion in 1 test case)] + [Running: Scenario: Do that thing with the thing] [Started section: ' Given: This stuff exists'] [Started section: ' When: I do this'] @@ -13660,32 +13781,22 @@ BDDTests.cpp:54: v.size() == 0 succeeded for: 0 == 0 [Finished: 'Scenario: Vector resizing affects size and capacity' All tests passed (15 assertions in 1 test case)] [Running: Scenario: This is a really long scenario name to see how the list command deals with wrapping] +[Started section: ' Given: A section name that is so long that it cannot fit in a single console width'] +[Started section: ' When: The test headers are printed as part of the normal running of the scenario'] +[Started section: ' Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent'] +BDDTests.cpp:67: succeeded +[with message: boo!] +[End of section: ' Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent' 1 assertion passed] -No assertions in test case, 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' +[End of section: ' When: The test headers are printed as part of the normal running of the scenario' 1 assertion passed] -[Finished: 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' 1 test case failed (1 assertion failed)] +[End of section: ' Given: A section name that is so long that it cannot fit in a single console width' 1 assertion passed] -[Running: Anonymous test case 1] -VariadicMacrosTests.cpp:14: succeeded -[with message: anonymous test case] -[Finished: 'Anonymous test case 1' All tests passed (1 assertion in 1 test case)] - -[Running: Test case with one argument] -VariadicMacrosTests.cpp:19: succeeded -[with message: no assertions] -[Finished: 'Test case with one argument' All tests passed (1 assertion in 1 test case)] - -[Running: Variadic macros] -[Started section: 'Section with one argument'] -VariadicMacrosTests.cpp:26: succeeded -[with message: no assertions] -[End of section: 'Section with one argument' 1 assertion passed] - -[Finished: 'Variadic macros' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 48 of 108 test cases failed (105 of 697 assertions failed)] +[Finished: 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' All tests passed (1 assertion in 1 test case)] +[End of group: '~dummy'. 48 of 109 test cases failed (105 of 699 assertions failed)] -[Testing completed. 48 of 108 test cases failed (105 of 697 assertions failed)] +[Testing completed. 48 of 109 test cases failed (105 of 699 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 579caae5..e1a44be0 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -467,6 +467,14 @@ TEST_CASE( "Long strings can be wrapped", "[wrap]" ) { CHECK( wrapper[2] == "three" ); CHECK( wrapper[3] == "four" ); } + SECTION( "Indent first line differently", "" ) { + CHECK( Catch::LineWrapper() + .setRight( 10 ) + .setIndent( 4 ) + .setInitialIndent( 1 ) + .wrap( testString ).toString() == " one two\n three\n four" ); + } + } SECTION( "With newlines", "" ) { diff --git a/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj b/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj index 591fd8cc..c094bb38 100644 --- a/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj +++ b/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj @@ -343,6 +343,14 @@ + + + + @@ -375,6 +383,10 @@ RelativePath="..\..\..\SelfTest\TrickyTests.cpp" > + + Date: Fri, 5 Apr 2013 20:58:01 +0100 Subject: [PATCH 199/296] Build 31 - new Colour class - Headers are wrapped, with special indentation for given/ when/ then --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 4 +- single_include/catch.hpp | 402 ++++++++++-------- 4 files changed, 222 insertions(+), 188 deletions(-) diff --git a/README.md b/README.md index 13e70dde..290b5327 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 30 (integration branch) +## CATCH v0.9 build 31 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 046d4b9b..cfa1dbc6 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 30, "integration" ); + Version libraryVersion( 0, 9, 31, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index a4af322e..bb271dd3 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b30 (integration) host application. +CatchSelfTest is a CATCH v0.9 b31 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -5452,7 +5452,7 @@ with message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b30 (integration) host application. +CatchSelfTest is a CATCH v0.9 b31 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 240d77d1..801fded1 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 30 (integration branch) - * Generated: 2013-04-01 11:26:11.785709 + * CATCH v0.9 build 31 (integration branch) + * Generated: 2013-04-05 20:56:17.492865 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -4161,7 +4161,9 @@ namespace Catch { LineWrapper(); LineWrapper& setIndent( std::size_t _indent ); + LineWrapper& setInitialIndent( std::size_t _initalIndent ); LineWrapper& setRight( std::size_t _right ); + LineWrapper& setTabChar( char _tabChar ); LineWrapper& wrap( std::string const& _str ); @@ -4181,12 +4183,15 @@ namespace Catch { void wrapInternal( std::string const& _str ); void addLine( const std::string& _line ); bool isWrapPoint( char c ); + std::size_t getCurrentIndent() const; - std::string indent; std::size_t right; std::size_t nextTab; std::size_t tab; + std::size_t indent; + std::size_t initialIndent; std::string wrappableChars; + char tabChar; int recursionCount; std::vector lines; }; @@ -4198,35 +4203,53 @@ namespace Catch { namespace Catch { - struct IConsoleColourCodes : NonCopyable { - enum Colours { - None, + namespace Detail { + struct IColourImpl; + } - FileName, - ResultError, - ResultSuccess, + struct Colour { + enum Code { + None = 0, - Error, - Success, + White, + Red, + Green, + Blue, + Cyan, + Yellow, + Grey, - OriginalExpression, - ReconstructedExpression, + Bright = 0x10, - SecondaryText, - Headers + BrightRed = Bright | Red, + BrightGreen = Bright | Green, + LightGrey = Bright | Grey, + BrightWhite = Bright | White, + + // By intention + FileName = LightGrey, + ResultError = BrightRed, + ResultSuccess = BrightGreen, + + Error = BrightRed, + Success = Green, + + OriginalExpression = Cyan, + ReconstructedExpression = Yellow, + + SecondaryText = LightGrey, + Headers = White }; - virtual void set( Colours colour ) = 0; - }; + // Use constructed object for RAII guard + Colour( Code _colourCode ); + ~Colour(); - class TextColour : public IConsoleColourCodes { - public: - TextColour( Colours colour = None ); - void set( Colours colour ); - ~TextColour(); + // Use static method for one-shot changes + static void use( Code _colourCode ); private: - IConsoleColourCodes* m_impl; + static Detail::IColourImpl* impl; }; } // end namespace Catch @@ -4283,25 +4306,25 @@ namespace Catch { tagsWrapper.setRight( maxTagLen ).wrap( it->getTestCaseInfo().tagsAsString ); for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) { - TextColour::Colours colour = TextColour::None; + Colour::Code colour = Colour::None; if( it->getTestCaseInfo().isHidden ) - colour = TextColour::SecondaryText; + colour = Colour::SecondaryText; std::string nameCol; if( i < nameWrapper.size() ) { nameCol = nameWrapper[i]; } else { nameCol = " ..."; - colour = TextColour::SecondaryText; + colour = Colour::SecondaryText; } { - TextColour colourGuard( colour ); + Colour colourGuard( colour ); std::cout << nameCol; } if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) { if( i == 0 ) { - TextColour colourGuard( TextColour::SecondaryText ); + Colour colourGuard( Colour::SecondaryText ); std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " "; } else { @@ -4337,7 +4360,7 @@ namespace Catch { tagItEnd = it->getTestCaseInfo().tags.end(); tagIt != tagItEnd; ++tagIt ) { - std::string tagName = "[" + *tagIt + "]"; + std::string tagName = *tagIt; maxTagLen = (std::max)( maxTagLen, tagName.size() ); std::map::iterator countIt = tagCounts.find( tagName ); if( countIt == tagCounts.end() ) @@ -4347,7 +4370,7 @@ namespace Catch { } } } - maxTagLen +=2; + maxTagLen +=4; if( maxTagLen > CATCH_CONFIG_CONSOLE_WIDTH-10 ) maxTagLen = CATCH_CONFIG_CONSOLE_WIDTH-10; @@ -4355,14 +4378,14 @@ namespace Catch { countIt != countItEnd; ++countIt ) { LineWrapper wrapper; - wrapper.setIndent(2).setRight( maxTagLen ).wrap( countIt->first ); + wrapper.setIndent(2).setRight( maxTagLen ).wrap( "[" + countIt->first + "]" ); std::cout << wrapper; std::size_t dots = 2; if( maxTagLen > wrapper.last().size() ) dots += maxTagLen - wrapper.last().size(); { - TextColour colourGuard( TextColour::SecondaryText ); + Colour colourGuard( Colour::SecondaryText ); std::cout << std::string( dots, '.' ); } std::cout << countIt->second @@ -5570,114 +5593,101 @@ namespace Catch { // #included from: catch_console_colour_impl.hpp #define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED +namespace Catch { namespace Detail { + struct IColourImpl { + virtual ~IColourImpl() {} + virtual void use( Colour::Code _colourCode ) = 0; + }; +}} + #if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// #include +namespace Catch { namespace { - using namespace Catch; - WORD mapConsoleColour( IConsoleColourCodes::Colours colour ) { - enum Win32Colours { - Grey = FOREGROUND_INTENSITY, - BrightRed = FOREGROUND_RED | FOREGROUND_INTENSITY, - BrightGreen = FOREGROUND_GREEN | FOREGROUND_INTENSITY, - BrightWhite = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY, - DarkGreen = FOREGROUND_GREEN, - Cyan = FOREGROUND_BLUE | FOREGROUND_GREEN, - Yellow = FOREGROUND_RED | FOREGROUND_GREEN - }; - switch( colour ) { - case IConsoleColourCodes::FileName: return Grey; - case IConsoleColourCodes::ResultError: return BrightRed; - case IConsoleColourCodes::ResultSuccess: return BrightGreen; - case IConsoleColourCodes::Error: return BrightRed; - case IConsoleColourCodes::Success: return DarkGreen; - case IConsoleColourCodes::OriginalExpression: return Cyan; - case IConsoleColourCodes::ReconstructedExpression: return Yellow; - case IConsoleColourCodes::SecondaryText: return Grey; - case IConsoleColourCodes::Headers: return 0; - default: return 0; - } - } - - struct WindowsConsoleColourCodes : IConsoleColourCodes { - - WindowsConsoleColourCodes() - : hStdout( GetStdHandle(STD_OUTPUT_HANDLE) ), - wOldColorAttrs( 0 ) + class Win32ColourImpl : public Detail::IColourImpl { + public: + Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) ) { - GetConsoleScreenBufferInfo( hStdout, &csbiInfo ); - wOldColorAttrs = csbiInfo.wAttributes; + CONSOLE_SCREEN_BUFFER_INFO csbiInfo; + GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo ); + originalAttributes = csbiInfo.wAttributes; } - ~WindowsConsoleColourCodes() { - SetConsoleTextAttribute( hStdout, wOldColorAttrs ); + virtual void use( Colour::Code _colourCode ) { + switch( _colourCode ) { + case Colour::None: return setTextAttribute( originalAttributes ); + case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); + case Colour::Red: return setTextAttribute( FOREGROUND_RED ); + case Colour::Green: return setTextAttribute( FOREGROUND_GREEN ); + case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE ); + case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN ); + case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN ); + case Colour::Grey: return setTextAttribute( 0 ); + + case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY ); + case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED ); + case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN ); + case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); + + case Colour::Bright: throw std::logic_error( "not a colour" ); + } } - void set( Colours colour ) { - WORD consoleColour = mapConsoleColour( colour ); - if( consoleColour > 0 ) - SetConsoleTextAttribute( hStdout, consoleColour ); + private: + void setTextAttribute( WORD _textAttribute ) { + SetConsoleTextAttribute( stdoutHandle, _textAttribute ); } - - HANDLE hStdout; - CONSOLE_SCREEN_BUFFER_INFO csbiInfo; - WORD wOldColorAttrs; + HANDLE stdoutHandle; + WORD originalAttributes; }; inline bool shouldUseColourForPlatform() { return true; } - typedef WindowsConsoleColourCodes PlatformConsoleColourCodes; + Win32ColourImpl platformColourImpl; } // end anon namespace +} // end namespace Catch #else // Not Windows - assumed to be POSIX compatible ////////////////////////// #include +namespace Catch { namespace { - using namespace Catch; // use POSIX/ ANSI console terminal codes - // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) + // Thanks to Adam Strzelecki for original contribution + // (http://github.com/nanoant) // https://github.com/philsquared/Catch/pull/131 + class PosixColourImpl : public Detail::IColourImpl { + public: + virtual void use( Colour::Code _colourCode ) { + switch( _colourCode ) { + case Colour::None: + case Colour::White: return setColour( "[0m" ); + case Colour::Red: return setColour( "[0;31m" ); + case Colour::Green: return setColour( "[0;32m" ); + case Colour::Blue: return setColour( "[0:34m" ); + case Colour::Cyan: return setColour( "[0;36m" ); + case Colour::Yellow: return setColour( "[0;33m" ); + case Colour::Grey: return setColour( "[1;30m" ); - const char* WhiteOrNormal = "[0m"; - const char* BrightRed = "[1;31m"; - const char* BrightGreen = "[1;32m"; -// const char* BrightWhite = "[1;37m"; - const char* Green = "[0;32m"; - const char* Cyan = "[0;36m"; - const char* Yellow = "[0;33m"; - const char* LightGrey = "[0;37m"; -// const char* DarkGrey = "[1;30m"; + case Colour::LightGrey: return setColour( "[0;37m" ); + case Colour::BrightRed: return setColour( "[1;31m" ); + case Colour::BrightGreen: return setColour( "[1;33m" ); + case Colour::BrightWhite: return setColour( "[1;37m" ); - struct AnsiConsoleColourCodes : IConsoleColourCodes { - - ~AnsiConsoleColourCodes() { - set( None ); + case Colour::Bright: throw std::logic_error( "not a colour" ); + } } - - const char* escapeCodeForColour( Colours colour ) { - switch( colour ) { - case FileName: return WhiteOrNormal; - case ResultError: return BrightRed; - case ResultSuccess: return BrightGreen; - case Error: return BrightRed; - case Success: return Green; - case OriginalExpression: return Cyan; - case ReconstructedExpression: return Yellow; - case SecondaryText: return LightGrey; - case Headers: return WhiteOrNormal; - case None: return WhiteOrNormal; - } - } - - void set( Colours colour ) { - std::cout << '\033' << escapeCodeForColour( colour ); + private: + void setColour( const char* _escapeCode ) { + std::cout << '\033' << _escapeCode; } }; @@ -5685,39 +5695,33 @@ namespace { return isatty( fileno(stdout) ); } - typedef AnsiConsoleColourCodes PlatformConsoleColourCodes; + PosixColourImpl platformColourImpl; -} // namespace Catch +} // end anon namespace +} // end namespace Catch #endif // not Windows -namespace { - struct NoConsoleColourCodes : IConsoleColourCodes { - void set( Colours ) {} - }; -} - namespace Catch { - TextColour::TextColour( Colours colour ) : m_impl( NULL ) { - static bool s_shouldUseColour = shouldUseColourForPlatform() && - !isDebuggerActive(); - if( s_shouldUseColour ) - m_impl = new PlatformConsoleColourCodes(); - else - m_impl = new NoConsoleColourCodes(); - - if( colour ) - set( colour ); + namespace { + struct NoColourImpl : Detail::IColourImpl { + void use( Colour::Code ) {} + }; + NoColourImpl noColourImpl; + static const bool shouldUseColour = shouldUseColourForPlatform() && + !isDebuggerActive(); } - TextColour::~TextColour() { - delete m_impl; + Colour::Colour( Code _colourCode ){ use( _colourCode ); } + Colour::~Colour(){ use( None ); } + void Colour::use( Code _colourCode ) { + impl->use( _colourCode ); } - void TextColour::set( Colours colour ) { - m_impl->set( colour ); - } + Detail::IColourImpl* Colour::impl = shouldUseColour + ? static_cast( &platformColourImpl ) + : static_cast( &noColourImpl ); } // end namespace Catch @@ -6077,7 +6081,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 30, "integration" ); + Version libraryVersion( 0, 9, 31, "integration" ); } // #included from: catch_line_wrap.hpp @@ -6089,12 +6093,19 @@ namespace Catch { : right( CATCH_CONFIG_CONSOLE_WIDTH-1 ), nextTab( 0 ), tab( 0 ), + indent( 0 ), + initialIndent( (std::size_t)-1 ), // use indent by default wrappableChars( " [({.,/|\\" ), + tabChar( '\t' ), recursionCount( 0 ) {} LineWrapper& LineWrapper::setIndent( std::size_t _indent ) { - indent = std::string( _indent, ' ' ); + indent = _indent; + return *this; + } + LineWrapper& LineWrapper::setInitialIndent( std::size_t _initialIndent ) { + initialIndent = _initialIndent; return *this; } LineWrapper& LineWrapper::setRight( std::size_t _right ) { @@ -6106,13 +6117,17 @@ namespace Catch { wrapInternal( _str ); return *this; } + LineWrapper& LineWrapper::setTabChar( char _tabChar ) { + tabChar = _tabChar; + return *this; + } bool LineWrapper::isWrapPoint( char c ) { return wrappableChars.find( c ) != std::string::npos; } void LineWrapper::wrapInternal( std::string const& _str ) { assert( ++recursionCount < 100 ); - std::size_t width = right - indent.size(); + std::size_t width = right - getCurrentIndent(); std::size_t wrapPoint = width-tab; for( std::size_t pos = 0; pos < _str.size(); ++pos ) { if( _str[pos] == '\n' ) @@ -6134,7 +6149,7 @@ namespace Catch { } return wrapInternal( _str.substr( wrapPoint ) ); } - if( _str[pos] == '\t' ) { + if( _str[pos] == tabChar ) { nextTab = pos; std::string withoutTab = _str.substr( 0, nextTab ) + _str.substr( nextTab+1 ); return wrapInternal( withoutTab ); @@ -6162,14 +6177,18 @@ namespace Catch { } void LineWrapper::addLine( const std::string& _line ) { - if( tab > 0 ) - lines.push_back( indent + std::string( tab, ' ' ) + _line ); - else - lines.push_back( indent + _line ); + lines.push_back( std::string( tab + getCurrentIndent(), ' ' ) + _line ); if( nextTab > 0 ) tab = nextTab; } + std::size_t LineWrapper::getCurrentIndent() const + { + return (initialIndent != (std::size_t)-1 && lines.empty() ) + ? initialIndent + : indent; + } + } // end namespace Catch // #included from: catch_message.hpp @@ -6336,7 +6355,7 @@ namespace Catch { m_config.stream() << "No tests ran"; } else if( totals.assertions.failed ) { - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); ReportCounts( "test case", totals.testCases, allPrefix ); if( totals.testCases.failed > 0 ) { m_config.stream() << " ("; @@ -6345,7 +6364,7 @@ namespace Catch { } } else { - TextColour colour( TextColour::ResultSuccess ); + Colour colour( Colour::ResultSuccess ); m_config.stream() << allPrefix << "tests passed (" << pluralise( totals.assertions.passed, "assertion" ) << " in " << pluralise( totals.testCases.passed, "test case" ) << ")"; @@ -6402,12 +6421,12 @@ namespace Catch { virtual void NoAssertionsInSection( const std::string& sectionName ) { startSpansLazily(); - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); m_config.stream() << "\nNo assertions in section, '" << sectionName << "'\n" << std::endl; } virtual void NoAssertionsInTestCase( const std::string& testName ) { startSpansLazily(); - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); m_config.stream() << "\nNo assertions in test case, '" << testName << "'\n" << std::endl; } @@ -6418,11 +6437,11 @@ namespace Catch { m_config.stream() << "[End of section: '" << sectionName << "' "; if( assertions.failed ) { - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); ReportCounts( "assertion", assertions); } else { - TextColour colour( TextColour::ResultSuccess ); + Colour colour( Colour::ResultSuccess ); m_config.stream() << ( assertions.passed > 1 ? "All " : "" ) << pluralise( assertions.passed, "assertion" ) << " passed" ; } @@ -6438,22 +6457,22 @@ namespace Catch { startSpansLazily(); if( !assertionResult.getSourceInfo().empty() ) { - TextColour colour( TextColour::FileName ); + Colour colour( Colour::FileName ); m_config.stream() << assertionResult.getSourceInfo() << ": "; } if( assertionResult.hasExpression() ) { - TextColour colour( TextColour::OriginalExpression ); + Colour colour( Colour::OriginalExpression ); m_config.stream() << assertionResult.getExpression(); if( assertionResult.succeeded() ) { - TextColour successColour( TextColour::Success ); + Colour successColour( Colour::Success ); m_config.stream() << " succeeded"; } else { - TextColour errorColour( TextColour::Error ); + Colour errorColour( Colour::Error ); m_config.stream() << " failed"; if( assertionResult.isOk() ) { - TextColour okAnywayColour( TextColour::Success ); + Colour okAnywayColour( Colour::Success ); m_config.stream() << " - but was ok"; } } @@ -6461,7 +6480,7 @@ namespace Catch { switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: { - TextColour colour( TextColour::Error ); + Colour colour( Colour::Error ); if( assertionResult.hasExpression() ) m_config.stream() << " with unexpected"; else @@ -6471,7 +6490,7 @@ namespace Catch { break; case ResultWas::DidntThrowException: { - TextColour colour( TextColour::Error ); + Colour colour( Colour::Error ); if( assertionResult.hasExpression() ) m_config.stream() << " because no exception was thrown where one was expected"; else @@ -6480,19 +6499,19 @@ namespace Catch { break; case ResultWas::Info: { - TextColour colour( TextColour::ReconstructedExpression ); + Colour colour( Colour::ReconstructedExpression ); streamVariableLengthText( "info", assertionResult.getMessage() ); } break; case ResultWas::Warning: { - TextColour colour( TextColour::ReconstructedExpression ); + Colour colour( Colour::ReconstructedExpression ); streamVariableLengthText( "warning", assertionResult.getMessage() ); } break; case ResultWas::ExplicitFailure: { - TextColour colour( TextColour::Error ); + Colour colour( Colour::Error ); m_config.stream() << "failed with message: '" << assertionResult.getMessage() << "'"; } break; @@ -6503,21 +6522,21 @@ namespace Catch { case ResultWas::Exception: if( !assertionResult.hasExpression() ) { if( assertionResult.succeeded() ) { - TextColour colour( TextColour::Success ); + Colour colour( Colour::Success ); m_config.stream() << " succeeded"; } else { - TextColour colour( TextColour::Error ); + Colour colour( Colour::Error ); m_config.stream() << " failed"; if( assertionResult.isOk() ) { - TextColour okAnywayColour( TextColour::Success ); + Colour okAnywayColour( Colour::Success ); m_config.stream() << " - but was ok"; } } } if( assertionResult.hasMessage() ) { m_config.stream() << "\n"; - TextColour colour( TextColour::ReconstructedExpression ); + Colour colour( Colour::ReconstructedExpression ); streamVariableLengthText( "with message", assertionResult.getMessage() ); } break; @@ -6530,7 +6549,7 @@ namespace Catch { if( assertionResult.getExpandedExpression().size() < 70 ) m_config.stream() << "\t"; } - TextColour colour( TextColour::ReconstructedExpression ); + Colour colour( Colour::ReconstructedExpression ); m_config.stream() << assertionResult.getExpandedExpression(); } m_config.stream() << std::endl; @@ -7243,7 +7262,7 @@ namespace Catch { virtual void sectionEnded( SectionStats const& _sectionStats ) { if( _sectionStats.missingAssertions ) { lazyPrint(); - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; } m_headerPrinted = false; @@ -7254,7 +7273,7 @@ namespace Catch { if( _testCaseStats.missingAssertions ) { lazyPrint(); - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl; } StreamingReporterBase::testCaseEnded( _testCaseStats ); @@ -7286,13 +7305,13 @@ namespace Catch { : stream( _stream ), stats( _stats ), result( _stats.assertionResult ), - colour( TextColour::None ), + colour( Colour::None ), message( result.getMessage() ), messages( _stats.infoMessages ) { switch( result.getResultType() ) { case ResultWas::Ok: - colour = TextColour::Success; + colour = Colour::Success; passOrFail = "PASSED"; //if( result.hasMessage() ) if( _stats.infoMessages.size() == 1 ) @@ -7302,11 +7321,11 @@ namespace Catch { break; case ResultWas::ExpressionFailed: if( result.isOk() ) { - colour = TextColour::Success; + colour = Colour::Success; passOrFail = "FAILED - but was ok"; } else { - colour = TextColour::Error; + colour = Colour::Error; passOrFail = "FAILED"; } if( _stats.infoMessages.size() == 1 ) @@ -7315,12 +7334,12 @@ namespace Catch { messageLabel = "with messages"; break; case ResultWas::ThrewException: - colour = TextColour::Error; + colour = Colour::Error; passOrFail = "FAILED"; messageLabel = "due to unexpected exception with message"; break; case ResultWas::DidntThrowException: - colour = TextColour::Error; + colour = Colour::Error; passOrFail = "FAILED"; messageLabel = "because no exception was thrown where one was expected"; break; @@ -7332,7 +7351,7 @@ namespace Catch { break; case ResultWas::ExplicitFailure: passOrFail = "FAILED"; - colour = TextColour::Error; + colour = Colour::Error; if( _stats.infoMessages.size() == 1 ) messageLabel = "explicitly with message"; if( _stats.infoMessages.size() > 1 ) @@ -7340,7 +7359,7 @@ namespace Catch { break; case ResultWas::Exception: passOrFail = "FAILED"; - colour = TextColour::Error; + colour = Colour::Error; if( _stats.infoMessages.size() == 1 ) messageLabel = "with message"; if( _stats.infoMessages.size() > 1 ) @@ -7351,7 +7370,7 @@ namespace Catch { case ResultWas::Unknown: case ResultWas::FailureBit: passOrFail = "** internal error **"; - colour = TextColour::Error; + colour = Colour::Error; break; } } @@ -7374,13 +7393,13 @@ namespace Catch { private: void printResultType() const { if( !passOrFail.empty() ) { - TextColour colourGuard( colour ); + Colour colourGuard( colour ); stream << passOrFail << ":\n"; } } void printOriginalExpression() const { if( result.hasExpression() ) { - TextColour colourGuard( TextColour::OriginalExpression ); + Colour colourGuard( Colour::OriginalExpression ); stream << " "; if( !result.getTestMacroName().empty() ) stream << result.getTestMacroName() << "( "; @@ -7393,7 +7412,7 @@ namespace Catch { void printReconstructedExpression() const { if( result.hasExpandedExpression() ) { stream << "with expansion:\n"; - TextColour colourGuard( TextColour::ReconstructedExpression ); + Colour colourGuard( Colour::ReconstructedExpression ); stream << LineWrapper().setIndent(2).wrap( result.getExpandedExpression() ) << "\n"; } } @@ -7407,14 +7426,14 @@ namespace Catch { } } void printSourceInfo() const { - TextColour colourGuard( TextColour::FileName ); + Colour colourGuard( Colour::FileName ); stream << result.getSourceInfo() << ": "; } std::ostream& stream; AssertionStats const& stats; AssertionResult const& result; - TextColour::Colours colour; + Colour::Code colour; std::string passOrFail; std::string messageLabel; std::string message; @@ -7436,7 +7455,7 @@ namespace Catch { } void lazyPrintRunInfo() { stream << "\n" << getTildes() << "\n"; - TextColour colour( TextColour::SecondaryText ); + Colour colour( Colour::SecondaryText ); stream << testRunInfo->name << " is a CATCH v" << libraryVersion.majorVersion << "." << libraryVersion.minorVersion << " b" @@ -7460,7 +7479,7 @@ namespace Catch { ? currentSectionInfo->lineInfo : unusedTestCaseInfo->lineInfo ); if( currentSectionInfo ) { - TextColour colourGuard( TextColour::Headers ); + Colour colourGuard( Colour::Headers ); std::vector sections; for( ThreadedSectionInfo* section = currentSectionInfo.get(); section; @@ -7471,7 +7490,8 @@ namespace Catch { if( !sections.empty() ) { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) - stream << " " << (*it)->name << "\n"; + printUserString( (*it)->name, 2 ); + } } stream << getDots() << "\n" << std::endl; @@ -7484,21 +7504,35 @@ namespace Catch { void printOpenHeader( std::string const& _name, SourceLineInfo const& _lineInfo = SourceLineInfo() ) { stream << getDashes() << "\n"; if( !_lineInfo.empty() ){ - TextColour colourGuard( TextColour::FileName ); + Colour colourGuard( Colour::FileName ); stream << _lineInfo << "\n\n"; } { - TextColour colourGuard( TextColour::Headers ); - stream << _name << "\n"; + Colour colourGuard( Colour::Headers ); + printUserString( _name ); } } + // if string has a : in first line will set indent to follow it on + // subsequent lines + void printUserString( std::string const& _string, std::size_t indent = 0 ) { + std::size_t i = _string.find( ": " ); + if( i != std::string::npos ) + i+=2; + else + i = 0; + stream << LineWrapper() + .setIndent( indent+i) + .setInitialIndent( indent ) + .wrap( _string ) << "\n"; + } + void printTotals( const Totals& totals ) { if( totals.assertions.total() == 0 ) { stream << "No tests ran"; } else if( totals.assertions.failed ) { - TextColour colour( TextColour::ResultError ); + Colour colour( Colour::ResultError ); printCounts( "test case", totals.testCases ); if( totals.testCases.failed > 0 ) { stream << " ("; @@ -7507,7 +7541,7 @@ namespace Catch { } } else { - TextColour colour( TextColour::ResultSuccess ); + Colour colour( Colour::ResultSuccess ); stream << "All tests passed (" << pluralise( totals.assertions.passed, "assertion" ) << " in " << pluralise( totals.testCases.passed, "test case" ) << ")"; From 7af7451f788a25448d5807a746e6cd5b0fd892d3 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 8 Apr 2013 11:44:03 +0100 Subject: [PATCH 200/296] LegacyReporterAdapter unbundles INFO messages from assertion to mimic legacy behaviour - Moved LegacyReporterAdapter out into its own file(s) --- include/internal/catch_impl.hpp | 2 +- include/internal/catch_interfaces_reporter.h | 63 -------------- .../internal/catch_reporter_registrars.hpp | 1 + .../reporters/catch_legacy_reporter_adapter.h | 40 +++++++++ .../catch_legacy_reporter_adapter.hpp | 84 +++++++++++++++++++ .../CatchSelfTest.xcodeproj/project.pbxproj | 4 + 6 files changed, 130 insertions(+), 64 deletions(-) create mode 100644 include/reporters/catch_legacy_reporter_adapter.h create mode 100644 include/reporters/catch_legacy_reporter_adapter.hpp diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 9856d8e4..f3f214b2 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -29,6 +29,7 @@ #include "catch_version.hpp" #include "catch_line_wrap.hpp" #include "catch_message.hpp" +#include "catch_legacy_reporter_adapter.hpp" #include "../reporters/catch_reporter_basic.hpp" #include "../reporters/catch_reporter_xml.hpp" @@ -51,7 +52,6 @@ namespace Catch { IReporterFactory::~IReporterFactory() {} IReporterRegistry::~IReporterRegistry() {} IStreamingReporter::~IStreamingReporter() {} - LegacyReporterAdapter::~LegacyReporterAdapter() {} AssertionStats::~AssertionStats() {} SectionStats::~SectionStats() {} TestCaseStats::~TestCaseStats() {} diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 72b922ee..856b33fc 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -311,69 +311,6 @@ namespace Catch virtual void Result( const AssertionResult& result ) = 0; }; - class LegacyReporterAdapter : public SharedImpl - { - public: - LegacyReporterAdapter( Ptr const& legacyReporter, ReporterConfig const& config ) - : m_legacyReporter( legacyReporter ), - m_config( config ) - {} - virtual ~LegacyReporterAdapter(); - - virtual ReporterPreferences getPreferences() const { - ReporterPreferences prefs; - prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout(); - return prefs; - } - - virtual void noMatchingTestCases( std::string const& ) {} - virtual void testRunStarting( TestRunInfo const& ) { - m_legacyReporter->StartTesting(); - } - virtual void testGroupStarting( GroupInfo const& groupInfo ) { - m_legacyReporter->StartGroup( groupInfo.name ); - } - virtual void testCaseStarting( TestCaseInfo const& testInfo ) { - m_legacyReporter->StartTestCase( testInfo ); - } - virtual void sectionStarting( SectionInfo const& sectionInfo ) { - m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description ); - } - virtual void assertionStarting( AssertionInfo const& ) { - // Not on legacy interface - } - - virtual void assertionEnded( AssertionStats const& assertionStats ) { - m_legacyReporter->Result( assertionStats.assertionResult ); - } - virtual void sectionEnded( SectionStats const& sectionStats ) { - if( sectionStats.missingAssertions ) - m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); - m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); - } - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { - if( testCaseStats.missingAssertions ) - m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name ); - m_legacyReporter->EndTestCase - ( testCaseStats.testInfo, - testCaseStats.totals, - testCaseStats.stdOut, - testCaseStats.stdErr ); - } - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { - if( testGroupStats.aborting ) - m_legacyReporter->Aborted(); - m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals ); - } - virtual void testRunEnded( TestRunStats const& testRunStats ) { - m_legacyReporter->EndTesting( testRunStats.totals ); - } - - private: - Ptr m_legacyReporter; - ReporterConfig m_config; - }; - struct IReporterFactory { virtual ~IReporterFactory(); diff --git a/include/internal/catch_reporter_registrars.hpp b/include/internal/catch_reporter_registrars.hpp index 3496999f..93e19667 100644 --- a/include/internal/catch_reporter_registrars.hpp +++ b/include/internal/catch_reporter_registrars.hpp @@ -9,6 +9,7 @@ #define TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED #include "catch_interfaces_registry_hub.h" +#include "catch_legacy_reporter_adapter.h" namespace Catch { diff --git a/include/reporters/catch_legacy_reporter_adapter.h b/include/reporters/catch_legacy_reporter_adapter.h new file mode 100644 index 00000000..4d5457e6 --- /dev/null +++ b/include/reporters/catch_legacy_reporter_adapter.h @@ -0,0 +1,40 @@ +/* + * Created by Phil on 6th April 2013. + * Copyright 2013 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_LEGACY_REPORTER_ADAPTER_H_INCLUDED +#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_H_INCLUDED + +#include "catch_interfaces_reporter.h" + +namespace Catch +{ + class LegacyReporterAdapter : public SharedImpl + { + public: + LegacyReporterAdapter( Ptr const& legacyReporter, ReporterConfig const& config ); + virtual ~LegacyReporterAdapter(); + + virtual ReporterPreferences getPreferences() const; + virtual void noMatchingTestCases( std::string const& ); + virtual void testRunStarting( TestRunInfo const& ); + virtual void testGroupStarting( GroupInfo const& groupInfo ); + virtual void testCaseStarting( TestCaseInfo const& testInfo ); + virtual void sectionStarting( SectionInfo const& sectionInfo ); + virtual void assertionStarting( AssertionInfo const& ); + virtual void assertionEnded( AssertionStats const& assertionStats ); + virtual void sectionEnded( SectionStats const& sectionStats ); + virtual void testCaseEnded( TestCaseStats const& testCaseStats ); + virtual void testGroupEnded( TestGroupStats const& testGroupStats ); + virtual void testRunEnded( TestRunStats const& testRunStats ); + + private: + Ptr m_legacyReporter; + ReporterConfig m_config; + }; +} + +#endif // TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_H_INCLUDED diff --git a/include/reporters/catch_legacy_reporter_adapter.hpp b/include/reporters/catch_legacy_reporter_adapter.hpp new file mode 100644 index 00000000..44d90af8 --- /dev/null +++ b/include/reporters/catch_legacy_reporter_adapter.hpp @@ -0,0 +1,84 @@ +/* + * Created by Phil on 6th April 2013. + * Copyright 2013 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_LEGACY_REPORTER_ADAPTER_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_HPP_INCLUDED + +#include "catch_legacy_reporter_adapter.h" + +namespace Catch +{ + LegacyReporterAdapter::LegacyReporterAdapter( Ptr const& legacyReporter, ReporterConfig const& config ) + : m_legacyReporter( legacyReporter ), + m_config( config ) + {} + LegacyReporterAdapter::~LegacyReporterAdapter() {} + + ReporterPreferences LegacyReporterAdapter::getPreferences() const { + ReporterPreferences prefs; + prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout(); + return prefs; + } + + void LegacyReporterAdapter::noMatchingTestCases( std::string const& ) {} + void LegacyReporterAdapter::testRunStarting( TestRunInfo const& ) { + m_legacyReporter->StartTesting(); + } + void LegacyReporterAdapter::testGroupStarting( GroupInfo const& groupInfo ) { + m_legacyReporter->StartGroup( groupInfo.name ); + } + void LegacyReporterAdapter::testCaseStarting( TestCaseInfo const& testInfo ) { + m_legacyReporter->StartTestCase( testInfo ); + } + void LegacyReporterAdapter::sectionStarting( SectionInfo const& sectionInfo ) { + m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description ); + } + void LegacyReporterAdapter::assertionStarting( AssertionInfo const& ) { + // Not on legacy interface + } + + void LegacyReporterAdapter::assertionEnded( AssertionStats const& assertionStats ) { + if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) { + for( std::vector::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end(); + it != itEnd; + ++it ) { + if( it->type == ResultWas::Info ) { + ExpressionResultBuilder expressionBuilder( it->type ); + expressionBuilder << it->message; + AssertionInfo info( it->macroName, it->lineInfo, "", ResultDisposition::Normal ); + AssertionResult result = expressionBuilder.buildResult( info ); + m_legacyReporter->Result( result ); + } + } + } + m_legacyReporter->Result( assertionStats.assertionResult ); + } + void LegacyReporterAdapter::sectionEnded( SectionStats const& sectionStats ) { + if( sectionStats.missingAssertions ) + m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); + m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); + } + void LegacyReporterAdapter::testCaseEnded( TestCaseStats const& testCaseStats ) { + if( testCaseStats.missingAssertions ) + m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name ); + m_legacyReporter->EndTestCase + ( testCaseStats.testInfo, + testCaseStats.totals, + testCaseStats.stdOut, + testCaseStats.stdErr ); + } + void LegacyReporterAdapter::testGroupEnded( TestGroupStats const& testGroupStats ) { + if( testGroupStats.aborting ) + m_legacyReporter->Aborted(); + m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals ); + } + void LegacyReporterAdapter::testRunEnded( TestRunStats const& testRunStats ) { + m_legacyReporter->EndTesting( testRunStats.totals ); + } +} + +#endif // TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_H_INCLUDED diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 4f1a6a1e..ea2e0916 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -57,6 +57,8 @@ /* Begin PBXFileReference section */ 266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VariadicMacrosTests.cpp; path = ../../../SelfTest/VariadicMacrosTests.cpp; sourceTree = ""; }; 266ECD73170F3C620030D735 /* BDDTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BDDTests.cpp; path = ../../../SelfTest/BDDTests.cpp; sourceTree = ""; }; + 266ECD751710B2EB0030D735 /* catch_legacy_reporter_adapter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_legacy_reporter_adapter.h; sourceTree = ""; }; + 266ECD761710B3970030D735 /* catch_legacy_reporter_adapter.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_legacy_reporter_adapter.hpp; sourceTree = ""; }; 26847E5B16BBAB790043B9C1 /* catch_message.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_message.h; sourceTree = ""; }; 26847E5C16BBACB60043B9C1 /* catch_message.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_message.hpp; sourceTree = ""; }; 26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = ""; }; @@ -256,6 +258,8 @@ 4A6D0C67149B3E3D00DB3EAA /* catch_reporter_junit.hpp */, 4A6D0C68149B3E3D00DB3EAA /* catch_reporter_xml.hpp */, 4AB42F84166F3E1A0099F2C8 /* catch_reporter_console.hpp */, + 266ECD751710B2EB0030D735 /* catch_legacy_reporter_adapter.h */, + 266ECD761710B3970030D735 /* catch_legacy_reporter_adapter.hpp */, ); name = reporters; path = ../../../../include/reporters; From 8764177c0e85512f3f0315c67b7a52fa6d8c6423 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 8 Apr 2013 11:50:41 +0100 Subject: [PATCH 201/296] build 32 --- README.md | 2 +- include/internal/catch_impl.hpp | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 116 +++++++++++- single_include/catch.hpp | 174 +++++++++++------- 5 files changed, 224 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index 290b5327..ef706d53 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 31 (integration branch) +## CATCH v0.9 build 32 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index f3f214b2..74350048 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -29,8 +29,8 @@ #include "catch_version.hpp" #include "catch_line_wrap.hpp" #include "catch_message.hpp" -#include "catch_legacy_reporter_adapter.hpp" +#include "../reporters/catch_legacy_reporter_adapter.hpp" #include "../reporters/catch_reporter_basic.hpp" #include "../reporters/catch_reporter_xml.hpp" #include "../reporters/catch_reporter_junit.hpp" diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index cfa1dbc6..7269815a 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 31, "integration" ); + Version libraryVersion( 0, 9, 32, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index bb271dd3..aebdee5b 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b31 (integration) host application. +CatchSelfTest is a CATCH v0.9 b32 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -5452,7 +5452,7 @@ with message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b31 (integration) host application. +CatchSelfTest is a CATCH v0.9 b32 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -5994,20 +5994,35 @@ ExceptionTests.cpp:125 + +MessageTests.cpp:13 + MessageTests.cpp:14 + +MessageTests.cpp:23 + + +MessageTests.cpp:24 + MessageTests.cpp:26 + +MessageTests.cpp:35 + MessageTests.cpp:37 + +MessageTests.cpp:39 + MessageTests.cpp:41 @@ -6032,6 +6047,12 @@ Message from section two + +MessageTests.cpp:84 + + +MessageTests.cpp:85 + MessageTests.cpp:86 @@ -6061,21 +6082,39 @@ MiscTests.cpp:99 + +MiscTests.cpp:110 + MiscTests.cpp:111 + +MiscTests.cpp:110 + MiscTests.cpp:111 + +MiscTests.cpp:110 + MiscTests.cpp:111 + +MiscTests.cpp:110 + MiscTests.cpp:111 + +MiscTests.cpp:110 + MiscTests.cpp:111 + +MiscTests.cpp:110 + MiscTests.cpp:111 @@ -6090,6 +6129,12 @@ An error + +MiscTests.cpp:135 + + +MiscTests.cpp:137 + MiscTests.cpp:138 @@ -6114,6 +6159,9 @@ MiscTests.cpp:174 + +MiscTests.cpp:191 + MiscTests.cpp:192 @@ -8887,6 +8935,9 @@ GeneratorTests.cpp" line="40"> + + this is a message + this is a warning @@ -8896,6 +8947,12 @@ GeneratorTests.cpp" line="40"> + + this message should be logged + + + so should this + MessageTests.cpp" line="26"> a == 1 @@ -8915,6 +8972,9 @@ MessageTests.cpp" line="33"> 2 == 2 + + this message should be logged + MessageTests.cpp" line="37"> a == 1 @@ -8923,6 +8983,9 @@ MessageTests.cpp" line="37"> 2 == 1 + + and this, but later + MessageTests.cpp" line="41"> a == 0 @@ -9052,6 +9115,12 @@ MessageTests.cpp" line="86"> 9 < 10 + + current counter 10 + + + i := 10 + MessageTests.cpp" line="86"> i < 10 @@ -9229,6 +9298,9 @@ MiscTests.cpp" line="99"> + + Testing if fib[0] (1) is even + MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -9237,6 +9309,9 @@ MiscTests.cpp" line="111"> 1 == 0 + + Testing if fib[1] (1) is even + MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -9253,6 +9328,9 @@ MiscTests.cpp" line="111"> 0 == 0 + + Testing if fib[3] (3) is even + MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -9261,6 +9339,9 @@ MiscTests.cpp" line="111"> 1 == 0 + + Testing if fib[4] (5) is even + MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -9277,6 +9358,9 @@ MiscTests.cpp" line="111"> 0 == 0 + + Testing if fib[6] (13) is even + MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -9285,6 +9369,9 @@ MiscTests.cpp" line="111"> 1 == 0 + + Testing if fib[7] (21) is even + MiscTests.cpp" line="111"> ( fib[i] % 2 ) == 0 @@ -9318,6 +9405,12 @@ MiscTests.cpp" line="130"> + + hi + + + i := 7 + MiscTests.cpp" line="138"> false @@ -9414,6 +9507,9 @@ MiscTests.cpp" line="174"> + + 3 + MiscTests.cpp" line="192"> false @@ -12451,6 +12547,7 @@ GeneratorTests.cpp:40: i->first == i->second-1 succeeded for: 2 == 2 [Finished: './succeeding/generators/2' All tests passed (2 assertions in 1 test case)] [Running: ./succeeding/message] +MessageTests.cpp:13: [info: this is a message] MessageTests.cpp:14: [warning: this is a warning] No assertions in test case, './succeeding/message' @@ -12463,12 +12560,16 @@ MessageTests.cpp:18: succeeded [Finished: './succeeding/succeed' All tests passed (1 assertion in 1 test case)] [Running: ./failing/message/info/1] +MessageTests.cpp:23: [info: this message should be logged] +MessageTests.cpp:24: [info: so should this] MessageTests.cpp:26: a == 1 failed for: 2 == 1 [Finished: './failing/message/info/1' 1 test case failed (1 assertion failed)] [Running: ./mixed/message/info/2] MessageTests.cpp:33: a == 2 succeeded for: 2 == 2 +MessageTests.cpp:35: [info: this message should be logged] MessageTests.cpp:37: a == 1 failed for: 2 == 1 +MessageTests.cpp:39: [info: and this, but later] MessageTests.cpp:41: a == 0 failed for: 2 == 0 MessageTests.cpp:45: a == 2 succeeded for: 2 == 2 [Finished: './mixed/message/info/2' 1 test case failed (2 of 4 assertions failed)] @@ -12516,6 +12617,8 @@ MessageTests.cpp:86: i < 10 succeeded for: 6 < 10 MessageTests.cpp:86: i < 10 succeeded for: 7 < 10 MessageTests.cpp:86: i < 10 succeeded for: 8 < 10 MessageTests.cpp:86: i < 10 succeeded for: 9 < 10 +MessageTests.cpp:84: [info: current counter 10] +MessageTests.cpp:85: [info: i := 10] MessageTests.cpp:86: i < 10 failed for: 10 < 10 [Finished: './mixed/message/scoped' 1 test case failed (1 of 11 assertions failed)] @@ -12619,13 +12722,19 @@ MiscTests.cpp:99: b > a failed for: 0 > 1 [Finished: './mixed/Misc/Sections/loops' 1 test case failed (1 assertion failed)] [Running: ./mixed/Misc/loops] +MiscTests.cpp:110: [info: Testing if fib[0] (1) is even] MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:110: [info: Testing if fib[1] (1) is even] MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 MiscTests.cpp:111: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +MiscTests.cpp:110: [info: Testing if fib[3] (3) is even] MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:110: [info: Testing if fib[4] (5) is even] MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 MiscTests.cpp:111: ( fib[i] % 2 ) == 0 succeeded for: 0 == 0 +MiscTests.cpp:110: [info: Testing if fib[6] (13) is even] MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 +MiscTests.cpp:110: [info: Testing if fib[7] (21) is even] MiscTests.cpp:111: ( fib[i] % 2 ) == 0 failed for: 1 == 0 [Finished: './mixed/Misc/loops' 1 test case failed (6 of 8 assertions failed)] Some information @@ -12643,6 +12752,8 @@ MiscTests.cpp:130: makeString( true ) == static_cast(__null) succeeded fo [Finished: './succeeding/Misc/null strings' All tests passed (2 assertions in 1 test case)] [Running: ./failing/info] +MiscTests.cpp:135: [info: hi] +MiscTests.cpp:137: [info: i := 7] MiscTests.cpp:138: false failed [Finished: './failing/info' 1 test case failed (1 assertion failed)] @@ -12682,6 +12793,7 @@ No assertions in section, 'encoded chars' [Finished: './misc/xmlentitycheck' 1 test case failed (All 2 assertions failed)] [Running: ./manual/onechar] +MiscTests.cpp:191: [info: 3] MiscTests.cpp:192: false failed [Finished: './manual/onechar' 1 test case failed (1 assertion failed)] diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 801fded1..1cb07a6e 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 31 (integration branch) - * Generated: 2013-04-05 20:56:17.492865 + * CATCH v0.9 build 32 (integration branch) + * Generated: 2013-04-08 11:50:07.907187 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -2404,69 +2404,6 @@ namespace Catch virtual void Result( const AssertionResult& result ) = 0; }; - class LegacyReporterAdapter : public SharedImpl - { - public: - LegacyReporterAdapter( Ptr const& legacyReporter, ReporterConfig const& config ) - : m_legacyReporter( legacyReporter ), - m_config( config ) - {} - virtual ~LegacyReporterAdapter(); - - virtual ReporterPreferences getPreferences() const { - ReporterPreferences prefs; - prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout(); - return prefs; - } - - virtual void noMatchingTestCases( std::string const& ) {} - virtual void testRunStarting( TestRunInfo const& ) { - m_legacyReporter->StartTesting(); - } - virtual void testGroupStarting( GroupInfo const& groupInfo ) { - m_legacyReporter->StartGroup( groupInfo.name ); - } - virtual void testCaseStarting( TestCaseInfo const& testInfo ) { - m_legacyReporter->StartTestCase( testInfo ); - } - virtual void sectionStarting( SectionInfo const& sectionInfo ) { - m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description ); - } - virtual void assertionStarting( AssertionInfo const& ) { - // Not on legacy interface - } - - virtual void assertionEnded( AssertionStats const& assertionStats ) { - m_legacyReporter->Result( assertionStats.assertionResult ); - } - virtual void sectionEnded( SectionStats const& sectionStats ) { - if( sectionStats.missingAssertions ) - m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); - m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); - } - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { - if( testCaseStats.missingAssertions ) - m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name ); - m_legacyReporter->EndTestCase - ( testCaseStats.testInfo, - testCaseStats.totals, - testCaseStats.stdOut, - testCaseStats.stdErr ); - } - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { - if( testGroupStats.aborting ) - m_legacyReporter->Aborted(); - m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals ); - } - virtual void testRunEnded( TestRunStats const& testRunStats ) { - m_legacyReporter->EndTesting( testRunStats.totals ); - } - - private: - Ptr m_legacyReporter; - ReporterConfig m_config; - }; - struct IReporterFactory { virtual ~IReporterFactory(); virtual IStreamingReporter* create( ReporterConfig const& config ) const = 0; @@ -6081,7 +6018,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 31, "integration" ); + Version libraryVersion( 0, 9, 32, "integration" ); } // #included from: catch_line_wrap.hpp @@ -6237,6 +6174,110 @@ namespace Catch { } // end namespace Catch +// #included from: ../reporters/catch_legacy_reporter_adapter.hpp +#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_HPP_INCLUDED + +// #included from: catch_legacy_reporter_adapter.h +#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_H_INCLUDED + +namespace Catch +{ + class LegacyReporterAdapter : public SharedImpl + { + public: + LegacyReporterAdapter( Ptr const& legacyReporter, ReporterConfig const& config ); + virtual ~LegacyReporterAdapter(); + + virtual ReporterPreferences getPreferences() const; + virtual void noMatchingTestCases( std::string const& ); + virtual void testRunStarting( TestRunInfo const& ); + virtual void testGroupStarting( GroupInfo const& groupInfo ); + virtual void testCaseStarting( TestCaseInfo const& testInfo ); + virtual void sectionStarting( SectionInfo const& sectionInfo ); + virtual void assertionStarting( AssertionInfo const& ); + virtual void assertionEnded( AssertionStats const& assertionStats ); + virtual void sectionEnded( SectionStats const& sectionStats ); + virtual void testCaseEnded( TestCaseStats const& testCaseStats ); + virtual void testGroupEnded( TestGroupStats const& testGroupStats ); + virtual void testRunEnded( TestRunStats const& testRunStats ); + + private: + Ptr m_legacyReporter; + ReporterConfig m_config; + }; +} + +namespace Catch +{ + LegacyReporterAdapter::LegacyReporterAdapter( Ptr const& legacyReporter, ReporterConfig const& config ) + : m_legacyReporter( legacyReporter ), + m_config( config ) + {} + LegacyReporterAdapter::~LegacyReporterAdapter() {} + + ReporterPreferences LegacyReporterAdapter::getPreferences() const { + ReporterPreferences prefs; + prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout(); + return prefs; + } + + void LegacyReporterAdapter::noMatchingTestCases( std::string const& ) {} + void LegacyReporterAdapter::testRunStarting( TestRunInfo const& ) { + m_legacyReporter->StartTesting(); + } + void LegacyReporterAdapter::testGroupStarting( GroupInfo const& groupInfo ) { + m_legacyReporter->StartGroup( groupInfo.name ); + } + void LegacyReporterAdapter::testCaseStarting( TestCaseInfo const& testInfo ) { + m_legacyReporter->StartTestCase( testInfo ); + } + void LegacyReporterAdapter::sectionStarting( SectionInfo const& sectionInfo ) { + m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description ); + } + void LegacyReporterAdapter::assertionStarting( AssertionInfo const& ) { + // Not on legacy interface + } + + void LegacyReporterAdapter::assertionEnded( AssertionStats const& assertionStats ) { + if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) { + for( std::vector::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end(); + it != itEnd; + ++it ) { + if( it->type == ResultWas::Info ) { + ExpressionResultBuilder expressionBuilder( it->type ); + expressionBuilder << it->message; + AssertionInfo info( it->macroName, it->lineInfo, "", ResultDisposition::Normal ); + AssertionResult result = expressionBuilder.buildResult( info ); + m_legacyReporter->Result( result ); + } + } + } + m_legacyReporter->Result( assertionStats.assertionResult ); + } + void LegacyReporterAdapter::sectionEnded( SectionStats const& sectionStats ) { + if( sectionStats.missingAssertions ) + m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); + m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); + } + void LegacyReporterAdapter::testCaseEnded( TestCaseStats const& testCaseStats ) { + if( testCaseStats.missingAssertions ) + m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name ); + m_legacyReporter->EndTestCase + ( testCaseStats.testInfo, + testCaseStats.totals, + testCaseStats.stdOut, + testCaseStats.stdErr ); + } + void LegacyReporterAdapter::testGroupEnded( TestGroupStats const& testGroupStats ) { + if( testGroupStats.aborting ) + m_legacyReporter->Aborted(); + m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals ); + } + void LegacyReporterAdapter::testRunEnded( TestRunStats const& testRunStats ) { + m_legacyReporter->EndTesting( testRunStats.totals ); + } +} + // #included from: ../reporters/catch_reporter_basic.hpp #define TWOBLUECUBES_CATCH_REPORTER_BASIC_HPP_INCLUDED @@ -7622,7 +7663,6 @@ namespace Catch { IReporterFactory::~IReporterFactory() {} IReporterRegistry::~IReporterRegistry() {} IStreamingReporter::~IStreamingReporter() {} - LegacyReporterAdapter::~LegacyReporterAdapter() {} AssertionStats::~AssertionStats() {} SectionStats::~SectionStats() {} TestCaseStats::~TestCaseStats() {} From 3bd42417952e5065cd1ccebc1d6cdd0dbe6c4812 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 8 Apr 2013 12:05:32 +0100 Subject: [PATCH 202/296] Fixed Junit issue with REQUIRE_THROWS - As mentioned by @SebDyn in GitHub issue #5 --- include/reporters/catch_reporter_console.hpp | 10 +--------- include/reporters/catch_reporter_junit.hpp | 6 +++++- projects/SelfTest/Baselines/approvedResults.txt | 6 +++--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index cb50436d..9cd25e89 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -155,18 +155,10 @@ namespace Catch { if( _stats.infoMessages.size() > 1 ) messageLabel = "explicitly with messages"; break; - case ResultWas::Exception: - passOrFail = "FAILED"; - colour = Colour::Error; - if( _stats.infoMessages.size() == 1 ) - messageLabel = "with message"; - if( _stats.infoMessages.size() > 1 ) - messageLabel = "with messages"; - break; - // These cases are here to prevent compiler warnings case ResultWas::Unknown: case ResultWas::FailureBit: + case ResultWas::Exception: passOrFail = "** internal error **"; colour = Colour::Error; break; diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index af43b3b7..7e2f4b2b 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -143,10 +143,14 @@ namespace Catch { case ResultWas::Ok: stats.m_element = "success"; break; + case ResultWas::DidntThrowException: + stats.m_element = "failure"; + m_currentStats->m_failuresCount++; + break; case ResultWas::Unknown: case ResultWas::FailureBit: case ResultWas::Exception: - case ResultWas::DidntThrowException: + stats.m_element = "* internal error *"; break; } testCaseStats.m_testStats.push_back( stats ); diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index aebdee5b..9b668439 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -5769,7 +5769,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -5947,9 +5947,9 @@ ConditionTests.cpp:346 ExceptionTests.cpp:43 - < message="thisDoesntThrow()" type="CHECK_THROWS_AS"> + ExceptionTests.cpp:44 - + ExceptionTests.cpp:45 From 1ece38ed2062c37f55db158505faf9b2a88ba8ce Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 8 Apr 2013 21:36:08 +0100 Subject: [PATCH 203/296] Moved legacy_reporter_adapter files back into internal --- include/internal/catch_impl.hpp | 2 +- .../catch_legacy_reporter_adapter.h | 0 .../catch_legacy_reporter_adapter.hpp | 0 .../CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj | 8 ++++---- 4 files changed, 5 insertions(+), 5 deletions(-) rename include/{reporters => internal}/catch_legacy_reporter_adapter.h (100%) rename include/{reporters => internal}/catch_legacy_reporter_adapter.hpp (100%) diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 74350048..f3f214b2 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -29,8 +29,8 @@ #include "catch_version.hpp" #include "catch_line_wrap.hpp" #include "catch_message.hpp" +#include "catch_legacy_reporter_adapter.hpp" -#include "../reporters/catch_legacy_reporter_adapter.hpp" #include "../reporters/catch_reporter_basic.hpp" #include "../reporters/catch_reporter_xml.hpp" #include "../reporters/catch_reporter_junit.hpp" diff --git a/include/reporters/catch_legacy_reporter_adapter.h b/include/internal/catch_legacy_reporter_adapter.h similarity index 100% rename from include/reporters/catch_legacy_reporter_adapter.h rename to include/internal/catch_legacy_reporter_adapter.h diff --git a/include/reporters/catch_legacy_reporter_adapter.hpp b/include/internal/catch_legacy_reporter_adapter.hpp similarity index 100% rename from include/reporters/catch_legacy_reporter_adapter.hpp rename to include/internal/catch_legacy_reporter_adapter.hpp diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index ea2e0916..bef07f61 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -57,8 +57,8 @@ /* Begin PBXFileReference section */ 266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VariadicMacrosTests.cpp; path = ../../../SelfTest/VariadicMacrosTests.cpp; sourceTree = ""; }; 266ECD73170F3C620030D735 /* BDDTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BDDTests.cpp; path = ../../../SelfTest/BDDTests.cpp; sourceTree = ""; }; - 266ECD751710B2EB0030D735 /* catch_legacy_reporter_adapter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_legacy_reporter_adapter.h; sourceTree = ""; }; - 266ECD761710B3970030D735 /* catch_legacy_reporter_adapter.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_legacy_reporter_adapter.hpp; sourceTree = ""; }; + 266ECD8C1713614B0030D735 /* catch_legacy_reporter_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_legacy_reporter_adapter.hpp; sourceTree = ""; }; + 266ECD8D1713614B0030D735 /* catch_legacy_reporter_adapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_legacy_reporter_adapter.h; sourceTree = ""; }; 26847E5B16BBAB790043B9C1 /* catch_message.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_message.h; sourceTree = ""; }; 26847E5C16BBACB60043B9C1 /* catch_message.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_message.hpp; sourceTree = ""; }; 26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = ""; }; @@ -258,8 +258,6 @@ 4A6D0C67149B3E3D00DB3EAA /* catch_reporter_junit.hpp */, 4A6D0C68149B3E3D00DB3EAA /* catch_reporter_xml.hpp */, 4AB42F84166F3E1A0099F2C8 /* catch_reporter_console.hpp */, - 266ECD751710B2EB0030D735 /* catch_legacy_reporter_adapter.h */, - 266ECD761710B3970030D735 /* catch_legacy_reporter_adapter.hpp */, ); name = reporters; path = ../../../../include/reporters; @@ -386,6 +384,8 @@ 4AC91CC2155C388300DC5117 /* Infrastructure */ = { isa = PBXGroup; children = ( + 266ECD8C1713614B0030D735 /* catch_legacy_reporter_adapter.hpp */, + 266ECD8D1713614B0030D735 /* catch_legacy_reporter_adapter.h */, 4A6D0C49149B3E3D00DB3EAA /* catch_common.h */, 4A6D0C4B149B3E3D00DB3EAA /* catch_debugger.hpp */, 4A6D0C60149B3E3D00DB3EAA /* catch_stream.hpp */, From 1c03b4a3634c67c0c7297f0ae433e90bb272ae82 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 9 Apr 2013 08:19:04 +0100 Subject: [PATCH 204/296] Exclude VS2005 from using variadic macros - due to issues raised in https://groups.google.com/forum/?fromgroups=#!topic/catch-forum/VGfNtNXjHXQ --- include/catch.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/catch.hpp b/include/catch.hpp index 9240467a..9e8c2a71 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -18,7 +18,7 @@ #endif // Use variadic macros if the compiler supports them -#if ( defined _MSC_VER && _MSC_VER >= 1400 && !defined __EDGE__) || \ +#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ ( defined __GNUC__ && __GNUC__ >= 3 ) || \ ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) From cd9c72c66feb2f1a33c8d77c571c2e1fe248bc4b Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 9 Apr 2013 19:49:58 +0100 Subject: [PATCH 205/296] Fixed BrightGreen in ANSI/ Posix case - was yellow :-s --- include/internal/catch_console_colour_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index 938a5363..b1db918c 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -96,7 +96,7 @@ namespace { case Colour::LightGrey: return setColour( "[0;37m" ); case Colour::BrightRed: return setColour( "[1;31m" ); - case Colour::BrightGreen: return setColour( "[1;33m" ); + case Colour::BrightGreen: return setColour( "[1;32m" ); case Colour::BrightWhite: return setColour( "[1;37m" ); case Colour::Bright: throw std::logic_error( "not a colour" ); From 243f2d2caff024be5732224e214a0e25035ccc9e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 12 Apr 2013 10:43:06 +0100 Subject: [PATCH 206/296] build 33 --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 4 +-- projects/SelfTest/TrickyTests.cpp | 12 ++++++++ single_include/catch.hpp | 28 ++++++++----------- 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index ef706d53..171ca221 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 32 (integration branch) +## CATCH v0.9 build 33 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 7269815a..9a3d0a0f 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 32, "integration" ); + Version libraryVersion( 0, 9, 33, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 9b668439..167f1080 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b32 (integration) host application. +CatchSelfTest is a CATCH v0.9 b33 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -5452,7 +5452,7 @@ with message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b32 (integration) host application. +CatchSelfTest is a CATCH v0.9 b33 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index ad84b5ca..2326ca05 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -336,3 +336,15 @@ TEST_CASE( "Assertions then sections", "" ) } } } + +class Awkward +{ + operator int() const { return 7; } +}; + +//TEST_CASE( "non streamable", "" ) +//{ +// Awkward awkward; +// std::string s = Catch::toString( awkward ); +// REQUIRE( s == "{?}" ); +//} diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 1cb07a6e..7d5ca2a2 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 32 (integration branch) - * Generated: 2013-04-08 11:50:07.907187 + * CATCH v0.9 build 33 (integration branch) + * Generated: 2013-04-11 16:33:19.541792 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -22,7 +22,7 @@ #endif // Use variadic macros if the compiler supports them -#if ( defined _MSC_VER && _MSC_VER >= 1400 && !defined __EDGE__) || \ +#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ ( defined __GNUC__ && __GNUC__ >= 3 ) || \ ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) @@ -5616,7 +5616,7 @@ namespace { case Colour::LightGrey: return setColour( "[0;37m" ); case Colour::BrightRed: return setColour( "[1;31m" ); - case Colour::BrightGreen: return setColour( "[1;33m" ); + case Colour::BrightGreen: return setColour( "[1;32m" ); case Colour::BrightWhite: return setColour( "[1;37m" ); case Colour::Bright: throw std::logic_error( "not a colour" ); @@ -6018,7 +6018,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 32, "integration" ); + Version libraryVersion( 0, 9, 33, "integration" ); } // #included from: catch_line_wrap.hpp @@ -6174,7 +6174,7 @@ namespace Catch { } // end namespace Catch -// #included from: ../reporters/catch_legacy_reporter_adapter.hpp +// #included from: catch_legacy_reporter_adapter.hpp #define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_HPP_INCLUDED // #included from: catch_legacy_reporter_adapter.h @@ -7150,10 +7150,14 @@ namespace Catch { case ResultWas::Ok: stats.m_element = "success"; break; + case ResultWas::DidntThrowException: + stats.m_element = "failure"; + m_currentStats->m_failuresCount++; + break; case ResultWas::Unknown: case ResultWas::FailureBit: case ResultWas::Exception: - case ResultWas::DidntThrowException: + stats.m_element = "* internal error *"; break; } testCaseStats.m_testStats.push_back( stats ); @@ -7398,18 +7402,10 @@ namespace Catch { if( _stats.infoMessages.size() > 1 ) messageLabel = "explicitly with messages"; break; - case ResultWas::Exception: - passOrFail = "FAILED"; - colour = Colour::Error; - if( _stats.infoMessages.size() == 1 ) - messageLabel = "with message"; - if( _stats.infoMessages.size() > 1 ) - messageLabel = "with messages"; - break; - // These cases are here to prevent compiler warnings case ResultWas::Unknown: case ResultWas::FailureBit: + case ResultWas::Exception: passOrFail = "** internal error **"; colour = Colour::Error; break; From 5062d3e92bf3eb9a58b84083f1b7062fe7826591 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 16 Apr 2013 22:55:31 +0100 Subject: [PATCH 207/296] Added (conditional) SFINAE support. Better streamable detection for toString using SFINAE (falls back to non-SFINAE version without) --- .../internal/catch_compiler_capabilities.h | 74 +++++++++++++++++++ include/internal/catch_sfinae.hpp | 44 +++++++++++ include/internal/catch_tostring.hpp | 52 ++++++++++++- projects/SelfTest/TrickyTests.cpp | 16 ++-- .../CatchSelfTest.xcodeproj/project.pbxproj | 4 + 5 files changed, 180 insertions(+), 10 deletions(-) create mode 100644 include/internal/catch_compiler_capabilities.h create mode 100644 include/internal/catch_sfinae.hpp diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h new file mode 100644 index 00000000..f3e792d1 --- /dev/null +++ b/include/internal/catch_compiler_capabilities.h @@ -0,0 +1,74 @@ +/* + * Created by Phil on 15/04/2013. + * Copyright 2013 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_COMPILER_CAPABILITIES_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED + +// Much of the following code is based on Boost (1.53) + +//////////////////////////////////////////////////////////////////////////////// +// Borland +#ifdef __BORLANDC__ + +#if (__BORLANDC__ > 0x582 ) +#define CATCH_SFINAE +#endif + +#endif // __BORLANDC__ + +//////////////////////////////////////////////////////////////////////////////// +// EDG +#ifdef __EDG_VERSION__ + +#if (__EDG_VERSION__ > 238 ) +#define CATCH_SFINAE +#endif + +#endif // __EDG_VERSION__ + +//////////////////////////////////////////////////////////////////////////////// +// Digital Mars +#ifdef __DMC__ + +#if (__DMC__ > 0x840 ) +#define CATCH_SFINAE +#endif + +#endif // __DMC__ + +//////////////////////////////////////////////////////////////////////////////// +// GCC +#ifdef __GNUC__ + +#if __GNUC__ < 3 + +#if (__GNUC_MINOR__ >= 96 ) +#define CATCH_SFINAE +#endif + +#elif __GNUC__ >= 3 + +#define CATCH_SFINAE + +#endif // __GNUC__ < 3 + + +#endif // __GNUC__ + +//////////////////////////////////////////////////////////////////////////////// +// Visual C++ +#ifdef _MSC_VER + +#if (_MSC_VER >= 1310 ) // (VC++ 7.0+) +#define CATCH_SFINAE +#endif + +#endif // _MSC_VER + + +#endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED + diff --git a/include/internal/catch_sfinae.hpp b/include/internal/catch_sfinae.hpp new file mode 100644 index 00000000..ef414f84 --- /dev/null +++ b/include/internal/catch_sfinae.hpp @@ -0,0 +1,44 @@ +/* + * Created by Phil on 15/04/2013. + * Copyright 2013 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_SFINAE_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_SFINAE_HPP_INCLUDED + +// Try to detect if the current compiler supports SFINAE +#include "catch_compiler_capabilities.h" + +#ifdef CATCH_SFINAE + +namespace Catch { + + struct TrueType { + static const bool value = true; + typedef void Enable; + char sizer[1]; + }; + struct FalseType { + static const bool value = false; + typedef void Disable; + char sizer[2]; + }; + + template struct NotABooleanExpression; + + template struct If : NotABooleanExpression {}; + template<> struct If : TrueType {}; + template<> struct If : FalseType {}; + + template struct SizedIf; + template<> struct SizedIf : TrueType {}; + template<> struct SizedIf : FalseType {}; + +} // end namespace Catch + +#endif // CATCH_SFINAE + +#endif // TWOBLUECUBES_CATCH_SFINAE_HPP_INCLUDED + diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index f87127e0..0f7b8380 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -9,6 +9,8 @@ #define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED #include "catch_common.h" +#include "catch_sfinae.hpp" + #include #include #include @@ -18,6 +20,49 @@ #endif namespace Catch { + +#ifdef CATCH_SFINAE + +namespace Detail { + + template + class IsStreamInsertableHelper { + template struct TrueIfSizeable : TrueType {}; + + template + static TrueIfSizeable dummy(T2*); + static FalseType dummy(...); + + public: + typedef SizedIf type; + }; + + template + struct IsStreamInsertable : IsStreamInsertableHelper::type {}; + + template + void toStream( std::ostream& os, T const& value, typename IsStreamInsertable::Enable* = 0 ) { + os << value; + } + + template + void toStream( std::ostream& os, T const&, typename IsStreamInsertable::Disable* = 0 ) { + os << "{?}"; + } + +} + +template +struct StringMaker { + static std::string convert( T const& value ) { + std::ostringstream oss; + Detail::toStream( oss, value ); + return oss.str(); + } +}; + +#else + namespace Detail { struct NonStreamable { @@ -40,6 +85,10 @@ struct StringMaker { return oss.str(); } }; + +#endif + + template struct StringMaker { static std::string convert( T const* p ) { @@ -57,7 +106,7 @@ struct StringMaker > { std::ostringstream oss; oss << "{ "; for( std::size_t i = 0; i < v.size(); ++ i ) { - oss << v[i]; + oss << toString( v[i] ); if( i < v.size() - 1 ) oss << ", "; } @@ -83,7 +132,6 @@ namespace Detail { template std::string toString( const T& value ) { return StringMaker::convert( value ); -// return Detail::makeString( value ); } // Built in overloads diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index 2326ca05..a40cecd5 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -182,7 +182,7 @@ namespace ObjectWithConversions "Operators at different namespace levels not hijacked by Koenig lookup" ) { - Object o; + Object o; REQUIRE(0xc0000000 == o ); } } @@ -337,14 +337,14 @@ TEST_CASE( "Assertions then sections", "" ) } } -class Awkward +struct Awkward { operator int() const { return 7; } }; -//TEST_CASE( "non streamable", "" ) -//{ -// Awkward awkward; -// std::string s = Catch::toString( awkward ); -// REQUIRE( s == "{?}" ); -//} +TEST_CASE( "non streamable", "" ) +{ + Awkward awkward; + std::string s = Catch::toString( awkward ); + REQUIRE( s == "7" ); // This is ambiguous without SFINAE +} diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index bef07f61..d54036ab 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -59,6 +59,8 @@ 266ECD73170F3C620030D735 /* BDDTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BDDTests.cpp; path = ../../../SelfTest/BDDTests.cpp; sourceTree = ""; }; 266ECD8C1713614B0030D735 /* catch_legacy_reporter_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_legacy_reporter_adapter.hpp; sourceTree = ""; }; 266ECD8D1713614B0030D735 /* catch_legacy_reporter_adapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_legacy_reporter_adapter.h; sourceTree = ""; }; + 26759472171C72A400A84BD1 /* catch_sfinae.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_sfinae.hpp; sourceTree = ""; }; + 26759473171C74C200A84BD1 /* catch_compiler_capabilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_compiler_capabilities.h; sourceTree = ""; }; 26847E5B16BBAB790043B9C1 /* catch_message.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_message.h; sourceTree = ""; }; 26847E5C16BBACB60043B9C1 /* catch_message.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_message.hpp; sourceTree = ""; }; 26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = ""; }; @@ -395,6 +397,8 @@ 4AEE0326161431070071E950 /* catch_streambuf.h */, 4ACE21C8166CA19700FB5509 /* catch_option.hpp */, 2694A1F8169FFF9B004816E3 /* catch_line_wrap.h */, + 26759472171C72A400A84BD1 /* catch_sfinae.hpp */, + 26759473171C74C200A84BD1 /* catch_compiler_capabilities.h */, ); name = Infrastructure; sourceTree = ""; From bd5910ef9f758616111ba25df95ffd1c07673f5a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 17 Apr 2013 00:05:25 +0100 Subject: [PATCH 208/296] Moved line info in header again --- include/reporters/catch_reporter_console.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 9cd25e89..741f00b5 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -284,6 +284,15 @@ namespace Catch { } } + SourceLineInfo lineInfo = currentSectionInfo + ? currentSectionInfo->lineInfo + : unusedTestCaseInfo->lineInfo; + + if( !lineInfo.empty() ){ + stream << getDashes() << "\n"; + Colour colourGuard( Colour::FileName ); + stream << lineInfo << "\n"; + } stream << getDots() << "\n" << std::endl; } @@ -293,10 +302,6 @@ namespace Catch { } void printOpenHeader( std::string const& _name, SourceLineInfo const& _lineInfo = SourceLineInfo() ) { stream << getDashes() << "\n"; - if( !_lineInfo.empty() ){ - Colour colourGuard( Colour::FileName ); - stream << _lineInfo << "\n\n"; - } { Colour colourGuard( Colour::Headers ); printUserString( _name ); From 052dc18c768969cd2bd843ce35872a96d5fa8307 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 18 Apr 2013 07:40:19 +0100 Subject: [PATCH 209/296] Remove SFINAE support for all unknown compilers --- include/internal/catch_compiler_capabilities.h | 8 ++++---- projects/SelfTest/TrickyTests.cpp | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h index f3e792d1..7d0d7a3d 100644 --- a/include/internal/catch_compiler_capabilities.h +++ b/include/internal/catch_compiler_capabilities.h @@ -15,7 +15,7 @@ #ifdef __BORLANDC__ #if (__BORLANDC__ > 0x582 ) -#define CATCH_SFINAE +//#define CATCH_SFINAE // Not confirmed #endif #endif // __BORLANDC__ @@ -25,7 +25,7 @@ #ifdef __EDG_VERSION__ #if (__EDG_VERSION__ > 238 ) -#define CATCH_SFINAE +//#define CATCH_SFINAE // Not confirmed #endif #endif // __EDG_VERSION__ @@ -35,7 +35,7 @@ #ifdef __DMC__ #if (__DMC__ > 0x840 ) -#define CATCH_SFINAE +//#define CATCH_SFINAE // Not confirmed #endif #endif // __DMC__ @@ -64,7 +64,7 @@ #ifdef _MSC_VER #if (_MSC_VER >= 1310 ) // (VC++ 7.0+) -#define CATCH_SFINAE +//#define CATCH_SFINAE // Not confirmed #endif #endif // _MSC_VER diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index a40cecd5..0dd7c614 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -342,9 +342,11 @@ struct Awkward operator int() const { return 7; } }; -TEST_CASE( "non streamable", "" ) -{ - Awkward awkward; - std::string s = Catch::toString( awkward ); - REQUIRE( s == "7" ); // This is ambiguous without SFINAE -} +// This now works with GCC/ Clang usinh SFINAE +// Uncomment when it works on all compilers that are tested +//TEST_CASE( "non streamable", "" ) +//{ +// Awkward awkward; +// std::string s = Catch::toString( awkward ); +// REQUIRE( s == "7" ); // This is ambiguous without SFINAE +//} From 7059c6e1c32b8db1d5f1c6466bd9a1dd5bc7f04a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 19 Apr 2013 19:08:32 +0100 Subject: [PATCH 210/296] Text class mostly working - tabs not yet working --- include/catch_runner.hpp | 4 +- include/internal/catch_line_wrap.hpp | 2 +- include/internal/catch_text.h | 120 ++++++++++++++++ include/reporters/catch_reporter_console.hpp | 15 +- projects/SelfTest/TestMain.cpp | 129 +++++++++--------- .../CatchSelfTest.xcodeproj/project.pbxproj | 6 +- 6 files changed, 197 insertions(+), 79 deletions(-) create mode 100644 include/internal/catch_text.h diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 30ed6be1..81f0ad5f 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -14,6 +14,7 @@ #include "internal/catch_test_spec.h" #include "internal/catch_version.h" #include "internal/catch_line_wrap.h" +#include "internal/catch_text.h" #include #include @@ -161,7 +162,8 @@ namespace Catch { displayedSpecificOption = true; std::cout << "\n" << opt.optionNames() << " " << opt.argsSynopsis() << "\n\n" << opt.optionSummary() << "\n\n" - << LineWrapper().setIndent( 2 ).wrap( opt.optionDescription() ) << "\n" << std::endl; +// << LineWrapper().setIndent( 2 ).wrap( opt.optionDescription() ) << "\n" << std::endl; + << Text( opt.optionDescription(), TextAttributes().setIndent( 2 ) ) << "\n" << std::endl; } } diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp index 05e9143b..aa278f5d 100644 --- a/include/internal/catch_line_wrap.hpp +++ b/include/internal/catch_line_wrap.hpp @@ -48,7 +48,7 @@ namespace Catch { return wrappableChars.find( c ) != std::string::npos; } void LineWrapper::wrapInternal( std::string const& _str ) { - assert( ++recursionCount < 100 ); + assert( ++recursionCount < 1000 ); std::size_t width = right - getCurrentIndent(); std::size_t wrapPoint = width-tab; diff --git a/include/internal/catch_text.h b/include/internal/catch_text.h new file mode 100644 index 00000000..31c4e56d --- /dev/null +++ b/include/internal/catch_text.h @@ -0,0 +1,120 @@ +/* + * Created by Phil on 18/4/2013. + * Copyright 2013 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_TEXT_H_INCLUDED +#define TWOBLUECUBES_CATCH_TEXT_H_INCLUDED + +#include +#include + +namespace Catch { + + struct TextAttributes { + TextAttributes() + : initialIndent( std::string::npos ), + indent( 0 ), + width( CATCH_CONFIG_CONSOLE_WIDTH-1 ), + tabChar( '\t' ) + {} + + TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; } + TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; } + TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; } + TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; } + + std::size_t initialIndent; // indent of first line, or npos + std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos + std::size_t width; // maximum width of text, including indent. Longer text will wrap + char tabChar; // If this char is seen the indent is changed to current pos + }; + + class Text { + public: + Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() ) + : attr( _attr ) + { + std::string wrappableChars = " [({.,/|\\-"; + std::size_t indent = _attr.initialIndent != std::string::npos + ? _attr.initialIndent + : _attr.indent; + std::string remainder = _str; + std::size_t tabPos = std::string::npos; + while( !remainder.empty() ) { + std::size_t width = _attr.width - indent; + std::size_t wrapPos = width; + std::size_t pos = remainder.find_first_of( '\n' ); + if( pos <= width ) { + wrapPos = pos; + addLine( indent, remainder.substr( 0, pos ) ); + remainder = remainder.substr( pos+1 ); + if( remainder.empty() ) + addLine (indent, "" ); // Trailing newlines result in extra line + } + else { + pos = remainder.find_last_of( _attr.tabChar, width ); + if( pos != std::string::npos ) { + tabPos = pos; + remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); + } + if( remainder.size() <= width ) { + addLine( indent, remainder ); + remainder = std::string(); + } + else { + pos = remainder.find_last_of( wrappableChars, width ); + if( pos == std::string::npos ) { + addLine( indent, remainder.substr( 0, width-1 ) + "-" ); + remainder = remainder.substr( width-1 ); + } + else { + addLine( indent, remainder.substr( 0, pos ) ); + if( remainder[pos] == ' ' ) + pos++; + remainder = remainder.substr( pos ); + } + } + } + indent = tabPos == std::string::npos + ? _attr.indent + : indent + tabPos; + }; + } + void addLine( std::size_t indent, std::string const& _line ) { + lines.push_back( std::string( indent, ' ' ) + _line ); + } + typedef std::vector::const_iterator const_iterator; + + const_iterator begin() const { return lines.begin(); } + const_iterator end() const { return lines.end(); } + std::string const& last() const { return lines.back(); } + std::size_t size() const { return lines.size(); } + std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } + + friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { + for( Text::const_iterator it = _text.begin(), itEnd = _text.end(); + it != itEnd; ++it ) { + if( it != _text.begin() ) + _stream << "\n"; + _stream << *it; + } + return _stream; + } + std::string toString() const { + std::ostringstream oss; + oss << *this; + return oss.str(); + } + + private: + std::string str; + TextAttributes attr; + std::vector lines; + }; + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_TEXT_H_INCLUDED diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 741f00b5..8326cc2f 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -264,10 +264,7 @@ namespace Catch { } } void printTestCaseAndSectionHeader() { - printOpenHeader( unusedTestCaseInfo->name, - currentSectionInfo - ? currentSectionInfo->lineInfo - : unusedTestCaseInfo->lineInfo ); + printOpenHeader( unusedTestCaseInfo->name ); if( currentSectionInfo ) { Colour colourGuard( Colour::Headers ); std::vector sections; @@ -280,7 +277,7 @@ namespace Catch { if( !sections.empty() ) { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) - printUserString( (*it)->name, 2 ); + printHeaderString( (*it)->name, 2 ); } } @@ -300,17 +297,17 @@ namespace Catch { printOpenHeader( _name ); stream << getDots() << "\n"; } - void printOpenHeader( std::string const& _name, SourceLineInfo const& _lineInfo = SourceLineInfo() ) { + void printOpenHeader( std::string const& _name ) { stream << getDashes() << "\n"; { Colour colourGuard( Colour::Headers ); - printUserString( _name ); + printHeaderString( _name ); } } - + // if string has a : in first line will set indent to follow it on // subsequent lines - void printUserString( std::string const& _string, std::size_t indent = 0 ) { + void printHeaderString( std::string const& _string, std::size_t indent = 0 ) { std::size_t i = _string.find( ": " ); if( i != std::string::npos ) i+=2; diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index e1a44be0..7e47725e 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -11,6 +11,7 @@ #include "catch_self_test.hpp" #include "internal/catch_line_wrap.h" +#include "internal/catch_text.h" TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" ) { using namespace Catch; @@ -427,52 +428,53 @@ TEST_CASE( "selftest/tags", "" ) { TEST_CASE( "Long strings can be wrapped", "[wrap]" ) { + using namespace Catch; SECTION( "plain string", "" ) { // guide: 123456789012345678 std::string testString = "one two three four"; SECTION( "No wrapping", "" ) { - CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ); - CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ); + CHECK( Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString ); + CHECK( Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString ); } SECTION( "Wrapped once", "" ) { - CHECK( Catch::LineWrapper().setRight( 17 ).wrap( testString ).toString() == "one two three\nfour" ); - CHECK( Catch::LineWrapper().setRight( 16 ).wrap( testString ).toString() == "one two three\nfour" ); - CHECK( Catch::LineWrapper().setRight( 15 ).wrap( testString ).toString() == "one two three\nfour" ); - CHECK( Catch::LineWrapper().setRight( 14 ).wrap( testString ).toString() == "one two three\nfour" ); - CHECK( Catch::LineWrapper().setRight( 13 ).wrap( testString ).toString() == "one two\nthree four" ); + CHECK( Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" ); } SECTION( "Wrapped twice", "" ) { - CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ); - CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" ); } SECTION( "Wrapped three times", "" ) { - CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); - CHECK( Catch::LineWrapper().setRight( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" ); } SECTION( "Short wrap", "" ) { - CHECK( Catch::LineWrapper().setRight( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" ); - CHECK( Catch::LineWrapper().setRight( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" ); - CHECK( Catch::LineWrapper().setRight( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" ); + CHECK( Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" ); + CHECK( Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" ); + CHECK( Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" ); - CHECK( Catch::LineWrapper().setRight( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" ); - CHECK( Catch::LineWrapper().setRight( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ); + CHECK( Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ); } SECTION( "As container", "" ) { - Catch::LineWrapper wrapper; - wrapper.setRight( 7 ).wrap( testString ); - CHECK( wrapper.size() == 4 ); - CHECK( wrapper[0] == "one" ); - CHECK( wrapper[1] == "two" ); - CHECK( wrapper[2] == "three" ); - CHECK( wrapper[3] == "four" ); + Text text( testString, TextAttributes().setWidth( 6 ) ); + REQUIRE( text.size() == 4 ); + CHECK( text[0] == "one" ); + CHECK( text[1] == "two" ); + CHECK( text[2] == "three" ); + CHECK( text[3] == "four" ); } SECTION( "Indent first line differently", "" ) { - CHECK( Catch::LineWrapper() - .setRight( 10 ) - .setIndent( 4 ) - .setInitialIndent( 1 ) - .wrap( testString ).toString() == " one two\n three\n four" ); + Text text( testString, TextAttributes() + .setWidth( 10 ) + .setIndent( 4 ) + .setInitialIndent( 1 ) ); + CHECK( text.toString() == " one two\n three\n four" ); } } @@ -483,25 +485,35 @@ TEST_CASE( "Long strings can be wrapped", "[wrap]" ) { std::string testString = "one two\nthree four"; SECTION( "No wrapping" , "" ) { - CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ); - CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ); - CHECK( Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString ); + CHECK( Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString ); + CHECK( Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString ); + CHECK( Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString ); } SECTION( "Trailing newline" , "" ) { - CHECK( Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ); - CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" ); - CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ); + CHECK( Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" ); + CHECK( Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" ); + CHECK( Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" ); } SECTION( "Wrapped once", "" ) { - CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ); - CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ); - CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" ); } SECTION( "Wrapped twice", "" ) { - CHECK( Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ); + CHECK( Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" ); } } + SECTION( "With tabs", "" ) { + + // guide: 1234567890123456789 + std::string testString = "one two /tthree four five six"; + + CHECK( Text( testString, TextAttributes().setWidth( 18 ) ).toString() + == "one two three/n four/n five/n six" ); + } + + } using namespace Catch; @@ -520,7 +532,7 @@ public: std::size_t fromIndex; std::size_t toIndex; }; - + ColourString( std::string const& _string ) : string( _string ) {} @@ -576,34 +588,8 @@ private: std::vector colours; }; -class Text -{ -public: - Text( std::string const& _string ) : originalString( _string ) { - } - Text( char const* const _string ) : originalString( _string ) { - } - - friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { - _text.print( _stream ); - return _stream; - } - -private: - void process() const { - - } - void print( std::ostream& stream ) const { - stream << originalString; - } - - std::string originalString; -// std::vector< -}; - +// !TBD: This will be folded into Text class TEST_CASE( "Strings can be rendered with colour", "[colour]" ) { -// Text text = "`red`This is in red. `green` this is in green"; -// std::cout << text << std::endl; { ColourString cs( "hello" ); @@ -621,3 +607,14 @@ TEST_CASE( "Strings can be rendered with colour", "[colour]" ) { } } + +TEST_CASE( "Text can be formatted using the Text class", "" ) { + Text text( "hi there" ); + + CHECK( Text( "hi there" ).toString() == "hi there" ); + + TextAttributes narrow; + narrow.setWidth( 6 ); + + CHECK( Text( "hi there", narrow ).toString() == "hi\nthere" ); +} diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index d54036ab..347234fb 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -67,6 +67,7 @@ 2694A1F8169FFF9B004816E3 /* catch_line_wrap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_line_wrap.h; sourceTree = ""; }; 2694A1FA169FFFEC004816E3 /* catch_line_wrap.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_line_wrap.hpp; sourceTree = ""; }; 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = catch_line_wrap.cpp; sourceTree = ""; }; + 26DACF2F17206D3400A21326 /* catch_text.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_text.h; sourceTree = ""; }; 4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_test_case_info.hpp; sourceTree = ""; }; 4A084F1D15DAD15F0027E631 /* catch_test_spec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_test_spec.h; sourceTree = ""; }; 4A3D7DD01503869D005F9203 /* catch_matchers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_matchers.hpp; sourceTree = ""; }; @@ -399,6 +400,7 @@ 2694A1F8169FFF9B004816E3 /* catch_line_wrap.h */, 26759472171C72A400A84BD1 /* catch_sfinae.hpp */, 26759473171C74C200A84BD1 /* catch_compiler_capabilities.h */, + 26DACF2F17206D3400A21326 /* catch_text.h */, ); name = Infrastructure; sourceTree = ""; @@ -522,7 +524,7 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; @@ -564,7 +566,7 @@ GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; From 54ca219aad1e8164cacc425c388c727d3dd146d1 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 20 Apr 2013 11:27:28 +0100 Subject: [PATCH 211/296] Text class is now full replacement for LineWrap --- include/internal/catch_text.h | 65 ++++++++++++++++++---------------- projects/SelfTest/TestMain.cpp | 7 ++-- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/include/internal/catch_text.h b/include/internal/catch_text.h index 31c4e56d..7adcaa3b 100644 --- a/include/internal/catch_text.h +++ b/include/internal/catch_text.h @@ -42,45 +42,50 @@ namespace Catch { ? _attr.initialIndent : _attr.indent; std::string remainder = _str; - std::size_t tabPos = std::string::npos; while( !remainder.empty() ) { - std::size_t width = _attr.width - indent; - std::size_t wrapPos = width; + assert( lines.size() < 1000 ); + std::size_t tabPos = std::string::npos; + std::size_t width = (std::min)( remainder.size(), _attr.width - indent ); std::size_t pos = remainder.find_first_of( '\n' ); if( pos <= width ) { - wrapPos = pos; - addLine( indent, remainder.substr( 0, pos ) ); - remainder = remainder.substr( pos+1 ); - if( remainder.empty() ) - addLine (indent, "" ); // Trailing newlines result in extra line + width = pos; + } + pos = remainder.find_last_of( _attr.tabChar, width ); + if( pos != std::string::npos ) { + tabPos = pos; + if( remainder[width] == '\n' ) + width--; + remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); + } + if( width == remainder.size() ) { + addLine( indent, remainder ); + remainder = std::string(); + } + else if( remainder[width] == '\n' ) { + addLine( indent, remainder.substr( 0, width ) ); + indent = _attr.indent; + if( width > 1 && width == remainder.size()-1 ) + remainder = remainder.substr( width ); + else + remainder = remainder.substr( width+1 ); } else { - pos = remainder.find_last_of( _attr.tabChar, width ); + pos = remainder.find_last_of( wrappableChars, width ); if( pos != std::string::npos ) { - tabPos = pos; - remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); + addLine( indent, remainder.substr( 0, pos ) ); + if( remainder[pos] == ' ' ) + pos++; + remainder = remainder.substr( pos ); } - if( remainder.size() <= width ) { - addLine( indent, remainder ); - remainder = std::string(); - } - else { - pos = remainder.find_last_of( wrappableChars, width ); - if( pos == std::string::npos ) { - addLine( indent, remainder.substr( 0, width-1 ) + "-" ); - remainder = remainder.substr( width-1 ); - } - else { - addLine( indent, remainder.substr( 0, pos ) ); - if( remainder[pos] == ' ' ) - pos++; - remainder = remainder.substr( pos ); - } + else { + addLine( indent, remainder.substr( 0, width-1 ) + "-" ); + remainder = remainder.substr( width-1 ); } + if( lines.size() == 1 ) + indent = _attr.indent; + if( tabPos != std::string::npos ) + indent += tabPos; } - indent = tabPos == std::string::npos - ? _attr.indent - : indent + tabPos; }; } void addLine( std::size_t indent, std::string const& _line ) { diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 7e47725e..19e8f68b 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -507,10 +507,10 @@ TEST_CASE( "Long strings can be wrapped", "[wrap]" ) { SECTION( "With tabs", "" ) { // guide: 1234567890123456789 - std::string testString = "one two /tthree four five six"; + std::string testString = "one two \tthree four five six"; - CHECK( Text( testString, TextAttributes().setWidth( 18 ) ).toString() - == "one two three/n four/n five/n six" ); + CHECK( Text( testString, TextAttributes().setWidth( 15 ) ).toString() + == "one two three\n four\n five\n six" ); } @@ -609,7 +609,6 @@ TEST_CASE( "Strings can be rendered with colour", "[colour]" ) { } TEST_CASE( "Text can be formatted using the Text class", "" ) { - Text text( "hi there" ); CHECK( Text( "hi there" ).toString() == "hi there" ); From e43d4a202876d1e4f016552a81c1c606e8efe867 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 20 Apr 2013 18:37:42 +0100 Subject: [PATCH 212/296] Refactored line wrapping in Text constructor a bit --- projects/SelfTest/makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 projects/SelfTest/makefile diff --git a/projects/SelfTest/makefile b/projects/SelfTest/makefile new file mode 100644 index 00000000..02dc3084 --- /dev/null +++ b/projects/SelfTest/makefile @@ -0,0 +1,13 @@ +SOURCES = ApproxTests.cpp ClassTests.cpp ConditionTests.cpp \ + ExceptionTests.cpp GeneratorTests.cpp MessageTests.cpp \ + MiscTests.cpp TestMain.cpp TrickyTests.cpp \ + catch_self_test.cpp +OBJECTS = $(patsubst %.cpp, %.o, $(SOURCES)) +CXX = gcc +CXXFLAGS = -I../../include + +all: $(OBJECTS) + $(CXX) -o $@ $^ + +clean: + rm -f $(OBJECTS) From d37a8e8f9883b3fbaada083f5543fcc96fdd6374 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 20 Apr 2013 18:40:10 +0100 Subject: [PATCH 213/296] Revert "Refactored line wrapping in Text constructor a bit" This reverts commit e43d4a202876d1e4f016552a81c1c606e8efe867. --- projects/SelfTest/makefile | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 projects/SelfTest/makefile diff --git a/projects/SelfTest/makefile b/projects/SelfTest/makefile deleted file mode 100644 index 02dc3084..00000000 --- a/projects/SelfTest/makefile +++ /dev/null @@ -1,13 +0,0 @@ -SOURCES = ApproxTests.cpp ClassTests.cpp ConditionTests.cpp \ - ExceptionTests.cpp GeneratorTests.cpp MessageTests.cpp \ - MiscTests.cpp TestMain.cpp TrickyTests.cpp \ - catch_self_test.cpp -OBJECTS = $(patsubst %.cpp, %.o, $(SOURCES)) -CXX = gcc -CXXFLAGS = -I../../include - -all: $(OBJECTS) - $(CXX) -o $@ $^ - -clean: - rm -f $(OBJECTS) From 97d99852a85f37dbc19fac9e6979c63bf5db0bc2 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 20 Apr 2013 18:41:00 +0100 Subject: [PATCH 214/296] Refactored line wrapping in Text constructor a bit --- include/internal/catch_text.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/internal/catch_text.h b/include/internal/catch_text.h index 7adcaa3b..97288a72 100644 --- a/include/internal/catch_text.h +++ b/include/internal/catch_text.h @@ -42,6 +42,7 @@ namespace Catch { ? _attr.initialIndent : _attr.indent; std::string remainder = _str; + while( !remainder.empty() ) { assert( lines.size() < 1000 ); std::size_t tabPos = std::string::npos; @@ -57,40 +58,39 @@ namespace Catch { width--; remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); } + if( width == remainder.size() ) { - addLine( indent, remainder ); - remainder = std::string(); + spliceLine( indent, remainder, width ); } else if( remainder[width] == '\n' ) { - addLine( indent, remainder.substr( 0, width ) ); + spliceLine( indent, remainder, width ); + if( width <= 1 || remainder.size() != 1 ) + remainder = remainder.substr( 1 ); indent = _attr.indent; - if( width > 1 && width == remainder.size()-1 ) - remainder = remainder.substr( width ); - else - remainder = remainder.substr( width+1 ); } else { pos = remainder.find_last_of( wrappableChars, width ); if( pos != std::string::npos ) { - addLine( indent, remainder.substr( 0, pos ) ); - if( remainder[pos] == ' ' ) - pos++; - remainder = remainder.substr( pos ); + spliceLine( indent, remainder, pos ); + if( remainder[0] == ' ' ) + remainder = remainder.substr( 1 ); } else { - addLine( indent, remainder.substr( 0, width-1 ) + "-" ); - remainder = remainder.substr( width-1 ); + spliceLine( indent, remainder, width-1 ); + lines.back() += "-"; } if( lines.size() == 1 ) indent = _attr.indent; if( tabPos != std::string::npos ) indent += tabPos; } - }; + } } - void addLine( std::size_t indent, std::string const& _line ) { - lines.push_back( std::string( indent, ' ' ) + _line ); + void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) { + lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) ); + _remainder = _remainder.substr( _pos ); } + typedef std::vector::const_iterator const_iterator; const_iterator begin() const { return lines.begin(); } From b3acf45d7052efc97409db4ba2f930833cd15596 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 20 Apr 2013 19:36:40 +0100 Subject: [PATCH 215/296] Fully committed to new Text class. - moved impl into .hpp - replaced last few uses of LineWrapper with Text - removed LineWrapper --- include/catch_runner.hpp | 2 - include/internal/catch_impl.hpp | 2 +- include/internal/catch_line_wrap.h | 58 - include/internal/catch_line_wrap.hpp | 117 -- include/internal/catch_list.hpp | 16 +- include/internal/catch_test_case_info.h | 1 + include/internal/catch_text.h | 76 +- include/internal/catch_text.hpp | 92 + include/reporters/catch_reporter_console.hpp | 11 +- .../SelfTest/Baselines/approvedResults.txt | 1523 +++++++++-------- projects/SelfTest/TestMain.cpp | 1 - .../CatchSelfTest.xcodeproj/project.pbxproj | 14 +- .../{catch_line_wrap.cpp => catch_text.cpp} | 2 +- 13 files changed, 954 insertions(+), 961 deletions(-) delete mode 100644 include/internal/catch_line_wrap.h delete mode 100644 include/internal/catch_line_wrap.hpp create mode 100644 include/internal/catch_text.hpp rename projects/XCode4/CatchSelfTest/CatchSelfTest/{catch_line_wrap.cpp => catch_text.cpp} (76%) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 81f0ad5f..7f24d5b5 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -13,7 +13,6 @@ #include "internal/catch_runner_impl.hpp" #include "internal/catch_test_spec.h" #include "internal/catch_version.h" -#include "internal/catch_line_wrap.h" #include "internal/catch_text.h" #include @@ -162,7 +161,6 @@ namespace Catch { displayedSpecificOption = true; std::cout << "\n" << opt.optionNames() << " " << opt.argsSynopsis() << "\n\n" << opt.optionSummary() << "\n\n" -// << LineWrapper().setIndent( 2 ).wrap( opt.optionDescription() ) << "\n" << std::endl; << Text( opt.optionDescription(), TextAttributes().setIndent( 2 ) ) << "\n" << std::endl; } } diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index f3f214b2..ff95675b 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -27,7 +27,7 @@ #include "catch_test_case_info.hpp" #include "catch_tags.hpp" #include "catch_version.hpp" -#include "catch_line_wrap.hpp" +#include "catch_text.hpp" #include "catch_message.hpp" #include "catch_legacy_reporter_adapter.hpp" diff --git a/include/internal/catch_line_wrap.h b/include/internal/catch_line_wrap.h deleted file mode 100644 index cfd31df8..00000000 --- a/include/internal/catch_line_wrap.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Created by Phil on 11/1/2013. - * Copyright 2013 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_LINE_WRAP_H_INCLUDED -#define TWOBLUECUBES_CATCH_LINE_WRAP_H_INCLUDED - -#include -#include - -namespace Catch { - - class LineWrapper { - public: - LineWrapper(); - - LineWrapper& setIndent( std::size_t _indent ); - LineWrapper& setInitialIndent( std::size_t _initalIndent ); - LineWrapper& setRight( std::size_t _right ); - LineWrapper& setTabChar( char _tabChar ); - - LineWrapper& wrap( std::string const& _str ); - - std::string toString() const; - - typedef std::vector::const_iterator const_iterator; - - const_iterator begin() const { return lines.begin(); } - const_iterator end() const { return lines.end(); } - std::string const& last() const { return lines.back(); } - std::size_t size() const { return lines.size(); } - std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } - - friend std::ostream& operator << ( std::ostream& _stream, LineWrapper const& _lineWrapper ); - - private: - void wrapInternal( std::string const& _str ); - void addLine( const std::string& _line ); - bool isWrapPoint( char c ); - std::size_t getCurrentIndent() const; - - std::size_t right; - std::size_t nextTab; - std::size_t tab; - std::size_t indent; - std::size_t initialIndent; - std::string wrappableChars; - char tabChar; - int recursionCount; - std::vector lines; - }; - -} // end namespace Catch - -#endif // TWOBLUECUBES_CATCH_LINE_WRAP_H_INCLUDED diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp deleted file mode 100644 index aa278f5d..00000000 --- a/include/internal/catch_line_wrap.hpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Created by Phil on 11/1/2013. - * Copyright 2013 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_LINE_WRAP_HPP_INCLUDED -#define TWOBLUECUBES_CATCH_LINE_WRAP_HPP_INCLUDED - -#include "catch_line_wrap.h" - -namespace Catch { - - LineWrapper::LineWrapper() - : right( CATCH_CONFIG_CONSOLE_WIDTH-1 ), - nextTab( 0 ), - tab( 0 ), - indent( 0 ), - initialIndent( (std::size_t)-1 ), // use indent by default - wrappableChars( " [({.,/|\\" ), - tabChar( '\t' ), - recursionCount( 0 ) - {} - - LineWrapper& LineWrapper::setIndent( std::size_t _indent ) { - indent = _indent; - return *this; - } - LineWrapper& LineWrapper::setInitialIndent( std::size_t _initialIndent ) { - initialIndent = _initialIndent; - return *this; - } - LineWrapper& LineWrapper::setRight( std::size_t _right ) { - right = _right; - return *this; - } - LineWrapper& LineWrapper::wrap( std::string const& _str ) { - nextTab = tab = 0; - wrapInternal( _str ); - return *this; - } - LineWrapper& LineWrapper::setTabChar( char _tabChar ) { - tabChar = _tabChar; - return *this; - } - bool LineWrapper::isWrapPoint( char c ) { - return wrappableChars.find( c ) != std::string::npos; - } - void LineWrapper::wrapInternal( std::string const& _str ) { - assert( ++recursionCount < 1000 ); - - std::size_t width = right - getCurrentIndent(); - std::size_t wrapPoint = width-tab; - for( std::size_t pos = 0; pos < _str.size(); ++pos ) { - if( _str[pos] == '\n' ) - { - addLine( _str.substr( 0, pos ) ); - nextTab = tab = 0; - return wrapInternal( _str.substr( pos+1 ) ); - } - if( pos == width-tab ) { - if( _str[wrapPoint] == ' ' ) { - addLine( _str.substr( 0, wrapPoint ) ); - while( _str[++wrapPoint] == ' ' ); - } - else if( isWrapPoint( _str[wrapPoint] ) ) { - addLine( _str.substr( 0, wrapPoint ) ); - } - else { - addLine( _str.substr( 0, --wrapPoint ) + '-' ); - } - return wrapInternal( _str.substr( wrapPoint ) ); - } - if( _str[pos] == tabChar ) { - nextTab = pos; - std::string withoutTab = _str.substr( 0, nextTab ) + _str.substr( nextTab+1 ); - return wrapInternal( withoutTab ); - } - else if( pos > 0 && isWrapPoint( _str[pos] ) ) { - wrapPoint = pos; - } - } - addLine( _str ); - } - - std::ostream& operator << ( std::ostream& _stream, LineWrapper const& _lineWrapper ) { - for( LineWrapper::const_iterator it = _lineWrapper.begin(), itEnd = _lineWrapper.end(); - it != itEnd; ++it ) { - if( it != _lineWrapper.begin() ) - _stream << "\n"; - _stream << *it; - } - return _stream; - } - std::string LineWrapper::toString() const { - std::ostringstream oss; - oss << *this; - return oss.str(); - } - - void LineWrapper::addLine( const std::string& _line ) { - lines.push_back( std::string( tab + getCurrentIndent(), ' ' ) + _line ); - if( nextTab > 0 ) - tab = nextTab; - } - - std::size_t LineWrapper::getCurrentIndent() const - { - return (initialIndent != (std::size_t)-1 && lines.empty() ) - ? initialIndent - : indent; - } - -} // end namespace Catch - -#endif // TWOBLUECUBES_CATCH_LINE_WRAP_HPP_INCLUDED diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index c0a44081..b1504f4d 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -9,7 +9,7 @@ #define TWOBLUECUBES_CATCH_LIST_HPP_INCLUDED #include "catch_commandline.hpp" -#include "catch_line_wrap.h" +#include "catch_text.h" #include "catch_console_colour.hpp" #include @@ -57,11 +57,11 @@ namespace Catch { if( matchesFilters( config.filters, *it ) ) { matchedTests++; // !TBD: consider listAs() - LineWrapper nameWrapper; - nameWrapper.setRight( maxNameLen ).setIndent( 2 ).wrap( it->getTestCaseInfo().name ); + Text nameWrapper( it->getTestCaseInfo().name, + TextAttributes().setWidth( maxNameLen ).setIndent(2) ); - LineWrapper tagsWrapper; - tagsWrapper.setRight( maxTagLen ).wrap( it->getTestCaseInfo().tagsAsString ); + Text tagsWrapper( it->getTestCaseInfo().tagsAsString, + TextAttributes().setWidth( maxTagLen ) ); for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) { Colour::Code colour = Colour::None; @@ -135,9 +135,9 @@ namespace Catch { for( std::map::const_iterator countIt = tagCounts.begin(), countItEnd = tagCounts.end(); countIt != countItEnd; ++countIt ) { - LineWrapper wrapper; - wrapper.setIndent(2).setRight( maxTagLen ).wrap( "[" + countIt->first + "]" ); - + Text wrapper( "[" + countIt->first + "]", TextAttributes() + .setIndent(2) + .setWidth( maxTagLen ) ); std::cout << wrapper; std::size_t dots = 2; if( maxTagLen > wrapper.last().size() ) diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h index fde9748a..ba804b19 100644 --- a/include/internal/catch_test_case_info.h +++ b/include/internal/catch_test_case_info.h @@ -9,6 +9,7 @@ #define TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED #include "catch_common.h" +#include "catch_ptr.hpp" #include #include diff --git a/include/internal/catch_text.h b/include/internal/catch_text.h index 97288a72..8584da31 100644 --- a/include/internal/catch_text.h +++ b/include/internal/catch_text.h @@ -8,6 +8,8 @@ #ifndef TWOBLUECUBES_CATCH_TEXT_H_INCLUDED #define TWOBLUECUBES_CATCH_TEXT_H_INCLUDED +#include "catch_config.hpp" + #include #include @@ -34,62 +36,8 @@ namespace Catch { class Text { public: - Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() ) - : attr( _attr ) - { - std::string wrappableChars = " [({.,/|\\-"; - std::size_t indent = _attr.initialIndent != std::string::npos - ? _attr.initialIndent - : _attr.indent; - std::string remainder = _str; - - while( !remainder.empty() ) { - assert( lines.size() < 1000 ); - std::size_t tabPos = std::string::npos; - std::size_t width = (std::min)( remainder.size(), _attr.width - indent ); - std::size_t pos = remainder.find_first_of( '\n' ); - if( pos <= width ) { - width = pos; - } - pos = remainder.find_last_of( _attr.tabChar, width ); - if( pos != std::string::npos ) { - tabPos = pos; - if( remainder[width] == '\n' ) - width--; - remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); - } - - if( width == remainder.size() ) { - spliceLine( indent, remainder, width ); - } - else if( remainder[width] == '\n' ) { - spliceLine( indent, remainder, width ); - if( width <= 1 || remainder.size() != 1 ) - remainder = remainder.substr( 1 ); - indent = _attr.indent; - } - else { - pos = remainder.find_last_of( wrappableChars, width ); - if( pos != std::string::npos ) { - spliceLine( indent, remainder, pos ); - if( remainder[0] == ' ' ) - remainder = remainder.substr( 1 ); - } - else { - spliceLine( indent, remainder, width-1 ); - lines.back() += "-"; - } - if( lines.size() == 1 ) - indent = _attr.indent; - if( tabPos != std::string::npos ) - indent += tabPos; - } - } - } - void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) { - lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) ); - _remainder = _remainder.substr( _pos ); - } + Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() ); + void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ); typedef std::vector::const_iterator const_iterator; @@ -98,21 +46,9 @@ namespace Catch { std::string const& last() const { return lines.back(); } std::size_t size() const { return lines.size(); } std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } + std::string toString() const; - friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { - for( Text::const_iterator it = _text.begin(), itEnd = _text.end(); - it != itEnd; ++it ) { - if( it != _text.begin() ) - _stream << "\n"; - _stream << *it; - } - return _stream; - } - std::string toString() const { - std::ostringstream oss; - oss << *this; - return oss.str(); - } + friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ); private: std::string str; diff --git a/include/internal/catch_text.hpp b/include/internal/catch_text.hpp new file mode 100644 index 00000000..bc502e8d --- /dev/null +++ b/include/internal/catch_text.hpp @@ -0,0 +1,92 @@ +/* + * Created by Phil on 20/4/2013. + * Copyright 2013 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_TEXT_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_TEXT_HPP_INCLUDED + +#include +#include + +namespace Catch { + + Text::Text( std::string const& _str, TextAttributes const& _attr ) + : attr( _attr ) + { + std::string wrappableChars = " [({.,/|\\-"; + std::size_t indent = _attr.initialIndent != std::string::npos + ? _attr.initialIndent + : _attr.indent; + std::string remainder = _str; + + while( !remainder.empty() ) { + assert( lines.size() < 1000 ); + std::size_t tabPos = std::string::npos; + std::size_t width = (std::min)( remainder.size(), _attr.width - indent ); + std::size_t pos = remainder.find_first_of( '\n' ); + if( pos <= width ) { + width = pos; + } + pos = remainder.find_last_of( _attr.tabChar, width ); + if( pos != std::string::npos ) { + tabPos = pos; + if( remainder[width] == '\n' ) + width--; + remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); + } + + if( width == remainder.size() ) { + spliceLine( indent, remainder, width ); + } + else if( remainder[width] == '\n' ) { + spliceLine( indent, remainder, width ); + if( width <= 1 || remainder.size() != 1 ) + remainder = remainder.substr( 1 ); + indent = _attr.indent; + } + else { + pos = remainder.find_last_of( wrappableChars, width ); + if( pos != std::string::npos && pos > 0 ) { + spliceLine( indent, remainder, pos ); + if( remainder[0] == ' ' ) + remainder = remainder.substr( 1 ); + } + else { + spliceLine( indent, remainder, width-1 ); + lines.back() += "-"; + } + if( lines.size() == 1 ) + indent = _attr.indent; + if( tabPos != std::string::npos ) + indent += tabPos; + } + } + } + + void Text::spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) { + lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) ); + _remainder = _remainder.substr( _pos ); + } + + std::string Text::toString() const { + std::ostringstream oss; + oss << *this; + return oss.str(); + } + + std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { + for( Text::const_iterator it = _text.begin(), itEnd = _text.end(); + it != itEnd; ++it ) { + if( it != _text.begin() ) + _stream << "\n"; + _stream << *it; + } + return _stream; + } + +} // end namespace Catch + +#endif // TWOBLUECUBES_CATCH_TEXT_HPP_INCLUDED diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 8326cc2f..99ba0bc3 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -203,7 +203,7 @@ namespace Catch { if( result.hasExpandedExpression() ) { stream << "with expansion:\n"; Colour colourGuard( Colour::ReconstructedExpression ); - stream << LineWrapper().setIndent(2).wrap( result.getExpandedExpression() ) << "\n"; + stream << Text( result.getExpandedExpression(), TextAttributes().setIndent(2) ) << "\n"; } } void printMessage() const { @@ -212,7 +212,7 @@ namespace Catch { for( std::vector::const_iterator it = messages.begin(), itEnd = messages.end(); it != itEnd; ++it ) { - stream << LineWrapper().setIndent(2).wrap( it->message ) << "\n"; + stream << Text( it->message, TextAttributes().setIndent(2) ) << "\n"; } } void printSourceInfo() const { @@ -313,10 +313,9 @@ namespace Catch { i+=2; else i = 0; - stream << LineWrapper() - .setIndent( indent+i) - .setInitialIndent( indent ) - .wrap( _string ) << "\n"; + stream << Text( _string, TextAttributes() + .setIndent( indent+i) + .setInitialIndent( indent ) ) << "\n"; } void printTotals( const Totals& totals ) { diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 167f1080..bfb9e47b 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -4,9 +4,9 @@ CatchSelfTest is a CATCH v0.9 b33 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- -ApproxTests.cpp:16 - ./succeeding/Approx/simple +------------------------------------------------------------------------------- +ApproxTests.cpp:16 ............................................................................... ApproxTests.cpp:20: @@ -46,9 +46,9 @@ with expansion: Approx( 1.23 ) != 1.24 ------------------------------------------------------------------------------- -ApproxTests.cpp:34 - ./succeeding/Approx/epsilon +------------------------------------------------------------------------------- +ApproxTests.cpp:34 ............................................................................... ApproxTests.cpp:38: @@ -64,9 +64,9 @@ with expansion: 1.23 == Approx( 1.231 ) ------------------------------------------------------------------------------- -ApproxTests.cpp:47 - ./succeeding/Approx/float +------------------------------------------------------------------------------- +ApproxTests.cpp:47 ............................................................................... ApproxTests.cpp:49: @@ -82,9 +82,9 @@ with expansion: 0 == Approx( 0 ) ------------------------------------------------------------------------------- -ApproxTests.cpp:58 - ./succeeding/Approx/int +------------------------------------------------------------------------------- +ApproxTests.cpp:58 ............................................................................... ApproxTests.cpp:60: @@ -96,9 +96,9 @@ PASSED: REQUIRE( 0 == Approx( 0 ) ) ------------------------------------------------------------------------------- -ApproxTests.cpp:69 - ./succeeding/Approx/mixed +------------------------------------------------------------------------------- +ApproxTests.cpp:69 ............................................................................... ApproxTests.cpp:75: @@ -132,9 +132,9 @@ with expansion: 1.234 == Approx( 1.234 ) ------------------------------------------------------------------------------- -ApproxTests.cpp:87 - ./succeeding/Approx/custom +------------------------------------------------------------------------------- +ApproxTests.cpp:87 ............................................................................... ApproxTests.cpp:93: @@ -186,9 +186,9 @@ with expansion: Approx( 1.23 ) != 1.25 ------------------------------------------------------------------------------- -ApproxTests.cpp:108 - Approximate PI +------------------------------------------------------------------------------- +ApproxTests.cpp:108 ............................................................................... ApproxTests.cpp:110: @@ -204,9 +204,9 @@ with expansion: 3.142857142857143 != Approx( 3.141 ) ------------------------------------------------------------------------------- -ClassTests.cpp:34 - ./succeeding/TestClass/succeedingCase +------------------------------------------------------------------------------- +ClassTests.cpp:34 ............................................................................... ClassTests.cpp:24: @@ -216,9 +216,9 @@ with expansion: "hello" == "hello" ------------------------------------------------------------------------------- -ClassTests.cpp:35 - ./failing/TestClass/failingCase +------------------------------------------------------------------------------- +ClassTests.cpp:35 ............................................................................... ClassTests.cpp:28: FAILED: @@ -227,9 +227,9 @@ with expansion: "hello" == "world" ------------------------------------------------------------------------------- -ClassTests.cpp:45 - ./succeeding/Fixture/succeedingCase +------------------------------------------------------------------------------- +ClassTests.cpp:45 ............................................................................... ClassTests.cpp:47: @@ -239,9 +239,9 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- -ClassTests.cpp:53 - ./failing/Fixture/failingCase +------------------------------------------------------------------------------- +ClassTests.cpp:53 ............................................................................... ClassTests.cpp:55: FAILED: @@ -250,9 +250,9 @@ with expansion: 1 == 2 ------------------------------------------------------------------------------- -ConditionTests.cpp:47 - ./succeeding/conditions/equality +------------------------------------------------------------------------------- +ConditionTests.cpp:47 ............................................................................... ConditionTests.cpp:55: @@ -298,9 +298,9 @@ with expansion: 1.3 == Approx( 1.3 ) ------------------------------------------------------------------------------- -ConditionTests.cpp:67 - ./failing/conditions/equality +------------------------------------------------------------------------------- +ConditionTests.cpp:67 ............................................................................... ConditionTests.cpp:71: FAILED: @@ -369,9 +369,9 @@ with expansion: 1.3 == Approx( 1.301 ) ------------------------------------------------------------------------------- -ConditionTests.cpp:89 - ./succeeding/conditions/inequality +------------------------------------------------------------------------------- +ConditionTests.cpp:89 ............................................................................... ConditionTests.cpp:93: @@ -441,9 +441,9 @@ with expansion: 5 != 6 ------------------------------------------------------------------------------- -ConditionTests.cpp:107 - ./failing/conditions/inequality +------------------------------------------------------------------------------- +ConditionTests.cpp:107 ............................................................................... ConditionTests.cpp:111: FAILED: @@ -472,9 +472,9 @@ with expansion: 5 != 5 ------------------------------------------------------------------------------- -ConditionTests.cpp:120 - ./succeeding/conditions/ordered +------------------------------------------------------------------------------- +ConditionTests.cpp:120 ............................................................................... ConditionTests.cpp:124: @@ -580,9 +580,9 @@ with expansion: "hello" > "a" ------------------------------------------------------------------------------- -ConditionTests.cpp:148 - ./failing/conditions/ordered +------------------------------------------------------------------------------- +ConditionTests.cpp:148 ............................................................................... ConditionTests.cpp:152: FAILED: @@ -681,9 +681,9 @@ with expansion: "hello" <= "a" ------------------------------------------------------------------------------- -ConditionTests.cpp:179 - ./succeeding/conditions/int literals +------------------------------------------------------------------------------- +ConditionTests.cpp:179 ............................................................................... ConditionTests.cpp:188: @@ -765,9 +765,9 @@ with expansion: 0x > 4 ------------------------------------------------------------------------------- -ConditionTests.cpp:218 - ./succeeding/conditions//long_to_unsigned_x +------------------------------------------------------------------------------- +ConditionTests.cpp:218 ............................................................................... ConditionTests.cpp:226: @@ -795,9 +795,9 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- -ConditionTests.cpp:233 - ./succeeding/conditions/const ints to int literal +------------------------------------------------------------------------------- +ConditionTests.cpp:233 ............................................................................... ConditionTests.cpp:240: @@ -825,9 +825,9 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- -ConditionTests.cpp:247 - ./succeeding/conditions/negative ints +------------------------------------------------------------------------------- +ConditionTests.cpp:247 ............................................................................... ConditionTests.cpp:249: @@ -867,9 +867,9 @@ with expansion: -2147483648 > 2 ------------------------------------------------------------------------------- -ConditionTests.cpp:270 - ./succeeding/conditions/computed ints +------------------------------------------------------------------------------- +ConditionTests.cpp:270 ............................................................................... ConditionTests.cpp:272: @@ -879,9 +879,9 @@ with expansion: 54 == 54 ------------------------------------------------------------------------------- -ConditionTests.cpp:283 - ./succeeding/conditions/ptr +------------------------------------------------------------------------------- +ConditionTests.cpp:283 ............................................................................... ConditionTests.cpp:288: @@ -933,9 +933,9 @@ with expansion: 0 != 0x ------------------------------------------------------------------------------- -ConditionTests.cpp:316 - ./succeeding/conditions/not +------------------------------------------------------------------------------- +ConditionTests.cpp:316 ............................................................................... ConditionTests.cpp:320: @@ -981,9 +981,9 @@ with expansion: !(1 == 2) ------------------------------------------------------------------------------- -ConditionTests.cpp:333 - ./failing/conditions/not +------------------------------------------------------------------------------- +ConditionTests.cpp:333 ............................................................................... ConditionTests.cpp:337: FAILED: @@ -1021,9 +1021,9 @@ with expansion: !(1 == 1) ------------------------------------------------------------------------------- -ExceptionTests.cpp:33 - ./succeeding/exceptions/explicit +------------------------------------------------------------------------------- +ExceptionTests.cpp:33 ............................................................................... ExceptionTests.cpp:35: @@ -1039,9 +1039,9 @@ PASSED: REQUIRE_THROWS( thisThrows() ) ------------------------------------------------------------------------------- -ExceptionTests.cpp:41 - ./failing/exceptions/explicit +------------------------------------------------------------------------------- +ExceptionTests.cpp:41 ............................................................................... ExceptionTests.cpp:43: FAILED: @@ -1059,9 +1059,9 @@ due to unexpected exception with message: expected exception ------------------------------------------------------------------------------- -ExceptionTests.cpp:48 - ./failing/exceptions/implicit +------------------------------------------------------------------------------- +ExceptionTests.cpp:48 ............................................................................... ExceptionTests.cpp:48: FAILED: @@ -1069,9 +1069,9 @@ due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- -ExceptionTests.cpp:54 - ./failing/exceptions/implicit/2 +------------------------------------------------------------------------------- +ExceptionTests.cpp:54 ............................................................................... ExceptionTests.cpp:56: @@ -1084,10 +1084,10 @@ due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- -ExceptionTests.cpp:62 - ./failing/exceptions/implicit/3 section name +------------------------------------------------------------------------------- +ExceptionTests.cpp:62 ............................................................................... ExceptionTests.cpp:62: FAILED: @@ -1095,18 +1095,18 @@ due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- -ExceptionTests.cpp:69 - ./succeeding/exceptions/implicit +------------------------------------------------------------------------------- +ExceptionTests.cpp:69 ............................................................................... No assertions in test case, './succeeding/exceptions/implicit' ------------------------------------------------------------------------------- -ExceptionTests.cpp:106 - ./failing/exceptions/custom +------------------------------------------------------------------------------- +ExceptionTests.cpp:106 ............................................................................... ExceptionTests.cpp:106: FAILED: @@ -1114,9 +1114,9 @@ due to unexpected exception with message: custom exception ------------------------------------------------------------------------------- -ExceptionTests.cpp:114 - ./failing/exceptions/custom/nothrow +------------------------------------------------------------------------------- +ExceptionTests.cpp:114 ............................................................................... ExceptionTests.cpp:116: FAILED: @@ -1125,9 +1125,9 @@ due to unexpected exception with message: unexpected custom exception ------------------------------------------------------------------------------- -ExceptionTests.cpp:119 - ./failing/exceptions/custom/throw +------------------------------------------------------------------------------- +ExceptionTests.cpp:119 ............................................................................... ExceptionTests.cpp:121: FAILED: @@ -1136,9 +1136,9 @@ due to unexpected exception with message: custom exception - not std ------------------------------------------------------------------------------- -ExceptionTests.cpp:125 - ./failing/exceptions/custom/double +------------------------------------------------------------------------------- +ExceptionTests.cpp:125 ............................................................................... ExceptionTests.cpp:125: FAILED: @@ -1146,9 +1146,9 @@ due to unexpected exception with message: 3.14 ------------------------------------------------------------------------------- -ExceptionTests.cpp:134 - ./succeeding/exceptions/notimplemented +------------------------------------------------------------------------------- +ExceptionTests.cpp:134 ............................................................................... ExceptionTests.cpp:136: @@ -1156,9 +1156,9 @@ PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) ------------------------------------------------------------------------------- -GeneratorTests.cpp:19 - ./succeeding/generators/1 +------------------------------------------------------------------------------- +GeneratorTests.cpp:19 ............................................................................... GeneratorTests.cpp:26: @@ -2026,9 +2026,9 @@ with expansion: 214 == 214 ------------------------------------------------------------------------------- -GeneratorTests.cpp:32 - ./succeeding/generators/2 +------------------------------------------------------------------------------- +GeneratorTests.cpp:32 ............................................................................... GeneratorTests.cpp:40: @@ -2044,9 +2044,9 @@ with expansion: 2 == 2 ------------------------------------------------------------------------------- -MessageTests.cpp:11 - ./succeeding/message +------------------------------------------------------------------------------- +MessageTests.cpp:11 ............................................................................... MessageTests.cpp:14: @@ -2058,9 +2058,9 @@ warning: No assertions in test case, './succeeding/message' ------------------------------------------------------------------------------- -MessageTests.cpp:16 - ./succeeding/succeed +------------------------------------------------------------------------------- +MessageTests.cpp:16 ............................................................................... MessageTests.cpp:18: @@ -2069,9 +2069,9 @@ with message: this is a success ------------------------------------------------------------------------------- -MessageTests.cpp:21 - ./failing/message/info/1 +------------------------------------------------------------------------------- +MessageTests.cpp:21 ............................................................................... MessageTests.cpp:26: FAILED: @@ -2083,9 +2083,9 @@ with messages: so should this ------------------------------------------------------------------------------- -MessageTests.cpp:29 - ./mixed/message/info/2 +------------------------------------------------------------------------------- +MessageTests.cpp:29 ............................................................................... MessageTests.cpp:33: @@ -2119,9 +2119,9 @@ with message: but not this ------------------------------------------------------------------------------- -MessageTests.cpp:48 - ./failing/message/fail +------------------------------------------------------------------------------- +MessageTests.cpp:48 ............................................................................... MessageTests.cpp:51: FAILED: @@ -2129,10 +2129,10 @@ explicitly with message: This is a failure ------------------------------------------------------------------------------- -MessageTests.cpp:56 - ./failing/message/sections one +------------------------------------------------------------------------------- +MessageTests.cpp:56 ............................................................................... MessageTests.cpp:58: FAILED: @@ -2140,10 +2140,10 @@ explicitly with message: Message from section one ------------------------------------------------------------------------------- -MessageTests.cpp:61 - ./failing/message/sections two +------------------------------------------------------------------------------- +MessageTests.cpp:61 ............................................................................... MessageTests.cpp:63: FAILED: @@ -2152,10 +2152,10 @@ explicitly with message: Message from section one ------------------------------------------------------------------------------- -MessageTests.cpp:69 - ./succeeding/message/sections/stdout one +------------------------------------------------------------------------------- +MessageTests.cpp:69 ............................................................................... @@ -2163,19 +2163,19 @@ No assertions in section, 'one' Message from section two ------------------------------------------------------------------------------- -MessageTests.cpp:74 - ./succeeding/message/sections/stdout two +------------------------------------------------------------------------------- +MessageTests.cpp:74 ............................................................................... No assertions in section, 'two' ------------------------------------------------------------------------------- -MessageTests.cpp:80 - ./mixed/message/scoped +------------------------------------------------------------------------------- +MessageTests.cpp:80 ............................................................................... MessageTests.cpp:86: @@ -2277,9 +2277,9 @@ with messages: i := 10 ------------------------------------------------------------------------------- -MessageTests.cpp:90 - ./succeeding/nofail +------------------------------------------------------------------------------- +MessageTests.cpp:90 ............................................................................... MessageTests.cpp:92: @@ -2290,18 +2290,18 @@ FAILED - but was ok: No assertions in test case, './succeeding/nofail' ------------------------------------------------------------------------------- -MessageTests.cpp:95 - just info +------------------------------------------------------------------------------- +MessageTests.cpp:95 ............................................................................... No assertions in test case, 'just info' ------------------------------------------------------------------------------- -MessageTests.cpp:99 - just failure +------------------------------------------------------------------------------- +MessageTests.cpp:99 ............................................................................... MessageTests.cpp:101: FAILED: @@ -2309,10 +2309,10 @@ explicitly with message: Previous info should not be seen ------------------------------------------------------------------------------- -MiscTests.cpp:19 - ./succeeding/Misc/Sections s1 +------------------------------------------------------------------------------- +MiscTests.cpp:19 ............................................................................... MiscTests.cpp:21: @@ -2328,10 +2328,10 @@ with expansion: 2 != 1 ------------------------------------------------------------------------------- -MiscTests.cpp:25 - ./succeeding/Misc/Sections s2 +------------------------------------------------------------------------------- +MiscTests.cpp:25 ............................................................................... MiscTests.cpp:27: @@ -2341,10 +2341,10 @@ with expansion: 1 != 2 ------------------------------------------------------------------------------- -MiscTests.cpp:36 - ./succeeding/Misc/Sections/nested s1 +------------------------------------------------------------------------------- +MiscTests.cpp:36 ............................................................................... MiscTests.cpp:38: @@ -2360,11 +2360,11 @@ with expansion: 2 != 1 ------------------------------------------------------------------------------- -MiscTests.cpp:41 - ./succeeding/Misc/Sections/nested s1 s2 +------------------------------------------------------------------------------- +MiscTests.cpp:41 ............................................................................... MiscTests.cpp:43: @@ -2374,11 +2374,11 @@ with expansion: 1 != 2 ------------------------------------------------------------------------------- -MiscTests.cpp:55 - ./mixed/Misc/Sections/nested2 s1 s2 +------------------------------------------------------------------------------- +MiscTests.cpp:55 ............................................................................... MiscTests.cpp:57: FAILED: @@ -2387,11 +2387,11 @@ with expansion: 1 == 2 ------------------------------------------------------------------------------- -MiscTests.cpp:60 - ./mixed/Misc/Sections/nested2 s1 s3 +------------------------------------------------------------------------------- +MiscTests.cpp:60 ............................................................................... MiscTests.cpp:62: @@ -2401,11 +2401,11 @@ with expansion: 1 != 2 ------------------------------------------------------------------------------- -MiscTests.cpp:64 - ./mixed/Misc/Sections/nested2 s1 s4 +------------------------------------------------------------------------------- +MiscTests.cpp:64 ............................................................................... MiscTests.cpp:66: @@ -2415,42 +2415,42 @@ with expansion: 1 < 2 ------------------------------------------------------------------------------- -MiscTests.cpp:75 - ./Sections/nested/a/b c d (leaf) +------------------------------------------------------------------------------- +MiscTests.cpp:75 ............................................................................... No assertions in section, 'd (leaf)' ------------------------------------------------------------------------------- -MiscTests.cpp:79 - ./Sections/nested/a/b c e (leaf) +------------------------------------------------------------------------------- +MiscTests.cpp:79 ............................................................................... No assertions in section, 'e (leaf)' ------------------------------------------------------------------------------- -MiscTests.cpp:84 - ./Sections/nested/a/b f (leaf) +------------------------------------------------------------------------------- +MiscTests.cpp:84 ............................................................................... No assertions in section, 'f (leaf)' ------------------------------------------------------------------------------- -MiscTests.cpp:97 - ./mixed/Misc/Sections/loops s1 +------------------------------------------------------------------------------- +MiscTests.cpp:97 ............................................................................... MiscTests.cpp:99: FAILED: @@ -2459,9 +2459,9 @@ with expansion: 0 > 1 ------------------------------------------------------------------------------- -MiscTests.cpp:104 - ./mixed/Misc/loops +------------------------------------------------------------------------------- +MiscTests.cpp:104 ............................................................................... MiscTests.cpp:111: FAILED: @@ -2525,18 +2525,18 @@ with message: Some information An error ------------------------------------------------------------------------------- -MiscTests.cpp:115 - ./succeeding/Misc/stdout,stderr +------------------------------------------------------------------------------- +MiscTests.cpp:115 ............................................................................... No assertions in test case, './succeeding/Misc/stdout,stderr' ------------------------------------------------------------------------------- -MiscTests.cpp:127 - ./succeeding/Misc/null strings +------------------------------------------------------------------------------- +MiscTests.cpp:127 ............................................................................... MiscTests.cpp:129: @@ -2552,9 +2552,9 @@ with expansion: {null string} == {null string} ------------------------------------------------------------------------------- -MiscTests.cpp:133 - ./failing/info +------------------------------------------------------------------------------- +MiscTests.cpp:133 ............................................................................... MiscTests.cpp:138: FAILED: @@ -2564,9 +2564,9 @@ with messages: i := 7 ------------------------------------------------------------------------------- -MiscTests.cpp:149 - ./succeeding/checkedif +------------------------------------------------------------------------------- +MiscTests.cpp:149 ............................................................................... MiscTests.cpp:143: @@ -2582,9 +2582,9 @@ with expansion: true ------------------------------------------------------------------------------- -MiscTests.cpp:154 - ./failing/checkedif +------------------------------------------------------------------------------- +MiscTests.cpp:154 ............................................................................... MiscTests.cpp:143: FAILED: @@ -2598,9 +2598,9 @@ with expansion: false ------------------------------------------------------------------------------- -MiscTests.cpp:167 - ./succeeding/checkedelse +------------------------------------------------------------------------------- +MiscTests.cpp:167 ............................................................................... MiscTests.cpp:161: @@ -2616,9 +2616,9 @@ with expansion: true ------------------------------------------------------------------------------- -MiscTests.cpp:172 - ./failing/checkedelse +------------------------------------------------------------------------------- +MiscTests.cpp:172 ............................................................................... MiscTests.cpp:161: FAILED: @@ -2632,29 +2632,29 @@ with expansion: false ------------------------------------------------------------------------------- -MiscTests.cpp:179 - ./misc/xmlentitycheck embedded xml +------------------------------------------------------------------------------- +MiscTests.cpp:179 ............................................................................... No assertions in section, 'embedded xml' ------------------------------------------------------------------------------- -MiscTests.cpp:183 - ./misc/xmlentitycheck encoded chars +------------------------------------------------------------------------------- +MiscTests.cpp:183 ............................................................................... No assertions in section, 'encoded chars' ------------------------------------------------------------------------------- -MiscTests.cpp:189 - ./manual/onechar +------------------------------------------------------------------------------- +MiscTests.cpp:189 ............................................................................... MiscTests.cpp:192: FAILED: @@ -2663,9 +2663,9 @@ with message: 3 ------------------------------------------------------------------------------- -MiscTests.cpp:195 - ./succeeding/atomic if +------------------------------------------------------------------------------- +MiscTests.cpp:195 ............................................................................... MiscTests.cpp:202: @@ -2675,9 +2675,9 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -MiscTests.cpp:210 - ./succeeding/matchers +------------------------------------------------------------------------------- +MiscTests.cpp:210 ............................................................................... MiscTests.cpp:212: @@ -2705,9 +2705,9 @@ with expansion: "this string contains 'abc' as a substring" ends with: "substring" ------------------------------------------------------------------------------- -MiscTests.cpp:219 - ./failing/matchers/Contains +------------------------------------------------------------------------------- +MiscTests.cpp:219 ............................................................................... MiscTests.cpp:221: FAILED: @@ -2716,9 +2716,9 @@ with expansion: "this string contains 'abc' as a substring" contains: "not there" ------------------------------------------------------------------------------- -MiscTests.cpp:224 - ./failing/matchers/StartsWith +------------------------------------------------------------------------------- +MiscTests.cpp:224 ............................................................................... MiscTests.cpp:226: FAILED: @@ -2727,9 +2727,9 @@ with expansion: "this string contains 'abc' as a substring" starts with: "string" ------------------------------------------------------------------------------- -MiscTests.cpp:229 - ./failing/matchers/EndsWith +------------------------------------------------------------------------------- +MiscTests.cpp:229 ............................................................................... MiscTests.cpp:231: FAILED: @@ -2738,9 +2738,9 @@ with expansion: "this string contains 'abc' as a substring" ends with: "this" ------------------------------------------------------------------------------- -MiscTests.cpp:234 - ./failing/matchers/Equals +------------------------------------------------------------------------------- +MiscTests.cpp:234 ............................................................................... MiscTests.cpp:236: FAILED: @@ -2749,9 +2749,9 @@ with expansion: "this string contains 'abc' as a substring" equals: "something else" ------------------------------------------------------------------------------- -MiscTests.cpp:242 - ./succeeding/matchers/AllOf +------------------------------------------------------------------------------- +MiscTests.cpp:242 ............................................................................... MiscTests.cpp:244: @@ -2762,17 +2762,17 @@ with expansion: contains: "abc" ) ------------------------------------------------------------------------------- -MiscTests.cpp:246 - ./succeeding/matchers/AnyOf +------------------------------------------------------------------------------- +MiscTests.cpp:246 ............................................................................... MiscTests.cpp:248: PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) ) with expansion: - "this string contains 'abc' as a substring" ( contains: "string" or - contains: "not there" ) + "this string contains 'abc' as a substring" ( contains: "string" or contains: + "not there" ) MiscTests.cpp:249: PASSED: @@ -2782,9 +2782,9 @@ with expansion: contains: "string" ) ------------------------------------------------------------------------------- -MiscTests.cpp:252 - ./succeeding/matchers/Equals +------------------------------------------------------------------------------- +MiscTests.cpp:252 ............................................................................... MiscTests.cpp:254: @@ -2795,9 +2795,9 @@ with expansion: 'abc' as a substring" ------------------------------------------------------------------------------- -MiscTests.cpp:263 - example/factorial +------------------------------------------------------------------------------- +MiscTests.cpp:263 ............................................................................... MiscTests.cpp:265: @@ -2831,18 +2831,18 @@ with expansion: 0x == 3628800 ------------------------------------------------------------------------------- -MiscTests.cpp:272 - empty +------------------------------------------------------------------------------- +MiscTests.cpp:272 ............................................................................... No assertions in test case, 'empty' ------------------------------------------------------------------------------- -MiscTests.cpp:276 - Nice descriptive name +------------------------------------------------------------------------------- +MiscTests.cpp:276 ............................................................................... MiscTests.cpp:278: @@ -2853,27 +2853,27 @@ warning: No assertions in test case, 'Nice descriptive name' ------------------------------------------------------------------------------- -MiscTests.cpp:280 - first tag +------------------------------------------------------------------------------- +MiscTests.cpp:280 ............................................................................... No assertions in test case, 'first tag' ------------------------------------------------------------------------------- -MiscTests.cpp:283 - second tag +------------------------------------------------------------------------------- +MiscTests.cpp:283 ............................................................................... No assertions in test case, 'second tag' ------------------------------------------------------------------------------- -MiscTests.cpp:296 - vectors can be sized and resized +------------------------------------------------------------------------------- +MiscTests.cpp:296 ............................................................................... MiscTests.cpp:300: @@ -2889,10 +2889,10 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -MiscTests.cpp:303 - vectors can be sized and resized resizing bigger changes size and capacity +------------------------------------------------------------------------------- +MiscTests.cpp:303 ............................................................................... MiscTests.cpp:306: @@ -2908,9 +2908,9 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- -MiscTests.cpp:296 - vectors can be sized and resized +------------------------------------------------------------------------------- +MiscTests.cpp:296 ............................................................................... MiscTests.cpp:300: @@ -2926,10 +2926,10 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -MiscTests.cpp:309 - vectors can be sized and resized resizing smaller changes size but not capacity +------------------------------------------------------------------------------- +MiscTests.cpp:309 ............................................................................... MiscTests.cpp:312: @@ -2945,11 +2945,11 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -MiscTests.cpp:315 - vectors can be sized and resized resizing smaller changes size but not capacity We can use the 'swap trick' to reset the capacity +------------------------------------------------------------------------------- +MiscTests.cpp:315 ............................................................................... MiscTests.cpp:319: @@ -2959,9 +2959,9 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -MiscTests.cpp:296 - vectors can be sized and resized +------------------------------------------------------------------------------- +MiscTests.cpp:296 ............................................................................... MiscTests.cpp:300: @@ -2977,10 +2977,10 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -MiscTests.cpp:309 - vectors can be sized and resized resizing smaller changes size but not capacity +------------------------------------------------------------------------------- +MiscTests.cpp:309 ............................................................................... MiscTests.cpp:312: @@ -2996,9 +2996,9 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -MiscTests.cpp:296 - vectors can be sized and resized +------------------------------------------------------------------------------- +MiscTests.cpp:296 ............................................................................... MiscTests.cpp:300: @@ -3014,10 +3014,10 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -MiscTests.cpp:322 - vectors can be sized and resized reserving bigger changes capacity but not size +------------------------------------------------------------------------------- +MiscTests.cpp:322 ............................................................................... MiscTests.cpp:325: @@ -3033,9 +3033,9 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- -MiscTests.cpp:296 - vectors can be sized and resized +------------------------------------------------------------------------------- +MiscTests.cpp:296 ............................................................................... MiscTests.cpp:300: @@ -3051,10 +3051,10 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -MiscTests.cpp:328 - vectors can be sized and resized reserving smaller does not change size or capacity +------------------------------------------------------------------------------- +MiscTests.cpp:328 ............................................................................... MiscTests.cpp:331: @@ -3070,11 +3070,11 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TestMain.cpp:23 - selftest/main selftest/expected result selftest/expected result/failing tests +------------------------------------------------------------------------------- +TestMain.cpp:23 ............................................................................... catch_self_test.hpp:120: @@ -3208,11 +3208,11 @@ with message: Tests failed, as expected ------------------------------------------------------------------------------- -TestMain.cpp:28 - selftest/main selftest/expected result selftest/expected result/succeeding tests +------------------------------------------------------------------------------- +TestMain.cpp:28 ............................................................................... catch_self_test.hpp:109: @@ -3454,11 +3454,11 @@ Message from section two Some information An error ------------------------------------------------------------------------------- -TestMain.cpp:39 - selftest/main selftest/test counts selftest/test counts/succeeding tests +------------------------------------------------------------------------------- +TestMain.cpp:39 ............................................................................... TestMain.cpp:41: @@ -3474,11 +3474,11 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -TestMain.cpp:46 - selftest/main selftest/test counts selftest/test counts/failing tests +------------------------------------------------------------------------------- +TestMain.cpp:46 ............................................................................... TestMain.cpp:48: @@ -3494,9 +3494,9 @@ with expansion: 73 == 73 ------------------------------------------------------------------------------- -TestMain.cpp:54 - meta/Misc/Sections +------------------------------------------------------------------------------- +TestMain.cpp:54 ............................................................................... TestMain.cpp:58: @@ -3512,10 +3512,10 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- -TestMain.cpp:96 - selftest/parser/2 default +------------------------------------------------------------------------------- +TestMain.cpp:96 ............................................................................... TestMain.cpp:98: @@ -3547,11 +3547,11 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:107 - selftest/parser/2 test lists -t/1 +------------------------------------------------------------------------------- +TestMain.cpp:107 ............................................................................... TestMain.cpp:109: @@ -3577,11 +3577,11 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:115 - selftest/parser/2 test lists -t/exclude:1 +------------------------------------------------------------------------------- +TestMain.cpp:115 ............................................................................... TestMain.cpp:117: @@ -3607,11 +3607,11 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:124 - selftest/parser/2 test lists --test/1 +------------------------------------------------------------------------------- +TestMain.cpp:124 ............................................................................... TestMain.cpp:126: @@ -3637,11 +3637,11 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:133 - selftest/parser/2 test lists --test/exclude:1 +------------------------------------------------------------------------------- +TestMain.cpp:133 ............................................................................... TestMain.cpp:135: @@ -3667,11 +3667,11 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:142 - selftest/parser/2 test lists --test/exclude:2 +------------------------------------------------------------------------------- +TestMain.cpp:142 ............................................................................... TestMain.cpp:144: @@ -3697,11 +3697,11 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:151 - selftest/parser/2 test lists -t/2 +------------------------------------------------------------------------------- +TestMain.cpp:151 ............................................................................... TestMain.cpp:153: @@ -3733,11 +3733,11 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:161 - selftest/parser/2 test lists -t/0 +------------------------------------------------------------------------------- +TestMain.cpp:161 ............................................................................... TestMain.cpp:163: @@ -3748,11 +3748,11 @@ with expansion: least 1" ------------------------------------------------------------------------------- -TestMain.cpp:168 - selftest/parser/2 reporter -r/console +------------------------------------------------------------------------------- +TestMain.cpp:168 ............................................................................... TestMain.cpp:170: @@ -3766,11 +3766,11 @@ with expansion: "console" == "console" ------------------------------------------------------------------------------- -TestMain.cpp:174 - selftest/parser/2 reporter -r/xml +------------------------------------------------------------------------------- +TestMain.cpp:174 ............................................................................... TestMain.cpp:176: @@ -3784,11 +3784,11 @@ with expansion: "xml" == "xml" ------------------------------------------------------------------------------- -TestMain.cpp:180 - selftest/parser/2 reporter --reporter/junit +------------------------------------------------------------------------------- +TestMain.cpp:180 ............................................................................... TestMain.cpp:182: @@ -3802,26 +3802,26 @@ with expansion: "junit" == "junit" ------------------------------------------------------------------------------- -TestMain.cpp:186 - selftest/parser/2 reporter -r/error +------------------------------------------------------------------------------- +TestMain.cpp:186 ............................................................................... TestMain.cpp:188: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) ) with expansion: - "Error while parsing arguments. Expected 1 argument. Arguments were: one - two" contains: "1 argument" + "Error while parsing arguments. Expected 1 argument. Arguments were: one two" + contains: "1 argument" ------------------------------------------------------------------------------- -TestMain.cpp:193 - selftest/parser/2 debugger -b +------------------------------------------------------------------------------- +TestMain.cpp:193 ............................................................................... TestMain.cpp:195: @@ -3835,11 +3835,11 @@ with expansion: true == true ------------------------------------------------------------------------------- -TestMain.cpp:199 - selftest/parser/2 debugger --break +------------------------------------------------------------------------------- +TestMain.cpp:199 ............................................................................... TestMain.cpp:201: @@ -3853,11 +3853,11 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:205 - selftest/parser/2 debugger -b +------------------------------------------------------------------------------- +TestMain.cpp:205 ............................................................................... TestMain.cpp:207: @@ -3868,11 +3868,11 @@ with expansion: unexpected" contains: "0 arguments" ------------------------------------------------------------------------------- -TestMain.cpp:212 - selftest/parser/2 abort -a +------------------------------------------------------------------------------- +TestMain.cpp:212 ............................................................................... TestMain.cpp:214: @@ -3886,11 +3886,11 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- -TestMain.cpp:218 - selftest/parser/2 abort -a/2 +------------------------------------------------------------------------------- +TestMain.cpp:218 ............................................................................... TestMain.cpp:220: @@ -3904,41 +3904,41 @@ with expansion: 2 == 2 ------------------------------------------------------------------------------- -TestMain.cpp:224 - selftest/parser/2 abort -a/error/0 +------------------------------------------------------------------------------- +TestMain.cpp:224 ............................................................................... TestMain.cpp:226: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: - "Error while parsing arguments. threshold must be a number greater than zero - . Arguments were: 0" contains: "greater than zero" + "Error while parsing arguments. threshold must be a number greater than zero. + Arguments were: 0" contains: "greater than zero" ------------------------------------------------------------------------------- -TestMain.cpp:228 - selftest/parser/2 abort -a/error/non numeric +------------------------------------------------------------------------------- +TestMain.cpp:228 ............................................................................... TestMain.cpp:230: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: - "Error while parsing arguments. threshold must be a number greater than zero - . Arguments were: oops" contains: "greater than zero" + "Error while parsing arguments. threshold must be a number greater than zero. + Arguments were: oops" contains: "greater than zero" ------------------------------------------------------------------------------- -TestMain.cpp:232 - selftest/parser/2 abort -a/error/two args +------------------------------------------------------------------------------- +TestMain.cpp:232 ............................................................................... TestMain.cpp:234: @@ -3949,11 +3949,11 @@ with expansion: were: 1 2" contains: "0 and 1 argument" ------------------------------------------------------------------------------- -TestMain.cpp:239 - selftest/parser/2 nothrow -nt +------------------------------------------------------------------------------- +TestMain.cpp:239 ............................................................................... TestMain.cpp:241: @@ -3967,11 +3967,11 @@ with expansion: false == false ------------------------------------------------------------------------------- -TestMain.cpp:245 - selftest/parser/2 nothrow --nothrow +------------------------------------------------------------------------------- +TestMain.cpp:245 ............................................................................... TestMain.cpp:247: @@ -3985,11 +3985,11 @@ with expansion: false == false ------------------------------------------------------------------------------- -TestMain.cpp:254 - selftest/parser/2 streams -o filename +------------------------------------------------------------------------------- +TestMain.cpp:254 ............................................................................... TestMain.cpp:256: @@ -4009,11 +4009,11 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:261 - selftest/parser/2 streams -o %stdout +------------------------------------------------------------------------------- +TestMain.cpp:261 ............................................................................... TestMain.cpp:263: @@ -4033,11 +4033,11 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:268 - selftest/parser/2 streams --out +------------------------------------------------------------------------------- +TestMain.cpp:268 ............................................................................... TestMain.cpp:270: @@ -4051,11 +4051,11 @@ with expansion: "filename.ext" == "filename.ext" ------------------------------------------------------------------------------- -TestMain.cpp:277 - selftest/parser/2 combinations -a -b +------------------------------------------------------------------------------- +TestMain.cpp:277 ............................................................................... TestMain.cpp:279: @@ -4081,9 +4081,9 @@ with expansion: false == false ------------------------------------------------------------------------------- -TestMain.cpp:288 - selftest/test filter +------------------------------------------------------------------------------- +TestMain.cpp:288 ............................................................................... TestMain.cpp:292: @@ -4123,9 +4123,9 @@ with expansion: false == false ------------------------------------------------------------------------------- -TestMain.cpp:305 - selftest/test filters +------------------------------------------------------------------------------- +TestMain.cpp:305 ............................................................................... TestMain.cpp:313: @@ -4153,9 +4153,9 @@ with expansion: false == false ------------------------------------------------------------------------------- -TestMain.cpp:320 - selftest/filter/prefix wildcard +------------------------------------------------------------------------------- +TestMain.cpp:320 ............................................................................... TestMain.cpp:323: @@ -4171,9 +4171,9 @@ with expansion: false == false ------------------------------------------------------------------------------- -TestMain.cpp:326 - selftest/filter/wildcard at both ends +------------------------------------------------------------------------------- +TestMain.cpp:326 ............................................................................... TestMain.cpp:329: @@ -4201,9 +4201,9 @@ with expansion: false == false ------------------------------------------------------------------------------- -TestMain.cpp:341 - selftest/option parsers +------------------------------------------------------------------------------- +TestMain.cpp:341 ............................................................................... TestMain.cpp:352: @@ -4229,10 +4229,10 @@ with expansion: true ------------------------------------------------------------------------------- -TestMain.cpp:367 - selftest/tags one tag +------------------------------------------------------------------------------- +TestMain.cpp:367 ............................................................................... TestMain.cpp:370: @@ -4284,10 +4284,10 @@ with expansion: false == false ------------------------------------------------------------------------------- -TestMain.cpp:381 - selftest/tags two tags +------------------------------------------------------------------------------- +TestMain.cpp:381 ............................................................................... TestMain.cpp:384: @@ -4357,10 +4357,10 @@ with expansion: true == true ------------------------------------------------------------------------------- -TestMain.cpp:398 - selftest/tags one tag with characters either side +------------------------------------------------------------------------------- +TestMain.cpp:398 ............................................................................... TestMain.cpp:401: @@ -4388,10 +4388,10 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- -TestMain.cpp:407 - selftest/tags start of a tag, but not closed +------------------------------------------------------------------------------- +TestMain.cpp:407 ............................................................................... TestMain.cpp:411: @@ -4413,10 +4413,10 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -TestMain.cpp:416 - selftest/tags hidden +------------------------------------------------------------------------------- +TestMain.cpp:416 ............................................................................... TestMain.cpp:419: @@ -4444,50 +4444,40 @@ with expansion: false == false ------------------------------------------------------------------------------- -TestMain.cpp:434 - Long strings can be wrapped plain string No wrapping +------------------------------------------------------------------------------- +TestMain.cpp:435 ............................................................................... -TestMain.cpp:435: +TestMain.cpp:436: PASSED: - CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ) + CHECK( Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString ) with expansion: "one two three four" == "one two three four" -TestMain.cpp:436: +TestMain.cpp:437: PASSED: - CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ) + CHECK( Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString ) with expansion: "one two three four" == "one two three four" ------------------------------------------------------------------------------- -TestMain.cpp:438 - Long strings can be wrapped plain string Wrapped once +------------------------------------------------------------------------------- +TestMain.cpp:439 ............................................................................... -TestMain.cpp:439: -PASSED: - CHECK( Catch::LineWrapper().setRight( 17 ).wrap( testString ).toString() == "one two three\nfour" ) -with expansion: - "one two three - four" - == - "one two three - four" - TestMain.cpp:440: PASSED: - CHECK( Catch::LineWrapper().setRight( 16 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4497,7 +4487,7 @@ with expansion: TestMain.cpp:441: PASSED: - CHECK( Catch::LineWrapper().setRight( 15 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4507,7 +4497,7 @@ with expansion: TestMain.cpp:442: PASSED: - CHECK( Catch::LineWrapper().setRight( 14 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4517,7 +4507,17 @@ with expansion: TestMain.cpp:443: PASSED: - CHECK( Catch::LineWrapper().setRight( 13 ).wrap( testString ).toString() == "one two\nthree four" ) + CHECK( Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" ) +with expansion: + "one two three + four" + == + "one two three + four" + +TestMain.cpp:444: +PASSED: + CHECK( Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" ) with expansion: "one two three four" @@ -4526,28 +4526,40 @@ with expansion: three four" ------------------------------------------------------------------------------- -TestMain.cpp:445 - Long strings can be wrapped plain string Wrapped twice +------------------------------------------------------------------------------- +TestMain.cpp:446 ............................................................................... -TestMain.cpp:446: -PASSED: - CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) -with expansion: - "one two - three - four" - == - "one two - three - four" - TestMain.cpp:447: PASSED: - CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" ) +with expansion: + "one two + three + four" + == + "one two + three + four" + +TestMain.cpp:448: +PASSED: + CHECK( Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" ) +with expansion: + "one two + three + four" + == + "one two + three + four" + +TestMain.cpp:449: +PASSED: + CHECK( Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4558,16 +4570,16 @@ with expansion: four" ------------------------------------------------------------------------------- -TestMain.cpp:449 - Long strings can be wrapped plain string Wrapped three times +------------------------------------------------------------------------------- +TestMain.cpp:451 ............................................................................... -TestMain.cpp:450: +TestMain.cpp:452: PASSED: - CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) + CHECK( Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4579,9 +4591,9 @@ with expansion: three four" -TestMain.cpp:451: +TestMain.cpp:453: PASSED: - CHECK( Catch::LineWrapper().setRight( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) + CHECK( Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4594,48 +4606,48 @@ with expansion: four" ------------------------------------------------------------------------------- -TestMain.cpp:453 - Long strings can be wrapped plain string Short wrap +------------------------------------------------------------------------------- +TestMain.cpp:455 ............................................................................... -TestMain.cpp:454: -PASSED: - CHECK( Catch::LineWrapper().setRight( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" ) -with expansion: - "abc- - def" - == - "abc- - def" - -TestMain.cpp:455: -PASSED: - CHECK( Catch::LineWrapper().setRight( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" ) -with expansion: - "abc- - defg" - == - "abc- - defg" - TestMain.cpp:456: PASSED: - CHECK( Catch::LineWrapper().setRight( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" ) + CHECK( Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" ) with expansion: "abc- - def- - gh" + def" == "abc- - def- - gh" + def" + +TestMain.cpp:457: +PASSED: + CHECK( Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" ) +with expansion: + "abc- + defg" + == + "abc- + defg" TestMain.cpp:458: PASSED: - CHECK( Catch::LineWrapper().setRight( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" ) + CHECK( Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" ) +with expansion: + "abc- + def- + gh" + == + "abc- + def- + gh" + +TestMain.cpp:460: +PASSED: + CHECK( Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" ) with expansion: "one two @@ -4649,9 +4661,9 @@ with expansion: ee four" -TestMain.cpp:459: +TestMain.cpp:461: PASSED: - CHECK( Catch::LineWrapper().setRight( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ) + CHECK( Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ) with expansion: "one two @@ -4668,54 +4680,54 @@ with expansion: ur" ------------------------------------------------------------------------------- -TestMain.cpp:461 - Long strings can be wrapped plain string As container +------------------------------------------------------------------------------- +TestMain.cpp:463 ............................................................................... -TestMain.cpp:464: -PASSED: - CHECK( wrapper.size() == 4 ) -with expansion: - 4 == 4 - TestMain.cpp:465: PASSED: - CHECK( wrapper[0] == "one" ) + REQUIRE( text.size() == 4 ) with expansion: - "one" == "one" + 4 == 4 TestMain.cpp:466: PASSED: - CHECK( wrapper[1] == "two" ) + CHECK( text[0] == "one" ) with expansion: - "two" == "two" + "one" == "one" TestMain.cpp:467: PASSED: - CHECK( wrapper[2] == "three" ) + CHECK( text[1] == "two" ) with expansion: - "three" == "three" + "two" == "two" TestMain.cpp:468: PASSED: - CHECK( wrapper[3] == "four" ) + CHECK( text[2] == "three" ) +with expansion: + "three" == "three" + +TestMain.cpp:469: +PASSED: + CHECK( text[3] == "four" ) with expansion: "four" == "four" ------------------------------------------------------------------------------- -TestMain.cpp:470 - Long strings can be wrapped plain string Indent first line differently +------------------------------------------------------------------------------- +TestMain.cpp:471 ............................................................................... -TestMain.cpp:475: +TestMain.cpp:476: PASSED: - CHECK( Catch::LineWrapper() .setRight( 10 ) .setIndent( 4 ) .setInitialIndent( 1 ) .wrap( testString ).toString() == " one two\n three\n four" ) + CHECK( text.toString() == " one two\n three\n four" ) with expansion: " one two three @@ -4726,26 +4738,16 @@ with expansion: four" ------------------------------------------------------------------------------- -TestMain.cpp:485 - Long strings can be wrapped With newlines No wrapping +------------------------------------------------------------------------------- +TestMain.cpp:486 ............................................................................... -TestMain.cpp:486: -PASSED: - CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ) -with expansion: - "one two - three four" - == - "one two - three four" - TestMain.cpp:487: PASSED: - CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ) + CHECK( Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString ) with expansion: "one two three four" @@ -4755,7 +4757,17 @@ with expansion: TestMain.cpp:488: PASSED: - CHECK( Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString ) + CHECK( Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString ) +with expansion: + "one two + three four" + == + "one two + three four" + +TestMain.cpp:489: +PASSED: + CHECK( Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString ) with expansion: "one two three four" @@ -4764,16 +4776,16 @@ with expansion: three four" ------------------------------------------------------------------------------- -TestMain.cpp:490 - Long strings can be wrapped With newlines Trailing newline +------------------------------------------------------------------------------- +TestMain.cpp:491 ............................................................................... -TestMain.cpp:491: +TestMain.cpp:492: PASSED: - CHECK( Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) + CHECK( Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" ) with expansion: "abcdef " @@ -4781,15 +4793,15 @@ with expansion: "abcdef " -TestMain.cpp:492: +TestMain.cpp:493: PASSED: - CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" ) + CHECK( Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" ) with expansion: "abcdef" == "abcdef" -TestMain.cpp:493: +TestMain.cpp:494: PASSED: - CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) + CHECK( Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" ) with expansion: "abcdef " @@ -4798,28 +4810,16 @@ with expansion: " ------------------------------------------------------------------------------- -TestMain.cpp:495 - Long strings can be wrapped With newlines Wrapped once +------------------------------------------------------------------------------- +TestMain.cpp:496 ............................................................................... -TestMain.cpp:496: -PASSED: - CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) -with expansion: - "one two - three - four" - == - "one two - three - four" - TestMain.cpp:497: PASSED: - CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4831,7 +4831,19 @@ with expansion: TestMain.cpp:498: PASSED: - CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" ) +with expansion: + "one two + three + four" + == + "one two + three + four" + +TestMain.cpp:499: +PASSED: + CHECK( Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4842,16 +4854,16 @@ with expansion: four" ------------------------------------------------------------------------------- -TestMain.cpp:500 - Long strings can be wrapped With newlines Wrapped twice +------------------------------------------------------------------------------- +TestMain.cpp:501 ............................................................................... -TestMain.cpp:501: +TestMain.cpp:502: PASSED: - CHECK( Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) + CHECK( Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4863,21 +4875,64 @@ with expansion: three four" +------------------------------------------------------------------------------- +Long strings can be wrapped + With tabs +------------------------------------------------------------------------------- +TestMain.cpp:506 +............................................................................... + +TestMain.cpp:512: +PASSED: + CHECK( Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" ) +with expansion: + "one two three + four + five + six" + == + "one two three + four + five + six" + hello hello ------------------------------------------------------------------------------- -TestMain.cpp:604 - Strings can be rendered with colour +------------------------------------------------------------------------------- +TestMain.cpp:591 ............................................................................... No assertions in test case, 'Strings can be rendered with colour' ------------------------------------------------------------------------------- -TrickyTests.cpp:32 +Text can be formatted using the Text class +------------------------------------------------------------------------------- +TestMain.cpp:610 +............................................................................... +TestMain.cpp:612: +PASSED: + CHECK( Text( "hi there" ).toString() == "hi there" ) +with expansion: + "hi there" == "hi there" + +TestMain.cpp:617: +PASSED: + CHECK( Text( "hi there", narrow ).toString() == "hi\nthere" ) +with expansion: + "hi + there" + == + "hi + there" + +------------------------------------------------------------------------------- ./succeeding/Tricky/std::pair +------------------------------------------------------------------------------- +TrickyTests.cpp:32 ............................................................................... TrickyTests.cpp:37: @@ -4887,9 +4942,9 @@ with expansion: std::pair( 1, 2 ) == std::pair( 1, 2 ) ------------------------------------------------------------------------------- -TrickyTests.cpp:46 - ./inprogress/failing/Tricky/trailing expression +------------------------------------------------------------------------------- +TrickyTests.cpp:46 ............................................................................... TrickyTests.cpp:55: @@ -4901,9 +4956,9 @@ warning: No assertions in test case, './inprogress/failing/Tricky/trailing expression' ------------------------------------------------------------------------------- -TrickyTests.cpp:62 - ./inprogress/failing/Tricky/compound lhs +------------------------------------------------------------------------------- +TrickyTests.cpp:62 ............................................................................... TrickyTests.cpp:71: @@ -4915,9 +4970,9 @@ warning: No assertions in test case, './inprogress/failing/Tricky/compound lhs' ------------------------------------------------------------------------------- -TrickyTests.cpp:88 - ./failing/Tricky/non streamable type +------------------------------------------------------------------------------- +TrickyTests.cpp:88 ............................................................................... TrickyTests.cpp:95: FAILED: @@ -4931,9 +4986,9 @@ with expansion: {?} == {?} ------------------------------------------------------------------------------- -TrickyTests.cpp:104 - ./failing/string literals +------------------------------------------------------------------------------- +TrickyTests.cpp:104 ............................................................................... TrickyTests.cpp:106: FAILED: @@ -4942,9 +4997,9 @@ with expansion: "first" == "second" ------------------------------------------------------------------------------- -TrickyTests.cpp:115 - ./succeeding/side-effects +------------------------------------------------------------------------------- +TrickyTests.cpp:115 ............................................................................... TrickyTests.cpp:119: @@ -4960,9 +5015,9 @@ with expansion: 8 == 8 ------------------------------------------------------------------------------- -TrickyTests.cpp:183 - ./succeeding/koenig +------------------------------------------------------------------------------- +TrickyTests.cpp:183 ............................................................................... TrickyTests.cpp:186: @@ -4972,9 +5027,9 @@ with expansion: 0x == {?} ------------------------------------------------------------------------------- -TrickyTests.cpp:209 - ./succeeding/non-const== +------------------------------------------------------------------------------- +TrickyTests.cpp:209 ............................................................................... TrickyTests.cpp:212: @@ -4984,9 +5039,9 @@ with expansion: {?} == 1 ------------------------------------------------------------------------------- -TrickyTests.cpp:222 - ./succeeding/enum/bits +------------------------------------------------------------------------------- +TrickyTests.cpp:222 ............................................................................... TrickyTests.cpp:224: @@ -4996,9 +5051,9 @@ with expansion: 0x == 3221225472 ------------------------------------------------------------------------------- -TrickyTests.cpp:236 - ./succeeding/boolean member +------------------------------------------------------------------------------- +TrickyTests.cpp:236 ............................................................................... TrickyTests.cpp:239: @@ -5008,10 +5063,10 @@ with expansion: 0x != 0 ------------------------------------------------------------------------------- -TrickyTests.cpp:257 - ./succeeding/unimplemented static bool compare to true +------------------------------------------------------------------------------- +TrickyTests.cpp:257 ............................................................................... TrickyTests.cpp:259: @@ -5027,10 +5082,10 @@ with expansion: true == true ------------------------------------------------------------------------------- -TrickyTests.cpp:262 - ./succeeding/unimplemented static bool compare to false +------------------------------------------------------------------------------- +TrickyTests.cpp:262 ............................................................................... TrickyTests.cpp:264: @@ -5046,10 +5101,10 @@ with expansion: false == false ------------------------------------------------------------------------------- -TrickyTests.cpp:268 - ./succeeding/unimplemented static bool negation +------------------------------------------------------------------------------- +TrickyTests.cpp:268 ............................................................................... TrickyTests.cpp:270: @@ -5059,10 +5114,10 @@ with expansion: true ------------------------------------------------------------------------------- -TrickyTests.cpp:273 - ./succeeding/unimplemented static bool double negation +------------------------------------------------------------------------------- +TrickyTests.cpp:273 ............................................................................... TrickyTests.cpp:275: @@ -5072,10 +5127,10 @@ with expansion: true ------------------------------------------------------------------------------- -TrickyTests.cpp:278 - ./succeeding/unimplemented static bool direct +------------------------------------------------------------------------------- +TrickyTests.cpp:278 ............................................................................... TrickyTests.cpp:280: @@ -5091,9 +5146,9 @@ with expansion: !false ------------------------------------------------------------------------------- -TrickyTests.cpp:308 - ./succeeding/SafeBool +------------------------------------------------------------------------------- +TrickyTests.cpp:308 ............................................................................... TrickyTests.cpp:313: @@ -5115,9 +5170,9 @@ with expansion: !false ------------------------------------------------------------------------------- -TrickyTests.cpp:318 - Assertions then sections +------------------------------------------------------------------------------- +TrickyTests.cpp:318 ............................................................................... TrickyTests.cpp:323: @@ -5127,10 +5182,10 @@ with expansion: true ------------------------------------------------------------------------------- -TrickyTests.cpp:325 - Assertions then sections A section +------------------------------------------------------------------------------- +TrickyTests.cpp:325 ............................................................................... TrickyTests.cpp:327: @@ -5140,11 +5195,11 @@ with expansion: true ------------------------------------------------------------------------------- -TrickyTests.cpp:329 - Assertions then sections A section Another section +------------------------------------------------------------------------------- +TrickyTests.cpp:329 ............................................................................... TrickyTests.cpp:331: @@ -5154,9 +5209,9 @@ with expansion: true ------------------------------------------------------------------------------- -TrickyTests.cpp:318 - Assertions then sections +------------------------------------------------------------------------------- +TrickyTests.cpp:318 ............................................................................... TrickyTests.cpp:323: @@ -5166,10 +5221,10 @@ with expansion: true ------------------------------------------------------------------------------- -TrickyTests.cpp:325 - Assertions then sections A section +------------------------------------------------------------------------------- +TrickyTests.cpp:325 ............................................................................... TrickyTests.cpp:327: @@ -5179,11 +5234,11 @@ with expansion: true ------------------------------------------------------------------------------- -TrickyTests.cpp:333 - Assertions then sections A section Another other section +------------------------------------------------------------------------------- +TrickyTests.cpp:333 ............................................................................... TrickyTests.cpp:335: @@ -5193,9 +5248,9 @@ with expansion: true ------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:12 - Anonymous test case 1 +------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:12 ............................................................................... VariadicMacrosTests.cpp:14: @@ -5204,9 +5259,9 @@ with message: anonymous test case ------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:17 - Test case with one argument +------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:17 ............................................................................... VariadicMacrosTests.cpp:19: @@ -5215,10 +5270,10 @@ with message: no assertions ------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:24 - Variadic macros Section with one argument +------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:24 ............................................................................... VariadicMacrosTests.cpp:26: @@ -5227,12 +5282,12 @@ with message: no assertions ------------------------------------------------------------------------------- -BDDTests.cpp:19 - Scenario: Do that thing with the thing Given: This stuff exists When: I do this Then: it should do this +------------------------------------------------------------------------------- +BDDTests.cpp:19 ............................................................................... BDDTests.cpp:21: @@ -5242,13 +5297,13 @@ with expansion: true ------------------------------------------------------------------------------- -BDDTests.cpp:22 - Scenario: Do that thing with the thing Given: This stuff exists When: I do this Then: it should do this And: do that +------------------------------------------------------------------------------- +BDDTests.cpp:22 ............................................................................... BDDTests.cpp:23: @@ -5258,10 +5313,10 @@ with expansion: true ------------------------------------------------------------------------------- -BDDTests.cpp:30 - Scenario: Vector resizing affects size and capacity Given: an empty vector +------------------------------------------------------------------------------- +BDDTests.cpp:30 ............................................................................... BDDTests.cpp:32: @@ -5271,12 +5326,12 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -BDDTests.cpp:36 - Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger Then: the size and capacity go up +------------------------------------------------------------------------------- +BDDTests.cpp:36 ............................................................................... BDDTests.cpp:37: @@ -5292,14 +5347,14 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- -BDDTests.cpp:42 - Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger Then: the size and capacity go up And when: it is made smaller again Then: the size goes down but the capacity stays the same +------------------------------------------------------------------------------- +BDDTests.cpp:42 ............................................................................... BDDTests.cpp:43: @@ -5315,10 +5370,10 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- -BDDTests.cpp:30 - Scenario: Vector resizing affects size and capacity Given: an empty vector +------------------------------------------------------------------------------- +BDDTests.cpp:30 ............................................................................... BDDTests.cpp:32: @@ -5328,12 +5383,12 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -BDDTests.cpp:36 - Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger Then: the size and capacity go up +------------------------------------------------------------------------------- +BDDTests.cpp:36 ............................................................................... BDDTests.cpp:37: @@ -5349,10 +5404,10 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- -BDDTests.cpp:30 - Scenario: Vector resizing affects size and capacity Given: an empty vector +------------------------------------------------------------------------------- +BDDTests.cpp:30 ............................................................................... BDDTests.cpp:32: @@ -5362,12 +5417,12 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -BDDTests.cpp:36 - Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger Then: the size and capacity go up +------------------------------------------------------------------------------- +BDDTests.cpp:36 ............................................................................... BDDTests.cpp:37: @@ -5383,10 +5438,10 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- -BDDTests.cpp:30 - Scenario: Vector resizing affects size and capacity Given: an empty vector +------------------------------------------------------------------------------- +BDDTests.cpp:30 ............................................................................... BDDTests.cpp:32: @@ -5396,10 +5451,10 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -BDDTests.cpp:30 - Scenario: Vector resizing affects size and capacity Given: an empty vector +------------------------------------------------------------------------------- +BDDTests.cpp:30 ............................................................................... BDDTests.cpp:32: @@ -5409,12 +5464,12 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -BDDTests.cpp:52 - Scenario: Vector resizing affects size and capacity Given: an empty vector When: we reserve more space Then: The capacity is increased but the size remains the same +------------------------------------------------------------------------------- +BDDTests.cpp:52 ............................................................................... BDDTests.cpp:53: @@ -5430,16 +5485,16 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -BDDTests.cpp:66 - -Scenario: This is a really long scenario name to see how the list command - deals with wrapping +Scenario: This is a really long scenario name to see how the list command deals + with wrapping Given: A section name that is so long that it cannot fit in a single console width When: The test headers are printed as part of the normal running of the scenario Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent +------------------------------------------------------------------------------- +BDDTests.cpp:66 ............................................................................... BDDTests.cpp:67: @@ -5448,7 +5503,7 @@ with message: boo! =============================================================================== -109 test cases - 48 failed (699 assertions - 105 failed) +110 test cases - 48 failed (703 assertions - 105 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -5456,9 +5511,9 @@ CatchSelfTest is a CATCH v0.9 b33 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- -ApproxTests.cpp:16 - ./succeeding/Approx/simple +------------------------------------------------------------------------------- +ApproxTests.cpp:16 ............................................................................... ApproxTests.cpp:20: @@ -5498,9 +5553,9 @@ with expansion: Approx( 1.23 ) != 1.24 ------------------------------------------------------------------------------- -ApproxTests.cpp:34 - ./succeeding/Approx/epsilon +------------------------------------------------------------------------------- +ApproxTests.cpp:34 ............................................................................... ApproxTests.cpp:38: @@ -5516,9 +5571,9 @@ with expansion: 1.23 == Approx( 1.231 ) ------------------------------------------------------------------------------- -ApproxTests.cpp:47 - ./succeeding/Approx/float +------------------------------------------------------------------------------- +ApproxTests.cpp:47 ............................................................................... ApproxTests.cpp:49: @@ -5534,9 +5589,9 @@ with expansion: 0 == Approx( 0 ) ------------------------------------------------------------------------------- -ApproxTests.cpp:58 - ./succeeding/Approx/int +------------------------------------------------------------------------------- +ApproxTests.cpp:58 ............................................................................... ApproxTests.cpp:60: @@ -5548,9 +5603,9 @@ PASSED: REQUIRE( 0 == Approx( 0 ) ) ------------------------------------------------------------------------------- -ApproxTests.cpp:69 - ./succeeding/Approx/mixed +------------------------------------------------------------------------------- +ApproxTests.cpp:69 ............................................................................... ApproxTests.cpp:75: @@ -5584,9 +5639,9 @@ with expansion: 1.234 == Approx( 1.234 ) ------------------------------------------------------------------------------- -ApproxTests.cpp:87 - ./succeeding/Approx/custom +------------------------------------------------------------------------------- +ApproxTests.cpp:87 ............................................................................... ApproxTests.cpp:93: @@ -5638,9 +5693,9 @@ with expansion: Approx( 1.23 ) != 1.25 ------------------------------------------------------------------------------- -ApproxTests.cpp:108 - Approximate PI +------------------------------------------------------------------------------- +ApproxTests.cpp:108 ............................................................................... ApproxTests.cpp:110: @@ -5656,9 +5711,9 @@ with expansion: 3.142857142857143 != Approx( 3.141 ) ------------------------------------------------------------------------------- -ClassTests.cpp:34 - ./succeeding/TestClass/succeedingCase +------------------------------------------------------------------------------- +ClassTests.cpp:34 ............................................................................... ClassTests.cpp:24: @@ -5668,9 +5723,9 @@ with expansion: "hello" == "hello" ------------------------------------------------------------------------------- -ClassTests.cpp:35 - ./failing/TestClass/failingCase +------------------------------------------------------------------------------- +ClassTests.cpp:35 ............................................................................... ClassTests.cpp:28: FAILED: @@ -5679,9 +5734,9 @@ with expansion: "hello" == "world" ------------------------------------------------------------------------------- -ClassTests.cpp:45 - ./succeeding/Fixture/succeedingCase +------------------------------------------------------------------------------- +ClassTests.cpp:45 ............................................................................... ClassTests.cpp:47: @@ -5691,9 +5746,9 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- -ClassTests.cpp:53 - ./failing/Fixture/failingCase +------------------------------------------------------------------------------- +ClassTests.cpp:53 ............................................................................... ClassTests.cpp:55: FAILED: @@ -5702,9 +5757,9 @@ with expansion: 1 == 2 ------------------------------------------------------------------------------- -ConditionTests.cpp:47 - ./succeeding/conditions/equality +------------------------------------------------------------------------------- +ConditionTests.cpp:47 ............................................................................... ConditionTests.cpp:55: @@ -5750,9 +5805,9 @@ with expansion: 1.3 == Approx( 1.3 ) ------------------------------------------------------------------------------- -ConditionTests.cpp:67 - ./failing/conditions/equality +------------------------------------------------------------------------------- +ConditionTests.cpp:67 ............................................................................... ConditionTests.cpp:71: FAILED: @@ -5769,7 +5824,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -6230,6 +6285,7 @@ hello hello + @@ -11117,9 +11173,9 @@ TestMain.cpp" line="423">
-TestMain.cpp" line="435"> +TestMain.cpp" line="436"> - Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString + Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString "one two three four" @@ -11127,9 +11183,9 @@ TestMain.cpp" line="435"> "one two three four" -TestMain.cpp" line="436"> +TestMain.cpp" line="437"> - Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString + Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString "one two three four" @@ -11143,21 +11199,9 @@ TestMain.cpp" line="436">
-TestMain.cpp" line="439"> - - Catch::LineWrapper().setRight( 17 ).wrap( testString ).toString() == "one two three\nfour" - - - "one two three -four" -== -"one two three -four" - - TestMain.cpp" line="440"> - Catch::LineWrapper().setRight( 16 ).wrap( testString ).toString() == "one two three\nfour" + Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" "one two three @@ -11169,7 +11213,7 @@ four" TestMain.cpp" line="441"> - Catch::LineWrapper().setRight( 15 ).wrap( testString ).toString() == "one two three\nfour" + Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" "one two three @@ -11181,7 +11225,7 @@ four" TestMain.cpp" line="442"> - Catch::LineWrapper().setRight( 14 ).wrap( testString ).toString() == "one two three\nfour" + Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" "one two three @@ -11193,7 +11237,19 @@ four" TestMain.cpp" line="443"> - Catch::LineWrapper().setRight( 13 ).wrap( testString ).toString() == "one two\nthree four" + Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" + + + "one two three +four" +== +"one two three +four" + + +TestMain.cpp" line="444"> + + Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" "one two @@ -11209,23 +11265,9 @@ three four"
-TestMain.cpp" line="446"> - - Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" - - - "one two -three -four" -== -"one two -three -four" - - TestMain.cpp" line="447"> - Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" + Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" "one two @@ -11237,15 +11279,43 @@ three four" - +TestMain.cpp" line="448"> + + Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" + + + "one two +three +four" +== +"one two +three +four" + + +TestMain.cpp" line="449"> + + Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" + + + "one two +three +four" +== +"one two +three +four" + + +
- +
-TestMain.cpp" line="450"> +TestMain.cpp" line="452"> - Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" "one @@ -11259,9 +11329,9 @@ three four" -TestMain.cpp" line="451"> +TestMain.cpp" line="453"> - Catch::LineWrapper().setRight( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" "one @@ -11281,47 +11351,47 @@ four"
-TestMain.cpp" line="454"> - - Catch::LineWrapper().setRight( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" - - - "abc- -def" -== -"abc- -def" - - -TestMain.cpp" line="455"> - - Catch::LineWrapper().setRight( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" - - - "abc- -defg" -== -"abc- -defg" - - TestMain.cpp" line="456"> - Catch::LineWrapper().setRight( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" + Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" "abc- -def- -gh" +def" == "abc- -def- -gh" +def" + + +TestMain.cpp" line="457"> + + Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" + + + "abc- +defg" +== +"abc- +defg" TestMain.cpp" line="458"> - Catch::LineWrapper().setRight( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" + Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" + + + "abc- +def- +gh" +== +"abc- +def- +gh" + + +TestMain.cpp" line="460"> + + Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" "one @@ -11337,9 +11407,9 @@ ee four" -TestMain.cpp" line="459"> +TestMain.cpp" line="461"> - Catch::LineWrapper().setRight( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" + Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" "one @@ -11363,41 +11433,41 @@ ur"
-TestMain.cpp" line="464"> +TestMain.cpp" line="465"> - wrapper.size() == 4 + text.size() == 4 4 == 4 -TestMain.cpp" line="465"> +TestMain.cpp" line="466"> - wrapper[0] == "one" + text[0] == "one" "one" == "one" -TestMain.cpp" line="466"> +TestMain.cpp" line="467"> - wrapper[1] == "two" + text[1] == "two" "two" == "two" -TestMain.cpp" line="467"> +TestMain.cpp" line="468"> - wrapper[2] == "three" + text[2] == "three" "three" == "three" -TestMain.cpp" line="468"> +TestMain.cpp" line="469"> - wrapper[3] == "four" + text[3] == "four" "four" == "four" @@ -11409,9 +11479,9 @@ TestMain.cpp" line="468">
-TestMain.cpp" line="475"> +TestMain.cpp" line="476"> - Catch::LineWrapper() .setRight( 10 ) .setIndent( 4 ) .setInitialIndent( 1 ) .wrap( testString ).toString() == " one two\n three\n four" + text.toString() == " one two\n three\n four" " one two @@ -11432,21 +11502,9 @@ TestMain.cpp" line="475">
-TestMain.cpp" line="486"> - - Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString - - - "one two -three four" -== -"one two -three four" - - TestMain.cpp" line="487"> - Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString + Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString "one two @@ -11458,7 +11516,19 @@ three four" TestMain.cpp" line="488"> - Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString + Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString + + + "one two +three four" +== +"one two +three four" + + +TestMain.cpp" line="489"> + + Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString "one two @@ -11474,9 +11544,9 @@ three four"
-TestMain.cpp" line="491"> +TestMain.cpp" line="492"> - Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" + Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" "abcdef @@ -11486,17 +11556,17 @@ TestMain.cpp" line="491"> " -TestMain.cpp" line="492"> +TestMain.cpp" line="493"> - Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" + Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" "abcdef" == "abcdef" -TestMain.cpp" line="493"> +TestMain.cpp" line="494"> - Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" + Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" "abcdef @@ -11512,23 +11582,9 @@ TestMain.cpp" line="493">
-TestMain.cpp" line="496"> - - Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" - - - "one two -three -four" -== -"one two -three -four" - - TestMain.cpp" line="497"> - Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" + Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" "one two @@ -11542,7 +11598,21 @@ four" TestMain.cpp" line="498"> - Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" + Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" + + + "one two +three +four" +== +"one two +three +four" + + +TestMain.cpp" line="499"> + + Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" "one two @@ -11560,9 +11630,9 @@ four"
-TestMain.cpp" line="501"> +TestMain.cpp" line="502"> - Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" "one @@ -11580,11 +11650,56 @@ four"
+
+ +
+
+TestMain.cpp" line="512"> + + Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" + + + "one two three + four + five + six" +== +"one two three + four + five + six" + + + +
+ +TestMain.cpp" line="612"> + + Text( "hi there" ).toString() == "hi there" + + + "hi there" == "hi there" + + +TestMain.cpp" line="617"> + + Text( "hi there", narrow ).toString() == "hi\nthere" + + + "hi +there" +== +"hi +there" + + + + TrickyTests.cpp" line="37"> @@ -12102,9 +12217,9 @@ BDDTests.cpp" line="54">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -13426,11 +13541,11 @@ TestMain.cpp:423: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false [Running: Long strings can be wrapped] [Started section: 'plain string'] [Started section: 'No wrapping'] -TestMain.cpp:435: Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:436: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:436: Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:437: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" @@ -13440,31 +13555,31 @@ TestMain.cpp:436: Catch::LineWrapper().setRight( 18 ).wrap( testString ).toStrin [Started section: 'plain string'] [Started section: 'Wrapped once'] -TestMain.cpp:439: Catch::LineWrapper().setRight( 17 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:440: Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:440: Catch::LineWrapper().setRight( 16 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:441: Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:441: Catch::LineWrapper().setRight( 15 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:442: Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:442: Catch::LineWrapper().setRight( 14 ).wrap( testString ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:443: Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:443: Catch::LineWrapper().setRight( 13 ).wrap( testString ).toString() == "one two\nthree four" succeeded for: +TestMain.cpp:444: Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" succeeded for: "one two three four" == @@ -13476,7 +13591,7 @@ three four" [Started section: 'plain string'] [Started section: 'Wrapped twice'] -TestMain.cpp:446: Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:447: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -13484,7 +13599,7 @@ four" "one two three four" -TestMain.cpp:447: Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:448: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -13492,13 +13607,21 @@ four" "one two three four" -[End of section: 'Wrapped twice' All 2 assertions passed] +TestMain.cpp:449: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: + "one two +three +four" +== +"one two +three +four" +[End of section: 'Wrapped twice' All 3 assertions passed] -[End of section: 'plain string' All 2 assertions passed] +[End of section: 'plain string' All 3 assertions passed] [Started section: 'plain string'] [Started section: 'Wrapped three times'] -TestMain.cpp:450: Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:452: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -13508,7 +13631,7 @@ four" two three four" -TestMain.cpp:451: Catch::LineWrapper().setRight( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:453: Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -13524,24 +13647,24 @@ four" [Started section: 'plain string'] [Started section: 'Short wrap'] -TestMain.cpp:454: Catch::LineWrapper().setRight( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" succeeded for: "abc- +TestMain.cpp:456: Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" succeeded for: "abc- def" == "abc- def" -TestMain.cpp:455: Catch::LineWrapper().setRight( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" succeeded for: "abc- +TestMain.cpp:457: Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" succeeded for: "abc- defg" == "abc- defg" -TestMain.cpp:456: Catch::LineWrapper().setRight( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- +TestMain.cpp:458: Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- def- gh" == "abc- def- gh" -TestMain.cpp:458: Catch::LineWrapper().setRight( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: +TestMain.cpp:460: Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: "one two thr- @@ -13553,7 +13676,7 @@ two thr- ee four" -TestMain.cpp:459: Catch::LineWrapper().setRight( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: +TestMain.cpp:461: Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: "one two th- @@ -13573,18 +13696,18 @@ ur" [Started section: 'plain string'] [Started section: 'As container'] -TestMain.cpp:464: wrapper.size() == 4 succeeded for: 4 == 4 -TestMain.cpp:465: wrapper[0] == "one" succeeded for: "one" == "one" -TestMain.cpp:466: wrapper[1] == "two" succeeded for: "two" == "two" -TestMain.cpp:467: wrapper[2] == "three" succeeded for: "three" == "three" -TestMain.cpp:468: wrapper[3] == "four" succeeded for: "four" == "four" +TestMain.cpp:465: text.size() == 4 succeeded for: 4 == 4 +TestMain.cpp:466: text[0] == "one" succeeded for: "one" == "one" +TestMain.cpp:467: text[1] == "two" succeeded for: "two" == "two" +TestMain.cpp:468: text[2] == "three" succeeded for: "three" == "three" +TestMain.cpp:469: text[3] == "four" succeeded for: "four" == "four" [End of section: 'As container' All 5 assertions passed] [End of section: 'plain string' All 5 assertions passed] [Started section: 'plain string'] [Started section: 'Indent first line differently'] -TestMain.cpp:475: Catch::LineWrapper() .setRight( 10 ) .setIndent( 4 ) .setInitialIndent( 1 ) .wrap( testString ).toString() == " one two\n three\n four" succeeded for: +TestMain.cpp:476: text.toString() == " one two\n three\n four" succeeded for: " one two three four" @@ -13598,19 +13721,19 @@ TestMain.cpp:475: Catch::LineWrapper() .setRight( 10 ) .setIndent( 4 ) .setIniti [Started section: 'With newlines'] [Started section: 'No wrapping'] -TestMain.cpp:486: Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:487: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:487: Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:488: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:488: Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString succeeded for: +TestMain.cpp:489: Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString succeeded for: "one two three four" == @@ -13622,13 +13745,13 @@ three four" [Started section: 'With newlines'] [Started section: 'Trailing newline'] -TestMain.cpp:491: Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:492: Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef " -TestMain.cpp:492: Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" -TestMain.cpp:493: Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:493: Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" +TestMain.cpp:494: Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef @@ -13639,7 +13762,7 @@ TestMain.cpp:493: Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString [Started section: 'With newlines'] [Started section: 'Wrapped once'] -TestMain.cpp:496: Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:497: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -13647,7 +13770,7 @@ four" "one two three four" -TestMain.cpp:497: Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:498: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -13655,7 +13778,7 @@ four" "one two three four" -TestMain.cpp:498: Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:499: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -13669,7 +13792,7 @@ four" [Started section: 'With newlines'] [Started section: 'Wrapped twice'] -TestMain.cpp:501: Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:502: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -13683,7 +13806,20 @@ four" [End of section: 'With newlines' 1 assertion passed] -[Finished: 'Long strings can be wrapped' All tests passed (32 assertions in 1 test case)] +[Started section: 'With tabs'] +TestMain.cpp:512: Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" succeeded for: +"one two three + four + five + six" +== +"one two three + four + five + six" +[End of section: 'With tabs' 1 assertion passed] + +[Finished: 'Long strings can be wrapped' All tests passed (34 assertions in 1 test case)] hello hello @@ -13693,6 +13829,15 @@ No assertions in test case, 'Strings can be rendered with colour' [Finished: 'Strings can be rendered with colour' 1 test case failed (1 assertion failed)] +[Running: Text can be formatted using the Text class] +TestMain.cpp:612: Text( "hi there" ).toString() == "hi there" succeeded for: "hi there" == "hi there" +TestMain.cpp:617: Text( "hi there", narrow ).toString() == "hi\nthere" succeeded for: "hi +there" +== +"hi +there" +[Finished: 'Text can be formatted using the Text class' All tests passed (2 assertions in 1 test case)] + [Running: ./succeeding/Tricky/std::pair] 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)] @@ -13905,10 +14050,10 @@ BDDTests.cpp:67: succeeded [End of section: ' Given: A section name that is so long that it cannot fit in a single console width' 1 assertion passed] [Finished: 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 48 of 109 test cases failed (105 of 699 assertions failed)] +[End of group: '~dummy'. 48 of 110 test cases failed (105 of 703 assertions failed)] -[Testing completed. 48 of 109 test cases failed (105 of 699 assertions failed)] +[Testing completed. 48 of 110 test cases failed (105 of 703 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 19e8f68b..e6e4faf9 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -10,7 +10,6 @@ #endif #include "catch_self_test.hpp" -#include "internal/catch_line_wrap.h" #include "internal/catch_text.h" TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" ) { diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 347234fb..37f2f351 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -10,7 +10,7 @@ 266B06B816F3A60A004ED264 /* VariadicMacrosTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */; }; 266ECD74170F3C620030D735 /* BDDTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266ECD73170F3C620030D735 /* BDDTests.cpp */; }; 26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26847E5D16BBADB40043B9C1 /* catch_message.cpp */; }; - 2694A1FD16A0000E004816E3 /* catch_line_wrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */; }; + 2694A1FD16A0000E004816E3 /* catch_text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694A1FB16A0000E004816E3 /* catch_text.cpp */; }; 4A45DA2416161EF9004F8D6B /* catch_console_colour.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA2316161EF9004F8D6B /* catch_console_colour.cpp */; }; 4A45DA2716161F1F004F8D6B /* catch_ptr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA2616161F1F004F8D6B /* catch_ptr.cpp */; }; 4A45DA2916161F3D004F8D6B /* catch_streambuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA2816161F3D004F8D6B /* catch_streambuf.cpp */; }; @@ -56,6 +56,7 @@ /* Begin PBXFileReference section */ 266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VariadicMacrosTests.cpp; path = ../../../SelfTest/VariadicMacrosTests.cpp; sourceTree = ""; }; + 266E9AD117230ACF0061DAB2 /* catch_text.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_text.hpp; sourceTree = ""; }; 266ECD73170F3C620030D735 /* BDDTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BDDTests.cpp; path = ../../../SelfTest/BDDTests.cpp; sourceTree = ""; }; 266ECD8C1713614B0030D735 /* catch_legacy_reporter_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_legacy_reporter_adapter.hpp; sourceTree = ""; }; 266ECD8D1713614B0030D735 /* catch_legacy_reporter_adapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_legacy_reporter_adapter.h; sourceTree = ""; }; @@ -64,9 +65,7 @@ 26847E5B16BBAB790043B9C1 /* catch_message.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_message.h; sourceTree = ""; }; 26847E5C16BBACB60043B9C1 /* catch_message.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_message.hpp; sourceTree = ""; }; 26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = ""; }; - 2694A1F8169FFF9B004816E3 /* catch_line_wrap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_line_wrap.h; sourceTree = ""; }; - 2694A1FA169FFFEC004816E3 /* catch_line_wrap.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_line_wrap.hpp; sourceTree = ""; }; - 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = catch_line_wrap.cpp; sourceTree = ""; }; + 2694A1FB16A0000E004816E3 /* catch_text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = catch_text.cpp; sourceTree = ""; }; 26DACF2F17206D3400A21326 /* catch_text.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_text.h; sourceTree = ""; }; 4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_test_case_info.hpp; sourceTree = ""; }; 4A084F1D15DAD15F0027E631 /* catch_test_spec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_test_spec.h; sourceTree = ""; }; @@ -286,7 +285,7 @@ 4AB3D99F1616219100C9A0F8 /* catch_interfaces_config.cpp */, 4AB3D9A1161621B500C9A0F8 /* catch_interfaces_generators.cpp */, 4ACE21CA166CA1B300FB5509 /* catch_option.cpp */, - 2694A1FB16A0000E004816E3 /* catch_line_wrap.cpp */, + 2694A1FB16A0000E004816E3 /* catch_text.cpp */, 26847E5D16BBADB40043B9C1 /* catch_message.cpp */, ); name = SurrogateCpps; @@ -295,6 +294,7 @@ 4AC91CB4155B9EBF00DC5117 /* impl */ = { isa = PBXGroup; children = ( + 266E9AD117230ACF0061DAB2 /* catch_text.hpp */, 4A4B0F9C15CEFA8300AE2392 /* catch_impl.hpp */, 4A4B0F9715CE6CFB00AE2392 /* catch_registry_hub.hpp */, 4A6D0C50149B3E3D00DB3EAA /* catch_generators_impl.hpp */, @@ -306,7 +306,6 @@ 4A90B59D15D24FE900EF71BC /* catch_assertionresult.hpp */, 4A90B59E15D2521E00EF71BC /* catch_expressionresult_builder.hpp */, 4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */, - 2694A1FA169FFFEC004816E3 /* catch_line_wrap.hpp */, 26847E5C16BBACB60043B9C1 /* catch_message.hpp */, ); name = impl; @@ -397,7 +396,6 @@ 4AB77CB51551AEA200857BF0 /* catch_ptr.hpp */, 4AEE0326161431070071E950 /* catch_streambuf.h */, 4ACE21C8166CA19700FB5509 /* catch_option.hpp */, - 2694A1F8169FFF9B004816E3 /* catch_line_wrap.h */, 26759472171C72A400A84BD1 /* catch_sfinae.hpp */, 26759473171C74C200A84BD1 /* catch_compiler_capabilities.h */, 26DACF2F17206D3400A21326 /* catch_text.h */, @@ -491,7 +489,7 @@ 4AB3D9A01616219100C9A0F8 /* catch_interfaces_config.cpp in Sources */, 4AB3D9A2161621B500C9A0F8 /* catch_interfaces_generators.cpp in Sources */, 4ACE21CC166CA1B300FB5509 /* catch_option.cpp in Sources */, - 2694A1FD16A0000E004816E3 /* catch_line_wrap.cpp in Sources */, + 2694A1FD16A0000E004816E3 /* catch_text.cpp in Sources */, 26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */, 266B06B816F3A60A004ED264 /* VariadicMacrosTests.cpp in Sources */, 266ECD74170F3C620030D735 /* BDDTests.cpp in Sources */, diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/catch_line_wrap.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/catch_text.cpp similarity index 76% rename from projects/XCode4/CatchSelfTest/CatchSelfTest/catch_line_wrap.cpp rename to projects/XCode4/CatchSelfTest/CatchSelfTest/catch_text.cpp index d0445cc2..502a0d05 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/catch_line_wrap.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/catch_text.cpp @@ -1,2 +1,2 @@ // This file is only here to verify (to the extent possible) the self sufficiency of the header -#include "catch_line_wrap.h" +#include "catch_text.h" From 2666c96d4e407c18fe6518007d403fe05327bcbc Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 20 Apr 2013 21:04:32 +0100 Subject: [PATCH 216/296] Fixes issue #164 - Removed spurious (re-)throw when catching unexpected exception --- include/internal/catch_capture.hpp | 2 - .../SelfTest/Baselines/approvedResults.txt | 127 ++++++++++++------ projects/SelfTest/ExceptionTests.cpp | 6 + projects/SelfTest/TestMain.cpp | 2 +- 4 files changed, 91 insertions(+), 46 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 4cc9705f..575f1931 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -88,7 +88,6 @@ inline bool isTrue( bool value ){ return value; } } catch( ... ) { \ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), \ resultDisposition | Catch::ResultDisposition::ContinueOnFailure, expr ); \ - throw; \ } \ } while( Catch::isTrue( false ) ) @@ -179,7 +178,6 @@ inline bool isTrue( bool value ){ return value; } } catch( ... ) { \ INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), \ resultDisposition | Catch::ResultDisposition::ContinueOnFailure, false ); \ - throw; \ } \ } while( Catch::isTrue( false ) ) diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index bfb9e47b..4af07a10 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1095,31 +1095,42 @@ due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- -./succeeding/exceptions/implicit +./failing/exceptions/implicit/4 ------------------------------------------------------------------------------- ExceptionTests.cpp:69 ............................................................................... +ExceptionTests.cpp:71: FAILED: + CHECK( thisThrows() == 0 ) +due to unexpected exception with message: + expected exception + +------------------------------------------------------------------------------- +./succeeding/exceptions/implicit +------------------------------------------------------------------------------- +ExceptionTests.cpp:75 +............................................................................... + No assertions in test case, './succeeding/exceptions/implicit' ------------------------------------------------------------------------------- ./failing/exceptions/custom ------------------------------------------------------------------------------- -ExceptionTests.cpp:106 +ExceptionTests.cpp:112 ............................................................................... -ExceptionTests.cpp:106: FAILED: +ExceptionTests.cpp:112: FAILED: due to unexpected exception with message: custom exception ------------------------------------------------------------------------------- ./failing/exceptions/custom/nothrow ------------------------------------------------------------------------------- -ExceptionTests.cpp:114 +ExceptionTests.cpp:120 ............................................................................... -ExceptionTests.cpp:116: FAILED: +ExceptionTests.cpp:122: FAILED: REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) due to unexpected exception with message: unexpected custom exception @@ -1127,10 +1138,10 @@ due to unexpected exception with message: ------------------------------------------------------------------------------- ./failing/exceptions/custom/throw ------------------------------------------------------------------------------- -ExceptionTests.cpp:119 +ExceptionTests.cpp:125 ............................................................................... -ExceptionTests.cpp:121: FAILED: +ExceptionTests.cpp:127: FAILED: REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) due to unexpected exception with message: custom exception - not std @@ -1138,20 +1149,20 @@ due to unexpected exception with message: ------------------------------------------------------------------------------- ./failing/exceptions/custom/double ------------------------------------------------------------------------------- -ExceptionTests.cpp:125 +ExceptionTests.cpp:131 ............................................................................... -ExceptionTests.cpp:125: FAILED: +ExceptionTests.cpp:131: FAILED: due to unexpected exception with message: 3.14 ------------------------------------------------------------------------------- ./succeeding/exceptions/notimplemented ------------------------------------------------------------------------------- -ExceptionTests.cpp:134 +ExceptionTests.cpp:140 ............................................................................... -ExceptionTests.cpp:136: +ExceptionTests.cpp:142: PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) @@ -3207,6 +3218,11 @@ PASSED: with message: Tests failed, as expected +catch_self_test.hpp:120: +PASSED: +with message: + Tests failed, as expected + ------------------------------------------------------------------------------- selftest/main selftest/expected result @@ -3489,9 +3505,9 @@ with expansion: TestMain.cpp:49: PASSED: - CHECK( totals.assertions.failed == 73 ) + CHECK( totals.assertions.failed == 74 ) with expansion: - 73 == 73 + 74 == 74 ------------------------------------------------------------------------------- meta/Misc/Sections @@ -5503,7 +5519,7 @@ with message: boo! =============================================================================== -110 test cases - 48 failed (703 assertions - 105 failed) +111 test cases - 49 failed (705 assertions - 106 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -5824,7 +5840,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -6024,25 +6040,30 @@ ExceptionTests.cpp:56 ExceptionTests.cpp:62 + + +ExceptionTests.cpp:71 + + -ExceptionTests.cpp:106 +ExceptionTests.cpp:112 -ExceptionTests.cpp:116 +ExceptionTests.cpp:122 -ExceptionTests.cpp:121 +ExceptionTests.cpp:127 -ExceptionTests.cpp:125 +ExceptionTests.cpp:131 @@ -7762,51 +7783,65 @@ ExceptionTests.cpp" line="62">
+ +ExceptionTests.cpp" line="71"> + + thisThrows() == 0 + + + thisThrows() == 0 + +ExceptionTests.cpp" line="71"> + expected exception + + + + -ExceptionTests.cpp" line="106"> +ExceptionTests.cpp" line="112"> custom exception -ExceptionTests.cpp" line="116"> +ExceptionTests.cpp" line="122"> throw CustomException( "unexpected custom exception" ) throw CustomException( "unexpected custom exception" ) -ExceptionTests.cpp" line="116"> +ExceptionTests.cpp" line="122"> unexpected custom exception -ExceptionTests.cpp" line="121"> +ExceptionTests.cpp" line="127"> throw CustomException( "custom exception - not std" ) throw CustomException( "custom exception - not std" ) -ExceptionTests.cpp" line="121"> +ExceptionTests.cpp" line="127"> custom exception - not std -ExceptionTests.cpp" line="125"> +ExceptionTests.cpp" line="131"> 3.14 -ExceptionTests.cpp" line="136"> +ExceptionTests.cpp" line="142"> thisFunctionNotImplemented( 7 ) @@ -9957,9 +9992,9 @@ MiscTests.cpp" line="332">
- +
- +
@@ -10004,10 +10039,10 @@ TestMain.cpp" line="48"> TestMain.cpp" line="49"> - totals.assertions.failed == 73 + totals.assertions.failed == 74 - 73 == 73 + 74 == 74 @@ -12217,9 +12252,9 @@ BDDTests.cpp" line="54">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -12483,6 +12518,10 @@ ExceptionTests.cpp:62: Unexpected exception with message: 'unexpected exception' [Finished: './failing/exceptions/implicit/3' 1 test case failed (1 assertion failed)] +[Running: ./failing/exceptions/implicit/4] +ExceptionTests.cpp:71: thisThrows() == 0 failed with unexpected exception with message: 'expected exception' +[Finished: './failing/exceptions/implicit/4' 1 test case failed (1 assertion failed)] + [Running: ./succeeding/exceptions/implicit] No assertions in test case, './succeeding/exceptions/implicit' @@ -12490,23 +12529,23 @@ No assertions in test case, './succeeding/exceptions/implicit' [Finished: './succeeding/exceptions/implicit' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/custom] -ExceptionTests.cpp:106: Unexpected exception with message: 'custom exception' +ExceptionTests.cpp:112: Unexpected exception with message: 'custom exception' [Finished: './failing/exceptions/custom' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/custom/nothrow] -ExceptionTests.cpp:116: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' +ExceptionTests.cpp:122: 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] -ExceptionTests.cpp:121: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' +ExceptionTests.cpp:127: 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] -ExceptionTests.cpp:125: Unexpected exception with message: '3.14' +ExceptionTests.cpp:131: Unexpected exception with message: '3.14' [Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] [Running: ./succeeding/exceptions/notimplemented] -ExceptionTests.cpp:136: thisFunctionNotImplemented( 7 ) succeeded +ExceptionTests.cpp:142: thisFunctionNotImplemented( 7 ) succeeded [Finished: './succeeding/exceptions/notimplemented' All tests passed (1 assertion in 1 test case)] [Running: ./succeeding/generators/1] @@ -13094,9 +13133,11 @@ catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] catch_self_test.hpp:120: succeeded [with message: Tests failed, as expected] -[End of section: 'selftest/expected result/failing tests' All 26 assertions passed] +catch_self_test.hpp:120: succeeded +[with message: Tests failed, as expected] +[End of section: 'selftest/expected result/failing tests' All 27 assertions passed] -[End of section: 'selftest/expected result' All 26 assertions passed] +[End of section: 'selftest/expected result' All 27 assertions passed] [Started section: 'selftest/expected result'] [Started section: 'selftest/expected result/succeeding tests'] @@ -13215,12 +13256,12 @@ TestMain.cpp:42: totals.assertions.failed == 0 succeeded for: 0 == 0 [Started section: 'selftest/test counts'] [Started section: 'selftest/test counts/failing tests'] TestMain.cpp:48: totals.assertions.passed == 1 succeeded for: 1 == 1 -TestMain.cpp:49: totals.assertions.failed == 73 succeeded for: 73 == 73 +TestMain.cpp:49: totals.assertions.failed == 74 succeeded for: 74 == 74 [End of section: 'selftest/test counts/failing tests' All 2 assertions passed] [End of section: 'selftest/test counts' All 2 assertions passed] -[Finished: 'selftest/main' All tests passed (76 assertions in 1 test case)] +[Finished: 'selftest/main' All tests passed (77 assertions in 1 test case)] [Running: meta/Misc/Sections] TestMain.cpp:58: totals.assertions.passed == 2 succeeded for: 2 == 2 @@ -14050,10 +14091,10 @@ BDDTests.cpp:67: succeeded [End of section: ' Given: A section name that is so long that it cannot fit in a single console width' 1 assertion passed] [Finished: 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 48 of 110 test cases failed (105 of 703 assertions failed)] +[End of group: '~dummy'. 49 of 111 test cases failed (106 of 705 assertions failed)] -[Testing completed. 48 of 110 test cases failed (105 of 703 assertions failed)] +[Testing completed. 49 of 111 test cases failed (106 of 705 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp index 444328c3..bf951222 100644 --- a/projects/SelfTest/ExceptionTests.cpp +++ b/projects/SelfTest/ExceptionTests.cpp @@ -66,6 +66,12 @@ TEST_CASE( "./failing/exceptions/implicit/3", "When unchecked exceptions are thr } } +TEST_CASE_NORETURN( "./failing/exceptions/implicit/4", "When unchecked exceptions are thrown they are always failures" ) +{ + CHECK( thisThrows() == 0 ); + /*NOTREACHED*/ +} + TEST_CASE( "./succeeding/exceptions/implicit", "When unchecked exceptions are thrown, but caught, they do not affect the test" ) { try diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index e6e4faf9..7b31bbba 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -46,7 +46,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" "Number of 'failing' tests is fixed" ) { Totals totals = runner.runMatching( "./failing/*", 1, 2 ); CHECK( totals.assertions.passed == 1 ); - CHECK( totals.assertions.failed == 73 ); + CHECK( totals.assertions.failed == 74 ); } } } From 19279250e89ee8cdd29f32c6e47dedd732695c5b Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 20 Apr 2013 21:07:32 +0100 Subject: [PATCH 217/296] Build 34 includes: - SFINAE version of IsStreamable (where available) - new Text class that replaces LineWrapper (internal) - fix for spurious double exception reporting (#164) --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 4 +- single_include/catch.hpp | 409 +++++++++++------- 4 files changed, 268 insertions(+), 149 deletions(-) diff --git a/README.md b/README.md index 171ca221..1194a86c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 33 (integration branch) +## CATCH v0.9 build 34 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 9a3d0a0f..7332935a 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 33, "integration" ); + Version libraryVersion( 0, 9, 34, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 4af07a10..2a98c58d 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b33 (integration) host application. +CatchSelfTest is a CATCH v0.9 b34 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -5523,7 +5523,7 @@ with message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b33 (integration) host application. +CatchSelfTest is a CATCH v0.9 b34 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 7d5ca2a2..dd7d6e9e 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 33 (integration branch) - * Generated: 2013-04-11 16:33:19.541792 + * CATCH v0.9 build 34 (integration branch) + * Generated: 2013-04-20 21:05:02.595019 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -504,6 +504,103 @@ private: // #included from: catch_tostring.hpp #define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED +// #included from: catch_sfinae.hpp +#define TWOBLUECUBES_CATCH_SFINAE_HPP_INCLUDED + +// Try to detect if the current compiler supports SFINAE +// #included from: catch_compiler_capabilities.h +#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED + +// Much of the following code is based on Boost (1.53) + +//////////////////////////////////////////////////////////////////////////////// +// Borland +#ifdef __BORLANDC__ + +#if (__BORLANDC__ > 0x582 ) +//#define CATCH_SFINAE // Not confirmed +#endif + +#endif // __BORLANDC__ + +//////////////////////////////////////////////////////////////////////////////// +// EDG +#ifdef __EDG_VERSION__ + +#if (__EDG_VERSION__ > 238 ) +//#define CATCH_SFINAE // Not confirmed +#endif + +#endif // __EDG_VERSION__ + +//////////////////////////////////////////////////////////////////////////////// +// Digital Mars +#ifdef __DMC__ + +#if (__DMC__ > 0x840 ) +//#define CATCH_SFINAE // Not confirmed +#endif + +#endif // __DMC__ + +//////////////////////////////////////////////////////////////////////////////// +// GCC +#ifdef __GNUC__ + +#if __GNUC__ < 3 + +#if (__GNUC_MINOR__ >= 96 ) +#define CATCH_SFINAE +#endif + +#elif __GNUC__ >= 3 + +#define CATCH_SFINAE + +#endif // __GNUC__ < 3 + +#endif // __GNUC__ + +//////////////////////////////////////////////////////////////////////////////// +// Visual C++ +#ifdef _MSC_VER + +#if (_MSC_VER >= 1310 ) // (VC++ 7.0+) +//#define CATCH_SFINAE // Not confirmed +#endif + +#endif // _MSC_VER + + +#ifdef CATCH_SFINAE + +namespace Catch { + + struct TrueType { + static const bool value = true; + typedef void Enable; + char sizer[1]; + }; + struct FalseType { + static const bool value = false; + typedef void Disable; + char sizer[2]; + }; + + template struct NotABooleanExpression; + + template struct If : NotABooleanExpression {}; + template<> struct If : TrueType {}; + template<> struct If : FalseType {}; + + template struct SizedIf; + template<> struct SizedIf : TrueType {}; + template<> struct SizedIf : FalseType {}; + +} // end namespace Catch + +#endif // CATCH_SFINAE + #include #include #include @@ -555,6 +652,49 @@ inline id performOptionalSelector( id obj, SEL sel ) { #endif namespace Catch { + +#ifdef CATCH_SFINAE + +namespace Detail { + + template + class IsStreamInsertableHelper { + template struct TrueIfSizeable : TrueType {}; + + template + static TrueIfSizeable dummy(T2*); + static FalseType dummy(...); + + public: + typedef SizedIf type; + }; + + template + struct IsStreamInsertable : IsStreamInsertableHelper::type {}; + + template + void toStream( std::ostream& os, T const& value, typename IsStreamInsertable::Enable* = 0 ) { + os << value; + } + + template + void toStream( std::ostream& os, T const&, typename IsStreamInsertable::Disable* = 0 ) { + os << "{?}"; + } + +} + +template +struct StringMaker { + static std::string convert( T const& value ) { + std::ostringstream oss; + Detail::toStream( oss, value ); + return oss.str(); + } +}; + +#else + namespace Detail { struct NonStreamable { @@ -577,6 +717,9 @@ struct StringMaker { return oss.str(); } }; + +#endif + template struct StringMaker { static std::string convert( T const* p ) { @@ -594,7 +737,7 @@ struct StringMaker > { std::ostringstream oss; oss << "{ "; for( std::size_t i = 0; i < v.size(); ++ i ) { - oss << v[i]; + oss << toString( v[i] ); if( i < v.size() - 1 ) oss << ", "; } @@ -620,7 +763,6 @@ namespace Detail { template std::string toString( const T& value ) { return StringMaker::convert( value ); -// return Detail::makeString( value ); } // Built in overloads @@ -2528,7 +2670,6 @@ inline bool isTrue( bool value ){ return value; } } catch( ... ) { \ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), \ resultDisposition | Catch::ResultDisposition::ContinueOnFailure, expr ); \ - throw; \ } \ } while( Catch::isTrue( false ) ) @@ -2618,7 +2759,6 @@ inline bool isTrue( bool value ){ return value; } } catch( ... ) { \ INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), \ resultDisposition | Catch::ResultDisposition::ContinueOnFailure, false ); \ - throw; \ } \ } while( Catch::isTrue( false ) ) @@ -4085,26 +4225,37 @@ namespace Catch { // #included from: internal/catch_list.hpp #define TWOBLUECUBES_CATCH_LIST_HPP_INCLUDED -// #included from: catch_line_wrap.h -#define TWOBLUECUBES_CATCH_LINE_WRAP_H_INCLUDED +// #included from: catch_text.h +#define TWOBLUECUBES_CATCH_TEXT_H_INCLUDED #include #include namespace Catch { - class LineWrapper { + struct TextAttributes { + TextAttributes() + : initialIndent( std::string::npos ), + indent( 0 ), + width( CATCH_CONFIG_CONSOLE_WIDTH-1 ), + tabChar( '\t' ) + {} + + TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; } + TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; } + TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; } + TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; } + + std::size_t initialIndent; // indent of first line, or npos + std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos + std::size_t width; // maximum width of text, including indent. Longer text will wrap + char tabChar; // If this char is seen the indent is changed to current pos + }; + + class Text { public: - LineWrapper(); - - LineWrapper& setIndent( std::size_t _indent ); - LineWrapper& setInitialIndent( std::size_t _initalIndent ); - LineWrapper& setRight( std::size_t _right ); - LineWrapper& setTabChar( char _tabChar ); - - LineWrapper& wrap( std::string const& _str ); - - std::string toString() const; + Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() ); + void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ); typedef std::vector::const_iterator const_iterator; @@ -4113,23 +4264,13 @@ namespace Catch { std::string const& last() const { return lines.back(); } std::size_t size() const { return lines.size(); } std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } + std::string toString() const; - friend std::ostream& operator << ( std::ostream& _stream, LineWrapper const& _lineWrapper ); + friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ); private: - void wrapInternal( std::string const& _str ); - void addLine( const std::string& _line ); - bool isWrapPoint( char c ); - std::size_t getCurrentIndent() const; - - std::size_t right; - std::size_t nextTab; - std::size_t tab; - std::size_t indent; - std::size_t initialIndent; - std::string wrappableChars; - char tabChar; - int recursionCount; + std::string str; + TextAttributes attr; std::vector lines; }; @@ -4236,11 +4377,11 @@ namespace Catch { if( matchesFilters( config.filters, *it ) ) { matchedTests++; // !TBD: consider listAs() - LineWrapper nameWrapper; - nameWrapper.setRight( maxNameLen ).setIndent( 2 ).wrap( it->getTestCaseInfo().name ); + Text nameWrapper( it->getTestCaseInfo().name, + TextAttributes().setWidth( maxNameLen ).setIndent(2) ); - LineWrapper tagsWrapper; - tagsWrapper.setRight( maxTagLen ).wrap( it->getTestCaseInfo().tagsAsString ); + Text tagsWrapper( it->getTestCaseInfo().tagsAsString, + TextAttributes().setWidth( maxTagLen ) ); for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) { Colour::Code colour = Colour::None; @@ -4314,9 +4455,9 @@ namespace Catch { for( std::map::const_iterator countIt = tagCounts.begin(), countItEnd = tagCounts.end(); countIt != countItEnd; ++countIt ) { - LineWrapper wrapper; - wrapper.setIndent(2).setRight( maxTagLen ).wrap( "[" + countIt->first + "]" ); - + Text wrapper( "[" + countIt->first + "]", TextAttributes() + .setIndent(2) + .setWidth( maxTagLen ) ); std::cout << wrapper; std::size_t dots = 2; if( maxTagLen > wrapper.last().size() ) @@ -5049,7 +5190,7 @@ namespace Catch { displayedSpecificOption = true; std::cout << "\n" << opt.optionNames() << " " << opt.argsSynopsis() << "\n\n" << opt.optionSummary() << "\n\n" - << LineWrapper().setIndent( 2 ).wrap( opt.optionDescription() ) << "\n" << std::endl; + << Text( opt.optionDescription(), TextAttributes().setIndent( 2 ) ) << "\n" << std::endl; } } @@ -6018,112 +6159,89 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 33, "integration" ); + Version libraryVersion( 0, 9, 34, "integration" ); } -// #included from: catch_line_wrap.hpp -#define TWOBLUECUBES_CATCH_LINE_WRAP_HPP_INCLUDED +// #included from: catch_text.hpp +#define TWOBLUECUBES_CATCH_TEXT_HPP_INCLUDED + +#include +#include namespace Catch { - LineWrapper::LineWrapper() - : right( CATCH_CONFIG_CONSOLE_WIDTH-1 ), - nextTab( 0 ), - tab( 0 ), - indent( 0 ), - initialIndent( (std::size_t)-1 ), // use indent by default - wrappableChars( " [({.,/|\\" ), - tabChar( '\t' ), - recursionCount( 0 ) - {} + Text::Text( std::string const& _str, TextAttributes const& _attr ) + : attr( _attr ) + { + std::string wrappableChars = " [({.,/|\\-"; + std::size_t indent = _attr.initialIndent != std::string::npos + ? _attr.initialIndent + : _attr.indent; + std::string remainder = _str; - LineWrapper& LineWrapper::setIndent( std::size_t _indent ) { - indent = _indent; - return *this; - } - LineWrapper& LineWrapper::setInitialIndent( std::size_t _initialIndent ) { - initialIndent = _initialIndent; - return *this; - } - LineWrapper& LineWrapper::setRight( std::size_t _right ) { - right = _right; - return *this; - } - LineWrapper& LineWrapper::wrap( std::string const& _str ) { - nextTab = tab = 0; - wrapInternal( _str ); - return *this; - } - LineWrapper& LineWrapper::setTabChar( char _tabChar ) { - tabChar = _tabChar; - return *this; - } - bool LineWrapper::isWrapPoint( char c ) { - return wrappableChars.find( c ) != std::string::npos; - } - void LineWrapper::wrapInternal( std::string const& _str ) { - assert( ++recursionCount < 100 ); - - std::size_t width = right - getCurrentIndent(); - std::size_t wrapPoint = width-tab; - for( std::size_t pos = 0; pos < _str.size(); ++pos ) { - if( _str[pos] == '\n' ) - { - addLine( _str.substr( 0, pos ) ); - nextTab = tab = 0; - return wrapInternal( _str.substr( pos+1 ) ); + while( !remainder.empty() ) { + assert( lines.size() < 1000 ); + std::size_t tabPos = std::string::npos; + std::size_t width = (std::min)( remainder.size(), _attr.width - indent ); + std::size_t pos = remainder.find_first_of( '\n' ); + if( pos <= width ) { + width = pos; } - if( pos == width-tab ) { - if( _str[wrapPoint] == ' ' ) { - addLine( _str.substr( 0, wrapPoint ) ); - while( _str[++wrapPoint] == ' ' ); - } - else if( isWrapPoint( _str[wrapPoint] ) ) { - addLine( _str.substr( 0, wrapPoint ) ); + pos = remainder.find_last_of( _attr.tabChar, width ); + if( pos != std::string::npos ) { + tabPos = pos; + if( remainder[width] == '\n' ) + width--; + remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); + } + + if( width == remainder.size() ) { + spliceLine( indent, remainder, width ); + } + else if( remainder[width] == '\n' ) { + spliceLine( indent, remainder, width ); + if( width <= 1 || remainder.size() != 1 ) + remainder = remainder.substr( 1 ); + indent = _attr.indent; + } + else { + pos = remainder.find_last_of( wrappableChars, width ); + if( pos != std::string::npos && pos > 0 ) { + spliceLine( indent, remainder, pos ); + if( remainder[0] == ' ' ) + remainder = remainder.substr( 1 ); } else { - addLine( _str.substr( 0, --wrapPoint ) + '-' ); + spliceLine( indent, remainder, width-1 ); + lines.back() += "-"; } - return wrapInternal( _str.substr( wrapPoint ) ); - } - if( _str[pos] == tabChar ) { - nextTab = pos; - std::string withoutTab = _str.substr( 0, nextTab ) + _str.substr( nextTab+1 ); - return wrapInternal( withoutTab ); - } - else if( pos > 0 && isWrapPoint( _str[pos] ) ) { - wrapPoint = pos; + if( lines.size() == 1 ) + indent = _attr.indent; + if( tabPos != std::string::npos ) + indent += tabPos; } } - addLine( _str ); } - std::ostream& operator << ( std::ostream& _stream, LineWrapper const& _lineWrapper ) { - for( LineWrapper::const_iterator it = _lineWrapper.begin(), itEnd = _lineWrapper.end(); - it != itEnd; ++it ) { - if( it != _lineWrapper.begin() ) - _stream << "\n"; - _stream << *it; - } - return _stream; + void Text::spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) { + lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) ); + _remainder = _remainder.substr( _pos ); } - std::string LineWrapper::toString() const { + + std::string Text::toString() const { std::ostringstream oss; oss << *this; return oss.str(); } - void LineWrapper::addLine( const std::string& _line ) { - lines.push_back( std::string( tab + getCurrentIndent(), ' ' ) + _line ); - if( nextTab > 0 ) - tab = nextTab; - } - - std::size_t LineWrapper::getCurrentIndent() const - { - return (initialIndent != (std::size_t)-1 && lines.empty() ) - ? initialIndent - : indent; + std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { + for( Text::const_iterator it = _text.begin(), itEnd = _text.end(); + it != itEnd; ++it ) { + if( it != _text.begin() ) + _stream << "\n"; + _stream << *it; + } + return _stream; } } // end namespace Catch @@ -7450,7 +7568,7 @@ namespace Catch { if( result.hasExpandedExpression() ) { stream << "with expansion:\n"; Colour colourGuard( Colour::ReconstructedExpression ); - stream << LineWrapper().setIndent(2).wrap( result.getExpandedExpression() ) << "\n"; + stream << Text( result.getExpandedExpression(), TextAttributes().setIndent(2) ) << "\n"; } } void printMessage() const { @@ -7459,7 +7577,7 @@ namespace Catch { for( std::vector::const_iterator it = messages.begin(), itEnd = messages.end(); it != itEnd; ++it ) { - stream << LineWrapper().setIndent(2).wrap( it->message ) << "\n"; + stream << Text( it->message, TextAttributes().setIndent(2) ) << "\n"; } } void printSourceInfo() const { @@ -7511,10 +7629,7 @@ namespace Catch { } } void printTestCaseAndSectionHeader() { - printOpenHeader( unusedTestCaseInfo->name, - currentSectionInfo - ? currentSectionInfo->lineInfo - : unusedTestCaseInfo->lineInfo ); + printOpenHeader( unusedTestCaseInfo->name ); if( currentSectionInfo ) { Colour colourGuard( Colour::Headers ); std::vector sections; @@ -7527,10 +7642,19 @@ namespace Catch { if( !sections.empty() ) { typedef std::vector::const_reverse_iterator It; for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) - printUserString( (*it)->name, 2 ); + printHeaderString( (*it)->name, 2 ); } } + SourceLineInfo lineInfo = currentSectionInfo + ? currentSectionInfo->lineInfo + : unusedTestCaseInfo->lineInfo; + + if( !lineInfo.empty() ){ + stream << getDashes() << "\n"; + Colour colourGuard( Colour::FileName ); + stream << lineInfo << "\n"; + } stream << getDots() << "\n" << std::endl; } @@ -7538,30 +7662,25 @@ namespace Catch { printOpenHeader( _name ); stream << getDots() << "\n"; } - void printOpenHeader( std::string const& _name, SourceLineInfo const& _lineInfo = SourceLineInfo() ) { + void printOpenHeader( std::string const& _name ) { stream << getDashes() << "\n"; - if( !_lineInfo.empty() ){ - Colour colourGuard( Colour::FileName ); - stream << _lineInfo << "\n\n"; - } { Colour colourGuard( Colour::Headers ); - printUserString( _name ); + printHeaderString( _name ); } } // if string has a : in first line will set indent to follow it on // subsequent lines - void printUserString( std::string const& _string, std::size_t indent = 0 ) { + void printHeaderString( std::string const& _string, std::size_t indent = 0 ) { std::size_t i = _string.find( ": " ); if( i != std::string::npos ) i+=2; else i = 0; - stream << LineWrapper() - .setIndent( indent+i) - .setInitialIndent( indent ) - .wrap( _string ) << "\n"; + stream << Text( _string, TextAttributes() + .setIndent( indent+i) + .setInitialIndent( indent ) ) << "\n"; } void printTotals( const Totals& totals ) { From 003960dc902b0837a9a23483eb5f1eda99a9d851 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 20 Apr 2013 23:12:17 +0100 Subject: [PATCH 218/296] Returned to older version of IsStreamable - this time based on code from Martin Moene https://gist.github.com/martinmoene/5418947#file-insertionopdetector-cpp --- include/internal/catch_sfinae.hpp | 8 +-- include/internal/catch_tostring.hpp | 75 +++++++++++++---------------- projects/SelfTest/TrickyTests.cpp | 14 +++--- 3 files changed, 44 insertions(+), 53 deletions(-) diff --git a/include/internal/catch_sfinae.hpp b/include/internal/catch_sfinae.hpp index ef414f84..ccb6dba9 100644 --- a/include/internal/catch_sfinae.hpp +++ b/include/internal/catch_sfinae.hpp @@ -11,8 +11,6 @@ // Try to detect if the current compiler supports SFINAE #include "catch_compiler_capabilities.h" -#ifdef CATCH_SFINAE - namespace Catch { struct TrueType { @@ -26,6 +24,8 @@ namespace Catch { char sizer[2]; }; +#ifdef CATCH_SFINAE + template struct NotABooleanExpression; template struct If : NotABooleanExpression {}; @@ -35,10 +35,10 @@ namespace Catch { template struct SizedIf; template<> struct SizedIf : TrueType {}; template<> struct SizedIf : FalseType {}; + +#endif // CATCH_SFINAE } // end namespace Catch -#endif // CATCH_SFINAE - #endif // TWOBLUECUBES_CATCH_SFINAE_HPP_INCLUDED diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index 0f7b8380..739dd851 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -20,11 +20,10 @@ #endif namespace Catch { +namespace Detail { #ifdef CATCH_SFINAE -namespace Detail { - template class IsStreamInsertableHelper { template struct TrueIfSizeable : TrueType {}; @@ -40,53 +39,47 @@ namespace Detail { template struct IsStreamInsertable : IsStreamInsertableHelper::type {}; - template - void toStream( std::ostream& os, T const& value, typename IsStreamInsertable::Enable* = 0 ) { - os << value; - } - - template - void toStream( std::ostream& os, T const&, typename IsStreamInsertable::Disable* = 0 ) { - os << "{?}"; - } - -} - -template -struct StringMaker { - static std::string convert( T const& value ) { - std::ostringstream oss; - Detail::toStream( oss, value ); - return oss.str(); - } -}; - #else -namespace Detail { + struct BorgType { + template BorgType( T const& ); + }; + + TrueType& testStreamable( std::ostream& ); + FalseType testStreamable( FalseType ); + + FalseType operator<<( std::ostream const&, BorgType const& ); - struct NonStreamable { - template NonStreamable( const T& ){} + template + struct IsStreamInsertable { + static std::ostream &s; + static T const &t; + enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) }; + }; + +#endif + + template + struct StringMakerBase { + template + static std::string convert( T const& ) { return "{?}"; } + }; + + template<> + struct StringMakerBase { + template + static std::string convert( T const& _value ) { + std::ostringstream oss; + oss << _value; + return oss.str(); + } }; } // end namespace Detail -// If the type does not have its own << overload for ostream then -// this one will be used instead -inline std::ostream& operator << ( std::ostream& ss, Detail::NonStreamable ){ - return ss << "{?}"; -} - template -struct StringMaker { - static std::string convert( T const& value ) { - std::ostringstream oss; - oss << value; - return oss.str(); - } -}; - -#endif +struct StringMaker : + Detail::StringMakerBase::value> {}; template diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index 0dd7c614..c79ad008 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -342,11 +342,9 @@ struct Awkward operator int() const { return 7; } }; -// This now works with GCC/ Clang usinh SFINAE -// Uncomment when it works on all compilers that are tested -//TEST_CASE( "non streamable", "" ) -//{ -// Awkward awkward; -// std::string s = Catch::toString( awkward ); -// REQUIRE( s == "7" ); // This is ambiguous without SFINAE -//} +TEST_CASE( "non streamable - with conv. op", "" ) +{ + Awkward awkward; + std::string s = Catch::toString( awkward ); + REQUIRE( s == "7" ); +} From 9fff9e47d344317f8f2f0e82c505b40666b44b54 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 20 Apr 2013 23:18:44 +0100 Subject: [PATCH 219/296] Complete disable CATCH_SFINAE for now --- include/internal/catch_compiler_capabilities.h | 2 +- include/internal/catch_tostring.hpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h index 7d0d7a3d..e2486a3d 100644 --- a/include/internal/catch_compiler_capabilities.h +++ b/include/internal/catch_compiler_capabilities.h @@ -52,7 +52,7 @@ #elif __GNUC__ >= 3 -#define CATCH_SFINAE +// #define CATCH_SFINAE // Taking this out completely for now #endif // __GNUC__ < 3 diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index 739dd851..e751816e 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -22,6 +22,9 @@ namespace Catch { namespace Detail { +// SFINAE is currently disabled by default for all compilers. +// If the non SFINAE version of IsStreamInsertable is ambiguous for you +// and your compiler supports SFINAE, try #defining CATCH_SFINAE #ifdef CATCH_SFINAE template @@ -81,7 +84,6 @@ template struct StringMaker : Detail::StringMakerBase::value> {}; - template struct StringMaker { static std::string convert( T const* p ) { From dd52044374ef7e91eea9a7add4e9a4564a9a9196 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 20 Apr 2013 23:20:05 +0100 Subject: [PATCH 220/296] Build 35 - non-SFINAE IsStreamInsertable --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 44 +++++++-- single_include/catch.hpp | 96 +++++++++---------- 4 files changed, 84 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 1194a86c..5a0a5563 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 34 (integration branch) +## CATCH v0.9 build 35 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 7332935a..5c5f4ccd 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 34, "integration" ); + Version libraryVersion( 0, 9, 35, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 2a98c58d..30599ef3 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b34 (integration) host application. +CatchSelfTest is a CATCH v0.9 b35 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -5263,6 +5263,18 @@ PASSED: with expansion: true +------------------------------------------------------------------------------- +non streamable - with conv. op +------------------------------------------------------------------------------- +TrickyTests.cpp:345 +............................................................................... + +TrickyTests.cpp:349: +PASSED: + REQUIRE( s == "7" ) +with expansion: + "7" == "7" + ------------------------------------------------------------------------------- Anonymous test case 1 ------------------------------------------------------------------------------- @@ -5519,11 +5531,11 @@ with message: boo! =============================================================================== -111 test cases - 49 failed (705 assertions - 106 failed) +112 test cases - 49 failed (706 assertions - 106 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b34 (integration) host application. +CatchSelfTest is a CATCH v0.9 b35 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -5840,7 +5852,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -6339,6 +6351,7 @@ TrickyTests.cpp:106 + @@ -12023,6 +12036,17 @@ TrickyTests.cpp" line="335">
+ +TrickyTests.cpp" line="349"> + + s == "7" + + + "7" == "7" + + + + @@ -12252,9 +12276,9 @@ BDDTests.cpp" line="54">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -13980,6 +14004,10 @@ TrickyTests.cpp:335: Catch::isTrue( true ) succeeded for: true [Finished: 'Assertions then sections' All tests passed (6 assertions in 1 test case)] +[Running: non streamable - with conv. op] +TrickyTests.cpp:349: s == "7" succeeded for: "7" == "7" +[Finished: 'non streamable - with conv. op' All tests passed (1 assertion in 1 test case)] + [Running: Anonymous test case 1] VariadicMacrosTests.cpp:14: succeeded [with message: anonymous test case] @@ -14091,10 +14119,10 @@ BDDTests.cpp:67: succeeded [End of section: ' Given: A section name that is so long that it cannot fit in a single console width' 1 assertion passed] [Finished: 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 49 of 111 test cases failed (106 of 705 assertions failed)] +[End of group: '~dummy'. 49 of 112 test cases failed (106 of 706 assertions failed)] -[Testing completed. 49 of 111 test cases failed (106 of 705 assertions failed)] +[Testing completed. 49 of 112 test cases failed (106 of 706 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/single_include/catch.hpp b/single_include/catch.hpp index dd7d6e9e..d53a8600 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 34 (integration branch) - * Generated: 2013-04-20 21:05:02.595019 + * CATCH v0.9 build 35 (integration branch) + * Generated: 2013-04-20 23:19:15.811241 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -555,7 +555,7 @@ private: #elif __GNUC__ >= 3 -#define CATCH_SFINAE +// #define CATCH_SFINAE // Taking this out completely for now #endif // __GNUC__ < 3 @@ -572,8 +572,6 @@ private: #endif // _MSC_VER -#ifdef CATCH_SFINAE - namespace Catch { struct TrueType { @@ -587,6 +585,8 @@ namespace Catch { char sizer[2]; }; +#ifdef CATCH_SFINAE + template struct NotABooleanExpression; template struct If : NotABooleanExpression {}; @@ -597,10 +597,10 @@ namespace Catch { template<> struct SizedIf : TrueType {}; template<> struct SizedIf : FalseType {}; -} // end namespace Catch - #endif // CATCH_SFINAE +} // end namespace Catch + #include #include #include @@ -652,11 +652,13 @@ inline id performOptionalSelector( id obj, SEL sel ) { #endif namespace Catch { - -#ifdef CATCH_SFINAE - namespace Detail { +// SFINAE is currently disabled by default for all compilers. +// If the non SFINAE version of IsStreamInsertable is ambiguous for you +// and your compiler supports SFINAE, try #defining CATCH_SFINAE +#ifdef CATCH_SFINAE + template class IsStreamInsertableHelper { template struct TrueIfSizeable : TrueType {}; @@ -672,53 +674,47 @@ namespace Detail { template struct IsStreamInsertable : IsStreamInsertableHelper::type {}; - template - void toStream( std::ostream& os, T const& value, typename IsStreamInsertable::Enable* = 0 ) { - os << value; - } - - template - void toStream( std::ostream& os, T const&, typename IsStreamInsertable::Disable* = 0 ) { - os << "{?}"; - } - -} - -template -struct StringMaker { - static std::string convert( T const& value ) { - std::ostringstream oss; - Detail::toStream( oss, value ); - return oss.str(); - } -}; - #else -namespace Detail { + struct BorgType { + template BorgType( T const& ); + }; - struct NonStreamable { - template NonStreamable( const T& ){} + TrueType& testStreamable( std::ostream& ); + FalseType testStreamable( FalseType ); + + FalseType operator<<( std::ostream const&, BorgType const& ); + + template + struct IsStreamInsertable { + static std::ostream &s; + static T const &t; + enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) }; + }; + +#endif + + template + struct StringMakerBase { + template + static std::string convert( T const& ) { return "{?}"; } + }; + + template<> + struct StringMakerBase { + template + static std::string convert( T const& _value ) { + std::ostringstream oss; + oss << _value; + return oss.str(); + } }; } // end namespace Detail -// If the type does not have its own << overload for ostream then -// this one will be used instead -inline std::ostream& operator << ( std::ostream& ss, Detail::NonStreamable ){ - return ss << "{?}"; -} - template -struct StringMaker { - static std::string convert( T const& value ) { - std::ostringstream oss; - oss << value; - return oss.str(); - } -}; - -#endif +struct StringMaker : + Detail::StringMakerBase::value> {}; template struct StringMaker { @@ -6159,7 +6155,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 34, "integration" ); + Version libraryVersion( 0, 9, 35, "integration" ); } // #included from: catch_text.hpp From 4dd3f68dd930fdb9f26c1776118e663908864931 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 22 Apr 2013 08:19:17 +0100 Subject: [PATCH 221/296] Compiler capabilities clean-up - renamed CATCH_SFINAE -> CATCH_CONFIG_SFINAE - moved variadic macros detection into catch_compiler_capabilities.h --- include/catch.hpp | 9 +-------- include/internal/catch_capture.hpp | 2 ++ .../internal/catch_compiler_capabilities.h | 19 +++++++++++++------ include/internal/catch_section.hpp | 1 + include/internal/catch_sfinae.hpp | 4 ++-- include/internal/catch_test_registry.hpp | 1 + include/internal/catch_tostring.hpp | 4 ++-- projects/SelfTest/VariadicMacrosTests.cpp | 1 - .../CatchSelfTest.xcodeproj/project.pbxproj | 6 +++--- 9 files changed, 25 insertions(+), 22 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index 9e8c2a71..6e57a9da 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -17,14 +17,6 @@ #pragma clang diagnostic ignored "-Wpadded" #endif -// Use variadic macros if the compiler supports them -#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ - ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ - ( defined __GNUC__ && __GNUC__ >= 3 ) || \ - ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) - #define CATCH_CONFIG_VARIADIC_MACROS -#endif - #include "internal/catch_notimplemented_exception.h" #include "internal/catch_context.h" #include "internal/catch_test_registry.hpp" @@ -34,6 +26,7 @@ #include "internal/catch_interfaces_exception.h" #include "internal/catch_approx.hpp" #include "internal/catch_matchers.hpp" +#include "internal/catch_compiler_capabilities.h" // These files are included here so the single_include script doesn't put them // in the conditionally compiled sections diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 575f1931..81eb4a0d 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -16,6 +16,8 @@ #include "catch_context.h" #include "catch_common.h" #include "catch_interfaces_registry_hub.h" +#include "internal/catch_compiler_capabilities.h" + #include namespace Catch { diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h index e2486a3d..6f08a624 100644 --- a/include/internal/catch_compiler_capabilities.h +++ b/include/internal/catch_compiler_capabilities.h @@ -15,7 +15,7 @@ #ifdef __BORLANDC__ #if (__BORLANDC__ > 0x582 ) -//#define CATCH_SFINAE // Not confirmed +//#define CATCH_CONFIG_SFINAE // Not confirmed #endif #endif // __BORLANDC__ @@ -25,7 +25,7 @@ #ifdef __EDG_VERSION__ #if (__EDG_VERSION__ > 238 ) -//#define CATCH_SFINAE // Not confirmed +//#define CATCH_CONFIG_SFINAE // Not confirmed #endif #endif // __EDG_VERSION__ @@ -35,7 +35,7 @@ #ifdef __DMC__ #if (__DMC__ > 0x840 ) -//#define CATCH_SFINAE // Not confirmed +//#define CATCH_CONFIG_SFINAE // Not confirmed #endif #endif // __DMC__ @@ -47,12 +47,12 @@ #if __GNUC__ < 3 #if (__GNUC_MINOR__ >= 96 ) -#define CATCH_SFINAE +#define CATCH_CONFIG_SFINAE #endif #elif __GNUC__ >= 3 -// #define CATCH_SFINAE // Taking this out completely for now +// #define CATCH_CONFIG_SFINAE // Taking this out completely for now #endif // __GNUC__ < 3 @@ -64,11 +64,18 @@ #ifdef _MSC_VER #if (_MSC_VER >= 1310 ) // (VC++ 7.0+) -//#define CATCH_SFINAE // Not confirmed +//#define CATCH_CONFIG_SFINAE // Not confirmed #endif #endif // _MSC_VER +// Use variadic macros if the compiler supports them +#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ + ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ + ( defined __GNUC__ && __GNUC__ >= 3 ) || \ + ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) + #define CATCH_CONFIG_VARIADIC_MACROS +#endif #endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED diff --git a/include/internal/catch_section.hpp b/include/internal/catch_section.hpp index 5c7e53aa..67bced6b 100644 --- a/include/internal/catch_section.hpp +++ b/include/internal/catch_section.hpp @@ -10,6 +10,7 @@ #include "catch_capture.hpp" #include "catch_totals.hpp" +#include "catch_compiler_capabilities.h" #include diff --git a/include/internal/catch_sfinae.hpp b/include/internal/catch_sfinae.hpp index ccb6dba9..bf8749fd 100644 --- a/include/internal/catch_sfinae.hpp +++ b/include/internal/catch_sfinae.hpp @@ -24,7 +24,7 @@ namespace Catch { char sizer[2]; }; -#ifdef CATCH_SFINAE +#ifdef CATCH_CONFIG_SFINAE template struct NotABooleanExpression; @@ -36,7 +36,7 @@ namespace Catch { template<> struct SizedIf : TrueType {}; template<> struct SizedIf : FalseType {}; -#endif // CATCH_SFINAE +#endif // CATCH_CONFIG_SFINAE } // end namespace Catch diff --git a/include/internal/catch_test_registry.hpp b/include/internal/catch_test_registry.hpp index 108de42a..ff0e3e87 100644 --- a/include/internal/catch_test_registry.hpp +++ b/include/internal/catch_test_registry.hpp @@ -10,6 +10,7 @@ #include "catch_common.h" #include "catch_interfaces_testcase.h" +#include "internal/catch_compiler_capabilities.h" namespace Catch { diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index e751816e..5d3bf39a 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -24,8 +24,8 @@ namespace Detail { // SFINAE is currently disabled by default for all compilers. // If the non SFINAE version of IsStreamInsertable is ambiguous for you -// and your compiler supports SFINAE, try #defining CATCH_SFINAE -#ifdef CATCH_SFINAE +// and your compiler supports SFINAE, try #defining CATCH_CONFIG_SFINAE +#ifdef CATCH_CONFIG_SFINAE template class IsStreamInsertableHelper { diff --git a/projects/SelfTest/VariadicMacrosTests.cpp b/projects/SelfTest/VariadicMacrosTests.cpp index 7155f801..f51980c1 100644 --- a/projects/SelfTest/VariadicMacrosTests.cpp +++ b/projects/SelfTest/VariadicMacrosTests.cpp @@ -6,7 +6,6 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -//#define CATCH_CONFIG_VARIADIC_MACROS #include "catch.hpp" TEST_CASE() diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 37f2f351..5993fa47 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -60,8 +60,8 @@ 266ECD73170F3C620030D735 /* BDDTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BDDTests.cpp; path = ../../../SelfTest/BDDTests.cpp; sourceTree = ""; }; 266ECD8C1713614B0030D735 /* catch_legacy_reporter_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_legacy_reporter_adapter.hpp; sourceTree = ""; }; 266ECD8D1713614B0030D735 /* catch_legacy_reporter_adapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_legacy_reporter_adapter.h; sourceTree = ""; }; - 26759472171C72A400A84BD1 /* catch_sfinae.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_sfinae.hpp; sourceTree = ""; }; - 26759473171C74C200A84BD1 /* catch_compiler_capabilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_compiler_capabilities.h; sourceTree = ""; }; + 26759472171C72A400A84BD1 /* catch_sfinae.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_sfinae.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + 26759473171C74C200A84BD1 /* catch_compiler_capabilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_compiler_capabilities.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 26847E5B16BBAB790043B9C1 /* catch_message.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_message.h; sourceTree = ""; }; 26847E5C16BBACB60043B9C1 /* catch_message.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_message.hpp; sourceTree = ""; }; 26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = ""; }; @@ -139,7 +139,7 @@ 4A90B59B15D0F61A00EF71BC /* catch_interfaces_generators.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_generators.h; sourceTree = ""; }; 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 = ""; }; + 4A9D84B11558FC0400FBB209 /* catch_tostring.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_tostring.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 4A9D84B315599AC900FBB209 /* catch_expressionresult_builder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_expressionresult_builder.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 4AA7B8B4165428BA003155F6 /* catch_version.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = catch_version.hpp; path = ../../../../include/internal/catch_version.hpp; sourceTree = ""; }; 4AB1C73514F97BDA00F31DF7 /* catch_console_colour_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_console_colour_impl.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; From 471eba2c32abe6811cdc2acddfbeb0032d0b5fe9 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 22 Apr 2013 18:55:12 +0100 Subject: [PATCH 222/296] Build 36 - incorporation of pull request #154 to allow comparison with nullptr_t - some compiler capability tweaks --- README.md | 2 +- include/internal/catch_evaluate.hpp | 30 ++- include/internal/catch_interfaces_reporter.h | 1 - include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 22 +-- projects/SelfTest/TrickyTests.cpp | 12 ++ .../CatchSelfTest.xcodeproj/project.pbxproj | 12 +- single_include/catch.hpp | 187 ++++++++++-------- 8 files changed, 157 insertions(+), 111 deletions(-) diff --git a/README.md b/README.md index 5a0a5563..9c4ca2cd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 35 (integration branch) +## CATCH v0.9 build 36 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_evaluate.hpp b/include/internal/catch_evaluate.hpp index 5971022a..db1be5ee 100644 --- a/include/internal/catch_evaluate.hpp +++ b/include/internal/catch_evaluate.hpp @@ -33,6 +33,14 @@ namespace Internal { template<> struct OperatorTraits { static const char* getName(){ return "<="; } }; template<> struct OperatorTraits{ static const char* getName(){ return ">="; } }; + template + inline T& opCast(const T& t) { return const_cast(t); } + +// nullptr_t support based on pull request #154 from Konstantin Baumann +#ifdef CATCH_CONFIG_CPP11_NULLPTR + inline std::nullptr_t opCast(std::nullptr_t) { return nullptr; } +#endif // CATCH_CONFIG_CPP11_NULLPTR + // So the compare overloads can be operator agnostic we convey the operator as a template // enum, which is used to specialise an Evaluator for doing the comparison. @@ -42,37 +50,37 @@ namespace Internal { template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs) { - return const_cast( lhs ) == const_cast( rhs ); + return opCast( lhs ) == opCast( rhs ); } }; template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs ) { - return const_cast( lhs ) != const_cast( rhs ); + return opCast( lhs ) != opCast( rhs ); } }; template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs ) { - return const_cast( lhs ) < const_cast( rhs ); + return opCast( lhs ) < opCast( rhs ); } }; template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs ) { - return const_cast( lhs ) > const_cast( rhs ); + return opCast( lhs ) > opCast( rhs ); } }; template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs ) { - return const_cast( lhs ) >= const_cast( rhs ); + return opCast( lhs ) >= opCast( rhs ); } }; template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs ) { - return const_cast( lhs ) <= const_cast( rhs ); + return opCast( lhs ) <= opCast( rhs ); } }; @@ -149,6 +157,16 @@ namespace Internal { template bool compare( T* lhs, int rhs ) { return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); } + +#ifdef CATCH_CONFIG_CPP11_NULLPTR + // pointer to nullptr_t (when comparing against nullptr) + template bool compare( std::nullptr_t, T* rhs ) { + return Evaluator::evaluate( NULL, rhs ); + } + template bool compare( T* lhs, std::nullptr_t ) { + return Evaluator::evaluate( lhs, NULL ); + } +#endif // CATCH_CONFIG_CPP11_NULLPTR } // end of namespace Internal } // end of namespace Catch diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 856b33fc..3fa228b3 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -189,7 +189,6 @@ namespace Catch bool aborting; }; - // !Work In progress struct IStreamingReporter : IShared { virtual ~IStreamingReporter(); diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 5c5f4ccd..05478a72 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 35, "integration" ); + Version libraryVersion( 0, 9, 36, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 30599ef3..e4441aa0 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b35 (integration) host application. +CatchSelfTest is a CATCH v0.9 b36 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -5278,10 +5278,10 @@ with expansion: ------------------------------------------------------------------------------- Anonymous test case 1 ------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:12 +VariadicMacrosTests.cpp:11 ............................................................................... -VariadicMacrosTests.cpp:14: +VariadicMacrosTests.cpp:13: PASSED: with message: anonymous test case @@ -5289,10 +5289,10 @@ with message: ------------------------------------------------------------------------------- Test case with one argument ------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:17 +VariadicMacrosTests.cpp:16 ............................................................................... -VariadicMacrosTests.cpp:19: +VariadicMacrosTests.cpp:18: PASSED: with message: no assertions @@ -5301,10 +5301,10 @@ with message: Variadic macros Section with one argument ------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:24 +VariadicMacrosTests.cpp:23 ............................................................................... -VariadicMacrosTests.cpp:26: +VariadicMacrosTests.cpp:25: PASSED: with message: no assertions @@ -5535,7 +5535,7 @@ with message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b35 (integration) host application. +CatchSelfTest is a CATCH v0.9 b36 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -14009,18 +14009,18 @@ TrickyTests.cpp:349: s == "7" succeeded for: "7" == "7" [Finished: 'non streamable - with conv. op' All tests passed (1 assertion in 1 test case)] [Running: Anonymous test case 1] -VariadicMacrosTests.cpp:14: succeeded +VariadicMacrosTests.cpp:13: succeeded [with message: anonymous test case] [Finished: 'Anonymous test case 1' All tests passed (1 assertion in 1 test case)] [Running: Test case with one argument] -VariadicMacrosTests.cpp:19: succeeded +VariadicMacrosTests.cpp:18: succeeded [with message: no assertions] [Finished: 'Test case with one argument' All tests passed (1 assertion in 1 test case)] [Running: Variadic macros] [Started section: 'Section with one argument'] -VariadicMacrosTests.cpp:26: succeeded +VariadicMacrosTests.cpp:25: succeeded [with message: no assertions] [End of section: 'Section with one argument' 1 assertion passed] diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index c79ad008..ec07f1fc 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -348,3 +348,15 @@ TEST_CASE( "non streamable - with conv. op", "" ) std::string s = Catch::toString( awkward ); REQUIRE( s == "7" ); } + +#ifdef CATCH_CONFIG_CPP11_NULLPTR + +#include + +TEST_CASE( "null_ptr", "" ) +{ + std::unique_ptr ptr; + REQUIRE(ptr.get() == nullptr); +} + +#endif diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 5993fa47..748d288c 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -503,8 +503,8 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; - CLANG_CXX_LIBRARY = "compiler-default"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_CXX0X_EXTENSIONS = YES; CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; @@ -522,7 +522,7 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; - GCC_VERSION = ""; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; @@ -551,8 +551,8 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; - CLANG_CXX_LIBRARY = "compiler-default"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_CXX0X_EXTENSIONS = YES; CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; @@ -564,7 +564,7 @@ GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; - GCC_VERSION = ""; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; diff --git a/single_include/catch.hpp b/single_include/catch.hpp index d53a8600..672d9ead 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 35 (integration branch) - * Generated: 2013-04-20 23:19:15.811241 + * CATCH v0.9 build 36 (integration branch) + * Generated: 2013-04-22 18:53:02.845247 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -21,14 +21,6 @@ #pragma clang diagnostic ignored "-Wpadded" #endif -// Use variadic macros if the compiler supports them -#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ - ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ - ( defined __GNUC__ && __GNUC__ >= 3 ) || \ - ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) - #define CATCH_CONFIG_VARIADIC_MACROS -#endif - // #included from: internal/catch_notimplemented_exception.h #define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED @@ -372,6 +364,77 @@ namespace Catch { }; } +// #included from: internal/catch_compiler_capabilities.h +#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED + +// Much of the following code is based on Boost (1.53) + +//////////////////////////////////////////////////////////////////////////////// +// Borland +#ifdef __BORLANDC__ + +#if (__BORLANDC__ > 0x582 ) +//#define CATCH_CONFIG_SFINAE // Not confirmed +#endif + +#endif // __BORLANDC__ + +//////////////////////////////////////////////////////////////////////////////// +// EDG +#ifdef __EDG_VERSION__ + +#if (__EDG_VERSION__ > 238 ) +//#define CATCH_CONFIG_SFINAE // Not confirmed +#endif + +#endif // __EDG_VERSION__ + +//////////////////////////////////////////////////////////////////////////////// +// Digital Mars +#ifdef __DMC__ + +#if (__DMC__ > 0x840 ) +//#define CATCH_CONFIG_SFINAE // Not confirmed +#endif + +#endif // __DMC__ + +//////////////////////////////////////////////////////////////////////////////// +// GCC +#ifdef __GNUC__ + +#if __GNUC__ < 3 + +#if (__GNUC_MINOR__ >= 96 ) +#define CATCH_CONFIG_SFINAE +#endif + +#elif __GNUC__ >= 3 + +// #define CATCH_CONFIG_SFINAE // Taking this out completely for now + +#endif // __GNUC__ < 3 + +#endif // __GNUC__ + +//////////////////////////////////////////////////////////////////////////////// +// Visual C++ +#ifdef _MSC_VER + +#if (_MSC_VER >= 1310 ) // (VC++ 7.0+) +//#define CATCH_CONFIG_SFINAE // Not confirmed +#endif + +#endif // _MSC_VER + +// Use variadic macros if the compiler supports them +#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ + ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ + ( defined __GNUC__ && __GNUC__ >= 3 ) || \ + ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) + #define CATCH_CONFIG_VARIADIC_MACROS +#endif + namespace Catch { template @@ -508,69 +571,6 @@ private: #define TWOBLUECUBES_CATCH_SFINAE_HPP_INCLUDED // Try to detect if the current compiler supports SFINAE -// #included from: catch_compiler_capabilities.h -#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED - -// Much of the following code is based on Boost (1.53) - -//////////////////////////////////////////////////////////////////////////////// -// Borland -#ifdef __BORLANDC__ - -#if (__BORLANDC__ > 0x582 ) -//#define CATCH_SFINAE // Not confirmed -#endif - -#endif // __BORLANDC__ - -//////////////////////////////////////////////////////////////////////////////// -// EDG -#ifdef __EDG_VERSION__ - -#if (__EDG_VERSION__ > 238 ) -//#define CATCH_SFINAE // Not confirmed -#endif - -#endif // __EDG_VERSION__ - -//////////////////////////////////////////////////////////////////////////////// -// Digital Mars -#ifdef __DMC__ - -#if (__DMC__ > 0x840 ) -//#define CATCH_SFINAE // Not confirmed -#endif - -#endif // __DMC__ - -//////////////////////////////////////////////////////////////////////////////// -// GCC -#ifdef __GNUC__ - -#if __GNUC__ < 3 - -#if (__GNUC_MINOR__ >= 96 ) -#define CATCH_SFINAE -#endif - -#elif __GNUC__ >= 3 - -// #define CATCH_SFINAE // Taking this out completely for now - -#endif // __GNUC__ < 3 - -#endif // __GNUC__ - -//////////////////////////////////////////////////////////////////////////////// -// Visual C++ -#ifdef _MSC_VER - -#if (_MSC_VER >= 1310 ) // (VC++ 7.0+) -//#define CATCH_SFINAE // Not confirmed -#endif - -#endif // _MSC_VER - namespace Catch { @@ -585,7 +585,7 @@ namespace Catch { char sizer[2]; }; -#ifdef CATCH_SFINAE +#ifdef CATCH_CONFIG_SFINAE template struct NotABooleanExpression; @@ -597,7 +597,7 @@ namespace Catch { template<> struct SizedIf : TrueType {}; template<> struct SizedIf : FalseType {}; -#endif // CATCH_SFINAE +#endif // CATCH_CONFIG_SFINAE } // end namespace Catch @@ -656,8 +656,8 @@ namespace Detail { // SFINAE is currently disabled by default for all compilers. // If the non SFINAE version of IsStreamInsertable is ambiguous for you -// and your compiler supports SFINAE, try #defining CATCH_SFINAE -#ifdef CATCH_SFINAE +// and your compiler supports SFINAE, try #defining CATCH_CONFIG_SFINAE +#ifdef CATCH_CONFIG_SFINAE template class IsStreamInsertableHelper { @@ -993,6 +993,14 @@ namespace Internal { template<> struct OperatorTraits { static const char* getName(){ return "<="; } }; template<> struct OperatorTraits{ static const char* getName(){ return ">="; } }; + template + inline T& opCast(const T& t) { return const_cast(t); } + +// nullptr_t support based on pull request #154 from Konstantin Baumann +#ifdef CATCH_CONFIG_CPP11_NULLPTR + inline std::nullptr_t opCast(std::nullptr_t) { return nullptr; } +#endif // CATCH_CONFIG_CPP11_NULLPTR + // So the compare overloads can be operator agnostic we convey the operator as a template // enum, which is used to specialise an Evaluator for doing the comparison. template @@ -1001,37 +1009,37 @@ namespace Internal { template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs) { - return const_cast( lhs ) == const_cast( rhs ); + return opCast( lhs ) == opCast( rhs ); } }; template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs ) { - return const_cast( lhs ) != const_cast( rhs ); + return opCast( lhs ) != opCast( rhs ); } }; template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs ) { - return const_cast( lhs ) < const_cast( rhs ); + return opCast( lhs ) < opCast( rhs ); } }; template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs ) { - return const_cast( lhs ) > const_cast( rhs ); + return opCast( lhs ) > opCast( rhs ); } }; template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs ) { - return const_cast( lhs ) >= const_cast( rhs ); + return opCast( lhs ) >= opCast( rhs ); } }; template struct Evaluator { static bool evaluate( const T1& lhs, const T2& rhs ) { - return const_cast( lhs ) <= const_cast( rhs ); + return opCast( lhs ) <= opCast( rhs ); } }; @@ -1109,6 +1117,16 @@ namespace Internal { return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); } +#ifdef CATCH_CONFIG_CPP11_NULLPTR + // pointer to nullptr_t (when comparing against nullptr) + template bool compare( std::nullptr_t, T* rhs ) { + return Evaluator::evaluate( NULL, rhs ); + } + template bool compare( T* lhs, std::nullptr_t ) { + return Evaluator::evaluate( lhs, NULL ); + } +#endif // CATCH_CONFIG_CPP11_NULLPTR + } // end of namespace Internal } // end of namespace Catch @@ -2420,7 +2438,6 @@ namespace Catch bool aborting; }; - // !Work In progress struct IStreamingReporter : IShared { virtual ~IStreamingReporter(); @@ -6155,7 +6172,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 35, "integration" ); + Version libraryVersion( 0, 9, 36, "integration" ); } // #included from: catch_text.hpp From c887d1a1679659a5c81a43ef05eb3aba88f33cfb Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 22 Apr 2013 22:20:42 +0100 Subject: [PATCH 223/296] Removed rogue CATCH_CONFIG_SFINAE for GCC 3.x --- include/internal/catch_compiler_capabilities.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h index 6f08a624..2e307d03 100644 --- a/include/internal/catch_compiler_capabilities.h +++ b/include/internal/catch_compiler_capabilities.h @@ -47,7 +47,7 @@ #if __GNUC__ < 3 #if (__GNUC_MINOR__ >= 96 ) -#define CATCH_CONFIG_SFINAE +//#define CATCH_CONFIG_SFINAE #endif #elif __GNUC__ >= 3 From 06548a5b6164ba8b6bc8e1b6a235bbac5bf38b2d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 23 Apr 2013 07:59:56 +0100 Subject: [PATCH 224/296] Fix for #144 - string matchers now work with NULLs --- include/internal/catch_matchers.hpp | 31 +++++++++++++++++++++++++---- projects/SelfTest/MiscTests.cpp | 8 ++++---- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/include/internal/catch_matchers.hpp b/include/internal/catch_matchers.hpp index 8fd88ad1..667224db 100644 --- a/include/internal/catch_matchers.hpp +++ b/include/internal/catch_matchers.hpp @@ -105,6 +105,9 @@ namespace Matchers { namespace StdString { + inline std::string makeString( const std::string& str ) { return str; } + inline std::string makeString( const char* str ) { return str ? std::string( str ) : std::string(); } + struct Equals : MatcherImpl { Equals( const std::string& str ) : m_str( str ){} Equals( const Equals& other ) : m_str( other.m_str ){} @@ -196,10 +199,30 @@ namespace Matchers { return Impl::Generic::AnyOf().add( m1 ).add( m2 ).add( m3 ); } - inline Impl::StdString::Equals Equals( const std::string& str ){ return Impl::StdString::Equals( str ); } - inline Impl::StdString::Contains Contains( const std::string& substr ){ return Impl::StdString::Contains( substr ); } - inline Impl::StdString::StartsWith StartsWith( const std::string& substr ){ return Impl::StdString::StartsWith( substr ); } - inline Impl::StdString::EndsWith EndsWith( const std::string& substr ){ return Impl::StdString::EndsWith( substr ); } + inline Impl::StdString::Equals Equals( const std::string& str ) { + return Impl::StdString::Equals( str ); + } + inline Impl::StdString::Equals Equals( const char* str ) { + return Impl::StdString::Equals( Impl::StdString::makeString( str ) ); + } + inline Impl::StdString::Contains Contains( const std::string& substr ) { + return Impl::StdString::Contains( substr ); + } + inline Impl::StdString::Contains Contains( const char* substr ) { + return Impl::StdString::Contains( Impl::StdString::makeString( substr ) ); + } + inline Impl::StdString::StartsWith StartsWith( const std::string& substr ) { + return Impl::StdString::StartsWith( substr ); + } + inline Impl::StdString::StartsWith StartsWith( const char* substr ) { + return Impl::StdString::StartsWith( Impl::StdString::makeString( substr ) ); + } + inline Impl::StdString::EndsWith EndsWith( const std::string& substr ) { + return Impl::StdString::EndsWith( substr ); + } + inline Impl::StdString::EndsWith EndsWith( const char* substr ) { + return Impl::StdString::EndsWith( Impl::StdString::makeString( substr ) ); + } } // namespace Matchers diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index edbda6e1..a77f215f 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -235,10 +235,10 @@ TEST_CASE("./failing/matchers/Equals", "") { CHECK_THAT( testStringForMatching(), Equals( "something else" ) ); } -//TEST_CASE("string", "Equals with NULL") -//{ -// REQUIRE_THAT("", Equals(NULL)); -//} +TEST_CASE("string", "Equals with NULL") +{ + REQUIRE_THAT("", Equals(NULL)); +} TEST_CASE("./succeeding/matchers/AllOf", "") { CHECK_THAT( testStringForMatching(), AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ); From d0d4d93a6be52fcb33cfeeb6dc10c26d4599a3ce Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 23 Apr 2013 08:02:48 +0100 Subject: [PATCH 225/296] Build 37 - string matchers work with NULLs - removed stray CATCH_CONFIG_SFINAE for GCC 3 --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 44 +++++++++++++++---- single_include/catch.hpp | 39 ++++++++++++---- 4 files changed, 69 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 9c4ca2cd..c832139a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 36 (integration branch) +## CATCH v0.9 build 37 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 05478a72..6fcf51a3 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 36, "integration" ); + Version libraryVersion( 0, 9, 37, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index e4441aa0..b68f72f1 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b36 (integration) host application. +CatchSelfTest is a CATCH v0.9 b37 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -2759,6 +2759,18 @@ MiscTests.cpp:236: FAILED: with expansion: "this string contains 'abc' as a substring" equals: "something else" +------------------------------------------------------------------------------- +string +------------------------------------------------------------------------------- +MiscTests.cpp:238 +............................................................................... + +MiscTests.cpp:240: +PASSED: + REQUIRE_THAT( "" Equals(__null) ) +with expansion: + "" equals: "" + ------------------------------------------------------------------------------- ./succeeding/matchers/AllOf ------------------------------------------------------------------------------- @@ -5531,11 +5543,11 @@ with message: boo! =============================================================================== -112 test cases - 49 failed (706 assertions - 106 failed) +113 test cases - 49 failed (707 assertions - 106 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b36 (integration) host application. +CatchSelfTest is a CATCH v0.9 b37 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -5852,7 +5864,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -6276,6 +6288,7 @@ MiscTests.cpp:231 MiscTests.cpp:236 + @@ -9714,6 +9727,17 @@ MiscTests.cpp" line="236"> + +MiscTests.cpp" line="240"> + + "" Equals(__null) + + + "" equals: "" + + + + MiscTests.cpp" line="244"> @@ -12276,9 +12300,9 @@ BDDTests.cpp" line="54">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -13010,6 +13034,10 @@ MiscTests.cpp:236: 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: string] +MiscTests.cpp:240: "" Equals(__null) succeeded for: "" equals: "" +[Finished: 'string' All tests passed (1 assertion in 1 test case)] + [Running: ./succeeding/matchers/AllOf] MiscTests.cpp:244: testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) succeeded for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" ) @@ -14119,10 +14147,10 @@ BDDTests.cpp:67: succeeded [End of section: ' Given: A section name that is so long that it cannot fit in a single console width' 1 assertion passed] [Finished: 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 49 of 112 test cases failed (106 of 706 assertions failed)] +[End of group: '~dummy'. 49 of 113 test cases failed (106 of 707 assertions failed)] -[Testing completed. 49 of 112 test cases failed (106 of 706 assertions failed)] +[Testing completed. 49 of 113 test cases failed (106 of 707 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 672d9ead..04abb256 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 36 (integration branch) - * Generated: 2013-04-22 18:53:02.845247 + * CATCH v0.9 build 37 (integration branch) + * Generated: 2013-04-23 08:01:34.500704 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -406,7 +406,7 @@ namespace Catch { #if __GNUC__ < 3 #if (__GNUC_MINOR__ >= 96 ) -#define CATCH_CONFIG_SFINAE +//#define CATCH_CONFIG_SFINAE #endif #elif __GNUC__ >= 3 @@ -3237,6 +3237,9 @@ namespace Matchers { namespace StdString { + inline std::string makeString( const std::string& str ) { return str; } + inline std::string makeString( const char* str ) { return str ? std::string( str ) : std::string(); } + struct Equals : MatcherImpl { Equals( const std::string& str ) : m_str( str ){} Equals( const Equals& other ) : m_str( other.m_str ){} @@ -3328,10 +3331,30 @@ namespace Matchers { return Impl::Generic::AnyOf().add( m1 ).add( m2 ).add( m3 ); } - inline Impl::StdString::Equals Equals( const std::string& str ){ return Impl::StdString::Equals( str ); } - inline Impl::StdString::Contains Contains( const std::string& substr ){ return Impl::StdString::Contains( substr ); } - inline Impl::StdString::StartsWith StartsWith( const std::string& substr ){ return Impl::StdString::StartsWith( substr ); } - inline Impl::StdString::EndsWith EndsWith( const std::string& substr ){ return Impl::StdString::EndsWith( substr ); } + inline Impl::StdString::Equals Equals( const std::string& str ) { + return Impl::StdString::Equals( str ); + } + inline Impl::StdString::Equals Equals( const char* str ) { + return Impl::StdString::Equals( Impl::StdString::makeString( str ) ); + } + inline Impl::StdString::Contains Contains( const std::string& substr ) { + return Impl::StdString::Contains( substr ); + } + inline Impl::StdString::Contains Contains( const char* substr ) { + return Impl::StdString::Contains( Impl::StdString::makeString( substr ) ); + } + inline Impl::StdString::StartsWith StartsWith( const std::string& substr ) { + return Impl::StdString::StartsWith( substr ); + } + inline Impl::StdString::StartsWith StartsWith( const char* substr ) { + return Impl::StdString::StartsWith( Impl::StdString::makeString( substr ) ); + } + inline Impl::StdString::EndsWith EndsWith( const std::string& substr ) { + return Impl::StdString::EndsWith( substr ); + } + inline Impl::StdString::EndsWith EndsWith( const char* substr ) { + return Impl::StdString::EndsWith( Impl::StdString::makeString( substr ) ); + } } // namespace Matchers @@ -6172,7 +6195,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 36, "integration" ); + Version libraryVersion( 0, 9, 37, "integration" ); } // #included from: catch_text.hpp From 2a9d8d9e368a8da58733df6746baff4bb76312d2 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 23 Apr 2013 18:58:56 +0100 Subject: [PATCH 226/296] Changed "const X ref"s to "X const ref"s - Brought older code up to current convention (with the help of a Python script) --- include/internal/catch_approx.hpp | 12 ++-- include/internal/catch_assertionresult.h | 8 +-- include/internal/catch_assertionresult.hpp | 8 +-- include/internal/catch_capture.hpp | 14 ++-- include/internal/catch_commandline.hpp | 56 +++++++-------- include/internal/catch_common.h | 24 +++---- include/internal/catch_config.hpp | 16 ++--- include/internal/catch_context.h | 4 +- include/internal/catch_context_impl.hpp | 8 +-- include/internal/catch_debugger.hpp | 4 +- include/internal/catch_evaluate.hpp | 18 ++--- .../internal/catch_expression_decomposer.hpp | 4 +- include/internal/catch_expression_lhs.hpp | 24 +++---- .../internal/catch_expressionresult_builder.h | 16 ++--- .../catch_expressionresult_builder.hpp | 14 ++-- include/internal/catch_generators_impl.hpp | 2 +- include/internal/catch_interfaces_capture.h | 2 +- .../internal/catch_interfaces_generators.h | 2 +- .../internal/catch_interfaces_registry_hub.h | 8 +-- include/internal/catch_interfaces_reporter.h | 6 +- include/internal/catch_interfaces_testcase.h | 4 +- include/internal/catch_list.hpp | 10 +-- include/internal/catch_matchers.hpp | 68 +++++++++---------- .../internal/catch_notimplemented_exception.h | 2 +- .../catch_notimplemented_exception.hpp | 2 +- include/internal/catch_objc.hpp | 6 +- include/internal/catch_option.hpp | 2 +- include/internal/catch_registry_hub.hpp | 12 ++-- .../internal/catch_reporter_registrars.hpp | 8 +-- include/internal/catch_reporter_registry.hpp | 6 +- include/internal/catch_runner_impl.hpp | 22 +++--- include/internal/catch_running_test.hpp | 10 +-- include/internal/catch_section.hpp | 6 +- include/internal/catch_section_info.hpp | 6 +- include/internal/catch_stream.hpp | 2 +- include/internal/catch_tags.hpp | 20 +++--- include/internal/catch_test_case_info.h | 40 +++++------ include/internal/catch_test_case_info.hpp | 40 +++++------ .../catch_test_case_registry_impl.hpp | 16 ++--- include/internal/catch_test_registry.hpp | 4 +- include/internal/catch_test_spec.h | 14 ++-- include/internal/catch_tostring.hpp | 10 +-- include/internal/catch_totals.hpp | 10 +-- include/internal/catch_xmlwriter.hpp | 24 +++---- 44 files changed, 297 insertions(+), 297 deletions(-) diff --git a/include/internal/catch_approx.hpp b/include/internal/catch_approx.hpp index 128ef050..2f467a36 100644 --- a/include/internal/catch_approx.hpp +++ b/include/internal/catch_approx.hpp @@ -24,7 +24,7 @@ namespace Detail { m_value( value ) {} - Approx( const Approx& other ) + Approx( Approx const& other ) : m_epsilon( other.m_epsilon ), m_scale( other.m_scale ), m_value( other.m_value ) @@ -41,20 +41,20 @@ namespace Detail { return approx; } - friend bool operator == ( double lhs, const Approx& rhs ) { + friend bool operator == ( double lhs, Approx const& rhs ) { // Thanks to Richard Harris for his help refining this formula return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) ); } - friend bool operator == ( const Approx& lhs, double rhs ) { + friend bool operator == ( Approx const& lhs, double rhs ) { return operator==( rhs, lhs ); } - friend bool operator != ( double lhs, const Approx& rhs ) { + friend bool operator != ( double lhs, Approx const& rhs ) { return !operator==( lhs, rhs ); } - friend bool operator != ( const Approx& lhs, double rhs ) { + friend bool operator != ( Approx const& lhs, double rhs ) { return !operator==( rhs, lhs ); } @@ -82,7 +82,7 @@ namespace Detail { } template<> -inline std::string toString( const Detail::Approx& value ) { +inline std::string toString( Detail::Approx const& value ) { return value.toString(); } diff --git a/include/internal/catch_assertionresult.h b/include/internal/catch_assertionresult.h index 37372b67..b3f63e04 100644 --- a/include/internal/catch_assertionresult.h +++ b/include/internal/catch_assertionresult.h @@ -16,9 +16,9 @@ namespace Catch { struct AssertionInfo { AssertionInfo() {} - AssertionInfo( const std::string& _macroName, - const SourceLineInfo& _lineInfo, - const std::string& _capturedExpression, + AssertionInfo( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + std::string const& _capturedExpression, ResultDisposition::Flags _resultDisposition ); std::string macroName; @@ -39,7 +39,7 @@ namespace Catch { class AssertionResult { public: AssertionResult(); - AssertionResult( const AssertionInfo& info, const AssertionResultData& data ); + AssertionResult( AssertionInfo const& info, AssertionResultData const& data ); ~AssertionResult(); bool isOk() const; diff --git a/include/internal/catch_assertionresult.hpp b/include/internal/catch_assertionresult.hpp index 91853307..5ba2f458 100644 --- a/include/internal/catch_assertionresult.hpp +++ b/include/internal/catch_assertionresult.hpp @@ -13,9 +13,9 @@ namespace Catch { - AssertionInfo::AssertionInfo( const std::string& _macroName, - const SourceLineInfo& _lineInfo, - const std::string& _capturedExpression, + AssertionInfo::AssertionInfo( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + std::string const& _capturedExpression, ResultDisposition::Flags _resultDisposition ) : macroName( _macroName ), lineInfo( _lineInfo ), @@ -28,7 +28,7 @@ namespace Catch { AssertionResult::AssertionResult() {} - AssertionResult::AssertionResult( const AssertionInfo& info, const AssertionResultData& data ) + AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data ) : m_info( info ), m_resultData( data ) {} diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 81eb4a0d..a8aa98b1 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -27,8 +27,8 @@ namespace Catch { } template - ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, - const std::string& matcherCallAsString ) { + ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher, + std::string const& matcherCallAsString ) { std::string matcherAsString = matcher.toString(); if( matcherAsString == "{?}" ) matcherAsString = matcherCallAsString; @@ -38,18 +38,18 @@ namespace Catch { } template - ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, - const ArgT& arg, - const std::string& matcherCallAsString ) { + ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher, + ArgT const& arg, + std::string const& matcherCallAsString ) { return expressionResultBuilderFromMatcher( matcher, matcherCallAsString ) .setLhs( Catch::toString( arg ) ) .setResultType( matcher.match( arg ) ); } template - ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, + ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher, ArgT* arg, - const std::string& matcherCallAsString ) { + std::string const& matcherCallAsString ) { return expressionResultBuilderFromMatcher( matcher, matcherCallAsString ) .setLhs( Catch::toString( arg ) ) .setResultType( matcher.match( arg ) ); diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 4c32d7f3..7657da6b 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -17,20 +17,20 @@ namespace Catch { public: Command(){} - explicit Command( const std::string& name ) : m_name( name ) { + explicit Command( std::string const& name ) : m_name( name ) { } - Command& operator += ( const std::string& arg ) { + Command& operator += ( std::string const& arg ) { m_args.push_back( arg ); return *this; } - Command& operator += ( const Command& other ) { + Command& operator += ( Command const& other ) { std::copy( other.m_args.begin(), other.m_args.end(), std::back_inserter( m_args ) ); if( m_name.empty() ) m_name = other.m_name; return *this; } - Command operator + ( const Command& other ) { + Command operator + ( Command const& other ) { Command newCommand( *this ); newCommand += other; return newCommand; @@ -45,7 +45,7 @@ namespace Catch { std::size_t argsCount() const { return m_args.size(); } CATCH_ATTRIBUTE_NORETURN - void raiseError( const std::string& message ) const { + void raiseError( std::string const& message ) const { std::ostringstream oss; if( m_name.empty() ) oss << "Error while parsing " << m_name << ". " << message << "."; @@ -76,14 +76,14 @@ namespace Catch { exeName = exeName.substr( pos+1 ); return exeName; } - Command find( const std::string& arg1, const std::string& arg2, const std::string& arg3 ) const { + Command find( std::string const& arg1, std::string const& arg2, std::string const& arg3 ) const { return find( arg1 ) + find( arg2 ) + find( arg3 ); } - Command find( const std::string& shortArg, const std::string& longArg ) const { + Command find( std::string const& shortArg, std::string const& longArg ) const { return find( shortArg ) + find( longArg ); } - Command find( const std::string& arg ) const { + Command find( std::string const& arg ) const { if( arg.empty() ) return getArgs( "", 1 ); else @@ -97,7 +97,7 @@ namespace Catch { } private: - Command getArgs( const std::string& cmdName, std::size_t from ) const { + Command getArgs( std::string const& cmdName, std::size_t from ) const { Command command( cmdName ); for( std::size_t i = from; i < m_argc && m_argv[i][0] != '-'; ++i ) command += m_argv[i]; @@ -116,7 +116,7 @@ namespace Catch { virtual ~OptionParser() {} - Command find( const CommandParser& parser ) const { + Command find( CommandParser const& parser ) const { Command cmd; for( std::vector::const_iterator it = m_optionNames.begin(); it != m_optionNames.end(); @@ -125,7 +125,7 @@ namespace Catch { return cmd; } - void validateArgs( const Command& args ) const { + void validateArgs( Command const& args ) const { if( tooFewArgs( args ) || tooManyArgs( args ) ) { std::ostringstream oss; if( m_maxArgs == -1 ) @@ -138,14 +138,14 @@ namespace Catch { } } - void parseIntoConfig( const CommandParser& parser, ConfigData& config ) { + void parseIntoConfig( CommandParser const& parser, ConfigData& config ) { if( Command cmd = find( parser ) ) { validateArgs( cmd ); parseIntoConfig( cmd, config ); } } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) = 0; + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) = 0; virtual std::string argsSynopsis() const = 0; virtual std::string optionSummary() const = 0; virtual std::string optionDescription() const { return ""; } @@ -171,10 +171,10 @@ namespace Catch { protected: - bool tooFewArgs( const Command& args ) const { + bool tooFewArgs( Command const& args ) const { return args.argsCount() < static_cast( m_minArgs ); } - bool tooManyArgs( const Command& args ) const { + bool tooManyArgs( Command const& args ) const { return m_maxArgs >= 0 && args.argsCount() > static_cast( m_maxArgs ); } std::vector m_optionNames; @@ -201,7 +201,7 @@ namespace Catch { return ""; } - virtual void parseIntoConfig( const Command&, ConfigData& ) { + virtual void parseIntoConfig( Command const&, ConfigData& ) { // Does not affect config } }; @@ -254,7 +254,7 @@ namespace Catch { "that start with 'a/b/', except 'a/b/c', which is included"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { std::string groupName; for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { if( i != 0 ) @@ -300,7 +300,7 @@ namespace Catch { "matches all tests tagged [one], except those also tagged [two]"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { std::string groupName; for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { if( i != 0 ) @@ -345,7 +345,7 @@ namespace Catch { ;//" -l xml"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { config.listSpec = List::Tests; if( cmd.argsCount() >= 1 ) { if( cmd[0] == "all" ) @@ -404,7 +404,7 @@ namespace Catch { "of the root node."; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { config.reporter = cmd[0]; } }; @@ -438,7 +438,7 @@ namespace Catch { " -o %debug \t(The IDE's debug output window - currently only Windows' " "OutputDebugString is supported)."; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { if( cmd[0][0] == '%' ) config.stream = cmd[0].substr( 1 ); else @@ -465,7 +465,7 @@ namespace Catch { "added worked first time!). To see successful, as well as failing, test results " "just pass this option."; } - virtual void parseIntoConfig( const Command&, ConfigData& config ) { + virtual void parseIntoConfig( Command const&, ConfigData& config ) { config.includeWhichResults = Include::SuccessfulResults; } }; @@ -491,7 +491,7 @@ namespace Catch { "built your code with the DEBUG preprocessor symbol"; } - virtual void parseIntoConfig( const Command&, ConfigData& config ) { + virtual void parseIntoConfig( Command const&, ConfigData& config ) { config.shouldDebugBreak = true; } }; @@ -521,7 +521,7 @@ namespace Catch { " -n \"tests of the widget component\""; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { config.name = cmd[0]; } }; @@ -550,7 +550,7 @@ namespace Catch { "number causes it to abort after that number of assertion failures."; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { int threshold = 1; if( cmd.argsCount() == 1 ) { std::stringstream ss; @@ -589,7 +589,7 @@ namespace Catch { "as not to contribute additional noise."; } - virtual void parseIntoConfig( const Command&, ConfigData& config ) { + virtual void parseIntoConfig( Command const&, ConfigData& config ) { config.allowThrows = false; } }; @@ -620,7 +620,7 @@ namespace Catch { " -w NoAssertions"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { if( cmd[i] == "NoAssertions" ) config.warnings = (ConfigData::WarnAbout::What)( config.warnings | ConfigData::WarnAbout::NoAssertions ); @@ -655,7 +655,7 @@ namespace Catch { add(); // Keep this one last } - void parseIntoConfig( const CommandParser& parser, ConfigData& config ) { + void parseIntoConfig( CommandParser const& parser, ConfigData& config ) { config.name = parser.exeName(); if( endsWith( config.name, ".exe" ) ) config.name = config.name.substr( 0, config.name.size()-4 ); diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index d6627878..954f6170 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -28,8 +28,8 @@ namespace Catch { class NonCopyable { - NonCopyable( const NonCopyable& ); - void operator = ( const NonCopyable& ); + NonCopyable( NonCopyable const& ); + void operator = ( NonCopyable const& ); protected: NonCopyable() {} virtual ~NonCopyable(); @@ -67,17 +67,17 @@ namespace Catch { } template - inline void forEach( const ContainerT& container, Function function ) { + inline void forEach( ContainerT const& container, Function function ) { std::for_each( container.begin(), container.end(), function ); } - inline bool startsWith( const std::string& s, const std::string& prefix ) { + inline bool startsWith( std::string const& s, std::string const& prefix ) { return s.size() >= prefix.size() && s.substr( 0, prefix.size() ) == prefix; } - inline bool endsWith( const std::string& s, const std::string& suffix ) { + inline bool endsWith( std::string const& s, std::string const& suffix ) { return s.size() >= suffix.size() && s.substr( s.size()-suffix.size(), suffix.size() ) == suffix; } - inline bool contains( const std::string& s, const std::string& infix ) { + inline bool contains( std::string const& s, std::string const& infix ) { return s.find( infix ) != std::string::npos; } inline void toLowerInPlace( std::string& s ) { @@ -90,12 +90,12 @@ namespace Catch { } struct pluralise { - pluralise( std::size_t count, const std::string& label ) + pluralise( std::size_t count, std::string const& label ) : m_count( count ), m_label( label ) {} - friend std::ostream& operator << ( std::ostream& os, const pluralise& pluraliser ) { + friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) { os << pluraliser.m_count << " " << pluraliser.m_label; if( pluraliser.m_count != 1 ) os << "s"; @@ -109,11 +109,11 @@ namespace Catch { struct SourceLineInfo { SourceLineInfo() : line( 0 ){} - SourceLineInfo( const std::string& _file, std::size_t _line ) + SourceLineInfo( std::string const& _file, std::size_t _line ) : file( _file ), line( _line ) {} - SourceLineInfo( const SourceLineInfo& other ) + SourceLineInfo( SourceLineInfo const& other ) : file( other.file ), line( other.line ) {} @@ -125,7 +125,7 @@ namespace Catch { std::size_t line; }; - inline std::ostream& operator << ( std::ostream& os, const SourceLineInfo& info ) { + inline std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) { #ifndef __GNUG__ os << info.file << "(" << info.line << ")"; #else @@ -135,7 +135,7 @@ namespace Catch { } CATCH_ATTRIBUTE_NORETURN - inline void throwLogicError( const std::string& message, const SourceLineInfo& locationInfo ) { + inline void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ) { std::ostringstream oss; oss << locationInfo << ": Internal Catch error: '" << message << "'"; throw std::logic_error( oss.str() ); diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 0e5de388..87c7d734 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -77,8 +77,8 @@ namespace Catch { class Config : public IConfig { private: - Config( const Config& other ); - Config& operator = ( const Config& other ); + Config( Config const& other ); + Config& operator = ( Config const& other ); virtual void dummy(); public: @@ -86,7 +86,7 @@ namespace Catch { : m_os( std::cout.rdbuf() ) {} - Config( const ConfigData& data ) + Config( ConfigData const& data ) : m_data( data ), m_os( std::cout.rdbuf() ) {} @@ -96,7 +96,7 @@ namespace Catch { m_stream.release(); } - void setFilename( const std::string& filename ) { + void setFilename( std::string const& filename ) { m_data.outputFilename = filename; } @@ -104,7 +104,7 @@ namespace Catch { return m_data.listSpec; } - const std::string& getFilename() const { + std::string const& getFilename() const { return m_data.outputFilename ; } @@ -132,14 +132,14 @@ namespace Catch { m_os.rdbuf( buf ? buf : std::cout.rdbuf() ); } - void useStream( const std::string& streamName ) { + void useStream( std::string const& streamName ) { Stream stream = createStream( streamName ); setStreamBuf( stream.streamBuf ); m_stream.release(); m_stream = stream; } - void addTestSpec( const std::string& testSpec ) { + void addTestSpec( std::string const& testSpec ) { TestCaseFilters filters( testSpec ); filters.addFilter( TestCaseFilter( testSpec ) ); m_data.filters.push_back( filters ); @@ -157,7 +157,7 @@ namespace Catch { return m_data.allowThrows; } - const ConfigData& data() const { + ConfigData const& data() const { return m_data; } ConfigData& data() { diff --git a/include/internal/catch_context.h b/include/internal/catch_context.h index 831d22a3..5b4976c6 100644 --- a/include/internal/catch_context.h +++ b/include/internal/catch_context.h @@ -29,7 +29,7 @@ namespace Catch { virtual IResultCapture& getResultCapture() = 0; virtual IRunner& getRunner() = 0; - virtual size_t getGeneratorIndex( const std::string& fileInfo, size_t totalSize ) = 0; + virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0; virtual bool advanceGeneratorsForCurrentTest() = 0; virtual const IConfig* getConfig() const = 0; }; @@ -45,7 +45,7 @@ namespace Catch { IContext& getCurrentContext(); IMutableContext& getCurrentMutableContext(); void cleanUpContext(); - Stream createStream( const std::string& streamName ); + Stream createStream( std::string const& streamName ); } diff --git a/include/internal/catch_context_impl.hpp b/include/internal/catch_context_impl.hpp index e9695725..d14aed40 100644 --- a/include/internal/catch_context_impl.hpp +++ b/include/internal/catch_context_impl.hpp @@ -18,8 +18,8 @@ namespace Catch { class Context : public IMutableContext { Context() : m_config( NULL ) {} - Context( const Context& ); - void operator=( const Context& ); + Context( Context const& ); + void operator=( Context const& ); public: // IContext virtual IResultCapture& getResultCapture() { @@ -28,7 +28,7 @@ namespace Catch { virtual IRunner& getRunner() { return *m_runner; } - virtual size_t getGeneratorIndex( const std::string& fileInfo, size_t totalSize ) { + virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) { return getGeneratorsForCurrentTest() .getGeneratorInfo( fileInfo, totalSize ) .getCurrentIndex(); @@ -95,7 +95,7 @@ namespace Catch { return getCurrentMutableContext(); } - Stream createStream( const std::string& streamName ) { + Stream createStream( std::string const& streamName ) { if( streamName == "stdout" ) return Stream( std::cout.rdbuf(), false ); if( streamName == "stderr" ) return Stream( std::cerr.rdbuf(), false ); if( streamName == "debug" ) return Stream( new StreamBufImpl, true ); diff --git a/include/internal/catch_debugger.hpp b/include/internal/catch_debugger.hpp index 42769898..89e15d69 100644 --- a/include/internal/catch_debugger.hpp +++ b/include/internal/catch_debugger.hpp @@ -103,11 +103,11 @@ #ifdef CATCH_PLATFORM_WINDOWS extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA( const char* ); -inline void writeToDebugConsole( const std::string& text ) { +inline void writeToDebugConsole( std::string const& text ) { ::OutputDebugStringA( text.c_str() ); } #else -inline void writeToDebugConsole( const std::string& text ) { +inline void writeToDebugConsole( std::string const& text ) { // !TBD: Need a version for Mac/ XCode and other IDEs std::cout << text; } diff --git a/include/internal/catch_evaluate.hpp b/include/internal/catch_evaluate.hpp index db1be5ee..3592e2a7 100644 --- a/include/internal/catch_evaluate.hpp +++ b/include/internal/catch_evaluate.hpp @@ -34,7 +34,7 @@ namespace Internal { template<> struct OperatorTraits{ static const char* getName(){ return ">="; } }; template - inline T& opCast(const T& t) { return const_cast(t); } + inline T& opCast(T const& t) { return const_cast(t); } // nullptr_t support based on pull request #154 from Konstantin Baumann #ifdef CATCH_CONFIG_CPP11_NULLPTR @@ -49,43 +49,43 @@ namespace Internal { template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs) { + static bool evaluate( T1 const& lhs, T2 const& rhs) { return opCast( lhs ) == opCast( rhs ); } }; template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs ) { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { return opCast( lhs ) != opCast( rhs ); } }; template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs ) { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { return opCast( lhs ) < opCast( rhs ); } }; template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs ) { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { return opCast( lhs ) > opCast( rhs ); } }; template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs ) { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { return opCast( lhs ) >= opCast( rhs ); } }; template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs ) { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { return opCast( lhs ) <= opCast( rhs ); } }; template - bool applyEvaluator( const T1& lhs, const T2& rhs ) { + bool applyEvaluator( T1 const& lhs, T2 const& rhs ) { return Evaluator::evaluate( lhs, rhs ); } @@ -94,7 +94,7 @@ namespace Internal { // "base" overload template - bool compare( const T1& lhs, const T2& rhs ) { + bool compare( T1 const& lhs, T2 const& rhs ) { return Evaluator::evaluate( lhs, rhs ); } diff --git a/include/internal/catch_expression_decomposer.hpp b/include/internal/catch_expression_decomposer.hpp index 1d8ca73d..9d8fd352 100644 --- a/include/internal/catch_expression_decomposer.hpp +++ b/include/internal/catch_expression_decomposer.hpp @@ -17,8 +17,8 @@ class ExpressionDecomposer { public: template - ExpressionLhs operator->* ( const T & operand ) { - return ExpressionLhs( operand ); + ExpressionLhs operator->* ( T const& operand ) { + return ExpressionLhs( operand ); } ExpressionLhs operator->* ( bool value ) { diff --git a/include/internal/catch_expression_lhs.hpp b/include/internal/catch_expression_lhs.hpp index 2cc7397d..21cc593a 100644 --- a/include/internal/catch_expression_lhs.hpp +++ b/include/internal/catch_expression_lhs.hpp @@ -19,38 +19,38 @@ struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; // in an ExpressionResultBuilder object template class ExpressionLhs { - void operator = ( const ExpressionLhs& ); + void operator = ( ExpressionLhs const& ); public: ExpressionLhs( T lhs ) : m_lhs( lhs ) {} template - ExpressionResultBuilder& operator == ( const RhsT& rhs ) { + ExpressionResultBuilder& operator == ( RhsT const& rhs ) { return captureExpression( rhs ); } template - ExpressionResultBuilder& operator != ( const RhsT& rhs ) { + ExpressionResultBuilder& operator != ( RhsT const& rhs ) { return captureExpression( rhs ); } template - ExpressionResultBuilder& operator < ( const RhsT& rhs ) { + ExpressionResultBuilder& operator < ( RhsT const& rhs ) { return captureExpression( rhs ); } template - ExpressionResultBuilder& operator > ( const RhsT& rhs ) { + ExpressionResultBuilder& operator > ( RhsT const& rhs ) { return captureExpression( rhs ); } template - ExpressionResultBuilder& operator <= ( const RhsT& rhs ) { + ExpressionResultBuilder& operator <= ( RhsT const& rhs ) { return captureExpression( rhs ); } template - ExpressionResultBuilder& operator >= ( const RhsT& rhs ) { + ExpressionResultBuilder& operator >= ( RhsT const& rhs ) { return captureExpression( rhs ); } @@ -72,14 +72,14 @@ public: // 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& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( RhsT const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( RhsT const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( RhsT const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( RhsT const& ); private: template - ExpressionResultBuilder& captureExpression( const RhsT& rhs ) { + ExpressionResultBuilder& captureExpression( RhsT const& rhs ) { return m_result .setResultType( Internal::compare( m_lhs, rhs ) ) .setLhs( Catch::toString( m_lhs ) ) diff --git a/include/internal/catch_expressionresult_builder.h b/include/internal/catch_expressionresult_builder.h index eb9109f9..5bf41379 100644 --- a/include/internal/catch_expressionresult_builder.h +++ b/include/internal/catch_expressionresult_builder.h @@ -22,26 +22,26 @@ class ExpressionResultBuilder { public: ExpressionResultBuilder( ResultWas::OfType resultType = ResultWas::Unknown ); - ExpressionResultBuilder( const ExpressionResultBuilder& other ); - ExpressionResultBuilder& operator=(const ExpressionResultBuilder& other ); + ExpressionResultBuilder( ExpressionResultBuilder const& other ); + ExpressionResultBuilder& operator=(ExpressionResultBuilder const& 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& setLhs( std::string const& lhs ); + ExpressionResultBuilder& setRhs( std::string const& rhs ); + ExpressionResultBuilder& setOp( std::string const& op ); ExpressionResultBuilder& endExpression( ResultDisposition::Flags resultDisposition ); template - ExpressionResultBuilder& operator << ( const T& value ) { + ExpressionResultBuilder& operator << ( T const& value ) { m_stream << value; return *this; } - std::string reconstructExpression( const AssertionInfo& info ) const; + std::string reconstructExpression( AssertionInfo const& info ) const; - AssertionResult buildResult( const AssertionInfo& info ) const; + AssertionResult buildResult( AssertionInfo const& info ) const; private: AssertionResultData m_data; diff --git a/include/internal/catch_expressionresult_builder.hpp b/include/internal/catch_expressionresult_builder.hpp index c1484fb7..ec4774b2 100644 --- a/include/internal/catch_expressionresult_builder.hpp +++ b/include/internal/catch_expressionresult_builder.hpp @@ -17,13 +17,13 @@ namespace Catch { ExpressionResultBuilder::ExpressionResultBuilder( ResultWas::OfType resultType ) { m_data.resultType = resultType; } - ExpressionResultBuilder::ExpressionResultBuilder( const ExpressionResultBuilder& other ) + ExpressionResultBuilder::ExpressionResultBuilder( ExpressionResultBuilder const& other ) : m_data( other.m_data ), m_exprComponents( other.m_exprComponents ) { m_stream << other.m_stream.str(); } - ExpressionResultBuilder& ExpressionResultBuilder::operator=(const ExpressionResultBuilder& other ) { + ExpressionResultBuilder& ExpressionResultBuilder::operator=(ExpressionResultBuilder const& other ) { m_data = other.m_data; m_exprComponents = other.m_exprComponents; m_stream.str(""); @@ -42,19 +42,19 @@ namespace Catch { m_exprComponents.shouldNegate = shouldNegate( resultDisposition ); return *this; } - ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { + ExpressionResultBuilder& ExpressionResultBuilder::setLhs( std::string const& lhs ) { m_exprComponents.lhs = lhs; return *this; } - ExpressionResultBuilder& ExpressionResultBuilder::setRhs( const std::string& rhs ) { + ExpressionResultBuilder& ExpressionResultBuilder::setRhs( std::string const& rhs ) { m_exprComponents.rhs = rhs; return *this; } - ExpressionResultBuilder& ExpressionResultBuilder::setOp( const std::string& op ) { + ExpressionResultBuilder& ExpressionResultBuilder::setOp( std::string const& op ) { m_exprComponents.op = op; return *this; } - AssertionResult ExpressionResultBuilder::buildResult( const AssertionInfo& info ) const + AssertionResult ExpressionResultBuilder::buildResult( AssertionInfo const& info ) const { assert( m_data.resultType != ResultWas::Unknown ); @@ -76,7 +76,7 @@ namespace Catch { } return AssertionResult( info, data ); } - std::string ExpressionResultBuilder::reconstructExpression( const AssertionInfo& info ) const { + std::string ExpressionResultBuilder::reconstructExpression( AssertionInfo const& 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" ) diff --git a/include/internal/catch_generators_impl.hpp b/include/internal/catch_generators_impl.hpp index 23304f91..75af7395 100644 --- a/include/internal/catch_generators_impl.hpp +++ b/include/internal/catch_generators_impl.hpp @@ -50,7 +50,7 @@ namespace Catch { deleteAll( m_generatorsInOrder ); } - IGeneratorInfo& getGeneratorInfo( const std::string& fileInfo, std::size_t size ) { + IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) { std::map::const_iterator it = m_generatorsByName.find( fileInfo ); if( it == m_generatorsByName.end() ) { IGeneratorInfo* info = new GeneratorInfo( size ); diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h index c6c327a6..8cc68cc7 100644 --- a/include/internal/catch_interfaces_capture.h +++ b/include/internal/catch_interfaces_capture.h @@ -36,7 +36,7 @@ namespace Catch { virtual bool shouldDebugBreak() const = 0; - virtual void acceptMessage( const MessageBuilder& messageBuilder ) = 0; + virtual void acceptMessage( MessageBuilder const& messageBuilder ) = 0; virtual ResultAction::Value acceptExpression( ExpressionResultBuilder const& assertionResult, AssertionInfo const& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; diff --git a/include/internal/catch_interfaces_generators.h b/include/internal/catch_interfaces_generators.h index 8907adb6..03b01d9a 100644 --- a/include/internal/catch_interfaces_generators.h +++ b/include/internal/catch_interfaces_generators.h @@ -21,7 +21,7 @@ namespace Catch { struct IGeneratorsForTest { virtual ~IGeneratorsForTest(); - virtual IGeneratorInfo& getGeneratorInfo( const std::string& fileInfo, std::size_t size ) = 0; + virtual IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) = 0; virtual bool moveNext() = 0; }; diff --git a/include/internal/catch_interfaces_registry_hub.h b/include/internal/catch_interfaces_registry_hub.h index 7d932bde..7fae3abd 100644 --- a/include/internal/catch_interfaces_registry_hub.h +++ b/include/internal/catch_interfaces_registry_hub.h @@ -23,15 +23,15 @@ namespace Catch { struct IRegistryHub { virtual ~IRegistryHub(); - virtual const IReporterRegistry& getReporterRegistry() const = 0; - virtual const ITestCaseRegistry& getTestCaseRegistry() const = 0; + virtual IReporterRegistry const& getReporterRegistry() const = 0; + virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() = 0; }; struct IMutableRegistryHub { virtual ~IMutableRegistryHub(); - virtual void registerReporter( const std::string& name, IReporterFactory* factory ) = 0; - virtual void registerTest( const TestCase& testInfo ) = 0; + virtual void registerReporter( std::string const& name, IReporterFactory* factory ) = 0; + virtual void registerTest( TestCase const& testInfo ) = 0; virtual void registerTranslator( const IExceptionTranslator* translator ) = 0; }; diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 3fa228b3..751135b8 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -303,11 +303,11 @@ namespace Catch virtual void StartTestCase( TestCaseInfo const& testInfo ) = 0; virtual void EndTestCase( TestCaseInfo const& testInfo, Totals const& totals, std::string const& stdOut, std::string const& stdErr ) = 0; virtual void StartSection( std::string const& sectionName, std::string const& description ) = 0; - virtual void EndSection( std::string const& sectionName, const Counts& assertions ) = 0; + virtual void EndSection( std::string const& sectionName, Counts const& assertions ) = 0; virtual void NoAssertionsInSection( std::string const& sectionName ) = 0; virtual void NoAssertionsInTestCase( std::string const& testName ) = 0; virtual void Aborted() = 0; - virtual void Result( const AssertionResult& result ) = 0; + virtual void Result( AssertionResult const& result ) = 0; }; @@ -322,7 +322,7 @@ namespace Catch virtual ~IReporterRegistry(); virtual IStreamingReporter* create( std::string const& name, ReporterConfig const& config ) const = 0; - virtual const FactoryMap& getFactories() const = 0; + virtual FactoryMap const& getFactories() const = 0; }; inline std::string trim( std::string const& str ) { diff --git a/include/internal/catch_interfaces_testcase.h b/include/internal/catch_interfaces_testcase.h index 3f0c7078..90d12009 100644 --- a/include/internal/catch_interfaces_testcase.h +++ b/include/internal/catch_interfaces_testcase.h @@ -26,8 +26,8 @@ namespace Catch { struct ITestCaseRegistry { virtual ~ITestCaseRegistry(); - virtual const std::vector& getAllTests() const = 0; - virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const = 0; + virtual std::vector const& getAllTests() const = 0; + virtual std::vector getMatchingTestCases( std::string const& rawTestSpec ) const = 0; }; } diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index b1504f4d..aa47b132 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -16,7 +16,7 @@ #include namespace Catch { - inline bool matchesFilters( const std::vector& filters, const TestCase& testCase ) { + inline bool matchesFilters( std::vector const& filters, TestCase const& testCase ) { std::vector::const_iterator it = filters.begin(); std::vector::const_iterator itEnd = filters.end(); for(; it != itEnd; ++it ) @@ -25,7 +25,7 @@ namespace Catch { return true; } - inline void listTests( const ConfigData& config ) { + inline void listTests( ConfigData const& config ) { if( config.filters.empty() ) std::cout << "All available test cases:\n"; else @@ -100,7 +100,7 @@ namespace Catch { std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; } - inline void listTags( const ConfigData& config ) { + inline void listTags( ConfigData const& config ) { if( config.filters.empty() ) std::cout << "All available tags:\n"; else @@ -152,7 +152,7 @@ namespace Catch { std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; } - inline void listReporters( const ConfigData& /*config*/ ) { + inline void listReporters( ConfigData const& /*config*/ ) { std::cout << "Available reports:\n"; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); IReporterRegistry::FactoryMap::const_iterator it = factories.begin(), itEnd = factories.end(); @@ -163,7 +163,7 @@ namespace Catch { std::cout << std::endl; } - inline void list( const ConfigData& config ) { + inline void list( ConfigData const& config ) { if( config.listSpec & List::Tests ) listTests( config ); if( config.listSpec & List::Tags ) diff --git a/include/internal/catch_matchers.hpp b/include/internal/catch_matchers.hpp index 667224db..55d592a3 100644 --- a/include/internal/catch_matchers.hpp +++ b/include/internal/catch_matchers.hpp @@ -27,7 +27,7 @@ namespace Matchers { struct MatcherImpl : Matcher { virtual Ptr > clone() const { - return Ptr >( new DerivedT( static_cast( *this ) ) ); + return Ptr >( new DerivedT( static_cast( *this ) ) ); } }; @@ -38,13 +38,13 @@ namespace Matchers { public: AllOf() {} - AllOf( const AllOf& other ) : m_matchers( other.m_matchers ) {} + AllOf( AllOf const& other ) : m_matchers( other.m_matchers ) {} - AllOf& add( const Matcher& matcher ) { + AllOf& add( Matcher const& matcher ) { m_matchers.push_back( matcher.clone() ); return *this; } - virtual bool match( const ExpressionT& expr ) const + virtual bool match( ExpressionT const& expr ) const { for( std::size_t i = 0; i < m_matchers.size(); ++i ) if( !m_matchers[i]->match( expr ) ) @@ -72,13 +72,13 @@ namespace Matchers { public: AnyOf() {} - AnyOf( const AnyOf& other ) : m_matchers( other.m_matchers ) {} + AnyOf( AnyOf const& other ) : m_matchers( other.m_matchers ) {} - AnyOf& add( const Matcher& matcher ) { + AnyOf& add( Matcher const& matcher ) { m_matchers.push_back( matcher.clone() ); return *this; } - virtual bool match( const ExpressionT& expr ) const + virtual bool match( ExpressionT const& expr ) const { for( std::size_t i = 0; i < m_matchers.size(); ++i ) if( m_matchers[i]->match( expr ) ) @@ -105,16 +105,16 @@ namespace Matchers { namespace StdString { - inline std::string makeString( const std::string& str ) { return str; } + inline std::string makeString( std::string const& str ) { return str; } inline std::string makeString( const char* str ) { return str ? std::string( str ) : std::string(); } struct Equals : MatcherImpl { - Equals( const std::string& str ) : m_str( str ){} - Equals( const Equals& other ) : m_str( other.m_str ){} + Equals( std::string const& str ) : m_str( str ){} + Equals( Equals const& other ) : m_str( other.m_str ){} virtual ~Equals(); - virtual bool match( const std::string& expr ) const { + virtual bool match( std::string const& expr ) const { return m_str == expr; } virtual std::string toString() const { @@ -125,12 +125,12 @@ namespace Matchers { }; struct Contains : MatcherImpl { - Contains( const std::string& substr ) : m_substr( substr ){} - Contains( const Contains& other ) : m_substr( other.m_substr ){} + Contains( std::string const& substr ) : m_substr( substr ){} + Contains( Contains const& other ) : m_substr( other.m_substr ){} virtual ~Contains(); - virtual bool match( const std::string& expr ) const { + virtual bool match( std::string const& expr ) const { return expr.find( m_substr ) != std::string::npos; } virtual std::string toString() const { @@ -141,12 +141,12 @@ namespace Matchers { }; struct StartsWith : MatcherImpl { - StartsWith( const std::string& substr ) : m_substr( substr ){} - StartsWith( const StartsWith& other ) : m_substr( other.m_substr ){} + StartsWith( std::string const& substr ) : m_substr( substr ){} + StartsWith( StartsWith const& other ) : m_substr( other.m_substr ){} virtual ~StartsWith(); - virtual bool match( const std::string& expr ) const { + virtual bool match( std::string const& expr ) const { return expr.find( m_substr ) == 0; } virtual std::string toString() const { @@ -157,12 +157,12 @@ namespace Matchers { }; struct EndsWith : MatcherImpl { - EndsWith( const std::string& substr ) : m_substr( substr ){} - EndsWith( const EndsWith& other ) : m_substr( other.m_substr ){} + EndsWith( std::string const& substr ) : m_substr( substr ){} + EndsWith( EndsWith const& other ) : m_substr( other.m_substr ){} virtual ~EndsWith(); - virtual bool match( const std::string& expr ) const { + virtual bool match( std::string const& expr ) const { return expr.find( m_substr ) == expr.size() - m_substr.size(); } virtual std::string toString() const { @@ -177,47 +177,47 @@ namespace Matchers { // The following functions create the actual matcher objects. // This allows the types to be inferred template - inline Impl::Generic::AllOf AllOf( const Impl::Matcher& m1, - const Impl::Matcher& m2 ) { + inline Impl::Generic::AllOf AllOf( Impl::Matcher const& m1, + Impl::Matcher const& m2 ) { return Impl::Generic::AllOf().add( m1 ).add( m2 ); } template - inline Impl::Generic::AllOf AllOf( const Impl::Matcher& m1, - const Impl::Matcher& m2, - const Impl::Matcher& m3 ) { + inline Impl::Generic::AllOf AllOf( Impl::Matcher const& m1, + Impl::Matcher const& m2, + Impl::Matcher const& m3 ) { return Impl::Generic::AllOf().add( m1 ).add( m2 ).add( m3 ); } template - inline Impl::Generic::AnyOf AnyOf( const Impl::Matcher& m1, - const Impl::Matcher& m2 ) { + inline Impl::Generic::AnyOf AnyOf( Impl::Matcher const& m1, + Impl::Matcher const& m2 ) { return Impl::Generic::AnyOf().add( m1 ).add( m2 ); } template - inline Impl::Generic::AnyOf AnyOf( const Impl::Matcher& m1, - const Impl::Matcher& m2, - const Impl::Matcher& m3 ) { + inline Impl::Generic::AnyOf AnyOf( Impl::Matcher const& m1, + Impl::Matcher const& m2, + Impl::Matcher const& m3 ) { return Impl::Generic::AnyOf().add( m1 ).add( m2 ).add( m3 ); } - inline Impl::StdString::Equals Equals( const std::string& str ) { + inline Impl::StdString::Equals Equals( std::string const& str ) { return Impl::StdString::Equals( str ); } inline Impl::StdString::Equals Equals( const char* str ) { return Impl::StdString::Equals( Impl::StdString::makeString( str ) ); } - inline Impl::StdString::Contains Contains( const std::string& substr ) { + inline Impl::StdString::Contains Contains( std::string const& substr ) { return Impl::StdString::Contains( substr ); } inline Impl::StdString::Contains Contains( const char* substr ) { return Impl::StdString::Contains( Impl::StdString::makeString( substr ) ); } - inline Impl::StdString::StartsWith StartsWith( const std::string& substr ) { + inline Impl::StdString::StartsWith StartsWith( std::string const& substr ) { return Impl::StdString::StartsWith( substr ); } inline Impl::StdString::StartsWith StartsWith( const char* substr ) { return Impl::StdString::StartsWith( Impl::StdString::makeString( substr ) ); } - inline Impl::StdString::EndsWith EndsWith( const std::string& substr ) { + inline Impl::StdString::EndsWith EndsWith( std::string const& substr ) { return Impl::StdString::EndsWith( substr ); } inline Impl::StdString::EndsWith EndsWith( const char* substr ) { diff --git a/include/internal/catch_notimplemented_exception.h b/include/internal/catch_notimplemented_exception.h index 5aa25e0d..e543bdaf 100644 --- a/include/internal/catch_notimplemented_exception.h +++ b/include/internal/catch_notimplemented_exception.h @@ -16,7 +16,7 @@ namespace Catch { class NotImplementedException : public std::exception { public: - NotImplementedException( const SourceLineInfo& lineInfo ); + NotImplementedException( SourceLineInfo const& lineInfo ); virtual ~NotImplementedException() throw() {} diff --git a/include/internal/catch_notimplemented_exception.hpp b/include/internal/catch_notimplemented_exception.hpp index 36368e8c..7cbe8175 100644 --- a/include/internal/catch_notimplemented_exception.hpp +++ b/include/internal/catch_notimplemented_exception.hpp @@ -13,7 +13,7 @@ namespace Catch { - NotImplementedException::NotImplementedException( const SourceLineInfo& lineInfo ) + NotImplementedException::NotImplementedException( SourceLineInfo const& lineInfo ) : m_lineInfo( lineInfo ) { std::ostringstream oss; oss << lineInfo << ": function "; diff --git a/include/internal/catch_objc.hpp b/include/internal/catch_objc.hpp index a25dd8cd..640b4cc2 100644 --- a/include/internal/catch_objc.hpp +++ b/include/internal/catch_objc.hpp @@ -56,13 +56,13 @@ namespace Catch { namespace Detail{ - inline bool startsWith( const std::string& str, const std::string& sub ) { + inline bool startsWith( std::string const& str, std::string const& sub ) { return str.length() > sub.length() && str.substr( 0, sub.length() ) == sub; } inline std::string getAnnotation( Class cls, - const std::string& annotationName, - const std::string& testCaseName ) { + std::string const& annotationName, + std::string const& testCaseName ) { NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()]; SEL sel = NSSelectorFromString( selStr ); arcSafeRelease( selStr ); diff --git a/include/internal/catch_option.hpp b/include/internal/catch_option.hpp index 0b01a4dc..9d6dec15 100644 --- a/include/internal/catch_option.hpp +++ b/include/internal/catch_option.hpp @@ -41,7 +41,7 @@ namespace Catch { nullableValue = NULL; } T& operator*() { return *nullableValue; } - const T& operator*() const { return *nullableValue; } + T const& operator*() const { return *nullableValue; } T* operator->() { return nullableValue; } const T* operator->() const { return nullableValue; } diff --git a/include/internal/catch_registry_hub.hpp b/include/internal/catch_registry_hub.hpp index 05d602e1..14038aff 100644 --- a/include/internal/catch_registry_hub.hpp +++ b/include/internal/catch_registry_hub.hpp @@ -20,16 +20,16 @@ namespace Catch { class RegistryHub : public IRegistryHub, public IMutableRegistryHub { - RegistryHub( const RegistryHub& ); - void operator=( const RegistryHub& ); + RegistryHub( RegistryHub const& ); + void operator=( RegistryHub const& ); public: // IRegistryHub RegistryHub() { } - virtual const IReporterRegistry& getReporterRegistry() const { + virtual IReporterRegistry const& getReporterRegistry() const { return m_reporterRegistry; } - virtual const ITestCaseRegistry& getTestCaseRegistry() const { + virtual ITestCaseRegistry const& getTestCaseRegistry() const { return m_testCaseRegistry; } virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() { @@ -37,10 +37,10 @@ namespace Catch { } public: // IMutableRegistryHub - virtual void registerReporter( const std::string& name, IReporterFactory* factory ) { + virtual void registerReporter( std::string const& name, IReporterFactory* factory ) { m_reporterRegistry.registerReporter( name, factory ); } - virtual void registerTest( const TestCase& testInfo ) { + virtual void registerTest( TestCase const& testInfo ) { m_testCaseRegistry.registerTest( testInfo ); } virtual void registerTranslator( const IExceptionTranslator* translator ) { diff --git a/include/internal/catch_reporter_registrars.hpp b/include/internal/catch_reporter_registrars.hpp index 93e19667..f2c482b2 100644 --- a/include/internal/catch_reporter_registrars.hpp +++ b/include/internal/catch_reporter_registrars.hpp @@ -18,7 +18,7 @@ namespace Catch { class ReporterFactory : public IReporterFactory { - virtual IStreamingReporter* create( const ReporterConfig& config ) const { + virtual IStreamingReporter* create( ReporterConfig const& config ) const { return new LegacyReporterAdapter( new T( config ), config ); } @@ -29,7 +29,7 @@ namespace Catch { public: - LegacyReporterRegistrar( const std::string& name ) { + LegacyReporterRegistrar( std::string const& name ) { getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); } }; @@ -50,7 +50,7 @@ namespace Catch { // In fact, ideally, please contact me anyway to let me know you've hit this - as I have // no idea who is actually using custom reporters at all (possibly no-one!). // The new interface is designed to minimise exposure to interface changes in the future. - virtual IStreamingReporter* create( const ReporterConfig& config ) const { + virtual IStreamingReporter* create( ReporterConfig const& config ) const { return new T( config ); } @@ -61,7 +61,7 @@ namespace Catch { public: - ReporterRegistrar( const std::string& name ) { + ReporterRegistrar( std::string const& name ) { getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); } }; diff --git a/include/internal/catch_reporter_registry.hpp b/include/internal/catch_reporter_registry.hpp index 78219805..8298758c 100644 --- a/include/internal/catch_reporter_registry.hpp +++ b/include/internal/catch_reporter_registry.hpp @@ -22,18 +22,18 @@ namespace Catch { deleteAllValues( m_factories ); } - virtual IStreamingReporter* create( const std::string& name, const ReporterConfig& config ) const { + virtual IStreamingReporter* create( std::string const& name, ReporterConfig const& config ) const { FactoryMap::const_iterator it = m_factories.find( name ); if( it == m_factories.end() ) return NULL; return it->second->create( config ); } - void registerReporter( const std::string& name, IReporterFactory* factory ) { + void registerReporter( std::string const& name, IReporterFactory* factory ) { m_factories.insert( std::make_pair( name, factory ) ); } - const FactoryMap& getFactories() const { + FactoryMap const& getFactories() const { return m_factories; } diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 2dcf92ae..18a3e03b 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -51,12 +51,12 @@ namespace Catch { class Runner : public IResultCapture, public IRunner { - Runner( const Runner& ); - void operator =( const Runner& ); + Runner( Runner const& ); + void operator =( Runner const& ); public: - explicit Runner( const Config& config, const Ptr& reporter ) + explicit Runner( Config const& config, Ptr const& reporter ) : m_runInfo( config.data().name ), m_context( getCurrentMutableContext() ), m_runningTest( NULL ), @@ -87,7 +87,7 @@ namespace Catch { m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, aborting() ) ); } - Totals runMatching( const std::string& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { + Totals runMatching( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { std::vector matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ); @@ -104,7 +104,7 @@ namespace Catch { return totals; } - Totals runTest( const TestCase& testCase ) { + Totals runTest( TestCase const& testCase ) { Totals prevTotals = m_totals; std::string redirectedCout; @@ -149,22 +149,22 @@ namespace Catch { return deltaTotals; } - const Config& config() const { + Config const& config() const { return m_config; } private: // IResultCapture - virtual void acceptMessage( const MessageBuilder& messageBuilder ) { + virtual void acceptMessage( MessageBuilder const& messageBuilder ) { m_messages.push_back( messageBuilder.build() ); } - virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) { + virtual ResultAction::Value acceptExpression( ExpressionResultBuilder const& assertionResult, AssertionInfo const& assertionInfo ) { m_lastAssertionInfo = assertionInfo; return actOnCurrentResult( assertionResult.buildResult( assertionInfo ) ); } - virtual void assertionEnded( const AssertionResult& result ) { + virtual void assertionEnded( AssertionResult const& result ) { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } @@ -252,7 +252,7 @@ namespace Catch { private: - ResultAction::Value actOnCurrentResult( const AssertionResult& result ) { + ResultAction::Value actOnCurrentResult( AssertionResult const& result ) { m_lastResult = result; assertionEnded( m_lastResult ); @@ -315,7 +315,7 @@ namespace Catch { RunningTest* m_runningTest; AssertionResult m_lastResult; - const Config& m_config; + Config const& m_config; Totals m_totals; Ptr m_reporter; std::vector m_messages; diff --git a/include/internal/catch_running_test.hpp b/include/internal/catch_running_test.hpp index 8787f8e8..c5ad8a6c 100644 --- a/include/internal/catch_running_test.hpp +++ b/include/internal/catch_running_test.hpp @@ -24,7 +24,7 @@ namespace Catch { }; public: - explicit RunningTest( const TestCase& info ) + explicit RunningTest( TestCase const& info ) : m_info( info ), m_runStatus( RanAtLeastOneSection ), m_rootSection( info.getTestCaseInfo().name ), @@ -64,7 +64,7 @@ namespace Catch { } } - bool addSection( const std::string& name ) { + bool addSection( std::string const& name ) { if( m_runStatus == NothingRun ) m_runStatus = EncounteredASection; @@ -78,7 +78,7 @@ namespace Catch { return false; } - void endSection( const std::string&, bool stealth ) { + void endSection( std::string const&, bool stealth ) { if( m_currentSection->ran() ) { if( !stealth ) m_runStatus = RanAtLeastOneSection; @@ -92,7 +92,7 @@ namespace Catch { m_currentSection = m_currentSection->getParent(); } - const TestCase& getTestCase() const { + TestCase const& getTestCase() const { return m_info; } @@ -105,7 +105,7 @@ namespace Catch { RunningTest( RunningTest const& ); void operator=( RunningTest const& ); - const TestCase& m_info; + TestCase const& m_info; RunStatus m_runStatus; RunningSection m_rootSection; RunningSection* m_currentSection; diff --git a/include/internal/catch_section.hpp b/include/internal/catch_section.hpp index 67bced6b..fd195364 100644 --- a/include/internal/catch_section.hpp +++ b/include/internal/catch_section.hpp @@ -18,9 +18,9 @@ namespace Catch { class Section { public: - Section( const SourceLineInfo& lineInfo, - const std::string& name, - const std::string& description = "" ) + Section( SourceLineInfo const& lineInfo, + std::string const& name, + std::string const& description = "" ) : m_info( name, description, lineInfo ), m_sectionIncluded( getCurrentContext().getResultCapture().sectionStarted( m_info, m_assertions ) ) {} diff --git a/include/internal/catch_section_info.hpp b/include/internal/catch_section_info.hpp index 7a326dfd..1ea24ee2 100644 --- a/include/internal/catch_section_info.hpp +++ b/include/internal/catch_section_info.hpp @@ -28,13 +28,13 @@ namespace Catch { TestedLeaf }; - RunningSection( RunningSection* parent, const std::string& name ) + RunningSection( RunningSection* parent, std::string const& name ) : m_state( Unknown ), m_parent( parent ), m_name( name ) {} - RunningSection( const std::string& name ) + RunningSection( std::string const& name ) : m_state( Root ), m_parent( NULL ), m_name( name ) @@ -77,7 +77,7 @@ namespace Catch { return m_parent; } - RunningSection* findOrAddSubSection( const std::string& name, bool& changed ) { + RunningSection* findOrAddSubSection( std::string const& name, bool& changed ) { for( SubSections::const_iterator it = m_subSections.begin(); it != m_subSections.end(); ++it) diff --git a/include/internal/catch_stream.hpp b/include/internal/catch_stream.hpp index b3135751..5abde5ad 100644 --- a/include/internal/catch_stream.hpp +++ b/include/internal/catch_stream.hpp @@ -57,7 +57,7 @@ namespace Catch { struct OutputDebugWriter { - void operator()( const std::string &str ) { + void operator()( std::string const&str ) { writeToDebugConsole( str ); } }; diff --git a/include/internal/catch_tags.hpp b/include/internal/catch_tags.hpp index 74d6ee4e..7b210989 100644 --- a/include/internal/catch_tags.hpp +++ b/include/internal/catch_tags.hpp @@ -24,7 +24,7 @@ namespace Catch { public: virtual ~TagParser(); - void parse( const std::string& str ) { + void parse( std::string const& str ) { std::size_t pos = 0; while( pos < str.size() ) { char c = str[pos]; @@ -48,7 +48,7 @@ namespace Catch { } protected: - virtual void acceptTag( const std::string& tag ) = 0; + virtual void acceptTag( std::string const& tag ) = 0; virtual void acceptChar( char c ) = 0; virtual void endParse() {} @@ -69,14 +69,14 @@ namespace Catch { } private: - virtual void acceptTag( const std::string& tag ) { + virtual void acceptTag( std::string const& tag ) { m_tags.insert( toLower( tag ) ); } virtual void acceptChar( char c ) { m_remainder += c; } - TagExtracter& operator=(const TagExtracter&); + TagExtracter& operator=(TagExtracter const&); std::set& m_tags; std::string m_remainder; @@ -88,7 +88,7 @@ namespace Catch { : m_isNegated( false ) {} - Tag( const std::string& name, bool isNegated ) + Tag( std::string const& name, bool isNegated ) : m_name( name ), m_isNegated( isNegated ) {} @@ -112,7 +112,7 @@ namespace Catch { class TagSet { typedef std::map TagMap; public: - void add( const Tag& tag ) { + void add( Tag const& tag ) { m_tags.insert( std::make_pair( toLower( tag.getName() ), tag ) ); } @@ -120,7 +120,7 @@ namespace Catch { return m_tags.empty(); } - bool matches( const std::set& tags ) const { + bool matches( std::set const& tags ) const { TagMap::const_iterator it = m_tags.begin(); TagMap::const_iterator itEnd = m_tags.end(); for(; it != itEnd; ++it ) { @@ -137,7 +137,7 @@ namespace Catch { class TagExpression { public: - bool matches( const std::set& tags ) const { + bool matches( std::set const& tags ) const { std::vector::const_iterator it = m_tagSets.begin(); std::vector::const_iterator itEnd = m_tagSets.end(); for(; it != itEnd; ++it ) @@ -162,7 +162,7 @@ namespace Catch { ~TagExpressionParser(); private: - virtual void acceptTag( const std::string& tag ) { + virtual void acceptTag( std::string const& tag ) { m_currentTagSet.add( Tag( tag, m_isNegated ) ); m_isNegated = false; } @@ -181,7 +181,7 @@ namespace Catch { m_exp.m_tagSets.push_back( m_currentTagSet ); } - TagExpressionParser& operator=(const TagExpressionParser&); + TagExpressionParser& operator=(TagExpressionParser const&); bool m_isNegated; TagSet m_currentTagSet; diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h index ba804b19..72d73f01 100644 --- a/include/internal/catch_test_case_info.h +++ b/include/internal/catch_test_case_info.h @@ -24,14 +24,14 @@ namespace Catch { struct ITestCase; struct TestCaseInfo { - TestCaseInfo( const std::string& _name, - const std::string& _className, - const std::string& _description, - const std::set& _tags, + TestCaseInfo( std::string const& _name, + std::string const& _className, + std::string const& _description, + std::set const& _tags, bool _isHidden, - const SourceLineInfo& _lineInfo ); + SourceLineInfo const& _lineInfo ); - TestCaseInfo( const TestCaseInfo& other ); + TestCaseInfo( TestCaseInfo const& other ); std::string name; std::string className; @@ -45,34 +45,34 @@ namespace Catch { class TestCase : protected TestCaseInfo { public: - TestCase( ITestCase* testCase, const TestCaseInfo& info ); - TestCase( const TestCase& other ); + TestCase( ITestCase* testCase, TestCaseInfo const& info ); + TestCase( TestCase const& other ); - TestCase withName( const std::string& _newName ) const; + TestCase withName( std::string const& _newName ) const; void invoke() const; - const TestCaseInfo& getTestCaseInfo() const; + TestCaseInfo const& getTestCaseInfo() const; bool isHidden() const; - bool hasTag( const std::string& tag ) const; - bool matchesTags( const std::string& tagPattern ) const; - const std::set& getTags() const; + bool hasTag( std::string const& tag ) const; + bool matchesTags( std::string const& tagPattern ) const; + std::set const& getTags() const; void swap( TestCase& other ); - bool operator == ( const TestCase& other ) const; - bool operator < ( const TestCase& other ) const; - TestCase& operator = ( const TestCase& other ); + bool operator == ( TestCase const& other ) const; + bool operator < ( TestCase const& other ) const; + TestCase& operator = ( TestCase const& other ); private: Ptr test; }; TestCase makeTestCase( ITestCase* testCase, - const std::string& className, - const std::string& name, - const std::string& description, - const SourceLineInfo& lineInfo ); + std::string const& className, + std::string const& name, + std::string const& description, + SourceLineInfo const& lineInfo ); } #ifdef __clang__ diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index a5412b6f..d3a2719b 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -16,10 +16,10 @@ namespace Catch { TestCase makeTestCase( ITestCase* _testCase, - const std::string& _className, - const std::string& _name, - const std::string& _descOrTags, - const SourceLineInfo& _lineInfo ) + std::string const& _className, + std::string const& _name, + std::string const& _descOrTags, + SourceLineInfo const& _lineInfo ) { std::string desc = _descOrTags; bool isHidden( startsWith( _name, "./" ) ); @@ -32,12 +32,12 @@ namespace Catch { return TestCase( _testCase, info ); } - TestCaseInfo::TestCaseInfo( const std::string& _name, - const std::string& _className, - const std::string& _description, - const std::set& _tags, + TestCaseInfo::TestCaseInfo( std::string const& _name, + std::string const& _className, + std::string const& _description, + std::set const& _tags, bool _isHidden, - const SourceLineInfo& _lineInfo ) + SourceLineInfo const& _lineInfo ) : name( _name ), className( _className ), description( _description ), @@ -51,7 +51,7 @@ namespace Catch { tagsAsString = oss.str(); } - TestCaseInfo::TestCaseInfo( const TestCaseInfo& other ) + TestCaseInfo::TestCaseInfo( TestCaseInfo const& other ) : name( other.name ), className( other.className ), description( other.description ), @@ -61,14 +61,14 @@ namespace Catch { isHidden( other.isHidden ) {} - TestCase::TestCase( ITestCase* testCase, const TestCaseInfo& info ) : TestCaseInfo( info ), test( testCase ) {} + TestCase::TestCase( ITestCase* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {} - TestCase::TestCase( const TestCase& other ) + TestCase::TestCase( TestCase const& other ) : TestCaseInfo( other ), test( other.test ) {} - TestCase TestCase::withName( const std::string& _newName ) const { + TestCase TestCase::withName( std::string const& _newName ) const { TestCase other( *this ); other.name = _newName; return other; @@ -82,15 +82,15 @@ namespace Catch { return TestCaseInfo::isHidden; } - bool TestCase::hasTag( const std::string& tag ) const { + bool TestCase::hasTag( std::string const& tag ) const { return tags.find( toLower( tag ) ) != tags.end(); } - bool TestCase::matchesTags( const std::string& tagPattern ) const { + bool TestCase::matchesTags( std::string const& tagPattern ) const { TagExpression exp; TagExpressionParser( exp ).parse( tagPattern ); return exp.matches( tags ); } - const std::set& TestCase::getTags() const { + std::set const& TestCase::getTags() const { return tags; } @@ -102,22 +102,22 @@ namespace Catch { std::swap( lineInfo, other.lineInfo ); } - bool TestCase::operator == ( const TestCase& other ) const { + bool TestCase::operator == ( TestCase const& other ) const { return test.get() == other.test.get() && name == other.name && className == other.className; } - bool TestCase::operator < ( const TestCase& other ) const { + bool TestCase::operator < ( TestCase const& other ) const { return name < other.name; } - TestCase& TestCase::operator = ( const TestCase& other ) { + TestCase& TestCase::operator = ( TestCase const& other ) { TestCase temp( other ); swap( temp ); return *this; } - const TestCaseInfo& TestCase::getTestCaseInfo() const + TestCaseInfo const& TestCase::getTestCaseInfo() const { return *this; } diff --git a/include/internal/catch_test_case_registry_impl.hpp b/include/internal/catch_test_case_registry_impl.hpp index ffccb284..0f09369d 100644 --- a/include/internal/catch_test_case_registry_impl.hpp +++ b/include/internal/catch_test_case_registry_impl.hpp @@ -25,7 +25,7 @@ namespace Catch { TestRegistry() : m_unnamedCount( 0 ) {} virtual ~TestRegistry(); - virtual void registerTest( const TestCase& testCase ) { + virtual void registerTest( TestCase const& testCase ) { std::string name = testCase.getTestCaseInfo().name; if( name == "" ) { std::ostringstream oss; @@ -40,7 +40,7 @@ namespace Catch { m_nonHiddenFunctions.push_back( testCase ); } else { - const TestCase& prev = *m_functions.find( testCase ); + TestCase const& prev = *m_functions.find( testCase ); std::cerr << "error: TEST_CASE( \"" << name << "\" ) already defined.\n" << "\tFirst seen at " << SourceLineInfo( prev.getTestCaseInfo().lineInfo ) << "\n" << "\tRedefined at " << SourceLineInfo( testCase.getTestCaseInfo().lineInfo ) << std::endl; @@ -48,23 +48,23 @@ namespace Catch { } } - virtual const std::vector& getAllTests() const { + virtual std::vector const& getAllTests() const { return m_functionsInOrder; } - virtual const std::vector& getAllNonHiddenTests() const { + virtual std::vector const& getAllNonHiddenTests() const { return m_nonHiddenFunctions; } // !TBD deprecated - virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const { + virtual std::vector getMatchingTestCases( std::string const& rawTestSpec ) const { std::vector matchingTests; getMatchingTestCases( rawTestSpec, matchingTests ); return matchingTests; } // !TBD deprecated - virtual void getMatchingTestCases( const std::string& rawTestSpec, std::vector& matchingTestsOut ) const { + virtual void getMatchingTestCases( std::string const& rawTestSpec, std::vector& matchingTestsOut ) const { TestCaseFilter filter( rawTestSpec ); std::vector::const_iterator it = m_functionsInOrder.begin(); @@ -75,7 +75,7 @@ namespace Catch { } } } - virtual void getMatchingTestCases( const TestCaseFilters& filters, std::vector& matchingTestsOut ) const { + virtual void getMatchingTestCases( TestCaseFilters const& filters, std::vector& matchingTestsOut ) const { std::vector::const_iterator it = m_functionsInOrder.begin(); std::vector::const_iterator itEnd = m_functionsInOrder.end(); // !TBD: replace with algorithm @@ -109,7 +109,7 @@ namespace Catch { TestFunction m_fun; }; - inline std::string extractClassName( const std::string& classOrQualifiedMethodName ) { + inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) { std::string className = classOrQualifiedMethodName; if( className[0] == '&' ) { diff --git a/include/internal/catch_test_registry.hpp b/include/internal/catch_test_registry.hpp index ff0e3e87..65fe760f 100644 --- a/include/internal/catch_test_registry.hpp +++ b/include/internal/catch_test_registry.hpp @@ -67,8 +67,8 @@ struct AutoReg { ~AutoReg(); private: - AutoReg( const AutoReg& ); - void operator= ( const AutoReg& ); + AutoReg( AutoReg const& ); + void operator= ( AutoReg const& ); }; } // end namespace Catch diff --git a/include/internal/catch_test_spec.h b/include/internal/catch_test_spec.h index 66839705..36dc55c4 100644 --- a/include/internal/catch_test_spec.h +++ b/include/internal/catch_test_spec.h @@ -32,7 +32,7 @@ namespace Catch { }; public: - TestCaseFilter( const std::string& testSpec, IfFilterMatches::DoWhat matchBehaviour = IfFilterMatches::AutoDetectBehaviour ) + TestCaseFilter( std::string const& testSpec, IfFilterMatches::DoWhat matchBehaviour = IfFilterMatches::AutoDetectBehaviour ) : m_stringToMatch( toLower( testSpec ) ), m_filterType( matchBehaviour ), m_wildcardPosition( NoWildcard ) @@ -65,7 +65,7 @@ namespace Catch { return m_filterType; } - bool shouldInclude( const TestCase& testCase ) const { + bool shouldInclude( TestCase const& testCase ) const { return isMatch( testCase ) == (m_filterType == IfFilterMatches::IncludeTests); } private: @@ -75,7 +75,7 @@ namespace Catch { #pragma clang diagnostic ignored "-Wunreachable-code" #endif - bool isMatch( const TestCase& testCase ) const { + bool isMatch( TestCase const& testCase ) const { std::string name = testCase.getTestCaseInfo().name; toLowerInPlace( name ); @@ -103,27 +103,27 @@ namespace Catch { class TestCaseFilters { public: - TestCaseFilters( const std::string& name ) : m_name( name ) {} + TestCaseFilters( std::string const& name ) : m_name( name ) {} std::string getName() const { return m_name; } - void addFilter( const TestCaseFilter& filter ) { + void addFilter( TestCaseFilter const& filter ) { if( filter.getFilterType() == IfFilterMatches::ExcludeTests ) m_exclusionFilters.push_back( filter ); else m_inclusionFilters.push_back( filter ); } - void addTags( const std::string& tagPattern ) { + void addTags( std::string const& tagPattern ) { TagExpression exp; TagExpressionParser( exp ).parse( tagPattern ); m_tagExpressions.push_back( exp ); } - bool shouldInclude( const TestCase& testCase ) const { + bool shouldInclude( TestCase const& testCase ) const { if( !m_tagExpressions.empty() ) { std::vector::const_iterator it = m_tagExpressions.begin(); std::vector::const_iterator itEnd = m_tagExpressions.end(); diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index 5d3bf39a..fef7ad3a 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -56,7 +56,7 @@ namespace Detail { template struct IsStreamInsertable { static std::ostream &s; - static T const &t; + static T const&t; enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) }; }; @@ -112,7 +112,7 @@ struct StringMaker > { namespace Detail { template - inline std::string makeString( const T& value ) { + inline std::string makeString( T const& value ) { return StringMaker::convert( value ); } } // end namespace Detail @@ -125,17 +125,17 @@ namespace Detail { /// Overload (not specialise) this template for custom typs that you don't want /// to provide an ostream overload for. template -std::string toString( const T& value ) { +std::string toString( T const& value ) { return StringMaker::convert( value ); } // Built in overloads -inline std::string toString( const std::string& value ) { +inline std::string toString( std::string const& value ) { return "\"" + value + "\""; } -inline std::string toString( const std::wstring& value ) { +inline std::string toString( std::wstring const& value ) { std::ostringstream oss; oss << "\""; for(size_t i = 0; i < value.size(); ++i ) diff --git a/include/internal/catch_totals.hpp b/include/internal/catch_totals.hpp index 03832a2e..2d10f7f9 100644 --- a/include/internal/catch_totals.hpp +++ b/include/internal/catch_totals.hpp @@ -15,13 +15,13 @@ namespace Catch { struct Counts { Counts() : passed( 0 ), failed( 0 ) {} - Counts operator - ( const Counts& other ) const { + Counts operator - ( Counts const& other ) const { Counts diff; diff.passed = passed - other.passed; diff.failed = failed - other.failed; return diff; } - Counts& operator += ( const Counts& other ) { + Counts& operator += ( Counts const& other ) { passed += other.passed; failed += other.failed; return *this; @@ -37,14 +37,14 @@ namespace Catch { struct Totals { - Totals operator - ( const Totals& other ) const { + Totals operator - ( Totals const& other ) const { Totals diff; diff.assertions = assertions - other.assertions; diff.testCases = testCases - other.testCases; return diff; } - Totals delta( const Totals& prevTotals ) const { + Totals delta( Totals const& prevTotals ) const { Totals diff = *this - prevTotals; if( diff.assertions.failed > 0 ) ++diff.testCases.failed; @@ -53,7 +53,7 @@ namespace Catch { return diff; } - Totals& operator += ( const Totals& other ) { + Totals& operator += ( Totals const& other ) { assertions += other.assertions; testCases += other.testCases; return *this; diff --git a/include/internal/catch_xmlwriter.hpp b/include/internal/catch_xmlwriter.hpp index 98e827f4..5e43b88e 100644 --- a/include/internal/catch_xmlwriter.hpp +++ b/include/internal/catch_xmlwriter.hpp @@ -24,7 +24,7 @@ namespace Catch { : m_writer( writer ) {} - ScopedElement( const ScopedElement& other ) + ScopedElement( ScopedElement const& other ) : m_writer( other.m_writer ){ other.m_writer = NULL; } @@ -34,13 +34,13 @@ namespace Catch { m_writer->endElement(); } - ScopedElement& writeText( const std::string& text, bool indent = true ) { + ScopedElement& writeText( std::string const& text, bool indent = true ) { m_writer->writeText( text, indent ); return *this; } template - ScopedElement& writeAttribute( const std::string& name, const T& attribute ) { + ScopedElement& writeAttribute( std::string const& name, T const& attribute ) { m_writer->writeAttribute( name, attribute ); return *this; } @@ -66,7 +66,7 @@ namespace Catch { endElement(); } - XmlWriter& operator = ( const XmlWriter& other ) { + XmlWriter& operator = ( XmlWriter const& other ) { XmlWriter temp( other ); swap( temp ); return *this; @@ -80,7 +80,7 @@ namespace Catch { std::swap( m_os, other.m_os ); } - XmlWriter& startElement( const std::string& name ) { + XmlWriter& startElement( std::string const& name ) { ensureTagClosed(); newlineIfNecessary(); stream() << m_indent << "<" << name; @@ -90,7 +90,7 @@ namespace Catch { return *this; } - ScopedElement scopedElement( const std::string& name ) { + ScopedElement scopedElement( std::string const& name ) { ScopedElement scoped( this ); startElement( name ); return scoped; @@ -110,7 +110,7 @@ namespace Catch { return *this; } - XmlWriter& writeAttribute( const std::string& name, const std::string& attribute ) { + XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ) { if( !name.empty() && !attribute.empty() ) { stream() << " " << name << "=\""; writeEncodedText( attribute ); @@ -119,19 +119,19 @@ namespace Catch { return *this; } - XmlWriter& writeAttribute( const std::string& name, bool attribute ) { + XmlWriter& writeAttribute( std::string const& name, bool attribute ) { stream() << " " << name << "=\"" << ( attribute ? "true" : "false" ) << "\""; return *this; } template - XmlWriter& writeAttribute( const std::string& name, const T& attribute ) { + XmlWriter& writeAttribute( std::string const& name, T const& attribute ) { if( !name.empty() ) stream() << " " << name << "=\"" << attribute << "\""; return *this; } - XmlWriter& writeText( const std::string& text, bool indent = true ) { + XmlWriter& writeText( std::string const& text, bool indent = true ) { if( !text.empty() ){ bool tagWasOpen = m_tagIsOpen; ensureTagClosed(); @@ -143,7 +143,7 @@ namespace Catch { return *this; } - XmlWriter& writeComment( const std::string& text ) { + XmlWriter& writeComment( std::string const& text ) { ensureTagClosed(); stream() << m_indent << ""; m_needsNewline = true; @@ -176,7 +176,7 @@ namespace Catch { } } - void writeEncodedText( const std::string& text ) { + void writeEncodedText( std::string const& text ) { static const char* charsToEncode = "<&\""; std::string mtext = text; std::string::size_type pos = mtext.find_first_of( charsToEncode ); From bf37e6879a37d74bde7eedb688506ee642229ff1 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 23 Apr 2013 20:52:49 +0100 Subject: [PATCH 227/296] Removed use of compiler specific techniques for denoting non-returning functions - use if( Catch::isTrue( true) ) to guard throws instead --- include/catch.hpp | 4 -- include/internal/catch_capture.hpp | 4 -- include/internal/catch_commandline.hpp | 4 +- include/internal/catch_common.h | 15 ++++--- include/internal/catch_test_registry.hpp | 12 ------ projects/SelfTest/ExceptionTests.cpp | 52 ++++++++++++------------ 6 files changed, 35 insertions(+), 56 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index 6e57a9da..a9fbfdba 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -80,12 +80,10 @@ #ifdef CATCH_CONFIG_VARIADIC_MACROS #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) - #define CATCH_TEST_CASE_NORETURN( ... ) INTERNAL_CATCH_TESTCASE_NORETURN( __VA_ARGS__ ) #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #else #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) - #define CATCH_TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) #endif @@ -141,12 +139,10 @@ #ifdef CATCH_CONFIG_VARIADIC_MACROS #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) - #define TEST_CASE_NORETURN( ... ) INTERNAL_CATCH_TESTCASE_NORETURN( __VA_ARGS__ ) #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #else #define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) - #define TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) #endif diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index a8aa98b1..cf143244 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -57,10 +57,6 @@ namespace Catch { struct TestFailureException{}; - -// This is just here to avoid compiler warnings with macro constants and boolean literals -inline bool isTrue( bool value ){ return value; } - } // end namespace Catch /////////////////////////////////////////////////////////////////////////////// diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 7657da6b..6c050f55 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -44,7 +44,6 @@ namespace Catch { std::string operator[]( std::size_t i ) const { return m_args[i]; } std::size_t argsCount() const { return m_args.size(); } - CATCH_ATTRIBUTE_NORETURN void raiseError( std::string const& message ) const { std::ostringstream oss; if( m_name.empty() ) @@ -56,7 +55,8 @@ namespace Catch { oss << " Arguments were:"; for( std::size_t i = 0; i < m_args.size(); ++i ) oss << " " << m_args[i]; - throw std::domain_error( oss.str() ); + if( isTrue( true ) ) + throw std::domain_error( oss.str() ); } private: diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 954f6170..7e74965a 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -15,16 +15,12 @@ #define INTERNAL_CATCH_STRINGIFY2( expr ) #expr #define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr ) -#ifdef __GNUC__ -#define CATCH_ATTRIBUTE_NORETURN __attribute__ ((noreturn)) -#else -#define CATCH_ATTRIBUTE_NORETURN -#endif - #include #include #include +#include "catch_compiler_capabilities.h" + namespace Catch { class NonCopyable { @@ -134,11 +130,14 @@ namespace Catch { return os; } - CATCH_ATTRIBUTE_NORETURN + // This is just here to avoid compiler warnings with macro constants and boolean literals + inline bool isTrue( bool value ){ return value; } + inline void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ) { std::ostringstream oss; oss << locationInfo << ": Internal Catch error: '" << message << "'"; - throw std::logic_error( oss.str() ); + if( isTrue( true )) + throw std::logic_error( oss.str() ); } } diff --git a/include/internal/catch_test_registry.hpp b/include/internal/catch_test_registry.hpp index 65fe760f..fde21d35 100644 --- a/include/internal/catch_test_registry.hpp +++ b/include/internal/catch_test_registry.hpp @@ -80,12 +80,6 @@ private: namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TESTCASE_NORETURN( ... ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() - /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } @@ -107,12 +101,6 @@ private: namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TESTCASE_NORETURN( Name, Desc ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() - /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp index bf951222..123e8cef 100644 --- a/projects/SelfTest/ExceptionTests.cpp +++ b/projects/SelfTest/ExceptionTests.cpp @@ -15,13 +15,11 @@ namespace { - CATCH_ATTRIBUTE_NORETURN - int thisThrows(); - - int thisThrows() + inline int thisThrows() { - throw std::domain_error( "expected exception" ); - /*NOTREACHED*/ + if( Catch::isTrue( true ) ) + throw std::domain_error( "expected exception" ); + return 1; } int thisDoesntThrow() @@ -37,7 +35,6 @@ TEST_CASE( "./succeeding/exceptions/explicit", "When checked exceptions are thro REQUIRE_THROWS( thisThrows() ); } -CATCH_ATTRIBUTE_NORETURN TEST_CASE( "./failing/exceptions/explicit", "When checked exceptions are thrown they can be expected or unexpected" ) { CHECK_THROWS_AS( thisThrows(), std::string ); @@ -45,31 +42,30 @@ TEST_CASE( "./failing/exceptions/explicit", "When checked exceptions are thrown CHECK_NOTHROW( thisThrows() ); } -TEST_CASE_NORETURN( "./failing/exceptions/implicit", "When unchecked exceptions are thrown they are always failures" ) +TEST_CASE( "./failing/exceptions/implicit", "When unchecked exceptions are thrown they are always failures" ) { - throw std::domain_error( "unexpected exception" ); - /*NOTREACHED*/ + if( Catch::isTrue( true ) ) + throw std::domain_error( "unexpected exception" ); } -TEST_CASE_NORETURN( "./failing/exceptions/implicit/2", "An unchecked exception reports the line of the last assertion" ) +TEST_CASE( "./failing/exceptions/implicit/2", "An unchecked exception reports the line of the last assertion" ) { CHECK( 1 == 1 ); - throw std::domain_error( "unexpected exception" ); - /*NOTREACHED*/ + if( Catch::isTrue( true ) ) + throw std::domain_error( "unexpected exception" ); } TEST_CASE( "./failing/exceptions/implicit/3", "When unchecked exceptions are thrown they are always failures" ) { SECTION( "section name", "" ) { - throw std::domain_error( "unexpected exception" ); - /*NOTREACHED*/ + if( Catch::isTrue( true ) ) + throw std::domain_error( "unexpected exception" ); } } -TEST_CASE_NORETURN( "./failing/exceptions/implicit/4", "When unchecked exceptions are thrown they are always failures" ) +TEST_CASE( "./failing/exceptions/implicit/4", "When unchecked exceptions are thrown they are always failures" ) { CHECK( thisThrows() == 0 ); - /*NOTREACHED*/ } TEST_CASE( "./succeeding/exceptions/implicit", "When unchecked exceptions are thrown, but caught, they do not affect the test" ) @@ -109,28 +105,32 @@ CATCH_TRANSLATE_EXCEPTION( double& ex ) return Catch::toString( ex ); } -TEST_CASE_NORETURN( "./failing/exceptions/custom", "Unexpected custom exceptions can be translated" ) +TEST_CASE( "./failing/exceptions/custom", "Unexpected custom exceptions can be translated" ) { - throw CustomException( "custom exception" ); + if( Catch::isTrue( true ) ) + throw CustomException( "custom exception" ); +} + +inline void throwCustom() { + if( Catch::isTrue( true ) ) + throw CustomException( "custom exception - not std" ); } -#ifdef _MSC_VER -#pragma warning(disable:4702) // unreachable code -#endif TEST_CASE( "./failing/exceptions/custom/nothrow", "Custom exceptions can be translated when testing for nothrow" ) { - REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ); + REQUIRE_NOTHROW( throwCustom() ); } TEST_CASE( "./failing/exceptions/custom/throw", "Custom exceptions can be translated when testing for throwing as something else" ) { - REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ), std::exception ); + REQUIRE_THROWS_AS( throwCustom(), std::exception ); } -TEST_CASE_NORETURN( "./failing/exceptions/custom/double", "Unexpected custom exceptions can be translated" ) +TEST_CASE( "./failing/exceptions/custom/double", "Unexpected custom exceptions can be translated" ) { - throw double( 3.14 ); + if( Catch::isTrue( true ) ) + throw double( 3.14 ); } inline int thisFunctionNotImplemented( int ) { From 1309da2b553d68dc13ee7d2a0556a24a7d6f7f35 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 24 Apr 2013 18:51:34 +0100 Subject: [PATCH 228/296] approved changes relating to no-return functions --- .../SelfTest/Baselines/approvedResults.txt | 190 +++++++++--------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index b68f72f1..ccec55ce 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1023,37 +1023,37 @@ with expansion: ------------------------------------------------------------------------------- ./succeeding/exceptions/explicit ------------------------------------------------------------------------------- -ExceptionTests.cpp:33 +ExceptionTests.cpp:31 ............................................................................... -ExceptionTests.cpp:35: +ExceptionTests.cpp:33: PASSED: REQUIRE_THROWS_AS( thisThrows() ) -ExceptionTests.cpp:36: +ExceptionTests.cpp:34: PASSED: REQUIRE_NOTHROW( thisDoesntThrow() ) -ExceptionTests.cpp:37: +ExceptionTests.cpp:35: PASSED: REQUIRE_THROWS( thisThrows() ) ------------------------------------------------------------------------------- ./failing/exceptions/explicit ------------------------------------------------------------------------------- -ExceptionTests.cpp:41 +ExceptionTests.cpp:38 ............................................................................... -ExceptionTests.cpp:43: FAILED: +ExceptionTests.cpp:40: FAILED: CHECK_THROWS_AS( thisThrows() ) due to unexpected exception with message: expected exception -ExceptionTests.cpp:44: FAILED: +ExceptionTests.cpp:41: FAILED: CHECK_THROWS_AS( thisDoesntThrow() ) because no exception was thrown where one was expected: -ExceptionTests.cpp:45: FAILED: +ExceptionTests.cpp:42: FAILED: CHECK_NOTHROW( thisThrows() ) due to unexpected exception with message: expected exception @@ -1061,24 +1061,24 @@ due to unexpected exception with message: ------------------------------------------------------------------------------- ./failing/exceptions/implicit ------------------------------------------------------------------------------- -ExceptionTests.cpp:48 +ExceptionTests.cpp:45 ............................................................................... -ExceptionTests.cpp:48: FAILED: +ExceptionTests.cpp:45: FAILED: due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- ./failing/exceptions/implicit/2 ------------------------------------------------------------------------------- -ExceptionTests.cpp:54 +ExceptionTests.cpp:51 ............................................................................... -ExceptionTests.cpp:56: +ExceptionTests.cpp:53: PASSED: CHECK( 1 == 1 ) -ExceptionTests.cpp:56: FAILED: +ExceptionTests.cpp:53: FAILED: {Unknown expression after the reported line} due to unexpected exception with message: unexpected exception @@ -1087,20 +1087,20 @@ due to unexpected exception with message: ./failing/exceptions/implicit/3 section name ------------------------------------------------------------------------------- -ExceptionTests.cpp:62 +ExceptionTests.cpp:59 ............................................................................... -ExceptionTests.cpp:62: FAILED: +ExceptionTests.cpp:59: FAILED: due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- ./failing/exceptions/implicit/4 ------------------------------------------------------------------------------- -ExceptionTests.cpp:69 +ExceptionTests.cpp:66 ............................................................................... -ExceptionTests.cpp:71: FAILED: +ExceptionTests.cpp:68: FAILED: CHECK( thisThrows() == 0 ) due to unexpected exception with message: expected exception @@ -1108,7 +1108,7 @@ due to unexpected exception with message: ------------------------------------------------------------------------------- ./succeeding/exceptions/implicit ------------------------------------------------------------------------------- -ExceptionTests.cpp:75 +ExceptionTests.cpp:71 ............................................................................... @@ -1117,42 +1117,42 @@ No assertions in test case, './succeeding/exceptions/implicit' ------------------------------------------------------------------------------- ./failing/exceptions/custom ------------------------------------------------------------------------------- -ExceptionTests.cpp:112 +ExceptionTests.cpp:108 ............................................................................... -ExceptionTests.cpp:112: FAILED: +ExceptionTests.cpp:108: FAILED: due to unexpected exception with message: custom exception ------------------------------------------------------------------------------- ./failing/exceptions/custom/nothrow ------------------------------------------------------------------------------- -ExceptionTests.cpp:120 +ExceptionTests.cpp:119 ............................................................................... -ExceptionTests.cpp:122: FAILED: - REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) +ExceptionTests.cpp:121: FAILED: + REQUIRE_NOTHROW( throwCustom() ) due to unexpected exception with message: - unexpected custom exception + custom exception - not std ------------------------------------------------------------------------------- ./failing/exceptions/custom/throw ------------------------------------------------------------------------------- -ExceptionTests.cpp:125 +ExceptionTests.cpp:124 ............................................................................... -ExceptionTests.cpp:127: FAILED: - REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) +ExceptionTests.cpp:126: FAILED: + REQUIRE_THROWS_AS( throwCustom() ) due to unexpected exception with message: custom exception - not std ------------------------------------------------------------------------------- ./failing/exceptions/custom/double ------------------------------------------------------------------------------- -ExceptionTests.cpp:131 +ExceptionTests.cpp:130 ............................................................................... -ExceptionTests.cpp:131: FAILED: +ExceptionTests.cpp:130: FAILED: due to unexpected exception with message: 3.14 @@ -6040,54 +6040,54 @@ ConditionTests.cpp:346 -ExceptionTests.cpp:43 +ExceptionTests.cpp:40 -ExceptionTests.cpp:44 +ExceptionTests.cpp:41 -ExceptionTests.cpp:45 +ExceptionTests.cpp:42 -ExceptionTests.cpp:48 +ExceptionTests.cpp:45 -ExceptionTests.cpp:56 +ExceptionTests.cpp:53 -ExceptionTests.cpp:62 +ExceptionTests.cpp:59 -ExceptionTests.cpp:71 +ExceptionTests.cpp:68 -ExceptionTests.cpp:112 +ExceptionTests.cpp:108 - -ExceptionTests.cpp:122 + +ExceptionTests.cpp:121 - -ExceptionTests.cpp:127 + +ExceptionTests.cpp:126 -ExceptionTests.cpp:131 +ExceptionTests.cpp:130 @@ -7713,6 +7713,22 @@ ConditionTests.cpp" line="346"> +ExceptionTests.cpp" line="33"> + + thisThrows() + + + thisThrows() + + +ExceptionTests.cpp" line="34"> + + thisDoesntThrow() + + + thisDoesntThrow() + + ExceptionTests.cpp" line="35"> thisThrows() @@ -7721,37 +7737,21 @@ ExceptionTests.cpp" line="35"> thisThrows() -ExceptionTests.cpp" line="36"> - - thisDoesntThrow() - - - thisDoesntThrow() - - -ExceptionTests.cpp" line="37"> - - thisThrows() - - - thisThrows() - - -ExceptionTests.cpp" line="43"> +ExceptionTests.cpp" line="40"> thisThrows() thisThrows() -ExceptionTests.cpp" line="43"> +ExceptionTests.cpp" line="40"> expected exception -ExceptionTests.cpp" line="44"> +ExceptionTests.cpp" line="41"> thisDoesntThrow() @@ -7759,27 +7759,27 @@ ExceptionTests.cpp" line="44"> thisDoesntThrow() -ExceptionTests.cpp" line="45"> +ExceptionTests.cpp" line="42"> thisThrows() thisThrows() -ExceptionTests.cpp" line="45"> +ExceptionTests.cpp" line="42"> expected exception -ExceptionTests.cpp" line="48"> +ExceptionTests.cpp" line="45"> unexpected exception -ExceptionTests.cpp" line="56"> +ExceptionTests.cpp" line="53"> 1 == 1 @@ -7787,14 +7787,14 @@ ExceptionTests.cpp" line="56"> 1 == 1 -ExceptionTests.cpp" line="56"> +ExceptionTests.cpp" line="53"> {Unknown expression after the reported line} {Unknown expression after the reported line} -ExceptionTests.cpp" line="56"> +ExceptionTests.cpp" line="53"> unexpected exception @@ -7802,7 +7802,7 @@ ExceptionTests.cpp" line="56">
-ExceptionTests.cpp" line="62"> +ExceptionTests.cpp" line="59"> unexpected exception @@ -7810,14 +7810,14 @@ ExceptionTests.cpp" line="62"> -ExceptionTests.cpp" line="71"> +ExceptionTests.cpp" line="68"> thisThrows() == 0 thisThrows() == 0 -ExceptionTests.cpp" line="71"> +ExceptionTests.cpp" line="68"> expected exception @@ -7827,41 +7827,41 @@ ExceptionTests.cpp" line="71"> -ExceptionTests.cpp" line="112"> +ExceptionTests.cpp" line="108"> custom exception -ExceptionTests.cpp" line="122"> +ExceptionTests.cpp" line="121"> - throw CustomException( "unexpected custom exception" ) + throwCustom() - throw CustomException( "unexpected custom exception" ) + throwCustom() -ExceptionTests.cpp" line="122"> - unexpected custom exception +ExceptionTests.cpp" line="121"> + custom exception - not std -ExceptionTests.cpp" line="127"> +ExceptionTests.cpp" line="126"> - throw CustomException( "custom exception - not std" ) + throwCustom() - throw CustomException( "custom exception - not std" ) + throwCustom() -ExceptionTests.cpp" line="127"> +ExceptionTests.cpp" line="126"> custom exception - not std -ExceptionTests.cpp" line="131"> +ExceptionTests.cpp" line="130"> 3.14 @@ -12538,36 +12538,36 @@ ConditionTests.cpp:346: !1 == 1 failed for: !(1 == 1) [Finished: './failing/conditions/not' 1 test case failed (All 8 assertions failed)] [Running: ./succeeding/exceptions/explicit] +ExceptionTests.cpp:33: thisThrows() succeeded +ExceptionTests.cpp:34: thisDoesntThrow() succeeded ExceptionTests.cpp:35: thisThrows() succeeded -ExceptionTests.cpp:36: thisDoesntThrow() succeeded -ExceptionTests.cpp:37: thisThrows() succeeded [Finished: './succeeding/exceptions/explicit' All tests passed (3 assertions in 1 test case)] [Running: ./failing/exceptions/explicit] -ExceptionTests.cpp:43: thisThrows() failed with unexpected exception with message: 'expected exception' -ExceptionTests.cpp:44: thisDoesntThrow() failed because no exception was thrown where one was expected -ExceptionTests.cpp:45: thisThrows() failed with unexpected exception with message: 'expected exception' +ExceptionTests.cpp:40: thisThrows() failed with unexpected exception with message: 'expected exception' +ExceptionTests.cpp:41: thisDoesntThrow() failed because no exception was thrown where one was expected +ExceptionTests.cpp:42: 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] -ExceptionTests.cpp:48: Unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:45: Unexpected exception with message: 'unexpected exception' [Finished: './failing/exceptions/implicit' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/implicit/2] -ExceptionTests.cpp:56: 1 == 1 succeeded -ExceptionTests.cpp:56: {Unknown expression after the reported line} failed with unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:53: 1 == 1 succeeded +ExceptionTests.cpp:53: {Unknown expression after the reported line} failed with unexpected exception with message: 'unexpected exception' [Finished: './failing/exceptions/implicit/2' 1 test case failed (1 of 2 assertions failed)] [Running: ./failing/exceptions/implicit/3] [Started section: 'section name'] -ExceptionTests.cpp:62: Unexpected exception with message: 'unexpected exception' +ExceptionTests.cpp:59: Unexpected exception with message: 'unexpected exception' [End of section: 'section name' 1 assertion failed] [Finished: './failing/exceptions/implicit/3' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/implicit/4] -ExceptionTests.cpp:71: thisThrows() == 0 failed with unexpected exception with message: 'expected exception' +ExceptionTests.cpp:68: thisThrows() == 0 failed with unexpected exception with message: 'expected exception' [Finished: './failing/exceptions/implicit/4' 1 test case failed (1 assertion failed)] [Running: ./succeeding/exceptions/implicit] @@ -12577,19 +12577,19 @@ No assertions in test case, './succeeding/exceptions/implicit' [Finished: './succeeding/exceptions/implicit' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/custom] -ExceptionTests.cpp:112: Unexpected exception with message: 'custom exception' +ExceptionTests.cpp:108: Unexpected exception with message: 'custom exception' [Finished: './failing/exceptions/custom' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/custom/nothrow] -ExceptionTests.cpp:122: throw CustomException( "unexpected custom exception" ) failed with unexpected exception with message: 'unexpected custom exception' +ExceptionTests.cpp:121: throwCustom() failed with unexpected exception with message: 'custom exception - not std' [Finished: './failing/exceptions/custom/nothrow' 1 test case failed (1 assertion failed)] [Running: ./failing/exceptions/custom/throw] -ExceptionTests.cpp:127: throw CustomException( "custom exception - not std" ) failed with unexpected exception with message: 'custom exception - not std' +ExceptionTests.cpp:126: throwCustom() 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] -ExceptionTests.cpp:131: Unexpected exception with message: '3.14' +ExceptionTests.cpp:130: Unexpected exception with message: '3.14' [Finished: './failing/exceptions/custom/double' 1 test case failed (1 assertion failed)] [Running: ./succeeding/exceptions/notimplemented] From 2278451cd22b69d6c18f6e42378df6bd2c549c51 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 24 Apr 2013 18:58:57 +0100 Subject: [PATCH 229/296] Refactored scripts to start using a common file --- scripts/approvalTests.py | 13 ++++++++----- scripts/approve.py | 7 ++++--- scripts/generateSingleHeader.py | 7 ++++--- scripts/scriptCommon.py | 4 ++++ 4 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 scripts/scriptCommon.py diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py index 1bf114af..14a5354e 100644 --- a/scripts/approvalTests.py +++ b/scripts/approvalTests.py @@ -3,18 +3,21 @@ import sys import subprocess import re +from scriptCommon import catchPath + filenameParser = re.compile( r'\s*.*/(.*\..pp)(.*)' ) hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' ) -catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) -baselinesPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/approvedResults.txt' ) -rawResultsPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/_rawResults.tmp' ) -filteredResultsPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/unapprovedResults.txt' ) +#catchPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0]))) + +baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedResults.txt' ) +rawResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/_rawResults.tmp' ) +filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) if len(sys.argv) == 2: cmdPath = sys.argv[1] else: - cmdPath = "../projects/XCode4/CatchSelfTest/DerivedData/CatchSelfTest/Build/Products/Debug/CatchSelfTest" + cmdPath = os.path.join( catchPath, 'projects/XCode4/CatchSelfTest/DerivedData/CatchSelfTest/Build/Products/Debug/CatchSelfTest' ) f = open( rawResultsPath, 'w' ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console" ], stdout=f, stderr=f ) diff --git a/scripts/approve.py b/scripts/approve.py index 25a566b4..9302ae56 100644 --- a/scripts/approve.py +++ b/scripts/approve.py @@ -2,9 +2,10 @@ import os import sys import shutil -catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) -baselinesPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/approvedResults.txt' ) -filteredResultsPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/unapprovedResults.txt' ) +from scriptCommon import catchPath + +baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedResults.txt' ) +filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) if os.path.isfile( filteredResultsPath ): os.remove( baselinesPath ) diff --git a/scripts/generateSingleHeader.py b/scripts/generateSingleHeader.py index 85b24ec6..0301cd63 100644 --- a/scripts/generateSingleHeader.py +++ b/scripts/generateSingleHeader.py @@ -3,6 +3,8 @@ import sys import re import datetime +from scriptCommon import catchPath + versionParser = re.compile( r'(\s*Version\slibraryVersion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*\).*' ) includesParser = re.compile( r'\s*#include\s*"(.*)"' ) guardParser = re.compile( r'\s*#.*_INCLUDED') @@ -11,10 +13,9 @@ commentParser1 = re.compile( r'^\s*/\*') commentParser2 = re.compile( r'^\s*\*') blankParser = re.compile( r'^\s*$') seenHeaders = set([]) -catchPath = os.path.realpath(os.path.dirname(sys.argv[0])) -rootPath = os.path.join( catchPath, '../include/' ) +rootPath = os.path.join( catchPath, 'include/' ) versionPath = os.path.join( rootPath, "internal/catch_version.hpp" ) -readmePath = os.path.join( catchPath, "../README.md" ) +readmePath = os.path.join( catchPath, "README.md" ) #outputPath = os.path.join( catchPath, 'single_include/catch.hpp' ) bumpVersion = len(sys.argv) < 2 or sys.argv[1] <> "nobump" diff --git a/scripts/scriptCommon.py b/scripts/scriptCommon.py new file mode 100644 index 00000000..5710ba9c --- /dev/null +++ b/scripts/scriptCommon.py @@ -0,0 +1,4 @@ +import os +import sys + +catchPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0]))) \ No newline at end of file From 8defc71e6ddaacbb3df6629218944c74b6a8a6d0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 24 Apr 2013 19:10:02 +0100 Subject: [PATCH 230/296] Build 38 --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- .../SelfTest/Baselines/approvedResults.txt | 4 +- single_include/catch.hpp | 778 +++++++++--------- 4 files changed, 382 insertions(+), 404 deletions(-) diff --git a/README.md b/README.md index c832139a..a78f0c14 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 37 (integration branch) +## CATCH v0.9 build 38 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 6fcf51a3..ae84eb5a 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 37, "integration" ); + Version libraryVersion( 0, 9, 38, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index ccec55ce..9aaf62f6 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,6 +1,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b37 (integration) host application. +CatchSelfTest is a CATCH v0.9 b38 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- @@ -5547,7 +5547,7 @@ with message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b37 (integration) host application. +CatchSelfTest is a CATCH v0.9 b38 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 04abb256..0de7b619 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 37 (integration branch) - * Generated: 2013-04-23 08:01:34.500704 + * CATCH v0.9 build 38 (integration branch) + * Generated: 2013-04-24 19:08:42.283467 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -34,21 +34,86 @@ #define INTERNAL_CATCH_STRINGIFY2( expr ) #expr #define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr ) -#ifdef __GNUC__ -#define CATCH_ATTRIBUTE_NORETURN __attribute__ ((noreturn)) -#else -#define CATCH_ATTRIBUTE_NORETURN -#endif - #include #include #include +// #included from: catch_compiler_capabilities.h +#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED + +// Much of the following code is based on Boost (1.53) + +//////////////////////////////////////////////////////////////////////////////// +// Borland +#ifdef __BORLANDC__ + +#if (__BORLANDC__ > 0x582 ) +//#define CATCH_CONFIG_SFINAE // Not confirmed +#endif + +#endif // __BORLANDC__ + +//////////////////////////////////////////////////////////////////////////////// +// EDG +#ifdef __EDG_VERSION__ + +#if (__EDG_VERSION__ > 238 ) +//#define CATCH_CONFIG_SFINAE // Not confirmed +#endif + +#endif // __EDG_VERSION__ + +//////////////////////////////////////////////////////////////////////////////// +// Digital Mars +#ifdef __DMC__ + +#if (__DMC__ > 0x840 ) +//#define CATCH_CONFIG_SFINAE // Not confirmed +#endif + +#endif // __DMC__ + +//////////////////////////////////////////////////////////////////////////////// +// GCC +#ifdef __GNUC__ + +#if __GNUC__ < 3 + +#if (__GNUC_MINOR__ >= 96 ) +//#define CATCH_CONFIG_SFINAE +#endif + +#elif __GNUC__ >= 3 + +// #define CATCH_CONFIG_SFINAE // Taking this out completely for now + +#endif // __GNUC__ < 3 + +#endif // __GNUC__ + +//////////////////////////////////////////////////////////////////////////////// +// Visual C++ +#ifdef _MSC_VER + +#if (_MSC_VER >= 1310 ) // (VC++ 7.0+) +//#define CATCH_CONFIG_SFINAE // Not confirmed +#endif + +#endif // _MSC_VER + +// Use variadic macros if the compiler supports them +#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ + ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ + ( defined __GNUC__ && __GNUC__ >= 3 ) || \ + ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) + #define CATCH_CONFIG_VARIADIC_MACROS +#endif + namespace Catch { class NonCopyable { - NonCopyable( const NonCopyable& ); - void operator = ( const NonCopyable& ); + NonCopyable( NonCopyable const& ); + void operator = ( NonCopyable const& ); protected: NonCopyable() {} virtual ~NonCopyable(); @@ -86,17 +151,17 @@ namespace Catch { } template - inline void forEach( const ContainerT& container, Function function ) { + inline void forEach( ContainerT const& container, Function function ) { std::for_each( container.begin(), container.end(), function ); } - inline bool startsWith( const std::string& s, const std::string& prefix ) { + inline bool startsWith( std::string const& s, std::string const& prefix ) { return s.size() >= prefix.size() && s.substr( 0, prefix.size() ) == prefix; } - inline bool endsWith( const std::string& s, const std::string& suffix ) { + inline bool endsWith( std::string const& s, std::string const& suffix ) { return s.size() >= suffix.size() && s.substr( s.size()-suffix.size(), suffix.size() ) == suffix; } - inline bool contains( const std::string& s, const std::string& infix ) { + inline bool contains( std::string const& s, std::string const& infix ) { return s.find( infix ) != std::string::npos; } inline void toLowerInPlace( std::string& s ) { @@ -109,12 +174,12 @@ namespace Catch { } struct pluralise { - pluralise( std::size_t count, const std::string& label ) + pluralise( std::size_t count, std::string const& label ) : m_count( count ), m_label( label ) {} - friend std::ostream& operator << ( std::ostream& os, const pluralise& pluraliser ) { + friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) { os << pluraliser.m_count << " " << pluraliser.m_label; if( pluraliser.m_count != 1 ) os << "s"; @@ -128,11 +193,11 @@ namespace Catch { struct SourceLineInfo { SourceLineInfo() : line( 0 ){} - SourceLineInfo( const std::string& _file, std::size_t _line ) + SourceLineInfo( std::string const& _file, std::size_t _line ) : file( _file ), line( _line ) {} - SourceLineInfo( const SourceLineInfo& other ) + SourceLineInfo( SourceLineInfo const& other ) : file( other.file ), line( other.line ) {} @@ -144,7 +209,7 @@ namespace Catch { std::size_t line; }; - inline std::ostream& operator << ( std::ostream& os, const SourceLineInfo& info ) { + inline std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) { #ifndef __GNUG__ os << info.file << "(" << info.line << ")"; #else @@ -153,11 +218,14 @@ namespace Catch { return os; } - CATCH_ATTRIBUTE_NORETURN - inline void throwLogicError( const std::string& message, const SourceLineInfo& locationInfo ) { + // This is just here to avoid compiler warnings with macro constants and boolean literals + inline bool isTrue( bool value ){ return value; } + + inline void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ) { std::ostringstream oss; oss << locationInfo << ": Internal Catch error: '" << message << "'"; - throw std::logic_error( oss.str() ); + if( isTrue( true )) + throw std::logic_error( oss.str() ); } } @@ -171,7 +239,7 @@ namespace Catch { class NotImplementedException : public std::exception { public: - NotImplementedException( const SourceLineInfo& lineInfo ); + NotImplementedException( SourceLineInfo const& lineInfo ); virtual ~NotImplementedException() throw() {} @@ -206,7 +274,7 @@ namespace Catch { struct IGeneratorsForTest { virtual ~IGeneratorsForTest(); - virtual IGeneratorInfo& getGeneratorInfo( const std::string& fileInfo, std::size_t size ) = 0; + virtual IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) = 0; virtual bool moveNext() = 0; }; @@ -233,7 +301,7 @@ namespace Catch { virtual IResultCapture& getResultCapture() = 0; virtual IRunner& getRunner() = 0; - virtual size_t getGeneratorIndex( const std::string& fileInfo, size_t totalSize ) = 0; + virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0; virtual bool advanceGeneratorsForCurrentTest() = 0; virtual const IConfig* getConfig() const = 0; }; @@ -249,7 +317,7 @@ namespace Catch { IContext& getCurrentContext(); IMutableContext& getCurrentMutableContext(); void cleanUpContext(); - Stream createStream( const std::string& streamName ); + Stream createStream( std::string const& streamName ); } @@ -359,82 +427,11 @@ namespace Catch { struct ITestCaseRegistry { virtual ~ITestCaseRegistry(); - virtual const std::vector& getAllTests() const = 0; - virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const = 0; + virtual std::vector const& getAllTests() const = 0; + virtual std::vector getMatchingTestCases( std::string const& rawTestSpec ) const = 0; }; } -// #included from: internal/catch_compiler_capabilities.h -#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED - -// Much of the following code is based on Boost (1.53) - -//////////////////////////////////////////////////////////////////////////////// -// Borland -#ifdef __BORLANDC__ - -#if (__BORLANDC__ > 0x582 ) -//#define CATCH_CONFIG_SFINAE // Not confirmed -#endif - -#endif // __BORLANDC__ - -//////////////////////////////////////////////////////////////////////////////// -// EDG -#ifdef __EDG_VERSION__ - -#if (__EDG_VERSION__ > 238 ) -//#define CATCH_CONFIG_SFINAE // Not confirmed -#endif - -#endif // __EDG_VERSION__ - -//////////////////////////////////////////////////////////////////////////////// -// Digital Mars -#ifdef __DMC__ - -#if (__DMC__ > 0x840 ) -//#define CATCH_CONFIG_SFINAE // Not confirmed -#endif - -#endif // __DMC__ - -//////////////////////////////////////////////////////////////////////////////// -// GCC -#ifdef __GNUC__ - -#if __GNUC__ < 3 - -#if (__GNUC_MINOR__ >= 96 ) -//#define CATCH_CONFIG_SFINAE -#endif - -#elif __GNUC__ >= 3 - -// #define CATCH_CONFIG_SFINAE // Taking this out completely for now - -#endif // __GNUC__ < 3 - -#endif // __GNUC__ - -//////////////////////////////////////////////////////////////////////////////// -// Visual C++ -#ifdef _MSC_VER - -#if (_MSC_VER >= 1310 ) // (VC++ 7.0+) -//#define CATCH_CONFIG_SFINAE // Not confirmed -#endif - -#endif // _MSC_VER - -// Use variadic macros if the compiler supports them -#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ - ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ - ( defined __GNUC__ && __GNUC__ >= 3 ) || \ - ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) - #define CATCH_CONFIG_VARIADIC_MACROS -#endif - namespace Catch { template @@ -490,8 +487,8 @@ struct AutoReg { ~AutoReg(); private: - AutoReg( const AutoReg& ); - void operator= ( const AutoReg& ); + AutoReg( AutoReg const& ); + void operator= ( AutoReg const& ); }; } // end namespace Catch @@ -503,12 +500,6 @@ private: namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TESTCASE_NORETURN( ... ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() - /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } @@ -530,12 +521,6 @@ private: namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TESTCASE_NORETURN( Name, Desc ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() - /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } @@ -688,7 +673,7 @@ namespace Detail { template struct IsStreamInsertable { static std::ostream &s; - static T const &t; + static T const&t; enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) }; }; @@ -744,7 +729,7 @@ struct StringMaker > { namespace Detail { template - inline std::string makeString( const T& value ) { + inline std::string makeString( T const& value ) { return StringMaker::convert( value ); } } // end namespace Detail @@ -757,17 +742,17 @@ namespace Detail { /// Overload (not specialise) this template for custom typs that you don't want /// to provide an ostream overload for. template -std::string toString( const T& value ) { +std::string toString( T const& value ) { return StringMaker::convert( value ); } // Built in overloads -inline std::string toString( const std::string& value ) { +inline std::string toString( std::string const& value ) { return "\"" + value + "\""; } -inline std::string toString( const std::wstring& value ) { +inline std::string toString( std::wstring const& value ) { std::ostringstream oss; oss << "\""; for(size_t i = 0; i < value.size(); ++i ) @@ -920,9 +905,9 @@ namespace Catch { struct AssertionInfo { AssertionInfo() {} - AssertionInfo( const std::string& _macroName, - const SourceLineInfo& _lineInfo, - const std::string& _capturedExpression, + AssertionInfo( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + std::string const& _capturedExpression, ResultDisposition::Flags _resultDisposition ); std::string macroName; @@ -943,7 +928,7 @@ namespace Catch { class AssertionResult { public: AssertionResult(); - AssertionResult( const AssertionInfo& info, const AssertionResultData& data ); + AssertionResult( AssertionInfo const& info, AssertionResultData const& data ); ~AssertionResult(); bool isOk() const; @@ -994,7 +979,7 @@ namespace Internal { template<> struct OperatorTraits{ static const char* getName(){ return ">="; } }; template - inline T& opCast(const T& t) { return const_cast(t); } + inline T& opCast(T const& t) { return const_cast(t); } // nullptr_t support based on pull request #154 from Konstantin Baumann #ifdef CATCH_CONFIG_CPP11_NULLPTR @@ -1008,43 +993,43 @@ namespace Internal { template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs) { + static bool evaluate( T1 const& lhs, T2 const& rhs) { return opCast( lhs ) == opCast( rhs ); } }; template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs ) { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { return opCast( lhs ) != opCast( rhs ); } }; template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs ) { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { return opCast( lhs ) < opCast( rhs ); } }; template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs ) { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { return opCast( lhs ) > opCast( rhs ); } }; template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs ) { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { return opCast( lhs ) >= opCast( rhs ); } }; template struct Evaluator { - static bool evaluate( const T1& lhs, const T2& rhs ) { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { return opCast( lhs ) <= opCast( rhs ); } }; template - bool applyEvaluator( const T1& lhs, const T2& rhs ) { + bool applyEvaluator( T1 const& lhs, T2 const& rhs ) { return Evaluator::evaluate( lhs, rhs ); } @@ -1053,7 +1038,7 @@ namespace Internal { // "base" overload template - bool compare( const T1& lhs, const T2& rhs ) { + bool compare( T1 const& lhs, T2 const& rhs ) { return Evaluator::evaluate( lhs, rhs ); } @@ -1142,26 +1127,26 @@ class ExpressionResultBuilder { public: ExpressionResultBuilder( ResultWas::OfType resultType = ResultWas::Unknown ); - ExpressionResultBuilder( const ExpressionResultBuilder& other ); - ExpressionResultBuilder& operator=(const ExpressionResultBuilder& other ); + ExpressionResultBuilder( ExpressionResultBuilder const& other ); + ExpressionResultBuilder& operator=(ExpressionResultBuilder const& 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& setLhs( std::string const& lhs ); + ExpressionResultBuilder& setRhs( std::string const& rhs ); + ExpressionResultBuilder& setOp( std::string const& op ); ExpressionResultBuilder& endExpression( ResultDisposition::Flags resultDisposition ); template - ExpressionResultBuilder& operator << ( const T& value ) { + ExpressionResultBuilder& operator << ( T const& value ) { m_stream << value; return *this; } - std::string reconstructExpression( const AssertionInfo& info ) const; + std::string reconstructExpression( AssertionInfo const& info ) const; - AssertionResult buildResult( const AssertionInfo& info ) const; + AssertionResult buildResult( AssertionInfo const& info ) const; private: AssertionResultData m_data; @@ -1183,38 +1168,38 @@ struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; // in an ExpressionResultBuilder object template class ExpressionLhs { - void operator = ( const ExpressionLhs& ); + void operator = ( ExpressionLhs const& ); public: ExpressionLhs( T lhs ) : m_lhs( lhs ) {} template - ExpressionResultBuilder& operator == ( const RhsT& rhs ) { + ExpressionResultBuilder& operator == ( RhsT const& rhs ) { return captureExpression( rhs ); } template - ExpressionResultBuilder& operator != ( const RhsT& rhs ) { + ExpressionResultBuilder& operator != ( RhsT const& rhs ) { return captureExpression( rhs ); } template - ExpressionResultBuilder& operator < ( const RhsT& rhs ) { + ExpressionResultBuilder& operator < ( RhsT const& rhs ) { return captureExpression( rhs ); } template - ExpressionResultBuilder& operator > ( const RhsT& rhs ) { + ExpressionResultBuilder& operator > ( RhsT const& rhs ) { return captureExpression( rhs ); } template - ExpressionResultBuilder& operator <= ( const RhsT& rhs ) { + ExpressionResultBuilder& operator <= ( RhsT const& rhs ) { return captureExpression( rhs ); } template - ExpressionResultBuilder& operator >= ( const RhsT& rhs ) { + ExpressionResultBuilder& operator >= ( RhsT const& rhs ) { return captureExpression( rhs ); } @@ -1236,14 +1221,14 @@ public: // 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& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( RhsT const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( RhsT const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( RhsT const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( RhsT const& ); private: template - ExpressionResultBuilder& captureExpression( const RhsT& rhs ) { + ExpressionResultBuilder& captureExpression( RhsT const& rhs ) { return m_result .setResultType( Internal::compare( m_lhs, rhs ) ) .setLhs( Catch::toString( m_lhs ) ) @@ -1265,8 +1250,8 @@ class ExpressionDecomposer { public: template - ExpressionLhs operator->* ( const T & operand ) { - return ExpressionLhs( operand ); + ExpressionLhs operator->* ( T const& operand ) { + return ExpressionLhs( operand ); } ExpressionLhs operator->* ( bool value ) { @@ -1345,13 +1330,13 @@ namespace Catch { struct Counts { Counts() : passed( 0 ), failed( 0 ) {} - Counts operator - ( const Counts& other ) const { + Counts operator - ( Counts const& other ) const { Counts diff; diff.passed = passed - other.passed; diff.failed = failed - other.failed; return diff; } - Counts& operator += ( const Counts& other ) { + Counts& operator += ( Counts const& other ) { passed += other.passed; failed += other.failed; return *this; @@ -1367,14 +1352,14 @@ namespace Catch { struct Totals { - Totals operator - ( const Totals& other ) const { + Totals operator - ( Totals const& other ) const { Totals diff; diff.assertions = assertions - other.assertions; diff.testCases = testCases - other.testCases; return diff; } - Totals delta( const Totals& prevTotals ) const { + Totals delta( Totals const& prevTotals ) const { Totals diff = *this - prevTotals; if( diff.assertions.failed > 0 ) ++diff.testCases.failed; @@ -1383,7 +1368,7 @@ namespace Catch { return diff; } - Totals& operator += ( const Totals& other ) { + Totals& operator += ( Totals const& other ) { assertions += other.assertions; testCases += other.testCases; return *this; @@ -1418,7 +1403,7 @@ namespace Catch { virtual bool shouldDebugBreak() const = 0; - virtual void acceptMessage( const MessageBuilder& messageBuilder ) = 0; + virtual void acceptMessage( MessageBuilder const& messageBuilder ) = 0; virtual ResultAction::Value acceptExpression( ExpressionResultBuilder const& assertionResult, AssertionInfo const& assertionInfo ) = 0; virtual std::string getCurrentTestName() const = 0; @@ -1522,11 +1507,11 @@ namespace Catch { #ifdef CATCH_PLATFORM_WINDOWS extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA( const char* ); -inline void writeToDebugConsole( const std::string& text ) { +inline void writeToDebugConsole( std::string const& text ) { ::OutputDebugStringA( text.c_str() ); } #else -inline void writeToDebugConsole( const std::string& text ) { +inline void writeToDebugConsole( std::string const& text ) { // !TBD: Need a version for Mac/ XCode and other IDEs std::cout << text; } @@ -1560,14 +1545,14 @@ namespace Catch { struct ITestCase; struct TestCaseInfo { - TestCaseInfo( const std::string& _name, - const std::string& _className, - const std::string& _description, - const std::set& _tags, + TestCaseInfo( std::string const& _name, + std::string const& _className, + std::string const& _description, + std::set const& _tags, bool _isHidden, - const SourceLineInfo& _lineInfo ); + SourceLineInfo const& _lineInfo ); - TestCaseInfo( const TestCaseInfo& other ); + TestCaseInfo( TestCaseInfo const& other ); std::string name; std::string className; @@ -1581,34 +1566,34 @@ namespace Catch { class TestCase : protected TestCaseInfo { public: - TestCase( ITestCase* testCase, const TestCaseInfo& info ); - TestCase( const TestCase& other ); + TestCase( ITestCase* testCase, TestCaseInfo const& info ); + TestCase( TestCase const& other ); - TestCase withName( const std::string& _newName ) const; + TestCase withName( std::string const& _newName ) const; void invoke() const; - const TestCaseInfo& getTestCaseInfo() const; + TestCaseInfo const& getTestCaseInfo() const; bool isHidden() const; - bool hasTag( const std::string& tag ) const; - bool matchesTags( const std::string& tagPattern ) const; - const std::set& getTags() const; + bool hasTag( std::string const& tag ) const; + bool matchesTags( std::string const& tagPattern ) const; + std::set const& getTags() const; void swap( TestCase& other ); - bool operator == ( const TestCase& other ) const; - bool operator < ( const TestCase& other ) const; - TestCase& operator = ( const TestCase& other ); + bool operator == ( TestCase const& other ) const; + bool operator < ( TestCase const& other ) const; + TestCase& operator = ( TestCase const& other ); private: Ptr test; }; TestCase makeTestCase( ITestCase* testCase, - const std::string& className, - const std::string& name, - const std::string& description, - const SourceLineInfo& lineInfo ); + std::string const& className, + std::string const& name, + std::string const& description, + SourceLineInfo const& lineInfo ); } #ifdef __clang__ @@ -1632,7 +1617,7 @@ namespace Catch { public: virtual ~TagParser(); - void parse( const std::string& str ) { + void parse( std::string const& str ) { std::size_t pos = 0; while( pos < str.size() ) { char c = str[pos]; @@ -1656,7 +1641,7 @@ namespace Catch { } protected: - virtual void acceptTag( const std::string& tag ) = 0; + virtual void acceptTag( std::string const& tag ) = 0; virtual void acceptChar( char c ) = 0; virtual void endParse() {} @@ -1677,14 +1662,14 @@ namespace Catch { } private: - virtual void acceptTag( const std::string& tag ) { + virtual void acceptTag( std::string const& tag ) { m_tags.insert( toLower( tag ) ); } virtual void acceptChar( char c ) { m_remainder += c; } - TagExtracter& operator=(const TagExtracter&); + TagExtracter& operator=(TagExtracter const&); std::set& m_tags; std::string m_remainder; @@ -1696,7 +1681,7 @@ namespace Catch { : m_isNegated( false ) {} - Tag( const std::string& name, bool isNegated ) + Tag( std::string const& name, bool isNegated ) : m_name( name ), m_isNegated( isNegated ) {} @@ -1720,7 +1705,7 @@ namespace Catch { class TagSet { typedef std::map TagMap; public: - void add( const Tag& tag ) { + void add( Tag const& tag ) { m_tags.insert( std::make_pair( toLower( tag.getName() ), tag ) ); } @@ -1728,7 +1713,7 @@ namespace Catch { return m_tags.empty(); } - bool matches( const std::set& tags ) const { + bool matches( std::set const& tags ) const { TagMap::const_iterator it = m_tags.begin(); TagMap::const_iterator itEnd = m_tags.end(); for(; it != itEnd; ++it ) { @@ -1745,7 +1730,7 @@ namespace Catch { class TagExpression { public: - bool matches( const std::set& tags ) const { + bool matches( std::set const& tags ) const { std::vector::const_iterator it = m_tagSets.begin(); std::vector::const_iterator itEnd = m_tagSets.end(); for(; it != itEnd; ++it ) @@ -1770,7 +1755,7 @@ namespace Catch { ~TagExpressionParser(); private: - virtual void acceptTag( const std::string& tag ) { + virtual void acceptTag( std::string const& tag ) { m_currentTagSet.add( Tag( tag, m_isNegated ) ); m_isNegated = false; } @@ -1789,7 +1774,7 @@ namespace Catch { m_exp.m_tagSets.push_back( m_currentTagSet ); } - TagExpressionParser& operator=(const TagExpressionParser&); + TagExpressionParser& operator=(TagExpressionParser const&); bool m_isNegated; TagSet m_currentTagSet; @@ -1818,7 +1803,7 @@ namespace Catch { }; public: - TestCaseFilter( const std::string& testSpec, IfFilterMatches::DoWhat matchBehaviour = IfFilterMatches::AutoDetectBehaviour ) + TestCaseFilter( std::string const& testSpec, IfFilterMatches::DoWhat matchBehaviour = IfFilterMatches::AutoDetectBehaviour ) : m_stringToMatch( toLower( testSpec ) ), m_filterType( matchBehaviour ), m_wildcardPosition( NoWildcard ) @@ -1851,7 +1836,7 @@ namespace Catch { return m_filterType; } - bool shouldInclude( const TestCase& testCase ) const { + bool shouldInclude( TestCase const& testCase ) const { return isMatch( testCase ) == (m_filterType == IfFilterMatches::IncludeTests); } private: @@ -1861,7 +1846,7 @@ namespace Catch { #pragma clang diagnostic ignored "-Wunreachable-code" #endif - bool isMatch( const TestCase& testCase ) const { + bool isMatch( TestCase const& testCase ) const { std::string name = testCase.getTestCaseInfo().name; toLowerInPlace( name ); @@ -1889,27 +1874,27 @@ namespace Catch { class TestCaseFilters { public: - TestCaseFilters( const std::string& name ) : m_name( name ) {} + TestCaseFilters( std::string const& name ) : m_name( name ) {} std::string getName() const { return m_name; } - void addFilter( const TestCaseFilter& filter ) { + void addFilter( TestCaseFilter const& filter ) { if( filter.getFilterType() == IfFilterMatches::ExcludeTests ) m_exclusionFilters.push_back( filter ); else m_inclusionFilters.push_back( filter ); } - void addTags( const std::string& tagPattern ) { + void addTags( std::string const& tagPattern ) { TagExpression exp; TagExpressionParser( exp ).parse( tagPattern ); m_tagExpressions.push_back( exp ); } - bool shouldInclude( const TestCase& testCase ) const { + bool shouldInclude( TestCase const& testCase ) const { if( !m_tagExpressions.empty() ) { std::vector::const_iterator it = m_tagExpressions.begin(); std::vector::const_iterator itEnd = m_tagExpressions.end(); @@ -2023,7 +2008,7 @@ namespace Catch { struct OutputDebugWriter { - void operator()( const std::string &str ) { + void operator()( std::string const&str ) { writeToDebugConsole( str ); } }; @@ -2116,8 +2101,8 @@ namespace Catch { class Config : public IConfig { private: - Config( const Config& other ); - Config& operator = ( const Config& other ); + Config( Config const& other ); + Config& operator = ( Config const& other ); virtual void dummy(); public: @@ -2125,7 +2110,7 @@ namespace Catch { : m_os( std::cout.rdbuf() ) {} - Config( const ConfigData& data ) + Config( ConfigData const& data ) : m_data( data ), m_os( std::cout.rdbuf() ) {} @@ -2135,7 +2120,7 @@ namespace Catch { m_stream.release(); } - void setFilename( const std::string& filename ) { + void setFilename( std::string const& filename ) { m_data.outputFilename = filename; } @@ -2143,7 +2128,7 @@ namespace Catch { return m_data.listSpec; } - const std::string& getFilename() const { + std::string const& getFilename() const { return m_data.outputFilename ; } @@ -2171,14 +2156,14 @@ namespace Catch { m_os.rdbuf( buf ? buf : std::cout.rdbuf() ); } - void useStream( const std::string& streamName ) { + void useStream( std::string const& streamName ) { Stream stream = createStream( streamName ); setStreamBuf( stream.streamBuf ); m_stream.release(); m_stream = stream; } - void addTestSpec( const std::string& testSpec ) { + void addTestSpec( std::string const& testSpec ) { TestCaseFilters filters( testSpec ); filters.addFilter( TestCaseFilter( testSpec ) ); m_data.filters.push_back( filters ); @@ -2196,7 +2181,7 @@ namespace Catch { return m_data.allowThrows; } - const ConfigData& data() const { + ConfigData const& data() const { return m_data; } ConfigData& data() { @@ -2247,7 +2232,7 @@ namespace Catch { nullableValue = NULL; } T& operator*() { return *nullableValue; } - const T& operator*() const { return *nullableValue; } + T const& operator*() const { return *nullableValue; } T* operator->() { return nullableValue; } const T* operator->() const { return nullableValue; } @@ -2552,11 +2537,11 @@ namespace Catch virtual void StartTestCase( TestCaseInfo const& testInfo ) = 0; virtual void EndTestCase( TestCaseInfo const& testInfo, Totals const& totals, std::string const& stdOut, std::string const& stdErr ) = 0; virtual void StartSection( std::string const& sectionName, std::string const& description ) = 0; - virtual void EndSection( std::string const& sectionName, const Counts& assertions ) = 0; + virtual void EndSection( std::string const& sectionName, Counts const& assertions ) = 0; virtual void NoAssertionsInSection( std::string const& sectionName ) = 0; virtual void NoAssertionsInTestCase( std::string const& testName ) = 0; virtual void Aborted() = 0; - virtual void Result( const AssertionResult& result ) = 0; + virtual void Result( AssertionResult const& result ) = 0; }; struct IReporterFactory { @@ -2570,7 +2555,7 @@ namespace Catch virtual ~IReporterRegistry(); virtual IStreamingReporter* create( std::string const& name, ReporterConfig const& config ) const = 0; - virtual const FactoryMap& getFactories() const = 0; + virtual FactoryMap const& getFactories() const = 0; }; inline std::string trim( std::string const& str ) { @@ -2593,15 +2578,15 @@ namespace Catch { struct IRegistryHub { virtual ~IRegistryHub(); - virtual const IReporterRegistry& getReporterRegistry() const = 0; - virtual const ITestCaseRegistry& getTestCaseRegistry() const = 0; + virtual IReporterRegistry const& getReporterRegistry() const = 0; + virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() = 0; }; struct IMutableRegistryHub { virtual ~IMutableRegistryHub(); - virtual void registerReporter( const std::string& name, IReporterFactory* factory ) = 0; - virtual void registerTest( const TestCase& testInfo ) = 0; + virtual void registerReporter( std::string const& name, IReporterFactory* factory ) = 0; + virtual void registerTest( TestCase const& testInfo ) = 0; virtual void registerTranslator( const IExceptionTranslator* translator ) = 0; }; @@ -2621,8 +2606,8 @@ namespace Catch { } template - ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, - const std::string& matcherCallAsString ) { + ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher, + std::string const& matcherCallAsString ) { std::string matcherAsString = matcher.toString(); if( matcherAsString == "{?}" ) matcherAsString = matcherCallAsString; @@ -2632,18 +2617,18 @@ namespace Catch { } template - ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, - const ArgT& arg, - const std::string& matcherCallAsString ) { + ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher, + ArgT const& arg, + std::string const& matcherCallAsString ) { return expressionResultBuilderFromMatcher( matcher, matcherCallAsString ) .setLhs( Catch::toString( arg ) ) .setResultType( matcher.match( arg ) ); } template - ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher, + ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher, ArgT* arg, - const std::string& matcherCallAsString ) { + std::string const& matcherCallAsString ) { return expressionResultBuilderFromMatcher( matcher, matcherCallAsString ) .setLhs( Catch::toString( arg ) ) .setResultType( matcher.match( arg ) ); @@ -2651,9 +2636,6 @@ namespace Catch { struct TestFailureException{}; -// This is just here to avoid compiler warnings with macro constants and boolean literals -inline bool isTrue( bool value ){ return value; } - } // end namespace Catch /////////////////////////////////////////////////////////////////////////////// @@ -2784,9 +2766,9 @@ namespace Catch { class Section { public: - Section( const SourceLineInfo& lineInfo, - const std::string& name, - const std::string& description = "" ) + Section( SourceLineInfo const& lineInfo, + std::string const& name, + std::string const& description = "" ) : m_info( name, description, lineInfo ), m_sectionIncluded( getCurrentContext().getResultCapture().sectionStarted( m_info, m_assertions ) ) {} @@ -3073,7 +3055,7 @@ namespace Detail { m_value( value ) {} - Approx( const Approx& other ) + Approx( Approx const& other ) : m_epsilon( other.m_epsilon ), m_scale( other.m_scale ), m_value( other.m_value ) @@ -3090,20 +3072,20 @@ namespace Detail { return approx; } - friend bool operator == ( double lhs, const Approx& rhs ) { + friend bool operator == ( double lhs, Approx const& rhs ) { // Thanks to Richard Harris for his help refining this formula return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) ); } - friend bool operator == ( const Approx& lhs, double rhs ) { + friend bool operator == ( Approx const& lhs, double rhs ) { return operator==( rhs, lhs ); } - friend bool operator != ( double lhs, const Approx& rhs ) { + friend bool operator != ( double lhs, Approx const& rhs ) { return !operator==( lhs, rhs ); } - friend bool operator != ( const Approx& lhs, double rhs ) { + friend bool operator != ( Approx const& lhs, double rhs ) { return !operator==( rhs, lhs ); } @@ -3131,7 +3113,7 @@ namespace Detail { } template<> -inline std::string toString( const Detail::Approx& value ) { +inline std::string toString( Detail::Approx const& value ) { return value.toString(); } @@ -3159,7 +3141,7 @@ namespace Matchers { struct MatcherImpl : Matcher { virtual Ptr > clone() const { - return Ptr >( new DerivedT( static_cast( *this ) ) ); + return Ptr >( new DerivedT( static_cast( *this ) ) ); } }; @@ -3170,13 +3152,13 @@ namespace Matchers { public: AllOf() {} - AllOf( const AllOf& other ) : m_matchers( other.m_matchers ) {} + AllOf( AllOf const& other ) : m_matchers( other.m_matchers ) {} - AllOf& add( const Matcher& matcher ) { + AllOf& add( Matcher const& matcher ) { m_matchers.push_back( matcher.clone() ); return *this; } - virtual bool match( const ExpressionT& expr ) const + virtual bool match( ExpressionT const& expr ) const { for( std::size_t i = 0; i < m_matchers.size(); ++i ) if( !m_matchers[i]->match( expr ) ) @@ -3204,13 +3186,13 @@ namespace Matchers { public: AnyOf() {} - AnyOf( const AnyOf& other ) : m_matchers( other.m_matchers ) {} + AnyOf( AnyOf const& other ) : m_matchers( other.m_matchers ) {} - AnyOf& add( const Matcher& matcher ) { + AnyOf& add( Matcher const& matcher ) { m_matchers.push_back( matcher.clone() ); return *this; } - virtual bool match( const ExpressionT& expr ) const + virtual bool match( ExpressionT const& expr ) const { for( std::size_t i = 0; i < m_matchers.size(); ++i ) if( m_matchers[i]->match( expr ) ) @@ -3237,16 +3219,16 @@ namespace Matchers { namespace StdString { - inline std::string makeString( const std::string& str ) { return str; } + inline std::string makeString( std::string const& str ) { return str; } inline std::string makeString( const char* str ) { return str ? std::string( str ) : std::string(); } struct Equals : MatcherImpl { - Equals( const std::string& str ) : m_str( str ){} - Equals( const Equals& other ) : m_str( other.m_str ){} + Equals( std::string const& str ) : m_str( str ){} + Equals( Equals const& other ) : m_str( other.m_str ){} virtual ~Equals(); - virtual bool match( const std::string& expr ) const { + virtual bool match( std::string const& expr ) const { return m_str == expr; } virtual std::string toString() const { @@ -3257,12 +3239,12 @@ namespace Matchers { }; struct Contains : MatcherImpl { - Contains( const std::string& substr ) : m_substr( substr ){} - Contains( const Contains& other ) : m_substr( other.m_substr ){} + Contains( std::string const& substr ) : m_substr( substr ){} + Contains( Contains const& other ) : m_substr( other.m_substr ){} virtual ~Contains(); - virtual bool match( const std::string& expr ) const { + virtual bool match( std::string const& expr ) const { return expr.find( m_substr ) != std::string::npos; } virtual std::string toString() const { @@ -3273,12 +3255,12 @@ namespace Matchers { }; struct StartsWith : MatcherImpl { - StartsWith( const std::string& substr ) : m_substr( substr ){} - StartsWith( const StartsWith& other ) : m_substr( other.m_substr ){} + StartsWith( std::string const& substr ) : m_substr( substr ){} + StartsWith( StartsWith const& other ) : m_substr( other.m_substr ){} virtual ~StartsWith(); - virtual bool match( const std::string& expr ) const { + virtual bool match( std::string const& expr ) const { return expr.find( m_substr ) == 0; } virtual std::string toString() const { @@ -3289,12 +3271,12 @@ namespace Matchers { }; struct EndsWith : MatcherImpl { - EndsWith( const std::string& substr ) : m_substr( substr ){} - EndsWith( const EndsWith& other ) : m_substr( other.m_substr ){} + EndsWith( std::string const& substr ) : m_substr( substr ){} + EndsWith( EndsWith const& other ) : m_substr( other.m_substr ){} virtual ~EndsWith(); - virtual bool match( const std::string& expr ) const { + virtual bool match( std::string const& expr ) const { return expr.find( m_substr ) == expr.size() - m_substr.size(); } virtual std::string toString() const { @@ -3309,47 +3291,47 @@ namespace Matchers { // The following functions create the actual matcher objects. // This allows the types to be inferred template - inline Impl::Generic::AllOf AllOf( const Impl::Matcher& m1, - const Impl::Matcher& m2 ) { + inline Impl::Generic::AllOf AllOf( Impl::Matcher const& m1, + Impl::Matcher const& m2 ) { return Impl::Generic::AllOf().add( m1 ).add( m2 ); } template - inline Impl::Generic::AllOf AllOf( const Impl::Matcher& m1, - const Impl::Matcher& m2, - const Impl::Matcher& m3 ) { + inline Impl::Generic::AllOf AllOf( Impl::Matcher const& m1, + Impl::Matcher const& m2, + Impl::Matcher const& m3 ) { return Impl::Generic::AllOf().add( m1 ).add( m2 ).add( m3 ); } template - inline Impl::Generic::AnyOf AnyOf( const Impl::Matcher& m1, - const Impl::Matcher& m2 ) { + inline Impl::Generic::AnyOf AnyOf( Impl::Matcher const& m1, + Impl::Matcher const& m2 ) { return Impl::Generic::AnyOf().add( m1 ).add( m2 ); } template - inline Impl::Generic::AnyOf AnyOf( const Impl::Matcher& m1, - const Impl::Matcher& m2, - const Impl::Matcher& m3 ) { + inline Impl::Generic::AnyOf AnyOf( Impl::Matcher const& m1, + Impl::Matcher const& m2, + Impl::Matcher const& m3 ) { return Impl::Generic::AnyOf().add( m1 ).add( m2 ).add( m3 ); } - inline Impl::StdString::Equals Equals( const std::string& str ) { + inline Impl::StdString::Equals Equals( std::string const& str ) { return Impl::StdString::Equals( str ); } inline Impl::StdString::Equals Equals( const char* str ) { return Impl::StdString::Equals( Impl::StdString::makeString( str ) ); } - inline Impl::StdString::Contains Contains( const std::string& substr ) { + inline Impl::StdString::Contains Contains( std::string const& substr ) { return Impl::StdString::Contains( substr ); } inline Impl::StdString::Contains Contains( const char* substr ) { return Impl::StdString::Contains( Impl::StdString::makeString( substr ) ); } - inline Impl::StdString::StartsWith StartsWith( const std::string& substr ) { + inline Impl::StdString::StartsWith StartsWith( std::string const& substr ) { return Impl::StdString::StartsWith( substr ); } inline Impl::StdString::StartsWith StartsWith( const char* substr ) { return Impl::StdString::StartsWith( Impl::StdString::makeString( substr ) ); } - inline Impl::StdString::EndsWith EndsWith( const std::string& substr ) { + inline Impl::StdString::EndsWith EndsWith( std::string const& substr ) { return Impl::StdString::EndsWith( substr ); } inline Impl::StdString::EndsWith EndsWith( const char* substr ) { @@ -3427,13 +3409,13 @@ namespace Catch { namespace Detail{ - inline bool startsWith( const std::string& str, const std::string& sub ) { + inline bool startsWith( std::string const& str, std::string const& sub ) { return str.length() > sub.length() && str.substr( 0, sub.length() ) == sub; } inline std::string getAnnotation( Class cls, - const std::string& annotationName, - const std::string& testCaseName ) { + std::string const& annotationName, + std::string const& testCaseName ) { NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()]; SEL sel = NSSelectorFromString( selStr ); arcSafeRelease( selStr ); @@ -3596,20 +3578,20 @@ namespace Catch { public: Command(){} - explicit Command( const std::string& name ) : m_name( name ) { + explicit Command( std::string const& name ) : m_name( name ) { } - Command& operator += ( const std::string& arg ) { + Command& operator += ( std::string const& arg ) { m_args.push_back( arg ); return *this; } - Command& operator += ( const Command& other ) { + Command& operator += ( Command const& other ) { std::copy( other.m_args.begin(), other.m_args.end(), std::back_inserter( m_args ) ); if( m_name.empty() ) m_name = other.m_name; return *this; } - Command operator + ( const Command& other ) { + Command operator + ( Command const& other ) { Command newCommand( *this ); newCommand += other; return newCommand; @@ -3623,8 +3605,7 @@ namespace Catch { std::string operator[]( std::size_t i ) const { return m_args[i]; } std::size_t argsCount() const { return m_args.size(); } - CATCH_ATTRIBUTE_NORETURN - void raiseError( const std::string& message ) const { + void raiseError( std::string const& message ) const { std::ostringstream oss; if( m_name.empty() ) oss << "Error while parsing " << m_name << ". " << message << "."; @@ -3635,7 +3616,8 @@ namespace Catch { oss << " Arguments were:"; for( std::size_t i = 0; i < m_args.size(); ++i ) oss << " " << m_args[i]; - throw std::domain_error( oss.str() ); + if( isTrue( true ) ) + throw std::domain_error( oss.str() ); } private: @@ -3655,14 +3637,14 @@ namespace Catch { exeName = exeName.substr( pos+1 ); return exeName; } - Command find( const std::string& arg1, const std::string& arg2, const std::string& arg3 ) const { + Command find( std::string const& arg1, std::string const& arg2, std::string const& arg3 ) const { return find( arg1 ) + find( arg2 ) + find( arg3 ); } - Command find( const std::string& shortArg, const std::string& longArg ) const { + Command find( std::string const& shortArg, std::string const& longArg ) const { return find( shortArg ) + find( longArg ); } - Command find( const std::string& arg ) const { + Command find( std::string const& arg ) const { if( arg.empty() ) return getArgs( "", 1 ); else @@ -3676,7 +3658,7 @@ namespace Catch { } private: - Command getArgs( const std::string& cmdName, std::size_t from ) const { + Command getArgs( std::string const& cmdName, std::size_t from ) const { Command command( cmdName ); for( std::size_t i = from; i < m_argc && m_argv[i][0] != '-'; ++i ) command += m_argv[i]; @@ -3695,7 +3677,7 @@ namespace Catch { virtual ~OptionParser() {} - Command find( const CommandParser& parser ) const { + Command find( CommandParser const& parser ) const { Command cmd; for( std::vector::const_iterator it = m_optionNames.begin(); it != m_optionNames.end(); @@ -3704,7 +3686,7 @@ namespace Catch { return cmd; } - void validateArgs( const Command& args ) const { + void validateArgs( Command const& args ) const { if( tooFewArgs( args ) || tooManyArgs( args ) ) { std::ostringstream oss; if( m_maxArgs == -1 ) @@ -3717,14 +3699,14 @@ namespace Catch { } } - void parseIntoConfig( const CommandParser& parser, ConfigData& config ) { + void parseIntoConfig( CommandParser const& parser, ConfigData& config ) { if( Command cmd = find( parser ) ) { validateArgs( cmd ); parseIntoConfig( cmd, config ); } } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) = 0; + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) = 0; virtual std::string argsSynopsis() const = 0; virtual std::string optionSummary() const = 0; virtual std::string optionDescription() const { return ""; } @@ -3750,10 +3732,10 @@ namespace Catch { protected: - bool tooFewArgs( const Command& args ) const { + bool tooFewArgs( Command const& args ) const { return args.argsCount() < static_cast( m_minArgs ); } - bool tooManyArgs( const Command& args ) const { + bool tooManyArgs( Command const& args ) const { return m_maxArgs >= 0 && args.argsCount() > static_cast( m_maxArgs ); } std::vector m_optionNames; @@ -3780,7 +3762,7 @@ namespace Catch { return ""; } - virtual void parseIntoConfig( const Command&, ConfigData& ) { + virtual void parseIntoConfig( Command const&, ConfigData& ) { // Does not affect config } }; @@ -3832,7 +3814,7 @@ namespace Catch { "that start with 'a/b/', except 'a/b/c', which is included"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { std::string groupName; for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { if( i != 0 ) @@ -3878,7 +3860,7 @@ namespace Catch { "matches all tests tagged [one], except those also tagged [two]"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { std::string groupName; for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { if( i != 0 ) @@ -3922,7 +3904,7 @@ namespace Catch { ;//" -l xml"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { config.listSpec = List::Tests; if( cmd.argsCount() >= 1 ) { if( cmd[0] == "all" ) @@ -3981,7 +3963,7 @@ namespace Catch { "of the root node."; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { config.reporter = cmd[0]; } }; @@ -4015,7 +3997,7 @@ namespace Catch { " -o %debug \t(The IDE's debug output window - currently only Windows' " "OutputDebugString is supported)."; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { if( cmd[0][0] == '%' ) config.stream = cmd[0].substr( 1 ); else @@ -4042,7 +4024,7 @@ namespace Catch { "added worked first time!). To see successful, as well as failing, test results " "just pass this option."; } - virtual void parseIntoConfig( const Command&, ConfigData& config ) { + virtual void parseIntoConfig( Command const&, ConfigData& config ) { config.includeWhichResults = Include::SuccessfulResults; } }; @@ -4068,7 +4050,7 @@ namespace Catch { "built your code with the DEBUG preprocessor symbol"; } - virtual void parseIntoConfig( const Command&, ConfigData& config ) { + virtual void parseIntoConfig( Command const&, ConfigData& config ) { config.shouldDebugBreak = true; } }; @@ -4098,7 +4080,7 @@ namespace Catch { " -n \"tests of the widget component\""; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { config.name = cmd[0]; } }; @@ -4127,7 +4109,7 @@ namespace Catch { "number causes it to abort after that number of assertion failures."; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { int threshold = 1; if( cmd.argsCount() == 1 ) { std::stringstream ss; @@ -4166,7 +4148,7 @@ namespace Catch { "as not to contribute additional noise."; } - virtual void parseIntoConfig( const Command&, ConfigData& config ) { + virtual void parseIntoConfig( Command const&, ConfigData& config ) { config.allowThrows = false; } }; @@ -4197,7 +4179,7 @@ namespace Catch { " -w NoAssertions"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { if( cmd[i] == "NoAssertions" ) config.warnings = (ConfigData::WarnAbout::What)( config.warnings | ConfigData::WarnAbout::NoAssertions ); @@ -4232,7 +4214,7 @@ namespace Catch { add(); // Keep this one last } - void parseIntoConfig( const CommandParser& parser, ConfigData& config ) { + void parseIntoConfig( CommandParser const& parser, ConfigData& config ) { config.name = parser.exeName(); if( endsWith( config.name, ".exe" ) ) config.name = config.name.substr( 0, config.name.size()-4 ); @@ -4372,7 +4354,7 @@ namespace Catch { #include namespace Catch { - inline bool matchesFilters( const std::vector& filters, const TestCase& testCase ) { + inline bool matchesFilters( std::vector const& filters, TestCase const& testCase ) { std::vector::const_iterator it = filters.begin(); std::vector::const_iterator itEnd = filters.end(); for(; it != itEnd; ++it ) @@ -4381,7 +4363,7 @@ namespace Catch { return true; } - inline void listTests( const ConfigData& config ) { + inline void listTests( ConfigData const& config ) { if( config.filters.empty() ) std::cout << "All available test cases:\n"; else @@ -4456,7 +4438,7 @@ namespace Catch { std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; } - inline void listTags( const ConfigData& config ) { + inline void listTags( ConfigData const& config ) { if( config.filters.empty() ) std::cout << "All available tags:\n"; else @@ -4508,7 +4490,7 @@ namespace Catch { std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; } - inline void listReporters( const ConfigData& /*config*/ ) { + inline void listReporters( ConfigData const& /*config*/ ) { std::cout << "Available reports:\n"; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); IReporterRegistry::FactoryMap::const_iterator it = factories.begin(), itEnd = factories.end(); @@ -4519,7 +4501,7 @@ namespace Catch { std::cout << std::endl; } - inline void list( const ConfigData& config ) { + inline void list( ConfigData const& config ) { if( config.listSpec & List::Tests ) listTests( config ); if( config.listSpec & List::Tags ) @@ -4559,13 +4541,13 @@ namespace Catch { TestedLeaf }; - RunningSection( RunningSection* parent, const std::string& name ) + RunningSection( RunningSection* parent, std::string const& name ) : m_state( Unknown ), m_parent( parent ), m_name( name ) {} - RunningSection( const std::string& name ) + RunningSection( std::string const& name ) : m_state( Root ), m_parent( NULL ), m_name( name ) @@ -4608,7 +4590,7 @@ namespace Catch { return m_parent; } - RunningSection* findOrAddSubSection( const std::string& name, bool& changed ) { + RunningSection* findOrAddSubSection( std::string const& name, bool& changed ) { for( SubSections::const_iterator it = m_subSections.begin(); it != m_subSections.end(); ++it) @@ -4654,7 +4636,7 @@ namespace Catch { }; public: - explicit RunningTest( const TestCase& info ) + explicit RunningTest( TestCase const& info ) : m_info( info ), m_runStatus( RanAtLeastOneSection ), m_rootSection( info.getTestCaseInfo().name ), @@ -4694,7 +4676,7 @@ namespace Catch { } } - bool addSection( const std::string& name ) { + bool addSection( std::string const& name ) { if( m_runStatus == NothingRun ) m_runStatus = EncounteredASection; @@ -4708,7 +4690,7 @@ namespace Catch { return false; } - void endSection( const std::string&, bool stealth ) { + void endSection( std::string const&, bool stealth ) { if( m_currentSection->ran() ) { if( !stealth ) m_runStatus = RanAtLeastOneSection; @@ -4722,7 +4704,7 @@ namespace Catch { m_currentSection = m_currentSection->getParent(); } - const TestCase& getTestCase() const { + TestCase const& getTestCase() const { return m_info; } @@ -4735,7 +4717,7 @@ namespace Catch { RunningTest( RunningTest const& ); void operator=( RunningTest const& ); - const TestCase& m_info; + TestCase const& m_info; RunStatus m_runStatus; RunningSection m_rootSection; RunningSection* m_currentSection; @@ -4776,12 +4758,12 @@ namespace Catch { class Runner : public IResultCapture, public IRunner { - Runner( const Runner& ); - void operator =( const Runner& ); + Runner( Runner const& ); + void operator =( Runner const& ); public: - explicit Runner( const Config& config, const Ptr& reporter ) + explicit Runner( Config const& config, Ptr const& reporter ) : m_runInfo( config.data().name ), m_context( getCurrentMutableContext() ), m_runningTest( NULL ), @@ -4812,7 +4794,7 @@ namespace Catch { m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, aborting() ) ); } - Totals runMatching( const std::string& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { + Totals runMatching( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { std::vector matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ); @@ -4829,7 +4811,7 @@ namespace Catch { return totals; } - Totals runTest( const TestCase& testCase ) { + Totals runTest( TestCase const& testCase ) { Totals prevTotals = m_totals; std::string redirectedCout; @@ -4873,22 +4855,22 @@ namespace Catch { return deltaTotals; } - const Config& config() const { + Config const& config() const { return m_config; } private: // IResultCapture - virtual void acceptMessage( const MessageBuilder& messageBuilder ) { + virtual void acceptMessage( MessageBuilder const& messageBuilder ) { m_messages.push_back( messageBuilder.build() ); } - virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) { + virtual ResultAction::Value acceptExpression( ExpressionResultBuilder const& assertionResult, AssertionInfo const& assertionInfo ) { m_lastAssertionInfo = assertionInfo; return actOnCurrentResult( assertionResult.buildResult( assertionInfo ) ); } - virtual void assertionEnded( const AssertionResult& result ) { + virtual void assertionEnded( AssertionResult const& result ) { if( result.getResultType() == ResultWas::Ok ) { m_totals.assertions.passed++; } @@ -4975,7 +4957,7 @@ namespace Catch { private: - ResultAction::Value actOnCurrentResult( const AssertionResult& result ) { + ResultAction::Value actOnCurrentResult( AssertionResult const& result ) { m_lastResult = result; assertionEnded( m_lastResult ); @@ -5038,7 +5020,7 @@ namespace Catch { RunningTest* m_runningTest; AssertionResult m_lastResult; - const Config& m_config; + Config const& m_config; Totals m_totals; Ptr m_reporter; std::vector m_messages; @@ -5298,7 +5280,7 @@ namespace Catch { TestRegistry() : m_unnamedCount( 0 ) {} virtual ~TestRegistry(); - virtual void registerTest( const TestCase& testCase ) { + virtual void registerTest( TestCase const& testCase ) { std::string name = testCase.getTestCaseInfo().name; if( name == "" ) { std::ostringstream oss; @@ -5313,7 +5295,7 @@ namespace Catch { m_nonHiddenFunctions.push_back( testCase ); } else { - const TestCase& prev = *m_functions.find( testCase ); + TestCase const& prev = *m_functions.find( testCase ); std::cerr << "error: TEST_CASE( \"" << name << "\" ) already defined.\n" << "\tFirst seen at " << SourceLineInfo( prev.getTestCaseInfo().lineInfo ) << "\n" << "\tRedefined at " << SourceLineInfo( testCase.getTestCaseInfo().lineInfo ) << std::endl; @@ -5321,23 +5303,23 @@ namespace Catch { } } - virtual const std::vector& getAllTests() const { + virtual std::vector const& getAllTests() const { return m_functionsInOrder; } - virtual const std::vector& getAllNonHiddenTests() const { + virtual std::vector const& getAllNonHiddenTests() const { return m_nonHiddenFunctions; } // !TBD deprecated - virtual std::vector getMatchingTestCases( const std::string& rawTestSpec ) const { + virtual std::vector getMatchingTestCases( std::string const& rawTestSpec ) const { std::vector matchingTests; getMatchingTestCases( rawTestSpec, matchingTests ); return matchingTests; } // !TBD deprecated - virtual void getMatchingTestCases( const std::string& rawTestSpec, std::vector& matchingTestsOut ) const { + virtual void getMatchingTestCases( std::string const& rawTestSpec, std::vector& matchingTestsOut ) const { TestCaseFilter filter( rawTestSpec ); std::vector::const_iterator it = m_functionsInOrder.begin(); @@ -5348,7 +5330,7 @@ namespace Catch { } } } - virtual void getMatchingTestCases( const TestCaseFilters& filters, std::vector& matchingTestsOut ) const { + virtual void getMatchingTestCases( TestCaseFilters const& filters, std::vector& matchingTestsOut ) const { std::vector::const_iterator it = m_functionsInOrder.begin(); std::vector::const_iterator itEnd = m_functionsInOrder.end(); // !TBD: replace with algorithm @@ -5382,7 +5364,7 @@ namespace Catch { TestFunction m_fun; }; - inline std::string extractClassName( const std::string& classOrQualifiedMethodName ) { + inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) { std::string className = classOrQualifiedMethodName; if( className[0] == '&' ) { @@ -5435,18 +5417,18 @@ namespace Catch { deleteAllValues( m_factories ); } - virtual IStreamingReporter* create( const std::string& name, const ReporterConfig& config ) const { + virtual IStreamingReporter* create( std::string const& name, ReporterConfig const& config ) const { FactoryMap::const_iterator it = m_factories.find( name ); if( it == m_factories.end() ) return NULL; return it->second->create( config ); } - void registerReporter( const std::string& name, IReporterFactory* factory ) { + void registerReporter( std::string const& name, IReporterFactory* factory ) { m_factories.insert( std::make_pair( name, factory ) ); } - const FactoryMap& getFactories() const { + FactoryMap const& getFactories() const { return m_factories; } @@ -5525,16 +5507,16 @@ namespace Catch { class RegistryHub : public IRegistryHub, public IMutableRegistryHub { - RegistryHub( const RegistryHub& ); - void operator=( const RegistryHub& ); + RegistryHub( RegistryHub const& ); + void operator=( RegistryHub const& ); public: // IRegistryHub RegistryHub() { } - virtual const IReporterRegistry& getReporterRegistry() const { + virtual IReporterRegistry const& getReporterRegistry() const { return m_reporterRegistry; } - virtual const ITestCaseRegistry& getTestCaseRegistry() const { + virtual ITestCaseRegistry const& getTestCaseRegistry() const { return m_testCaseRegistry; } virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() { @@ -5542,10 +5524,10 @@ namespace Catch { } public: // IMutableRegistryHub - virtual void registerReporter( const std::string& name, IReporterFactory* factory ) { + virtual void registerReporter( std::string const& name, IReporterFactory* factory ) { m_reporterRegistry.registerReporter( name, factory ); } - virtual void registerTest( const TestCase& testInfo ) { + virtual void registerTest( TestCase const& testInfo ) { m_testCaseRegistry.registerTest( testInfo ); } virtual void registerTranslator( const IExceptionTranslator* translator ) { @@ -5591,7 +5573,7 @@ namespace Catch { namespace Catch { - NotImplementedException::NotImplementedException( const SourceLineInfo& lineInfo ) + NotImplementedException::NotImplementedException( SourceLineInfo const& lineInfo ) : m_lineInfo( lineInfo ) { std::ostringstream oss; oss << lineInfo << ": function "; @@ -5613,8 +5595,8 @@ namespace Catch { class Context : public IMutableContext { Context() : m_config( NULL ) {} - Context( const Context& ); - void operator=( const Context& ); + Context( Context const& ); + void operator=( Context const& ); public: // IContext virtual IResultCapture& getResultCapture() { @@ -5623,7 +5605,7 @@ namespace Catch { virtual IRunner& getRunner() { return *m_runner; } - virtual size_t getGeneratorIndex( const std::string& fileInfo, size_t totalSize ) { + virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) { return getGeneratorsForCurrentTest() .getGeneratorInfo( fileInfo, totalSize ) .getCurrentIndex(); @@ -5690,7 +5672,7 @@ namespace Catch { return getCurrentMutableContext(); } - Stream createStream( const std::string& streamName ) { + Stream createStream( std::string const& streamName ) { if( streamName == "stdout" ) return Stream( std::cout.rdbuf(), false ); if( streamName == "stderr" ) return Stream( std::cerr.rdbuf(), false ); if( streamName == "debug" ) return Stream( new StreamBufImpl, true ); @@ -5880,7 +5862,7 @@ namespace Catch { deleteAll( m_generatorsInOrder ); } - IGeneratorInfo& getGeneratorInfo( const std::string& fileInfo, std::size_t size ) { + IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) { std::map::const_iterator it = m_generatorsByName.find( fileInfo ); if( it == m_generatorsByName.end() ) { IGeneratorInfo* info = new GeneratorInfo( size ); @@ -5918,9 +5900,9 @@ namespace Catch { namespace Catch { - AssertionInfo::AssertionInfo( const std::string& _macroName, - const SourceLineInfo& _lineInfo, - const std::string& _capturedExpression, + AssertionInfo::AssertionInfo( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + std::string const& _capturedExpression, ResultDisposition::Flags _resultDisposition ) : macroName( _macroName ), lineInfo( _lineInfo ), @@ -5933,7 +5915,7 @@ namespace Catch { AssertionResult::AssertionResult() {} - AssertionResult::AssertionResult( const AssertionInfo& info, const AssertionResultData& data ) + AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data ) : m_info( info ), m_resultData( data ) {} @@ -5997,13 +5979,13 @@ namespace Catch { ExpressionResultBuilder::ExpressionResultBuilder( ResultWas::OfType resultType ) { m_data.resultType = resultType; } - ExpressionResultBuilder::ExpressionResultBuilder( const ExpressionResultBuilder& other ) + ExpressionResultBuilder::ExpressionResultBuilder( ExpressionResultBuilder const& other ) : m_data( other.m_data ), m_exprComponents( other.m_exprComponents ) { m_stream << other.m_stream.str(); } - ExpressionResultBuilder& ExpressionResultBuilder::operator=(const ExpressionResultBuilder& other ) { + ExpressionResultBuilder& ExpressionResultBuilder::operator=(ExpressionResultBuilder const& other ) { m_data = other.m_data; m_exprComponents = other.m_exprComponents; m_stream.str(""); @@ -6022,19 +6004,19 @@ namespace Catch { m_exprComponents.shouldNegate = shouldNegate( resultDisposition ); return *this; } - ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) { + ExpressionResultBuilder& ExpressionResultBuilder::setLhs( std::string const& lhs ) { m_exprComponents.lhs = lhs; return *this; } - ExpressionResultBuilder& ExpressionResultBuilder::setRhs( const std::string& rhs ) { + ExpressionResultBuilder& ExpressionResultBuilder::setRhs( std::string const& rhs ) { m_exprComponents.rhs = rhs; return *this; } - ExpressionResultBuilder& ExpressionResultBuilder::setOp( const std::string& op ) { + ExpressionResultBuilder& ExpressionResultBuilder::setOp( std::string const& op ) { m_exprComponents.op = op; return *this; } - AssertionResult ExpressionResultBuilder::buildResult( const AssertionInfo& info ) const + AssertionResult ExpressionResultBuilder::buildResult( AssertionInfo const& info ) const { assert( m_data.resultType != ResultWas::Unknown ); @@ -6056,7 +6038,7 @@ namespace Catch { } return AssertionResult( info, data ); } - std::string ExpressionResultBuilder::reconstructExpression( const AssertionInfo& info ) const { + std::string ExpressionResultBuilder::reconstructExpression( AssertionInfo const& 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" ) @@ -6081,10 +6063,10 @@ namespace Catch { namespace Catch { TestCase makeTestCase( ITestCase* _testCase, - const std::string& _className, - const std::string& _name, - const std::string& _descOrTags, - const SourceLineInfo& _lineInfo ) + std::string const& _className, + std::string const& _name, + std::string const& _descOrTags, + SourceLineInfo const& _lineInfo ) { std::string desc = _descOrTags; bool isHidden( startsWith( _name, "./" ) ); @@ -6097,12 +6079,12 @@ namespace Catch { return TestCase( _testCase, info ); } - TestCaseInfo::TestCaseInfo( const std::string& _name, - const std::string& _className, - const std::string& _description, - const std::set& _tags, + TestCaseInfo::TestCaseInfo( std::string const& _name, + std::string const& _className, + std::string const& _description, + std::set const& _tags, bool _isHidden, - const SourceLineInfo& _lineInfo ) + SourceLineInfo const& _lineInfo ) : name( _name ), className( _className ), description( _description ), @@ -6116,7 +6098,7 @@ namespace Catch { tagsAsString = oss.str(); } - TestCaseInfo::TestCaseInfo( const TestCaseInfo& other ) + TestCaseInfo::TestCaseInfo( TestCaseInfo const& other ) : name( other.name ), className( other.className ), description( other.description ), @@ -6126,14 +6108,14 @@ namespace Catch { isHidden( other.isHidden ) {} - TestCase::TestCase( ITestCase* testCase, const TestCaseInfo& info ) : TestCaseInfo( info ), test( testCase ) {} + TestCase::TestCase( ITestCase* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {} - TestCase::TestCase( const TestCase& other ) + TestCase::TestCase( TestCase const& other ) : TestCaseInfo( other ), test( other.test ) {} - TestCase TestCase::withName( const std::string& _newName ) const { + TestCase TestCase::withName( std::string const& _newName ) const { TestCase other( *this ); other.name = _newName; return other; @@ -6147,15 +6129,15 @@ namespace Catch { return TestCaseInfo::isHidden; } - bool TestCase::hasTag( const std::string& tag ) const { + bool TestCase::hasTag( std::string const& tag ) const { return tags.find( toLower( tag ) ) != tags.end(); } - bool TestCase::matchesTags( const std::string& tagPattern ) const { + bool TestCase::matchesTags( std::string const& tagPattern ) const { TagExpression exp; TagExpressionParser( exp ).parse( tagPattern ); return exp.matches( tags ); } - const std::set& TestCase::getTags() const { + std::set const& TestCase::getTags() const { return tags; } @@ -6167,22 +6149,22 @@ namespace Catch { std::swap( lineInfo, other.lineInfo ); } - bool TestCase::operator == ( const TestCase& other ) const { + bool TestCase::operator == ( TestCase const& other ) const { return test.get() == other.test.get() && name == other.name && className == other.className; } - bool TestCase::operator < ( const TestCase& other ) const { + bool TestCase::operator < ( TestCase const& other ) const { return name < other.name; } - TestCase& TestCase::operator = ( const TestCase& other ) { + TestCase& TestCase::operator = ( TestCase const& other ) { TestCase temp( other ); swap( temp ); return *this; } - const TestCaseInfo& TestCase::getTestCaseInfo() const + TestCaseInfo const& TestCase::getTestCaseInfo() const { return *this; } @@ -6195,7 +6177,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 37, "integration" ); + Version libraryVersion( 0, 9, 38, "integration" ); } // #included from: catch_text.hpp @@ -6445,7 +6427,7 @@ namespace Catch { class ReporterFactory : public IReporterFactory { - virtual IStreamingReporter* create( const ReporterConfig& config ) const { + virtual IStreamingReporter* create( ReporterConfig const& config ) const { return new LegacyReporterAdapter( new T( config ), config ); } @@ -6456,7 +6438,7 @@ namespace Catch { public: - LegacyReporterRegistrar( const std::string& name ) { + LegacyReporterRegistrar( std::string const& name ) { getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); } }; @@ -6477,7 +6459,7 @@ namespace Catch { // In fact, ideally, please contact me anyway to let me know you've hit this - as I have // no idea who is actually using custom reporters at all (possibly no-one!). // The new interface is designed to minimise exposure to interface changes in the future. - virtual IStreamingReporter* create( const ReporterConfig& config ) const { + virtual IStreamingReporter* create( ReporterConfig const& config ) const { return new T( config ); } @@ -6488,7 +6470,7 @@ namespace Catch { public: - ReporterRegistrar( const std::string& name ) { + ReporterRegistrar( std::string const& name ) { getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); } }; @@ -6858,7 +6840,7 @@ namespace Catch { : m_writer( writer ) {} - ScopedElement( const ScopedElement& other ) + ScopedElement( ScopedElement const& other ) : m_writer( other.m_writer ){ other.m_writer = NULL; } @@ -6868,13 +6850,13 @@ namespace Catch { m_writer->endElement(); } - ScopedElement& writeText( const std::string& text, bool indent = true ) { + ScopedElement& writeText( std::string const& text, bool indent = true ) { m_writer->writeText( text, indent ); return *this; } template - ScopedElement& writeAttribute( const std::string& name, const T& attribute ) { + ScopedElement& writeAttribute( std::string const& name, T const& attribute ) { m_writer->writeAttribute( name, attribute ); return *this; } @@ -6900,7 +6882,7 @@ namespace Catch { endElement(); } - XmlWriter& operator = ( const XmlWriter& other ) { + XmlWriter& operator = ( XmlWriter const& other ) { XmlWriter temp( other ); swap( temp ); return *this; @@ -6914,7 +6896,7 @@ namespace Catch { std::swap( m_os, other.m_os ); } - XmlWriter& startElement( const std::string& name ) { + XmlWriter& startElement( std::string const& name ) { ensureTagClosed(); newlineIfNecessary(); stream() << m_indent << "<" << name; @@ -6924,7 +6906,7 @@ namespace Catch { return *this; } - ScopedElement scopedElement( const std::string& name ) { + ScopedElement scopedElement( std::string const& name ) { ScopedElement scoped( this ); startElement( name ); return scoped; @@ -6944,7 +6926,7 @@ namespace Catch { return *this; } - XmlWriter& writeAttribute( const std::string& name, const std::string& attribute ) { + XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ) { if( !name.empty() && !attribute.empty() ) { stream() << " " << name << "=\""; writeEncodedText( attribute ); @@ -6953,19 +6935,19 @@ namespace Catch { return *this; } - XmlWriter& writeAttribute( const std::string& name, bool attribute ) { + XmlWriter& writeAttribute( std::string const& name, bool attribute ) { stream() << " " << name << "=\"" << ( attribute ? "true" : "false" ) << "\""; return *this; } template - XmlWriter& writeAttribute( const std::string& name, const T& attribute ) { + XmlWriter& writeAttribute( std::string const& name, T const& attribute ) { if( !name.empty() ) stream() << " " << name << "=\"" << attribute << "\""; return *this; } - XmlWriter& writeText( const std::string& text, bool indent = true ) { + XmlWriter& writeText( std::string const& text, bool indent = true ) { if( !text.empty() ){ bool tagWasOpen = m_tagIsOpen; ensureTagClosed(); @@ -6977,7 +6959,7 @@ namespace Catch { return *this; } - XmlWriter& writeComment( const std::string& text ) { + XmlWriter& writeComment( std::string const& text ) { ensureTagClosed(); stream() << m_indent << ""; m_needsNewline = true; @@ -7010,7 +6992,7 @@ namespace Catch { } } - void writeEncodedText( const std::string& text ) { + void writeEncodedText( std::string const& text ) { static const char* charsToEncode = "<&\""; std::string mtext = text; std::string::size_type pos = mtext.find_first_of( charsToEncode ); @@ -7926,12 +7908,10 @@ int main (int argc, char * const argv[]) { #ifdef CATCH_CONFIG_VARIADIC_MACROS #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) - #define CATCH_TEST_CASE_NORETURN( ... ) INTERNAL_CATCH_TESTCASE_NORETURN( __VA_ARGS__ ) #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #else #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) - #define CATCH_TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) #endif @@ -7987,12 +7967,10 @@ int main (int argc, char * const argv[]) { #ifdef CATCH_CONFIG_VARIADIC_MACROS #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) - #define TEST_CASE_NORETURN( ... ) INTERNAL_CATCH_TESTCASE_NORETURN( __VA_ARGS__ ) #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #else #define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) - #define TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description ) #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) #endif From 7293c9785a577c31c63c9c186daff32873028d3d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 24 Apr 2013 20:19:05 +0100 Subject: [PATCH 231/296] header builder script writes to file rather than stdout --- scripts/generateSingleHeader.py | 37 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/scripts/generateSingleHeader.py b/scripts/generateSingleHeader.py index 0301cd63..e32f45e6 100644 --- a/scripts/generateSingleHeader.py +++ b/scripts/generateSingleHeader.py @@ -16,10 +16,12 @@ seenHeaders = set([]) rootPath = os.path.join( catchPath, 'include/' ) versionPath = os.path.join( rootPath, "internal/catch_version.hpp" ) readmePath = os.path.join( catchPath, "README.md" ) -#outputPath = os.path.join( catchPath, 'single_include/catch.hpp' ) +outputPath = os.path.join( catchPath, 'single_include/catch.hpp' ) bumpVersion = len(sys.argv) < 2 or sys.argv[1] <> "nobump" +out = open( outputPath, 'w' ) + def parseFile( path, filename ): f = open( path + filename, 'r' ) blanks = 0 @@ -30,7 +32,7 @@ def parseFile( path, filename ): headerPath, sep, headerFile = header.rpartition( "/" ) if not headerFile in seenHeaders: seenHeaders.add( headerFile ) - print "// #included from: " + header + out.write( "// #included from: {0}\n".format( header ) ) if( headerPath == "internal" and path.endswith( "internal/" ) ): headerPath = "" sep = "" @@ -44,7 +46,7 @@ def parseFile( path, filename ): else: blanks = 0 if blanks < 2: - print line.rstrip() + out.write( line.rstrip() + "\n" ) class Version: def __init__(self): @@ -95,20 +97,21 @@ def generateSingleInclude(): v.incrementBuildNumber() v.updateVersionFile() v.updateReadmeFile() - print "/*" - print " * CATCH v{0}.{1} build {2} ({3} branch)".format( v.majorVersion, v.minorVersion, v.buildNumber, v.branchName ) - print " * Generated: " + str( datetime.datetime.now() ) - print " * ----------------------------------------------------------" - print " * This file has been merged from multiple headers. Please don't edit it directly" - print " * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved." - print " *" - print " * Distributed under the Boost Software License, Version 1.0. (See accompanying" - print " * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)" - print " */" - print '#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED' - print '#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED' + out.write( "/*\n" ) + out.write( " * CATCH v{0}.{1} build {2} ({3} branch)\n".format( v.majorVersion, v.minorVersion, v.buildNumber, v.branchName ) ) + out.write( " * Generated: {0}\n".format( datetime.datetime.now() ) ) + out.write( " * ----------------------------------------------------------\n" ) + out.write( " * This file has been merged from multiple headers. Please don't edit it directly\n" ) + out.write( " * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.\n" ) + out.write( " *\n" ) + out.write( " * Distributed under the Boost Software License, Version 1.0. (See accompanying\n" ) + out.write( " * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n" ) + out.write( " */\n" ) + out.write( "#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n" ) + out.write( "#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n" ) + parseFile( rootPath, 'catch.hpp' ) - print '#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED' - print + + out.write( "#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n\n" ) generateSingleInclude() From 26ae11774b66ec849b4f8ef8f34fcb4e9c56ca66 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 27 Apr 2013 12:26:13 +0100 Subject: [PATCH 232/296] First draft of future opt parser lib --- .gitignore | 1 + projects/SelfTest/CmdLineTests.cpp | 313 ++++++++++++++++++ .../CatchSelfTest.xcodeproj/project.pbxproj | 12 + 3 files changed, 326 insertions(+) create mode 100644 projects/SelfTest/CmdLineTests.cpp diff --git a/.gitignore b/.gitignore index 76fc19e1..986f75d1 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ projects/XCode4/iOSTest/Build/Products/Debug-iphonesimulator/iOSTest.app.dSYM/Co projects/XCode4/iOSTest/Build projects/XCode4/CatchSelfTest/DerivedData projects/XCode4/OCTest/DerivedData +*.pyc diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp new file mode 100644 index 00000000..9952f36c --- /dev/null +++ b/projects/SelfTest/CmdLineTests.cpp @@ -0,0 +1,313 @@ +/* + * Created by Phil on 22/10/2010. + * Copyright 2010 Two Blue Cubes Ltd + * + * 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) + */ +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wpadded" +#endif + +#include "catch.hpp" +//#include "catch_ptr.hpp" + +namespace Catch { + +class ArgData { +public: + ArgData( std::string const& _arg ) : m_weight( 2 ) + { + std::size_t first = _arg.find( '<' ); + std::size_t last = _arg.find_last_of( '>' ); + if( first == std::string::npos || last == std::string::npos || last <= first+1 ) + throw std::logic_error( "Argument must contain a name in angle brackets but it was: " + _arg ); + m_prefix = _arg.substr( 0, first ); + m_postfix = _arg.substr( last+1 ); + m_name = _arg.substr( first+1, last-first-1 ); + if( !m_prefix.empty() ) + --m_weight; + if( !m_postfix.empty() ) + --m_weight; + } + std::string const& name() const { return m_name; } + std::string const& prefix() const { return m_prefix; } + std::string const& postfix() const { return m_postfix; } + + bool isMatch( std::string const& _arg ) const { + return startsWith( _arg, m_prefix ) && endsWith( _arg, m_postfix ); + } + std::string strip( std::string const& _arg ) const { + return _arg.substr( m_prefix.size(), + _arg.size() - m_prefix.size() - m_postfix.size() ); + } + bool operator < ( ArgData const& _other ) const { + return m_weight < _other.m_weight; + } +protected: + std::string m_prefix; + std::string m_postfix; + std::string m_name; + int m_weight; +}; + +template +class Opt { +public: + Opt( std::string const& _synposis ) : m_synopsis( _synposis ) {} + Opt& shortOpt( std::string const& _value ) { m_shortOpt = _value; return *this; } + Opt& longOpt( std::string const& _value ) { m_longOpt = _value; return *this; } + + template + Opt& addArg( std::string const& _name, M const& _member ){ + m_args.push_back( Arg( _name, _member ) ); + return *this; + } + + std::string synopsis() const { return m_synopsis; } + std::string shortOpt() const { return m_shortOpt; } + std::string longOpt() const { return m_longOpt; } + + bool parseInto( std::string const& _arg, T& _config ) const { + ensureWeightedArgsAreSorted(); + typename std::vector::const_iterator + it = m_argsInWeightedOrder.begin(), + itEnd = m_argsInWeightedOrder.end(); + for( ; it != itEnd; ++it ) + if( (*it)->isMatch( _arg ) ) { + (*it)->parseInto( _arg, _config ); + return true; + } + return false; + } + +private: + + struct IField : SharedImpl<> { + virtual ~IField() {} + virtual bool parseInto( std::string const& _arg, T& _config ) const = 0; + }; + template + struct Field : IField { + Field( M const& _member ) : member( _member ) {} + bool parseInto( std::string const& _arg, T& _config ) const { + std::stringstream ss; + ss << _arg; + ss >> _config.*member; + return !ss.fail(); + } + M member; + }; + class Arg : public ArgData { + public: + Arg() : m_field( NULL ) {} + template + Arg( std::string const& _name, M const& _member ) + : ArgData( _name ), + m_field( new Field( _member ) ) + {} + void parseInto( std::string const& _arg, T& _config ) const { + if( !m_field->parseInto( strip( _arg ), _config ) ) + throw std::domain_error( "'" + _arg + "' was not valid for <" + m_name + ">" ); + } + + private: + Ptr m_field; + }; + + static bool argLess( Arg const* lhs, Arg const* rhs ) { + return *lhs < *rhs; + } + void ensureWeightedArgsAreSorted() const { + if( m_args.size() > m_argsInWeightedOrder.size() ) { + m_argsInWeightedOrder.clear(); + typename std::vector::const_iterator it = m_args.begin(), + itEnd = m_args.end(); + for( ; it != itEnd; ++it ) + m_argsInWeightedOrder.push_back( &*it ); + sort( m_argsInWeightedOrder.begin(), m_argsInWeightedOrder.end(), &Opt::argLess ); + } + } + std::string m_synopsis; + std::string m_shortOpt; + std::string m_longOpt; + std::vector m_args; + mutable std::vector m_argsInWeightedOrder; +}; + +template +class CommandLineParser +{ +public: + void addOption( Opt const& _opt ) { + m_allOptionParsers.push_back( _opt ); + if( !_opt.shortOpt().empty() ) + m_optionsByName.insert( std::make_pair( "-" + _opt.shortOpt(), &m_allOptionParsers.back() ) ); + if( !_opt.longOpt().empty() ) + m_optionsByName.insert( std::make_pair( "--" + _opt.longOpt(), &m_allOptionParsers.back() ) ); + } + bool parseArgs( int argc, const char* const argv[], T& config ) { + for( int i = 0; i < argc; ++i ) { + std::string fullArg = argv[i]; + if( fullArg[0] == '-' ) { + std::string args, optName; + std::size_t pos = fullArg.find( ':' ); + if( pos == std::string::npos ) { + optName = fullArg; + } + else { + optName = fullArg.substr(0, pos ); + args = fullArg.substr( pos+1 ); + } + typename std::map*>::const_iterator it = m_optionsByName.find( optName ); + bool used = false; + if( it != m_optionsByName.end() ) { + try { + used = it->second->parseInto( args, config ); + } + catch( std::exception& ex ) { + throw std::domain_error( "Error in " + optName + " option: " + ex.what() ); + } + } + if( !used ) + m_unusedOpts.push_back( fullArg ); + } + else { + m_args.push_back( fullArg ); + } + } + return false; + } + +private: + std::vector > m_allOptionParsers; + std::map*> m_optionsByName; + std::vector m_args; + std::vector m_unusedOpts; +}; + + +} // end namespace Catch + +struct TestOpt { + TestOpt() : number( 0 ) {} + + std::string fileName; + std::string streamName; + int number; +}; + +TEST_CASE( "Arg" ) { + SECTION( "pre and post" ) { + Catch::ArgData preAndPost( "prefixpostfix" ); + CHECK( preAndPost.prefix() == "prefix" ); + CHECK( preAndPost.postfix() == "postfix" ); + CHECK( preAndPost.name() == "arg" ); + + CHECK( preAndPost.isMatch( "prefixpayloadpostfix" ) ); + CHECK( preAndPost.strip( "prefixpayloadpostfix" ) == "payload" ); + CHECK_FALSE( preAndPost.isMatch( "payload" ) ); + CHECK_FALSE( preAndPost.isMatch( "postfixpayloadpostfix" ) ); + CHECK_FALSE( preAndPost.isMatch( "prefixpayloadpostfixx" ) ); + } + SECTION( "pre" ) { + Catch::ArgData preAndPost( "prefix" ); + CHECK( preAndPost.prefix() == "prefix" ); + CHECK( preAndPost.postfix() == "" ); + CHECK( preAndPost.name() == "arg" ); + + CHECK( preAndPost.isMatch( "prefixpayload" ) ); + CHECK( preAndPost.strip( "prefixpayload" ) == "payload" ); + CHECK_FALSE( preAndPost.isMatch( "payload" ) ); + CHECK_FALSE( preAndPost.isMatch( "postfixpayload" ) ); + } + SECTION( "post" ) { + Catch::ArgData preAndPost( "postfix" ); + CHECK( preAndPost.prefix() == "" ); + CHECK( preAndPost.postfix() == "postfix" ); + CHECK( preAndPost.name() == "arg" ); + + CHECK( preAndPost.isMatch( "payloadpostfix" ) ); + CHECK( preAndPost.strip( "payloadpostfix" ) == "payload" ); + CHECK_FALSE( preAndPost.isMatch( "payload" ) ); + CHECK_FALSE( preAndPost.isMatch( "payloadpostfixx" ) ); + } + SECTION( "none" ) { + Catch::ArgData preAndPost( "" ); + CHECK( preAndPost.prefix() == "" ); + CHECK( preAndPost.postfix() == "" ); + CHECK( preAndPost.name() == "arg" ); + + CHECK( preAndPost.isMatch( "payload" ) ); + CHECK( preAndPost.strip( "payload" ) == "payload" ); + } + SECTION( "errors" ) { + CHECK_THROWS( Catch::ArgData( "" ) ); + CHECK_THROWS( Catch::ArgData( "no brackets" ) ); + CHECK_THROWS( Catch::ArgData( "" ) ); + CHECK_THROWS( Catch::ArgData( "><" ) ); + CHECK_THROWS( Catch::ArgData( "<>" ) ); + } +} + +TEST_CASE( "cmdline", "" ) { + + Catch::Opt opt( "specifies output file" ); + opt.shortOpt( "o" ) + .longOpt( "output" ) + .addArg( "", &TestOpt::fileName ) + .addArg( "%", &TestOpt::streamName ); + + TestOpt config; + Catch::CommandLineParser parser; + parser.addOption( opt ); + +// parser.addOption( "specifies output file" ) +// .shortOpt( "o" ) +// .longOpt( "output" ) +// .addArg( "", &TestOpt::fileName ) +// .addArg( "%", &TestOpt::streamName ); + + SECTION( "plain filename" ) { + const char* argv[] = { "test", "-o:filename.ext" }; + + parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + CHECK( config.fileName == "filename.ext" ); + CHECK( config.streamName == "" ); + } + SECTION( "stream name" ) { + const char* argv[] = { "test", "-o:%stdout" }; + + parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + CHECK( config.fileName == "" ); + CHECK( config.streamName == "stdout" ); + } + SECTION( "long opt" ) { + const char* argv[] = { "test", "--output:%stdout" }; + + parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + CHECK( config.fileName == "" ); + CHECK( config.streamName == "stdout" ); + } + + Catch::Opt opt2( "a number" ); + opt2.shortOpt( "n" ) + .addArg( "", &TestOpt::number ); + + parser.addOption( opt2 ); + + SECTION( "a number" ) { + const char* argv[] = { "test", "-n:42" }; + + parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + CHECK( config.number == 42 ); + } + SECTION( "not a number" ) { + const char* argv[] = { "test", "-n:forty-two" }; + + CHECK_THROWS( parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ) ); + CHECK( config.number == 0 ); + } + +} diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index 748d288c..c178f5ec 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 266B06B816F3A60A004ED264 /* VariadicMacrosTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */; }; + 266E9AD617290E8E0061DAB2 /* CmdLineTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266E9AD417290E8E0061DAB2 /* CmdLineTests.cpp */; }; 266ECD74170F3C620030D735 /* BDDTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266ECD73170F3C620030D735 /* BDDTests.cpp */; }; 26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26847E5D16BBADB40043B9C1 /* catch_message.cpp */; }; 2694A1FD16A0000E004816E3 /* catch_text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694A1FB16A0000E004816E3 /* catch_text.cpp */; }; @@ -57,6 +58,7 @@ /* Begin PBXFileReference section */ 266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VariadicMacrosTests.cpp; path = ../../../SelfTest/VariadicMacrosTests.cpp; sourceTree = ""; }; 266E9AD117230ACF0061DAB2 /* catch_text.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_text.hpp; sourceTree = ""; }; + 266E9AD417290E8E0061DAB2 /* CmdLineTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CmdLineTests.cpp; path = ../../../SelfTest/CmdLineTests.cpp; sourceTree = ""; }; 266ECD73170F3C620030D735 /* BDDTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BDDTests.cpp; path = ../../../SelfTest/BDDTests.cpp; sourceTree = ""; }; 266ECD8C1713614B0030D735 /* catch_legacy_reporter_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_legacy_reporter_adapter.hpp; sourceTree = ""; }; 266ECD8D1713614B0030D735 /* catch_legacy_reporter_adapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_legacy_reporter_adapter.h; sourceTree = ""; }; @@ -176,6 +178,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 266E9AD317290E710061DAB2 /* Introspective Tests */ = { + isa = PBXGroup; + children = ( + 266E9AD417290E8E0061DAB2 /* CmdLineTests.cpp */, + ); + name = "Introspective Tests"; + sourceTree = ""; + }; 4A6D0C15149B3D3B00DB3EAA = { isa = PBXGroup; children = ( @@ -198,6 +208,7 @@ 4A6D0C35149B3D9E00DB3EAA /* TestMain.cpp */, 4A6D0C2E149B3D9E00DB3EAA /* catch_self_test.hpp */, 4AE1840A14EE4F230066340D /* catch_self_test.cpp */, + 266E9AD317290E710061DAB2 /* Introspective Tests */, 4A6D0C40149B3DAB00DB3EAA /* Tests */, 4A6D0C41149B3DE900DB3EAA /* Catch */, 4A6D0C26149B3D3B00DB3EAA /* CatchSelfTest.1 */, @@ -493,6 +504,7 @@ 26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */, 266B06B816F3A60A004ED264 /* VariadicMacrosTests.cpp in Sources */, 266ECD74170F3C620030D735 /* BDDTests.cpp in Sources */, + 266E9AD617290E8E0061DAB2 /* CmdLineTests.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 46846a47f3b0c89f573fb169d7421b7eaca3b3f8 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 29 Apr 2013 19:26:18 +0100 Subject: [PATCH 233/296] More CmdLine work - Support for non string values - Support for chaining parsers --- projects/SelfTest/CmdLineTests.cpp | 131 ++++++++++++++++++++--------- 1 file changed, 90 insertions(+), 41 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 9952f36c..a7ca1e2c 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -10,7 +10,6 @@ #endif #include "catch.hpp" -//#include "catch_ptr.hpp" namespace Catch { @@ -51,6 +50,18 @@ protected: int m_weight; }; +template +bool convertInto( std::string const& _source, T& _dest ) { + std::stringstream ss; + ss << _source; + ss >> _dest; + return !ss.fail(); +} +inline bool convertInto( std::string const& _source, std::string& _dest ) { + _dest = _source; + return true; +} + template class Opt { public: @@ -87,14 +98,12 @@ private: virtual ~IField() {} virtual bool parseInto( std::string const& _arg, T& _config ) const = 0; }; + template struct Field : IField { Field( M const& _member ) : member( _member ) {} bool parseInto( std::string const& _arg, T& _config ) const { - std::stringstream ss; - ss << _arg; - ss >> _config.*member; - return !ss.fail(); + return convertInto( _arg, _config.*member ); } M member; }; @@ -146,40 +155,58 @@ public: if( !_opt.longOpt().empty() ) m_optionsByName.insert( std::make_pair( "--" + _opt.longOpt(), &m_allOptionParsers.back() ) ); } - bool parseArgs( int argc, const char* const argv[], T& config ) { - for( int i = 0; i < argc; ++i ) { - std::string fullArg = argv[i]; - if( fullArg[0] == '-' ) { - std::string args, optName; - std::size_t pos = fullArg.find( ':' ); - if( pos == std::string::npos ) { - optName = fullArg; - } - else { - optName = fullArg.substr(0, pos ); - args = fullArg.substr( pos+1 ); - } - typename std::map*>::const_iterator it = m_optionsByName.find( optName ); - bool used = false; - if( it != m_optionsByName.end() ) { - try { - used = it->second->parseInto( args, config ); - } - catch( std::exception& ex ) { - throw std::domain_error( "Error in " + optName + " option: " + ex.what() ); - } - } - if( !used ) - m_unusedOpts.push_back( fullArg ); - } - else { - m_args.push_back( fullArg ); - } - } - return false; + + void parseArgs( int argc, const char* const argv[], T& _config ) { + for( int i = 0; i < argc; ++i ) + parseArg( argv[i], _config ); } + void parseArgs( std::vector const& _args, T& _config ) { + for( std::vector::const_iterator + it = _args.begin(), itEnd = _args.end(); + it != itEnd; + ++it ) + parseArg( *it, _config ); + } + + template + void parseRemainingArgs( CommandLineParser& _parser, T& _config ) { + parseArgs( _parser.m_unusedOpts, _config ); + } + + void parseArg( std::string const& _arg, T& _config ) { + if( _arg[0] == '-' ) { + std::string args, optName; + std::size_t pos = _arg.find( ':' ); + if( pos == std::string::npos ) { + optName = _arg; + } + else { + optName = _arg.substr(0, pos ); + args = _arg.substr( pos+1 ); + } + typename std::map*>::const_iterator it = m_optionsByName.find( optName ); + bool used = false; + if( it != m_optionsByName.end() ) { + try { + used = it->second->parseInto( args, _config ); + } + catch( std::exception& ex ) { + throw std::domain_error( "Error in " + optName + " option: " + ex.what() ); + } + } + if( !used ) + m_unusedOpts.push_back( _arg ); + } + else { + m_args.push_back( _arg ); + } + } + private: + template + friend class CommandLineParser; + std::vector > m_allOptionParsers; std::map*> m_optionsByName; std::vector m_args; @@ -197,6 +224,10 @@ struct TestOpt { int number; }; +struct TestOpt2 { + std::string description; +}; + TEST_CASE( "Arg" ) { SECTION( "pre and post" ) { Catch::ArgData preAndPost( "prefixpostfix" ); @@ -291,11 +322,9 @@ TEST_CASE( "cmdline", "" ) { CHECK( config.streamName == "stdout" ); } - Catch::Opt opt2( "a number" ); - opt2.shortOpt( "n" ) - .addArg( "", &TestOpt::number ); - - parser.addOption( opt2 ); + parser.addOption( Catch::Opt( "a number" ) + .shortOpt( "n" ) + .addArg( "", &TestOpt::number ) ); SECTION( "a number" ) { const char* argv[] = { "test", "-n:42" }; @@ -310,4 +339,24 @@ TEST_CASE( "cmdline", "" ) { CHECK( config.number == 0 ); } + SECTION( "two parsers" ) { + + TestOpt config1; + TestOpt2 config2; + Catch::CommandLineParser parser2; + parser2.addOption( Catch::Opt( "description" ) + .shortOpt( "d" ) + .longOpt( "description" ) + .addArg( "", &TestOpt2::description ) ); + + const char* argv[] = { "test", "-n:42", "-d:some text" }; + + parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config1 ); + CHECK( config1.number == 42 ); + + parser2.parseRemainingArgs( parser, config2 ); + CHECK( config2.description == "some text" ); + + } + } From ed45ceb78665d56eee38549ae31e86b90e9b4438 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 1 May 2013 19:01:48 +0100 Subject: [PATCH 234/296] Added support for binding to methods and generating usage strings. Also renamed namespace to Clara --- projects/SelfTest/CmdLineTests.cpp | 152 +++++++++++++++++++++++------ 1 file changed, 124 insertions(+), 28 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index a7ca1e2c..cddfacef 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -10,8 +10,11 @@ #endif #include "catch.hpp" +#include "catch_text.h" -namespace Catch { +namespace Clara { + +using namespace Catch; class ArgData { public: @@ -43,6 +46,12 @@ public: bool operator < ( ArgData const& _other ) const { return m_weight < _other.m_weight; } + + friend std::ostream& operator << ( std::ostream& os, ArgData const& _arg ) { + os << _arg.m_prefix << "<" << _arg.m_name << ">" << _arg.m_postfix; + return os; + } + protected: std::string m_prefix; std::string m_postfix; @@ -91,6 +100,32 @@ public: } return false; } + + std::string usage() const { + std::ostringstream oss; + oss << *this; + return oss.str(); + } + friend std::ostream& operator << ( std::ostream& os, Opt const& _opt ) { + if( !_opt.m_shortOpt.empty() ) + os << "-" << _opt.m_shortOpt; + if( !_opt.m_longOpt.empty() ) + os << ", "; + if( !_opt.m_longOpt.empty() ) + os << "--" << _opt.m_longOpt; + if( !_opt.m_args.empty() ) { + os << " : "; + typename std::vector::const_iterator + it = _opt.m_args.begin(), + itEnd = _opt.m_args.end(); + while( it != itEnd ) { + os << static_cast( *it ); + if( ++it!=itEnd ) + os << "|"; + } + } + return os; + } private: @@ -99,14 +134,30 @@ private: virtual bool parseInto( std::string const& _arg, T& _config ) const = 0; }; - template - struct Field : IField { - Field( M const& _member ) : member( _member ) {} + template + struct Field; + + template + struct Field : IField { + Field( M C::* _member ) : member( _member ) {} bool parseInto( std::string const& _arg, T& _config ) const { return convertInto( _arg, _config.*member ); } - M member; + M C::* member; }; + template + struct Field : IField { + Field( void (C::*_method)( M ) ) : method( _method ) {} + bool parseInto( std::string const& _arg, T& _config ) const { + M value; + if( !convertInto( _arg, value ) ) + return false; + ( _config.*method )( value ); + return true; + } + void (C::*method)( M ); + }; + class Arg : public ArgData { public: Arg() : m_field( NULL ) {} @@ -119,7 +170,7 @@ private: if( !m_field->parseInto( strip( _arg ), _config ) ) throw std::domain_error( "'" + _arg + "' was not valid for <" + m_name + ">" ); } - + private: Ptr m_field; }; @@ -203,6 +254,30 @@ public: } } + friend std::ostream& operator <<( std::ostream& os, CommandLineParser const& _parser ) { + typename std::vector >::const_iterator it, itEnd = _parser.m_allOptionParsers.end(); + std::size_t maxWidth = 0; + for(it = _parser.m_allOptionParsers.begin(); it != itEnd; ++it ) + maxWidth = (std::max)( it->usage().size(), maxWidth ); + + for(it = _parser.m_allOptionParsers.begin(); it != itEnd; ++it ) { + Text usage( it->usage(), TextAttributes().setWidth( maxWidth ) ); + // !TBD handle longer usage strings + Text synopsis( it->synopsis(), TextAttributes().setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxWidth -3 ) ); + + for( std::size_t i = 0; i < std::max( usage.size(), synopsis.size() ); ++i ) { + std::string usageCol = i < usage.size() ? usage[i] : ""; + std::cout << usageCol; + + if( i < synopsis.size() && !synopsis[i].empty() ) + std::cout << std::string( 2 + maxWidth - usageCol.size(), ' ' ) + << synopsis[i]; + std::cout << "\n"; + } + } + return os; + } + private: template friend class CommandLineParser; @@ -217,11 +292,18 @@ private: } // end namespace Catch struct TestOpt { - TestOpt() : number( 0 ) {} + TestOpt() : number( 0 ), index( 0 ) {} std::string fileName; std::string streamName; int number; + int index; + + void setValidIndex( int i ) { + if( i < 0 || i > 10 ) + throw std::domain_error( "index must be between 0 and 10" ); + index = i; + } }; struct TestOpt2 { @@ -230,7 +312,7 @@ struct TestOpt2 { TEST_CASE( "Arg" ) { SECTION( "pre and post" ) { - Catch::ArgData preAndPost( "prefixpostfix" ); + Clara::ArgData preAndPost( "prefixpostfix" ); CHECK( preAndPost.prefix() == "prefix" ); CHECK( preAndPost.postfix() == "postfix" ); CHECK( preAndPost.name() == "arg" ); @@ -242,7 +324,7 @@ TEST_CASE( "Arg" ) { CHECK_FALSE( preAndPost.isMatch( "prefixpayloadpostfixx" ) ); } SECTION( "pre" ) { - Catch::ArgData preAndPost( "prefix" ); + Clara::ArgData preAndPost( "prefix" ); CHECK( preAndPost.prefix() == "prefix" ); CHECK( preAndPost.postfix() == "" ); CHECK( preAndPost.name() == "arg" ); @@ -253,7 +335,7 @@ TEST_CASE( "Arg" ) { CHECK_FALSE( preAndPost.isMatch( "postfixpayload" ) ); } SECTION( "post" ) { - Catch::ArgData preAndPost( "postfix" ); + Clara::ArgData preAndPost( "postfix" ); CHECK( preAndPost.prefix() == "" ); CHECK( preAndPost.postfix() == "postfix" ); CHECK( preAndPost.name() == "arg" ); @@ -264,7 +346,7 @@ TEST_CASE( "Arg" ) { CHECK_FALSE( preAndPost.isMatch( "payloadpostfixx" ) ); } SECTION( "none" ) { - Catch::ArgData preAndPost( "" ); + Clara::ArgData preAndPost( "" ); CHECK( preAndPost.prefix() == "" ); CHECK( preAndPost.postfix() == "" ); CHECK( preAndPost.name() == "arg" ); @@ -273,33 +355,27 @@ TEST_CASE( "Arg" ) { CHECK( preAndPost.strip( "payload" ) == "payload" ); } SECTION( "errors" ) { - CHECK_THROWS( Catch::ArgData( "" ) ); - CHECK_THROWS( Catch::ArgData( "no brackets" ) ); - CHECK_THROWS( Catch::ArgData( "" ) ); - CHECK_THROWS( Catch::ArgData( "><" ) ); - CHECK_THROWS( Catch::ArgData( "<>" ) ); + CHECK_THROWS( Clara::ArgData( "" ) ); + CHECK_THROWS( Clara::ArgData( "no brackets" ) ); + CHECK_THROWS( Clara::ArgData( "" ) ); + CHECK_THROWS( Clara::ArgData( "><" ) ); + CHECK_THROWS( Clara::ArgData( "<>" ) ); } } TEST_CASE( "cmdline", "" ) { - Catch::Opt opt( "specifies output file" ); + Clara::Opt opt( "specifies output file" ); opt.shortOpt( "o" ) .longOpt( "output" ) .addArg( "", &TestOpt::fileName ) .addArg( "%", &TestOpt::streamName ); TestOpt config; - Catch::CommandLineParser parser; + Clara::CommandLineParser parser; parser.addOption( opt ); -// parser.addOption( "specifies output file" ) -// .shortOpt( "o" ) -// .longOpt( "output" ) -// .addArg( "", &TestOpt::fileName ) -// .addArg( "%", &TestOpt::streamName ); - SECTION( "plain filename" ) { const char* argv[] = { "test", "-o:filename.ext" }; @@ -322,7 +398,7 @@ TEST_CASE( "cmdline", "" ) { CHECK( config.streamName == "stdout" ); } - parser.addOption( Catch::Opt( "a number" ) + parser.addOption( Clara::Opt( "a number" ) .shortOpt( "n" ) .addArg( "", &TestOpt::number ) ); @@ -343,8 +419,8 @@ TEST_CASE( "cmdline", "" ) { TestOpt config1; TestOpt2 config2; - Catch::CommandLineParser parser2; - parser2.addOption( Catch::Opt( "description" ) + Clara::CommandLineParser parser2; + parser2.addOption( Clara::Opt( "description" ) .shortOpt( "d" ) .longOpt( "description" ) .addArg( "", &TestOpt2::description ) ); @@ -358,5 +434,25 @@ TEST_CASE( "cmdline", "" ) { CHECK( config2.description == "some text" ); } + + SECTION( "methods" ) { + parser.addOption( Clara::Opt( "An index, which is an integer between 0 and 10, inclusive" ) + .shortOpt( "i" ) + .addArg( "", &TestOpt::setValidIndex ) ); + + SECTION( "in range" ) { + const char* argv[] = { "test", "-i:3" }; + + parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + REQUIRE( config.index == 3 ); + } + SECTION( "out of range" ) { + const char* argv[] = { "test", "-i:42" }; + + REQUIRE_THROWS( parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ) ); + } + + std::cout << parser << std::endl; + } } From a13ab71cbf97d56ac13e1d07ff50d09fab2d2200 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 2 May 2013 18:41:08 +0100 Subject: [PATCH 235/296] Clara: Some renames and changed the addOption interface --- projects/SelfTest/CmdLineTests.cpp | 68 +++++++++++++++++------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index cddfacef..781bc9a3 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -196,15 +196,12 @@ private: }; template -class CommandLineParser +class Parser { public: - void addOption( Opt const& _opt ) { - m_allOptionParsers.push_back( _opt ); - if( !_opt.shortOpt().empty() ) - m_optionsByName.insert( std::make_pair( "-" + _opt.shortOpt(), &m_allOptionParsers.back() ) ); - if( !_opt.longOpt().empty() ) - m_optionsByName.insert( std::make_pair( "--" + _opt.longOpt(), &m_allOptionParsers.back() ) ); + Opt& addOption( std::string const& _synposis ) { + m_allOptionParsers.push_back( _synposis ); + return m_allOptionParsers.back(); } void parseArgs( int argc, const char* const argv[], T& _config ) { @@ -221,11 +218,13 @@ public: } template - void parseRemainingArgs( CommandLineParser& _parser, T& _config ) { + void parseRemainingArgs( Parser& _parser, T& _config ) { parseArgs( _parser.m_unusedOpts, _config ); } void parseArg( std::string const& _arg, T& _config ) { + ensureOptions(); + if( _arg[0] == '-' ) { std::string args, optName; std::size_t pos = _arg.find( ':' ); @@ -236,7 +235,7 @@ public: optName = _arg.substr(0, pos ); args = _arg.substr( pos+1 ); } - typename std::map*>::const_iterator it = m_optionsByName.find( optName ); + typename std::map const*>::const_iterator it = m_optionsByName.find( optName ); bool used = false; if( it != m_optionsByName.end() ) { try { @@ -254,7 +253,7 @@ public: } } - friend std::ostream& operator <<( std::ostream& os, CommandLineParser const& _parser ) { + friend std::ostream& operator <<( std::ostream& os, Parser const& _parser ) { typename std::vector >::const_iterator it, itEnd = _parser.m_allOptionParsers.end(); std::size_t maxWidth = 0; for(it = _parser.m_allOptionParsers.begin(); it != itEnd; ++it ) @@ -279,11 +278,23 @@ public: } private: + void ensureOptions() const { + if( m_allOptionParsers.size() != m_optionsByName.size() ) { + m_optionsByName.clear(); + typename std::vector >::const_iterator it, itEnd = m_allOptionParsers.end(); + for( it = m_allOptionParsers.begin(); it != itEnd; ++it ) { + if( !it->shortOpt().empty() ) + m_optionsByName.insert( std::make_pair( "-" + it->shortOpt(), &*it ) ); + if( !it->longOpt().empty() ) + m_optionsByName.insert( std::make_pair( "--" + it->longOpt(), &*it ) ); + } + } + } template - friend class CommandLineParser; + friend class Parser; std::vector > m_allOptionParsers; - std::map*> m_optionsByName; + mutable std::map const*> m_optionsByName; std::vector m_args; std::vector m_unusedOpts; }; @@ -366,16 +377,14 @@ TEST_CASE( "Arg" ) { TEST_CASE( "cmdline", "" ) { - Clara::Opt opt( "specifies output file" ); - opt.shortOpt( "o" ) + TestOpt config; + Clara::Parser parser; + parser.addOption( "specifies output file" ) + .shortOpt( "o" ) .longOpt( "output" ) .addArg( "", &TestOpt::fileName ) .addArg( "%", &TestOpt::streamName ); - TestOpt config; - Clara::CommandLineParser parser; - parser.addOption( opt ); - SECTION( "plain filename" ) { const char* argv[] = { "test", "-o:filename.ext" }; @@ -398,9 +407,9 @@ TEST_CASE( "cmdline", "" ) { CHECK( config.streamName == "stdout" ); } - parser.addOption( Clara::Opt( "a number" ) - .shortOpt( "n" ) - .addArg( "", &TestOpt::number ) ); + parser.addOption( "a number" ) + .shortOpt( "n" ) + .addArg( "", &TestOpt::number ); SECTION( "a number" ) { const char* argv[] = { "test", "-n:42" }; @@ -419,11 +428,12 @@ TEST_CASE( "cmdline", "" ) { TestOpt config1; TestOpt2 config2; - Clara::CommandLineParser parser2; - parser2.addOption( Clara::Opt( "description" ) - .shortOpt( "d" ) - .longOpt( "description" ) - .addArg( "", &TestOpt2::description ) ); + Clara::Parser parser2; + + parser2.addOption( "description" ) + .shortOpt( "d" ) + .longOpt( "description" ) + .addArg( "", &TestOpt2::description ); const char* argv[] = { "test", "-n:42", "-d:some text" }; @@ -436,9 +446,9 @@ TEST_CASE( "cmdline", "" ) { } SECTION( "methods" ) { - parser.addOption( Clara::Opt( "An index, which is an integer between 0 and 10, inclusive" ) - .shortOpt( "i" ) - .addArg( "", &TestOpt::setValidIndex ) ); + parser.addOption( "An index, which is an integer between 0 and 10, inclusive" ) + .shortOpt( "i" ) + .addArg( "", &TestOpt::setValidIndex ); SECTION( "in range" ) { const char* argv[] = { "test", "-i:3" }; From e2f93b6507e58c09762f2e70b274359519ddcd68 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 3 May 2013 08:08:46 +0100 Subject: [PATCH 236/296] Clara: Allow space separator, as well as : and = --- projects/SelfTest/CmdLineTests.cpp | 112 ++++++++++++++++++----------- 1 file changed, 71 insertions(+), 41 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 781bc9a3..55bf159f 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -83,6 +83,8 @@ public: m_args.push_back( Arg( _name, _member ) ); return *this; } + + std::size_t takesArg() const { return !m_args.empty(); } std::string synopsis() const { return m_synopsis; } std::string shortOpt() const { return m_shortOpt; } @@ -114,7 +116,7 @@ public: if( !_opt.m_longOpt.empty() ) os << "--" << _opt.m_longOpt; if( !_opt.m_args.empty() ) { - os << " : "; + os << " "; typename std::vector::const_iterator it = _opt.m_args.begin(), itEnd = _opt.m_args.end(); @@ -199,22 +201,23 @@ template class Parser { public: + Parser() + : m_separatorChars( "=: " ), + m_allowSpaceSeparator( m_separatorChars.find( ' ' ) != std::string::npos ) + {} + Opt& addOption( std::string const& _synposis ) { m_allOptionParsers.push_back( _synposis ); return m_allOptionParsers.back(); } void parseArgs( int argc, const char* const argv[], T& _config ) { + std::vector args; + args.reserve( static_cast( argc ) ); for( int i = 0; i < argc; ++i ) - parseArg( argv[i], _config ); - } - - void parseArgs( std::vector const& _args, T& _config ) { - for( std::vector::const_iterator - it = _args.begin(), itEnd = _args.end(); - it != itEnd; - ++it ) - parseArg( *it, _config ); + args.push_back( argv[i] ); + + parseArgs( args, _config ); } template @@ -222,34 +225,45 @@ public: parseArgs( _parser.m_unusedOpts, _config ); } - void parseArg( std::string const& _arg, T& _config ) { + void parseArgs( std::vector const& _args, T& _config ) { ensureOptions(); - - if( _arg[0] == '-' ) { - std::string args, optName; - std::size_t pos = _arg.find( ':' ); - if( pos == std::string::npos ) { - optName = _arg; + for( std::size_t i = 0; i < _args.size(); ++i ) { + std::string const& arg = _args[i]; + if( arg[0] == '-' ) { + std::string optArgs, optName; + std::size_t pos = arg.find_first_of( m_separatorChars ); + if( pos == std::string::npos ) { + optName = arg; + } + else { + optName = arg.substr(0, pos ); + optArgs = arg.substr( pos+1 ); + } + typename std::map const*>::const_iterator it = m_optionsByName.find( optName ); + bool used = false; + if( it != m_optionsByName.end() ) { + Opt const& opt = *(it->second); + if( opt.takesArg() ) { + if( optArgs.empty() ) { + if( i < _args.size() && _args[i+1][0] != '-' ) + optArgs = _args[++i]; + else + throw std::domain_error( "Expected argument"); // !TBD better error + } + } + try { + used = opt.parseInto( optArgs, _config ); + } + catch( std::exception& ex ) { + throw std::domain_error( "Error in " + optName + " option: " + ex.what() ); + } + } + if( !used ) + m_unusedOpts.push_back( arg ); } else { - optName = _arg.substr(0, pos ); - args = _arg.substr( pos+1 ); + m_args.push_back( arg ); } - typename std::map const*>::const_iterator it = m_optionsByName.find( optName ); - bool used = false; - if( it != m_optionsByName.end() ) { - try { - used = it->second->parseInto( args, _config ); - } - catch( std::exception& ex ) { - throw std::domain_error( "Error in " + optName + " option: " + ex.what() ); - } - } - if( !used ) - m_unusedOpts.push_back( _arg ); - } - else { - m_args.push_back( _arg ); } } @@ -297,6 +311,8 @@ private: mutable std::map const*> m_optionsByName; std::vector m_args; std::vector m_unusedOpts; + std::string m_separatorChars; + bool m_allowSpaceSeparator; }; @@ -386,21 +402,35 @@ TEST_CASE( "cmdline", "" ) { .addArg( "%", &TestOpt::streamName ); SECTION( "plain filename" ) { + const char* argv[] = { "test", "-o filename.ext" }; + + parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + CHECK( config.fileName == "filename.ext" ); + CHECK( config.streamName == "" ); + } + SECTION( "plain filename with colon" ) { const char* argv[] = { "test", "-o:filename.ext" }; parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "filename.ext" ); CHECK( config.streamName == "" ); } + SECTION( "plain filename with =" ) { + const char* argv[] = { "test", "-o=filename.ext" }; + + parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + CHECK( config.fileName == "filename.ext" ); + CHECK( config.streamName == "" ); + } SECTION( "stream name" ) { - const char* argv[] = { "test", "-o:%stdout" }; + const char* argv[] = { "test", "-o %stdout" }; parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "" ); CHECK( config.streamName == "stdout" ); } SECTION( "long opt" ) { - const char* argv[] = { "test", "--output:%stdout" }; + const char* argv[] = { "test", "--output %stdout" }; parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "" ); @@ -412,13 +442,13 @@ TEST_CASE( "cmdline", "" ) { .addArg( "", &TestOpt::number ); SECTION( "a number" ) { - const char* argv[] = { "test", "-n:42" }; + const char* argv[] = { "test", "-n 42" }; parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.number == 42 ); } SECTION( "not a number" ) { - const char* argv[] = { "test", "-n:forty-two" }; + const char* argv[] = { "test", "-n forty-two" }; CHECK_THROWS( parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ) ); CHECK( config.number == 0 ); @@ -435,7 +465,7 @@ TEST_CASE( "cmdline", "" ) { .longOpt( "description" ) .addArg( "", &TestOpt2::description ); - const char* argv[] = { "test", "-n:42", "-d:some text" }; + const char* argv[] = { "test", "-n 42", "-d some text" }; parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config1 ); CHECK( config1.number == 42 ); @@ -451,13 +481,13 @@ TEST_CASE( "cmdline", "" ) { .addArg( "", &TestOpt::setValidIndex ); SECTION( "in range" ) { - const char* argv[] = { "test", "-i:3" }; + const char* argv[] = { "test", "-i 3" }; parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); REQUIRE( config.index == 3 ); } SECTION( "out of range" ) { - const char* argv[] = { "test", "-i:42" }; + const char* argv[] = { "test", "-i 42" }; REQUIRE_THROWS( parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ) ); } From 11e55161e1bd859ede9b5d67b6a7b436291fa5af Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 7 May 2013 18:53:14 +0100 Subject: [PATCH 237/296] Some refactoring of Clara impl and experimental string based interface --- projects/SelfTest/CmdLineTests.cpp | 455 +++++++++++++++-------------- 1 file changed, 242 insertions(+), 213 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 55bf159f..98c0963a 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -14,51 +14,13 @@ namespace Clara { +template struct RemoveConstRef{ typedef T type; }; +template struct RemoveConstRef{ typedef T type; }; +template struct RemoveConstRef{ typedef T type; }; +template struct RemoveConstRef{ typedef T type; }; + using namespace Catch; -class ArgData { -public: - ArgData( std::string const& _arg ) : m_weight( 2 ) - { - std::size_t first = _arg.find( '<' ); - std::size_t last = _arg.find_last_of( '>' ); - if( first == std::string::npos || last == std::string::npos || last <= first+1 ) - throw std::logic_error( "Argument must contain a name in angle brackets but it was: " + _arg ); - m_prefix = _arg.substr( 0, first ); - m_postfix = _arg.substr( last+1 ); - m_name = _arg.substr( first+1, last-first-1 ); - if( !m_prefix.empty() ) - --m_weight; - if( !m_postfix.empty() ) - --m_weight; - } - std::string const& name() const { return m_name; } - std::string const& prefix() const { return m_prefix; } - std::string const& postfix() const { return m_postfix; } - - bool isMatch( std::string const& _arg ) const { - return startsWith( _arg, m_prefix ) && endsWith( _arg, m_postfix ); - } - std::string strip( std::string const& _arg ) const { - return _arg.substr( m_prefix.size(), - _arg.size() - m_prefix.size() - m_postfix.size() ); - } - bool operator < ( ArgData const& _other ) const { - return m_weight < _other.m_weight; - } - - friend std::ostream& operator << ( std::ostream& os, ArgData const& _arg ) { - os << _arg.m_prefix << "<" << _arg.m_name << ">" << _arg.m_postfix; - return os; - } - -protected: - std::string m_prefix; - std::string m_postfix; - std::string m_name; - int m_weight; -}; - template bool convertInto( std::string const& _source, T& _dest ) { std::stringstream ss; @@ -70,75 +32,88 @@ inline bool convertInto( std::string const& _source, std::string& _dest ) { _dest = _source; return true; } +inline bool convertInto( std::string const& _source, bool _dest ) { + std::string sourceLC = toLower( _source ); + if( sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) + _dest = true; + else if( sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) + _dest = false; + else + return false; + return true; +} template class Opt { public: Opt( std::string const& _synposis ) : m_synopsis( _synposis ) {} - Opt& shortOpt( std::string const& _value ) { m_shortOpt = _value; return *this; } - Opt& longOpt( std::string const& _value ) { m_longOpt = _value; return *this; } + Opt& shortName( std::string const& _value ) { m_shortName = _value; return *this; } + Opt& longName( std::string const& _value ) { m_longName = _value; return *this; } template - Opt& addArg( std::string const& _name, M const& _member ){ - m_args.push_back( Arg( _name, _member ) ); + Opt& optArg( std::string const& _name, M const& _member ){ + m_argName = _name; + m_field = new Field( _member ); + return *this; + } + + template + Opt& flag( M const& _member ){ + m_field = new FlagField( _member ); return *this; } - std::size_t takesArg() const { return !m_args.empty(); } - + std::size_t takesArg() const { return !m_argName.empty(); } std::string synopsis() const { return m_synopsis; } - std::string shortOpt() const { return m_shortOpt; } - std::string longOpt() const { return m_longOpt; } + std::string shortName() const { return m_shortName; } + std::string longName() const { return m_longName; } bool parseInto( std::string const& _arg, T& _config ) const { - ensureWeightedArgsAreSorted(); - typename std::vector::const_iterator - it = m_argsInWeightedOrder.begin(), - itEnd = m_argsInWeightedOrder.end(); - for( ; it != itEnd; ++it ) - if( (*it)->isMatch( _arg ) ) { - (*it)->parseInto( _arg, _config ); - return true; - } - return false; + if( m_argName.empty() ) + m_field->set( _config ); + else if( !m_field->parseInto( _arg, _config ) ) + throw std::domain_error( "'" + _arg + "' was not valid for <" + m_argName + ">" ); + return true; } std::string usage() const { std::ostringstream oss; - oss << *this; + writeToStream( oss ); return oss.str(); } friend std::ostream& operator << ( std::ostream& os, Opt const& _opt ) { - if( !_opt.m_shortOpt.empty() ) - os << "-" << _opt.m_shortOpt; - if( !_opt.m_longOpt.empty() ) - os << ", "; - if( !_opt.m_longOpt.empty() ) - os << "--" << _opt.m_longOpt; - if( !_opt.m_args.empty() ) { - os << " "; - typename std::vector::const_iterator - it = _opt.m_args.begin(), - itEnd = _opt.m_args.end(); - while( it != itEnd ) { - os << static_cast( *it ); - if( ++it!=itEnd ) - os << "|"; - } - } + _opt.writeToStream( os ); return os; } - + void writeToStream ( std::ostream& os ) const { + if( !m_shortName.empty() ) + os << "-" << m_shortName; + if( !m_longName.empty() ) + os << ", "; + if( !m_longName.empty() ) + os << "--" << m_longName; + if( takesArg() ) + os << " <" << m_argName << ">"; + } private: struct IField : SharedImpl<> { virtual ~IField() {} - virtual bool parseInto( std::string const& _arg, T& _config ) const = 0; + virtual bool parseInto( std::string const&, T& ) const { + throw std::logic_error( "cannot pass argument to bool binder" ); + } + virtual void set( T& ) const { + throw std::logic_error( "field requires an argument" ); + } }; - + template struct Field; + template + struct FlagField; + + // Data member : with argument template struct Field : IField { Field( M C::* _member ) : member( _member ) {} @@ -147,11 +122,22 @@ private: } M C::* member; }; + // Data member : flag + template + struct FlagField : IField { + FlagField( M C::* _member ) : member( _member ) {} + void set( T& _config ) const { + _config.*member = true; + } + M C::* member; + }; + + // Unary method : with argument template struct Field : IField { Field( void (C::*_method)( M ) ) : method( _method ) {} bool parseInto( std::string const& _arg, T& _config ) const { - M value; + typename RemoveConstRef::type value; if( !convertInto( _arg, value ) ) return false; ( _config.*method )( value ); @@ -159,42 +145,32 @@ private: } void (C::*method)( M ); }; - - class Arg : public ArgData { - public: - Arg() : m_field( NULL ) {} - template - Arg( std::string const& _name, M const& _member ) - : ArgData( _name ), - m_field( new Field( _member ) ) - {} - void parseInto( std::string const& _arg, T& _config ) const { - if( !m_field->parseInto( strip( _arg ), _config ) ) - throw std::domain_error( "'" + _arg + "' was not valid for <" + m_name + ">" ); + + // Unary method : flag + template + struct FlagField : IField { + FlagField( void (C::*_method)( M ) ) : method( _method ) {} + void set( T& _config ) const { + ( _config.*method )( true ); } - - private: - Ptr m_field; + void (C::*method)( M ); + }; + + // Nullary method : flag + template + struct FlagField : IField { + FlagField( void (C::*_method)() ) : method( _method ) {} + void set( T& _config ) const { + ( _config.*method )(); + } + void (C::*method)(); }; - static bool argLess( Arg const* lhs, Arg const* rhs ) { - return *lhs < *rhs; - } - void ensureWeightedArgsAreSorted() const { - if( m_args.size() > m_argsInWeightedOrder.size() ) { - m_argsInWeightedOrder.clear(); - typename std::vector::const_iterator it = m_args.begin(), - itEnd = m_args.end(); - for( ; it != itEnd; ++it ) - m_argsInWeightedOrder.push_back( &*it ); - sort( m_argsInWeightedOrder.begin(), m_argsInWeightedOrder.end(), &Opt::argLess ); - } - } std::string m_synopsis; - std::string m_shortOpt; - std::string m_longOpt; - std::vector m_args; - mutable std::vector m_argsInWeightedOrder; + std::string m_shortName; + std::string m_longName; + std::string m_argName; + Ptr m_field; }; template @@ -205,27 +181,34 @@ public: : m_separatorChars( "=: " ), m_allowSpaceSeparator( m_separatorChars.find( ' ' ) != std::string::npos ) {} + template + Parser( std::string const&, M ) // !TBD + : m_separatorChars( "=: " ), + m_allowSpaceSeparator( m_separatorChars.find( ' ' ) != std::string::npos ) + {} + template + Parser& operator()( std::string const&, M ) { return *this; } // !TBD Opt& addOption( std::string const& _synposis ) { m_allOptionParsers.push_back( _synposis ); return m_allOptionParsers.back(); } - void parseArgs( int argc, const char* const argv[], T& _config ) { + void parseInto( int argc, const char* const argv[], T& _config ) { std::vector args; args.reserve( static_cast( argc ) ); for( int i = 0; i < argc; ++i ) args.push_back( argv[i] ); - parseArgs( args, _config ); + parseInto( args, _config ); } template void parseRemainingArgs( Parser& _parser, T& _config ) { - parseArgs( _parser.m_unusedOpts, _config ); + parseInto( _parser.m_unusedOpts, _config ); } - void parseArgs( std::vector const& _args, T& _config ) { + void parseInto( std::vector const& _args, T& _config ) { ensureOptions(); for( std::size_t i = 0; i < _args.size(); ++i ) { std::string const& arg = _args[i]; @@ -297,10 +280,10 @@ private: m_optionsByName.clear(); typename std::vector >::const_iterator it, itEnd = m_allOptionParsers.end(); for( it = m_allOptionParsers.begin(); it != itEnd; ++it ) { - if( !it->shortOpt().empty() ) - m_optionsByName.insert( std::make_pair( "-" + it->shortOpt(), &*it ) ); - if( !it->longOpt().empty() ) - m_optionsByName.insert( std::make_pair( "--" + it->longOpt(), &*it ) ); + if( !it->shortName().empty() ) + m_optionsByName.insert( std::make_pair( "-" + it->shortName(), &*it ) ); + if( !it->longName().empty() ) + m_optionsByName.insert( std::make_pair( "--" + it->longName(), &*it ) ); } } } @@ -319,12 +302,12 @@ private: } // end namespace Catch struct TestOpt { - TestOpt() : number( 0 ), index( 0 ) {} + TestOpt() : number( 0 ), index( 0 ), flag( false ) {} std::string fileName; - std::string streamName; int number; int index; + bool flag; void setValidIndex( int i ) { if( i < 0 || i > 10 ) @@ -337,120 +320,54 @@ struct TestOpt2 { std::string description; }; -TEST_CASE( "Arg" ) { - SECTION( "pre and post" ) { - Clara::ArgData preAndPost( "prefixpostfix" ); - CHECK( preAndPost.prefix() == "prefix" ); - CHECK( preAndPost.postfix() == "postfix" ); - CHECK( preAndPost.name() == "arg" ); - - CHECK( preAndPost.isMatch( "prefixpayloadpostfix" ) ); - CHECK( preAndPost.strip( "prefixpayloadpostfix" ) == "payload" ); - CHECK_FALSE( preAndPost.isMatch( "payload" ) ); - CHECK_FALSE( preAndPost.isMatch( "postfixpayloadpostfix" ) ); - CHECK_FALSE( preAndPost.isMatch( "prefixpayloadpostfixx" ) ); - } - SECTION( "pre" ) { - Clara::ArgData preAndPost( "prefix" ); - CHECK( preAndPost.prefix() == "prefix" ); - CHECK( preAndPost.postfix() == "" ); - CHECK( preAndPost.name() == "arg" ); - - CHECK( preAndPost.isMatch( "prefixpayload" ) ); - CHECK( preAndPost.strip( "prefixpayload" ) == "payload" ); - CHECK_FALSE( preAndPost.isMatch( "payload" ) ); - CHECK_FALSE( preAndPost.isMatch( "postfixpayload" ) ); - } - SECTION( "post" ) { - Clara::ArgData preAndPost( "postfix" ); - CHECK( preAndPost.prefix() == "" ); - CHECK( preAndPost.postfix() == "postfix" ); - CHECK( preAndPost.name() == "arg" ); - - CHECK( preAndPost.isMatch( "payloadpostfix" ) ); - CHECK( preAndPost.strip( "payloadpostfix" ) == "payload" ); - CHECK_FALSE( preAndPost.isMatch( "payload" ) ); - CHECK_FALSE( preAndPost.isMatch( "payloadpostfixx" ) ); - } - SECTION( "none" ) { - Clara::ArgData preAndPost( "" ); - CHECK( preAndPost.prefix() == "" ); - CHECK( preAndPost.postfix() == "" ); - CHECK( preAndPost.name() == "arg" ); - - CHECK( preAndPost.isMatch( "payload" ) ); - CHECK( preAndPost.strip( "payload" ) == "payload" ); - } - SECTION( "errors" ) { - CHECK_THROWS( Clara::ArgData( "" ) ); - CHECK_THROWS( Clara::ArgData( "no brackets" ) ); - CHECK_THROWS( Clara::ArgData( "" ) ); - CHECK_THROWS( Clara::ArgData( "><" ) ); - CHECK_THROWS( Clara::ArgData( "<>" ) ); - } -} - TEST_CASE( "cmdline", "" ) { TestOpt config; Clara::Parser parser; parser.addOption( "specifies output file" ) - .shortOpt( "o" ) - .longOpt( "output" ) - .addArg( "", &TestOpt::fileName ) - .addArg( "%", &TestOpt::streamName ); + .shortName( "o" ) + .longName( "output" ) + .optArg( "", &TestOpt::fileName ); SECTION( "plain filename" ) { const char* argv[] = { "test", "-o filename.ext" }; - parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "filename.ext" ); - CHECK( config.streamName == "" ); } SECTION( "plain filename with colon" ) { const char* argv[] = { "test", "-o:filename.ext" }; - parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "filename.ext" ); - CHECK( config.streamName == "" ); } SECTION( "plain filename with =" ) { const char* argv[] = { "test", "-o=filename.ext" }; - parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "filename.ext" ); - CHECK( config.streamName == "" ); - } - SECTION( "stream name" ) { - const char* argv[] = { "test", "-o %stdout" }; - - parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); - CHECK( config.fileName == "" ); - CHECK( config.streamName == "stdout" ); } SECTION( "long opt" ) { const char* argv[] = { "test", "--output %stdout" }; - parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); - CHECK( config.fileName == "" ); - CHECK( config.streamName == "stdout" ); + parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + CHECK( config.fileName == "%stdout" ); } parser.addOption( "a number" ) - .shortOpt( "n" ) - .addArg( "", &TestOpt::number ); + .shortName( "n" ) + .optArg( "", &TestOpt::number ); SECTION( "a number" ) { const char* argv[] = { "test", "-n 42" }; - parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.number == 42 ); } SECTION( "not a number" ) { const char* argv[] = { "test", "-n forty-two" }; - CHECK_THROWS( parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ) ); + CHECK_THROWS( parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); CHECK( config.number == 0 ); } @@ -461,13 +378,13 @@ TEST_CASE( "cmdline", "" ) { Clara::Parser parser2; parser2.addOption( "description" ) - .shortOpt( "d" ) - .longOpt( "description" ) - .addArg( "", &TestOpt2::description ); + .shortName( "d" ) + .longName( "description" ) + .optArg( "", &TestOpt2::description ); const char* argv[] = { "test", "-n 42", "-d some text" }; - parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config1 ); + parser.parseInto( sizeof(argv)/sizeof(char*), argv, config1 ); CHECK( config1.number == 42 ); parser2.parseRemainingArgs( parser, config2 ); @@ -477,22 +394,134 @@ TEST_CASE( "cmdline", "" ) { SECTION( "methods" ) { parser.addOption( "An index, which is an integer between 0 and 10, inclusive" ) - .shortOpt( "i" ) - .addArg( "", &TestOpt::setValidIndex ); + .shortName( "i" ) + .optArg( "", &TestOpt::setValidIndex ); SECTION( "in range" ) { const char* argv[] = { "test", "-i 3" }; - parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ); + parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); REQUIRE( config.index == 3 ); } SECTION( "out of range" ) { const char* argv[] = { "test", "-i 42" }; - REQUIRE_THROWS( parser.parseArgs( sizeof(argv)/sizeof(char*), argv, config ) ); + REQUIRE_THROWS( parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); } - - std::cout << parser << std::endl; } + SECTION( "flags" ) { + parser.addOption( "A flag" ) + .shortName( "f" ) + .flag( &TestOpt::flag ); + + SECTION( "set" ) { + const char* argv[] = { "test", "-f" }; + + parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + REQUIRE( config.flag ); + } + SECTION( "not set" ) { + const char* argv[] = { "test" }; + + parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + REQUIRE( config.flag == false ); + } + } +} + +struct Config { + bool listTests; + bool listTags; + bool showPassingTests; + bool breakIntoDebugger; + bool noThrow; + bool showHelp; + + int abortAfter; + std::string reporterName; + std::string fileName; + std::string suiteName; + std::vector warnings; + + void abortAfterFirst() { abortAfter = 1; } + void abortAfterX( int x ) { abortAfter = x; } + void addWarning( std::string const& _warning ) { warnings.push_back( _warning ); } +}; + + +TEST_CASE( "growing new Catch cli" ) { + Clara::Parser parser; + + Clara::Parser + ( "-h, --help display usage information", &Config::showHelp ) + ( "-l, --list list all (or matching) test cases", &Config::listTests ) + ( "-t, --tags list all (or matching) tags", &Config::listTags ) + ( "-p, --passing show passing test output", &Config::showPassingTests ) + ( "-b, --break break into debugger on failure", &Config::breakIntoDebugger ) + ( "-e, --nothrow Skip exception tests", &Config::noThrow ) + ( "-o, --out output filename", &Config::fileName ) + ( "-n, --name suite name", &Config::suiteName ) + ( "-a, --abort abort at first failure", &Config::abortAfterFirst ) + ( "-x, --abortx abort after x failures", &Config::abortAfterX ) + ( "-w, --warn enables warnings", &Config::addWarning ); +// .parseInto( argc, argv, config ); + + parser.addOption( "display usage information" ) + .shortName( "?") + .shortName( "h") + .longName( "help" ) + .flag( &Config::showHelp ); + + parser.addOption( "list all (or matching) test cases" ) + .shortName( "l") + .longName( "list" ) + .flag( &Config::listTests ); + + parser.addOption( "list all (or matching) tags" ) + .shortName( "t") + .longName( "tags" ) + .flag( &Config::listTags ); + + parser.addOption( "show passing test output" ) + .shortName( "p") + .longName( "passing" ) + .flag( &Config::showPassingTests ); + + parser.addOption( "break into debugger on failure" ) + .shortName( "b") + .longName( "break" ) + .flag( &Config::breakIntoDebugger ); + + parser.addOption( "Skip exception tests" ) + .shortName( "e") + .longName( "nothrow" ) + .flag( &Config::noThrow ); + + parser.addOption( "output filename" ) + .shortName( "o") + .longName( "out" ) + .optArg( "", &Config::fileName ); + + parser.addOption( "suite name" ) + .shortName( "n") + .longName( "name" ) + .optArg( "", &Config::suiteName ); + + parser.addOption( "abort at first failure" ) + .shortName( "a") + .longName( "abort" ) + .flag( &Config::abortAfterFirst ); + + parser.addOption( "abort after x failures" ) + .shortName( "x") + .longName( "abortx" ) + .optArg( "", &Config::abortAfterX ); + + parser.addOption( "enables warnings" ) + .shortName( "w") + .longName( "warn" ) + .optArg( "", &Config::addWarning ); + + std::cout << parser << std::endl; } From 0c5626962a9f621a2c63dbf2a128520d530d8360 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 13 May 2013 08:20:45 +0100 Subject: [PATCH 238/296] test case for infinite loop --- projects/SelfTest/MiscTests.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index a77f215f..dc23bd58 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -332,3 +332,13 @@ TEST_CASE( "vectors can be sized and resized", "[vector]" ) { REQUIRE( v.capacity() >= 5 ); } } + +// https://github.com/philsquared/Catch/issues/166 +//TEST_CASE("CatchSectionInfiniteLoop", "") +//{ +// SECTION("Outer", "") +// SECTION("Inner", "") +// SUCCEED("that's not flying - that's failing in style"); +// +// FAIL("to infinity and beyond"); +//} From 597ed1f79db1d1fc1069723a7a676c75eec36f3a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 14 May 2013 19:31:21 +0100 Subject: [PATCH 239/296] handle TEST_CASE_METHOD macro consistently - internally define INTERNAL_CATCH_TEST_CASE_METHOD --- include/catch.hpp | 4 ++++ include/internal/catch_compiler_capabilities.h | 6 +++++- include/internal/catch_test_registry.hpp | 4 ++-- projects/SelfTest/CmdLineTests.cpp | 4 ++++ projects/SelfTest/VariadicMacrosTests.cpp | 4 ++++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index a9fbfdba..d2ebab64 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -80,10 +80,12 @@ #ifdef CATCH_CONFIG_VARIADIC_MACROS #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) + #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #else #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) + #define CATCH_TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description ) #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) #endif @@ -139,10 +141,12 @@ #ifdef CATCH_CONFIG_VARIADIC_MACROS #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) + #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #else #define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) + #define TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description ) #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) #endif diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h index 2e307d03..8191e967 100644 --- a/include/internal/catch_compiler_capabilities.h +++ b/include/internal/catch_compiler_capabilities.h @@ -74,7 +74,11 @@ ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ ( defined __GNUC__ && __GNUC__ >= 3 ) || \ ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) - #define CATCH_CONFIG_VARIADIC_MACROS + +#ifndef CATCH_CONFIG_NO_VARIADIC_MACROS +#define CATCH_CONFIG_VARIADIC_MACROS +#endif + #endif #endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED diff --git a/include/internal/catch_test_registry.hpp b/include/internal/catch_test_registry.hpp index fde21d35..269f48eb 100644 --- a/include/internal/catch_test_registry.hpp +++ b/include/internal/catch_test_registry.hpp @@ -85,7 +85,7 @@ private: namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } /////////////////////////////////////////////////////////////////////////////// - #define TEST_CASE_METHOD( ClassName, ... )\ + #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... )\ namespace{ \ struct INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ ) : ClassName{ \ void test(); \ @@ -106,7 +106,7 @@ private: namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } /////////////////////////////////////////////////////////////////////////////// - #define TEST_CASE_METHOD( ClassName, TestName, Desc )\ + #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\ namespace{ \ struct INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ ) : ClassName{ \ void test(); \ diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 98c0963a..ca968d1e 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -320,6 +320,8 @@ struct TestOpt2 { std::string description; }; +#ifdef CATCH_CONFIG_VARIADIC_MACROS + TEST_CASE( "cmdline", "" ) { TestOpt config; @@ -525,3 +527,5 @@ TEST_CASE( "growing new Catch cli" ) { std::cout << parser << std::endl; } +#endif + diff --git a/projects/SelfTest/VariadicMacrosTests.cpp b/projects/SelfTest/VariadicMacrosTests.cpp index f51980c1..b784076d 100644 --- a/projects/SelfTest/VariadicMacrosTests.cpp +++ b/projects/SelfTest/VariadicMacrosTests.cpp @@ -8,6 +8,8 @@ #include "catch.hpp" +#ifdef CATCH_CONFIG_VARIADIC_MACROS + TEST_CASE() { SUCCEED( "anonymous test case" ); @@ -25,3 +27,5 @@ TEST_CASE( "Variadic macros", "[variadic][sections]" ) SUCCEED( "no assertions" ); } } + +#endif From 372a8b018d05e771492f6bcfeded42fae75a09de Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 15 May 2013 19:25:34 +0100 Subject: [PATCH 240/296] New CLI parser impl --- projects/SelfTest/CmdLineTests.cpp | 758 ++++++++++++++++------------- 1 file changed, 419 insertions(+), 339 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index ca968d1e..330c850a 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -14,292 +14,362 @@ namespace Clara { -template struct RemoveConstRef{ typedef T type; }; -template struct RemoveConstRef{ typedef T type; }; -template struct RemoveConstRef{ typedef T type; }; -template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; -using namespace Catch; + template struct IsBool { static const bool value = false; }; + template<> struct IsBool { static const bool value = true; }; -template -bool convertInto( std::string const& _source, T& _dest ) { - std::stringstream ss; - ss << _source; - ss >> _dest; - return !ss.fail(); -} -inline bool convertInto( std::string const& _source, std::string& _dest ) { - _dest = _source; - return true; -} -inline bool convertInto( std::string const& _source, bool _dest ) { - std::string sourceLC = toLower( _source ); - if( sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) - _dest = true; - else if( sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) - _dest = false; - else - return false; - return true; -} - -template -class Opt { -public: - Opt( std::string const& _synposis ) : m_synopsis( _synposis ) {} - Opt& shortName( std::string const& _value ) { m_shortName = _value; return *this; } - Opt& longName( std::string const& _value ) { m_longName = _value; return *this; } - - template - Opt& optArg( std::string const& _name, M const& _member ){ - m_argName = _name; - m_field = new Field( _member ); - return *this; + template + void convertInto( std::string const& _source, T& _dest ) { + std::stringstream ss; + ss << _source; + ss >> _dest; + if( ss.fail() ) + throw std::runtime_error( "Unable to convert " + _source + " to destination type" ); + } + inline void convertInto( std::string const& _source, std::string& _dest ) { + _dest = _source; + } + inline void convertInto( std::string const& _source, bool& _dest ) { + std::string sourceLC = _source; + std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower ); + if( sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) + _dest = true; + else if( sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) + _dest = false; + else + throw std::runtime_error( "Expected a boolean value but did recognise: '" + _source + "'" ); + } + inline void convertInto( bool _source, bool& _dest ) { + _dest = _source; + } + template + inline void convertInto( bool, T& ) { + throw std::runtime_error( "Invalid conversion" ); } - template - Opt& flag( M const& _member ){ - m_field = new FlagField( _member ); - return *this; - } - - std::size_t takesArg() const { return !m_argName.empty(); } - std::string synopsis() const { return m_synopsis; } - std::string shortName() const { return m_shortName; } - std::string longName() const { return m_longName; } - - bool parseInto( std::string const& _arg, T& _config ) const { - if( m_argName.empty() ) - m_field->set( _config ); - else if( !m_field->parseInto( _arg, _config ) ) - throw std::domain_error( "'" + _arg + "' was not valid for <" + m_argName + ">" ); - return true; - } - - std::string usage() const { - std::ostringstream oss; - writeToStream( oss ); - return oss.str(); - } - friend std::ostream& operator << ( std::ostream& os, Opt const& _opt ) { - _opt.writeToStream( os ); - return os; - } - void writeToStream ( std::ostream& os ) const { - if( !m_shortName.empty() ) - os << "-" << m_shortName; - if( !m_longName.empty() ) - os << ", "; - if( !m_longName.empty() ) - os << "--" << m_longName; - if( takesArg() ) - os << " <" << m_argName << ">"; - } -private: - - struct IField : SharedImpl<> { - virtual ~IField() {} - virtual bool parseInto( std::string const&, T& ) const { - throw std::logic_error( "cannot pass argument to bool binder" ); - } - virtual void set( T& ) const { - throw std::logic_error( "field requires an argument" ); - } + template + struct IBoundMember { + virtual ~IBoundMember() {} + virtual void set( ConfigT& config, std::string const& value ) const = 0; + virtual void setFlag( ConfigT& config ) const = 0; + virtual bool takesArg() const = 0; + virtual IBoundMember* clone() const = 0; }; - - template - struct Field; - template - struct FlagField; - - // Data member : with argument - template - struct Field : IField { - Field( M C::* _member ) : member( _member ) {} - bool parseInto( std::string const& _arg, T& _config ) const { - return convertInto( _arg, _config.*member ); + template + class BoundField { + public: + BoundField( IBoundMember* _boundMember ) : boundMember( _boundMember ) {} + BoundField( BoundField const& other ) : boundMember( other.boundMember->clone() ) {} + BoundField& operator = ( BoundField const& other ) { + IBoundMember newMember = other.clone(); + delete boundMember; + boundMember = newMember; + return *this; } + ~BoundField() { delete boundMember; } + + void set( ConfigT& config, std::string const& value ) const { + boundMember->set( config, value ); + } + void setFlag( ConfigT& config ) const { + boundMember->setFlag( config ); + } + bool takesArg() const { return boundMember->takesArg(); } + private: + IBoundMember* boundMember; + }; + + + template + struct BoundDataMember : IBoundMember{ + BoundDataMember( M C::* _member ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + convertInto( stringValue, p.*member ); + } + virtual void setFlag( C& p ) const { + convertInto( true, p.*member ); + } + virtual bool takesArg() const { return !IsBool::value; } + virtual IBoundMember* clone() const { return new BoundDataMember( *this ); } M C::* member; }; - // Data member : flag template - struct FlagField : IField { - FlagField( M C::* _member ) : member( _member ) {} - void set( T& _config ) const { - _config.*member = true; - } - M C::* member; - }; - - // Unary method : with argument - template - struct Field : IField { - Field( void (C::*_method)( M ) ) : method( _method ) {} - bool parseInto( std::string const& _arg, T& _config ) const { + struct BoundUnaryMethod : IBoundMember{ + BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { typename RemoveConstRef::type value; - if( !convertInto( _arg, value ) ) - return false; - ( _config.*method )( value ); - return true; + convertInto( stringValue, value ); + (p.*member)( value ); } - void (C::*method)( M ); - }; - - // Unary method : flag - template - struct FlagField : IField { - FlagField( void (C::*_method)( M ) ) : method( _method ) {} - void set( T& _config ) const { - ( _config.*method )( true ); + virtual void setFlag( C& p ) const { + typename RemoveConstRef::type value; + convertInto( true, value ); + (p.*member)( value ); } - void (C::*method)( M ); + virtual bool takesArg() const { return !IsBool::value; } + virtual IBoundMember* clone() const { return new BoundUnaryMethod( *this ); } + void (C::*member)( M ); }; - - // Nullary method : flag template - struct FlagField : IField { - FlagField( void (C::*_method)() ) : method( _method ) {} - void set( T& _config ) const { - ( _config.*method )(); + struct BoundNullaryMethod : IBoundMember{ + BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + bool value; + convertInto( stringValue, value ); + if( value ) + (p.*member)(); } - void (C::*method)(); + virtual void setFlag( C& p ) const { + (p.*member)(); + } + virtual bool takesArg() const { return false; } + virtual IBoundMember* clone() const { return new BoundNullaryMethod( *this ); } + void (C::*member)(); }; - std::string m_synopsis; - std::string m_shortName; - std::string m_longName; - std::string m_argName; - Ptr m_field; -}; - -template -class Parser -{ -public: - Parser() - : m_separatorChars( "=: " ), - m_allowSpaceSeparator( m_separatorChars.find( ' ' ) != std::string::npos ) - {} - template - Parser( std::string const&, M ) // !TBD - : m_separatorChars( "=: " ), - m_allowSpaceSeparator( m_separatorChars.find( ' ' ) != std::string::npos ) - {} - template - Parser& operator()( std::string const&, M ) { return *this; } // !TBD - - Opt& addOption( std::string const& _synposis ) { - m_allOptionParsers.push_back( _synposis ); - return m_allOptionParsers.back(); + template + BoundField makeBoundField( M C::* _member ) { + return BoundField( new BoundDataMember( _member ) ); + } + template + BoundField makeBoundField( void (C::*_member)( M ) ) { + return BoundField( new BoundUnaryMethod( _member ) ); + } + template + BoundField makeBoundField( void (C::*_member)() ) { + return BoundField( new BoundNullaryMethod( _member ) ); } - void parseInto( int argc, const char* const argv[], T& _config ) { - std::vector args; - args.reserve( static_cast( argc ) ); - for( int i = 0; i < argc; ++i ) - args.push_back( argv[i] ); + + template + class CommandLine { + struct ArgToken { + enum TokenType { + Positional, + ShortOpt, + LongOpt + }; + ArgToken() : type( Positional ) {} + ArgToken( TokenType _type, std::string const& _arg ) + : type( _type ), arg( _arg ) {} + + TokenType type; + std::string arg; + }; + + class ArgBinder { + public: + ArgBinder( CommandLine* cl ) : m_cl( cl ) {} + + template + ArgBinder& bind( F f ) { + if( !m_cl->opts.empty() ) + m_cl->opts.back().validate(); + m_cl->opts.push_back( Opt( makeBoundField( f ) ) ); + return *this; + } + + ArgBinder& shortOpt( std::string const& name ) { + m_cl->opts.back().shortNames.push_back( name ); + return *this; + } + ArgBinder& longOpt( std::string const& name ) { + m_cl->opts.back().longName = name; + return *this; + } + ArgBinder& describe( std::string const& description ) { + m_cl->opts.back().description = description; + return *this; + } + ArgBinder& argName( std::string const& argName ) { + m_cl->opts.back().argName = argName; + return *this; + } + ArgBinder& position( int /*position*/ ) { + // !TBD: Support for positional args in fixed positions + return *this; + } + private: + CommandLine* m_cl; + }; + + struct Opt { + public: + Opt( BoundField const& _boundField ) : boundField( _boundField ) {} + + bool hasShortName( std::string const& shortName ) const { + for( std::vector::const_iterator + it = shortNames.begin(), itEnd = shortNames.end(); + it != itEnd; + ++it ) + if( *it == shortName ) + return true; + return false; + } + bool hasLongName( std::string const& _longName ) const { + return _longName == longName; + } + bool takesArg() const { + return !argName.empty(); + } + bool isPositional() const { + return shortNames.empty() && longName.empty(); + } + std::string dbgName() const { + if( !longName.empty() ) + return "--" + longName; + if( !shortNames.empty() ) + return "-" + shortNames[0]; + return "positional args"; + } + + void validate() const { + if( boundField.takesArg() && !takesArg() ) + throw std::logic_error( dbgName() + " must specify an arg name" ); + } + + std::string commands() const { + std::ostringstream oss; + bool first = true; + std::vector::const_iterator it = shortNames.begin(), itEnd = shortNames.end(); + for(; it != itEnd; ++it ) { + if( first ) + first = false; + else + oss << ", "; + oss << "-" << *it; + } + if( !longName.empty() ) { + if( !first ) + oss << ", "; + oss << "--" << longName; + } + if( !argName.empty() ) + oss << " <" << argName << ">"; + return oss.str(); + } + + BoundField boundField; + std::vector shortNames; + std::string longName; + std::string description; + std::string argName; + }; + + public: + template + ArgBinder bind( F f ) { + ArgBinder binder( this ); + binder.bind( f ); + return binder; + } + + void parseInto( int argc, char const* argv[], ConfigT& config ) const { + if( opts.empty() ) + throw std::logic_error( "No options or arguments specified" ); + opts.back().validate(); + + std::vector tokens; + parseIntoTokens( argc, argv, tokens ); + setFromTokens( tokens, config ); + } + + void usage( std::ostream& os ) const { + typename std::vector::const_iterator itBegin = opts.begin(), itEnd = opts.end(), it; + std::size_t maxWidth = 0; + for( it = itBegin; it != itEnd; ++it ) + maxWidth = (std::max)( maxWidth, it->commands().size() ); + + for( it = itBegin; it != itEnd; ++it ) { + Catch::Text usage( it->commands(), Catch::TextAttributes().setWidth( maxWidth ) ); + // !TBD handle longer usage strings + Catch::Text desc( it->description, Catch::TextAttributes().setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxWidth -3 ) ); + + for( std::size_t i = 0; i < std::max( usage.size(), desc.size() ); ++i ) { + std::string usageCol = i < usage.size() ? usage[i] : ""; + os << usageCol; + + if( i < desc.size() && !desc[i].empty() ) + os << std::string( 2 + maxWidth - usageCol.size(), ' ' ) + << desc[i]; + os << "\n"; + } + } + + } + std::string usage() const { + std::ostringstream oss; + usage( oss ); + return oss.str(); + } + friend std::ostream& operator << ( std::ostream& os, CommandLine const& parser ) { + parser.usage( os ); + return os; + } - parseInto( args, _config ); - } - - template - void parseRemainingArgs( Parser& _parser, T& _config ) { - parseInto( _parser.m_unusedOpts, _config ); - } - - void parseInto( std::vector const& _args, T& _config ) { - ensureOptions(); - for( std::size_t i = 0; i < _args.size(); ++i ) { - std::string const& arg = _args[i]; - if( arg[0] == '-' ) { - std::string optArgs, optName; - std::size_t pos = arg.find_first_of( m_separatorChars ); - if( pos == std::string::npos ) { - optName = arg; - } - else { - optName = arg.substr(0, pos ); - optArgs = arg.substr( pos+1 ); - } - typename std::map const*>::const_iterator it = m_optionsByName.find( optName ); - bool used = false; - if( it != m_optionsByName.end() ) { - Opt const& opt = *(it->second); - if( opt.takesArg() ) { - if( optArgs.empty() ) { - if( i < _args.size() && _args[i+1][0] != '-' ) - optArgs = _args[++i]; - else - throw std::domain_error( "Expected argument"); // !TBD better error + private: + void parseIntoTokens( int argc, char const* argv[], std::vector& tokens ) const { + for( int i = 1; i < argc; ++i ) { + std::string arg = argv[i]; + while( !arg.empty() ) { + ArgToken token( ArgToken::Positional, arg ); + arg = ""; + if( token.arg[0] == '-' ) { + if( token.arg.size() > 1 && token.arg[1] == '-' ) + token = ArgToken( ArgToken::LongOpt, token.arg.substr( 2 ) ); + else + token = ArgToken( ArgToken::ShortOpt, token.arg.substr( 1 ) ); + } + if( token.type != ArgToken::Positional ) { + std::size_t pos = token.arg.find_first_of( " \t=:" ); + if( pos != std::string::npos ) { + arg = token.arg.substr( pos+1 ); + token.arg = token.arg.substr( 0, pos ); } } - try { - used = opt.parseInto( optArgs, _config ); - } - catch( std::exception& ex ) { - throw std::domain_error( "Error in " + optName + " option: " + ex.what() ); - } + tokens.push_back( token ); } - if( !used ) - m_unusedOpts.push_back( arg ); - } - else { - m_args.push_back( arg ); - } - } - } - - friend std::ostream& operator <<( std::ostream& os, Parser const& _parser ) { - typename std::vector >::const_iterator it, itEnd = _parser.m_allOptionParsers.end(); - std::size_t maxWidth = 0; - for(it = _parser.m_allOptionParsers.begin(); it != itEnd; ++it ) - maxWidth = (std::max)( it->usage().size(), maxWidth ); - - for(it = _parser.m_allOptionParsers.begin(); it != itEnd; ++it ) { - Text usage( it->usage(), TextAttributes().setWidth( maxWidth ) ); - // !TBD handle longer usage strings - Text synopsis( it->synopsis(), TextAttributes().setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxWidth -3 ) ); - - for( std::size_t i = 0; i < std::max( usage.size(), synopsis.size() ); ++i ) { - std::string usageCol = i < usage.size() ? usage[i] : ""; - std::cout << usageCol; - - if( i < synopsis.size() && !synopsis[i].empty() ) - std::cout << std::string( 2 + maxWidth - usageCol.size(), ' ' ) - << synopsis[i]; - std::cout << "\n"; } } - return os; - } - -private: - void ensureOptions() const { - if( m_allOptionParsers.size() != m_optionsByName.size() ) { - m_optionsByName.clear(); - typename std::vector >::const_iterator it, itEnd = m_allOptionParsers.end(); - for( it = m_allOptionParsers.begin(); it != itEnd; ++it ) { - if( !it->shortName().empty() ) - m_optionsByName.insert( std::make_pair( "-" + it->shortName(), &*it ) ); - if( !it->longName().empty() ) - m_optionsByName.insert( std::make_pair( "--" + it->longName(), &*it ) ); + void setFromTokens( std::vectorconst & tokens, ConfigT& config ) const { + for( std::size_t i = 0; i < tokens.size(); ++i ) { + ArgToken const& token = tokens[i]; + typename std::vector::const_iterator it = opts.begin(), itEnd = opts.end(); + for(; it != itEnd; ++it ) { + Opt const& opt = *it; + + if( ( token.type == ArgToken::ShortOpt && opt.hasShortName( token.arg ) ) || + ( token.type == ArgToken::LongOpt && opt.hasLongName( token.arg ) ) ) { + if( opt.takesArg() ) { + if( i == tokens.size()-1 || tokens[i+1].type != ArgToken::Positional ) + throw std::domain_error( "Expected argument to option " + token.arg ); + opt.boundField.set( config, tokens[++i].arg ); + } + else { + opt.boundField.setFlag( config ); + } + break; + } + else if( token.type == ArgToken::Positional && opt.isPositional() ) { + opt.boundField.set( config, token.arg ); + break; + } + } + if( it == itEnd ) + unhandledTokens.push_back( token ); } } - } - template - friend class Parser; - - std::vector > m_allOptionParsers; - mutable std::map const*> m_optionsByName; - std::vector m_args; - std::vector m_unusedOpts; - std::string m_separatorChars; - bool m_allowSpaceSeparator; -}; - + + std::vector opts; + mutable std::vector unhandledTokens; // !TBD + }; -} // end namespace Catch +} // end namespace Clara struct TestOpt { TestOpt() : number( 0 ), index( 0 ), flag( false ) {} @@ -325,11 +395,12 @@ struct TestOpt2 { TEST_CASE( "cmdline", "" ) { TestOpt config; - Clara::Parser parser; - parser.addOption( "specifies output file" ) - .shortName( "o" ) - .longName( "output" ) - .optArg( "", &TestOpt::fileName ); + Clara::CommandLine parser; + parser.bind( &TestOpt::fileName ) + .describe( "specifies output file" ) + .shortOpt( "o" ) + .longOpt( "output" ) + .argName( "" ); SECTION( "plain filename" ) { const char* argv[] = { "test", "-o filename.ext" }; @@ -356,9 +427,9 @@ TEST_CASE( "cmdline", "" ) { CHECK( config.fileName == "%stdout" ); } - parser.addOption( "a number" ) - .shortName( "n" ) - .optArg( "", &TestOpt::number ); + parser.bind( &TestOpt::number ) + .shortOpt( "n" ) + .argName( "" ); SECTION( "a number" ) { const char* argv[] = { "test", "-n 42" }; @@ -377,27 +448,30 @@ TEST_CASE( "cmdline", "" ) { TestOpt config1; TestOpt2 config2; - Clara::Parser parser2; + Clara::CommandLine parser2; - parser2.addOption( "description" ) - .shortName( "d" ) - .longName( "description" ) - .optArg( "", &TestOpt2::description ); + parser2.bind( &TestOpt2::description ) + .describe( "description" ) + .shortOpt( "d" ) + .longOpt( "description" ) + .argName( "" ); const char* argv[] = { "test", "-n 42", "-d some text" }; parser.parseInto( sizeof(argv)/sizeof(char*), argv, config1 ); CHECK( config1.number == 42 ); - - parser2.parseRemainingArgs( parser, config2 ); - CHECK( config2.description == "some text" ); + +// !TBD +// parser2.parseRemainingArgs( parser, config2 ); +// CHECK( config2.description == "some text" ); } SECTION( "methods" ) { - parser.addOption( "An index, which is an integer between 0 and 10, inclusive" ) - .shortName( "i" ) - .optArg( "", &TestOpt::setValidIndex ); + parser.bind( &TestOpt::setValidIndex ) + .describe( "An index, which is an integer between 0 and 10, inclusive" ) + .shortOpt( "i" ) + .argName( "" ); SECTION( "in range" ) { const char* argv[] = { "test", "-i 3" }; @@ -413,9 +487,9 @@ TEST_CASE( "cmdline", "" ) { } SECTION( "flags" ) { - parser.addOption( "A flag" ) - .shortName( "f" ) - .flag( &TestOpt::flag ); + parser.bind( &TestOpt::flag ) + .describe( "A flag" ) + .shortOpt( "f" ); SECTION( "set" ) { const char* argv[] = { "test", "-f" }; @@ -453,79 +527,85 @@ struct Config { TEST_CASE( "growing new Catch cli" ) { - Clara::Parser parser; + Clara::CommandLine parser; - Clara::Parser - ( "-h, --help display usage information", &Config::showHelp ) - ( "-l, --list list all (or matching) test cases", &Config::listTests ) - ( "-t, --tags list all (or matching) tags", &Config::listTags ) - ( "-p, --passing show passing test output", &Config::showPassingTests ) - ( "-b, --break break into debugger on failure", &Config::breakIntoDebugger ) - ( "-e, --nothrow Skip exception tests", &Config::noThrow ) - ( "-o, --out output filename", &Config::fileName ) - ( "-n, --name suite name", &Config::suiteName ) - ( "-a, --abort abort at first failure", &Config::abortAfterFirst ) - ( "-x, --abortx abort after x failures", &Config::abortAfterX ) - ( "-w, --warn enables warnings", &Config::addWarning ); -// .parseInto( argc, argv, config ); + parser.bind( &Config::showHelp ) + .describe( "display usage information" ) + .shortOpt( "?") + .shortOpt( "h") + .longOpt( "help" ); - parser.addOption( "display usage information" ) - .shortName( "?") - .shortName( "h") - .longName( "help" ) - .flag( &Config::showHelp ); + parser.bind( &Config::listTests ) + .describe( "list all (or matching) test cases" ) + .shortOpt( "l") + .longOpt( "list" ); - parser.addOption( "list all (or matching) test cases" ) - .shortName( "l") - .longName( "list" ) - .flag( &Config::listTests ); + parser.bind( &Config::listTags ) + .describe( "list all (or matching) tags" ) + .shortOpt( "t") + .longOpt( "tags" ); - parser.addOption( "list all (or matching) tags" ) - .shortName( "t") - .longName( "tags" ) - .flag( &Config::listTags ); + parser.bind( &Config::showPassingTests ) + .describe( "show passing test output" ) + .shortOpt( "p") + .longOpt( "passing" ); - parser.addOption( "show passing test output" ) - .shortName( "p") - .longName( "passing" ) - .flag( &Config::showPassingTests ); + parser.bind( &Config::breakIntoDebugger ) + .describe( "break into debugger on failure" ) + .shortOpt( "b") + .longOpt( "break" ); - parser.addOption( "break into debugger on failure" ) - .shortName( "b") - .longName( "break" ) - .flag( &Config::breakIntoDebugger ); + parser.bind( &Config::noThrow ) + .describe( "Skip exception tests" ) + .shortOpt( "e") + .longOpt( "nothrow" ); - parser.addOption( "Skip exception tests" ) - .shortName( "e") - .longName( "nothrow" ) - .flag( &Config::noThrow ); + parser.bind( &Config::fileName ) + .describe( "output filename" ) + .shortOpt( "o") + .longOpt( "out" ) + .argName( "file name" ); - parser.addOption( "output filename" ) - .shortName( "o") - .longName( "out" ) - .optArg( "", &Config::fileName ); + parser.bind( &Config::suiteName ) + .describe( "suite name" ) + .shortOpt( "n") + .longOpt( "name" ) + .argName( "name" ); - parser.addOption( "suite name" ) - .shortName( "n") - .longName( "name" ) - .optArg( "", &Config::suiteName ); + parser.bind( &Config::abortAfterFirst ) + .describe( "abort at first failure" ) + .shortOpt( "a") + .longOpt( "abort" ); - parser.addOption( "abort at first failure" ) - .shortName( "a") - .longName( "abort" ) - .flag( &Config::abortAfterFirst ); + parser.bind( &Config::abortAfterX ) + .describe( "abort after x failures" ) + .shortOpt( "x") + .longOpt( "abortx" ) + .argName( "number of failures" ); - parser.addOption( "abort after x failures" ) - .shortName( "x") - .longName( "abortx" ) - .optArg( "", &Config::abortAfterX ); - - parser.addOption( "enables warnings" ) - .shortName( "w") - .longName( "warn" ) - .optArg( "", &Config::addWarning ); + parser.bind( &Config::addWarning ) + .describe( "enables warnings" ) + .shortOpt( "w") + .longOpt( "warn" ) + .argName( "warning name" ); std::cout << parser << std::endl; } + +// !TBD still support this? +// Clara::Parser +// ( "-h, --help display usage information", &Config::showHelp ) +// ( "-l, --list list all (or matching) test cases", &Config::listTests ) +// ( "-t, --tags list all (or matching) tags", &Config::listTags ) +// ( "-p, --passing show passing test output", &Config::showPassingTests ) +// ( "-b, --break break into debugger on failure", &Config::breakIntoDebugger ) +// ( "-e, --nothrow Skip exception tests", &Config::noThrow ) +// ( "-o, --out output filename", &Config::fileName ) +// ( "-n, --name suite name", &Config::suiteName ) +// ( "-a, --abort abort at first failure", &Config::abortAfterFirst ) +// ( "-x, --abortx abort after x failures", &Config::abortAfterX ) +// ( "-w, --warn enables warnings", &Config::addWarning ); +// .parseInto( argc, argv, config ); + #endif From 58846c395cd2636b0d6d8864b7d9b28f540055b7 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 16 May 2013 08:21:13 +0100 Subject: [PATCH 241/296] Clara: Added support for compact short opts (e.g. -peb) --- projects/SelfTest/CmdLineTests.cpp | 40 +++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 330c850a..57c88a33 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -262,6 +262,8 @@ namespace Clara { }; public: + CommandLine() : seperators( " \t=:" ) {} + template ArgBinder bind( F f ) { ArgBinder binder( this ); @@ -320,13 +322,19 @@ namespace Clara { ArgToken token( ArgToken::Positional, arg ); arg = ""; if( token.arg[0] == '-' ) { - if( token.arg.size() > 1 && token.arg[1] == '-' ) + if( token.arg.size() > 1 && token.arg[1] == '-' ) { token = ArgToken( ArgToken::LongOpt, token.arg.substr( 2 ) ); - else + } + else { token = ArgToken( ArgToken::ShortOpt, token.arg.substr( 1 ) ); + if( token.arg.size() > 1 && seperators.find( token.arg[1] ) == std::string::npos ) { + arg = "-" + token.arg.substr( 1 ); + token.arg = token.arg.substr( 0, 1 ); + } + } } if( token.type != ArgToken::Positional ) { - std::size_t pos = token.arg.find_first_of( " \t=:" ); + std::size_t pos = token.arg.find_first_of( seperators ); if( pos != std::string::npos ) { arg = token.arg.substr( pos+1 ); token.arg = token.arg.substr( 0, pos ); @@ -365,6 +373,7 @@ namespace Clara { } } + std::string seperators; std::vector opts; mutable std::vector unhandledTokens; // !TBD }; @@ -507,6 +516,16 @@ TEST_CASE( "cmdline", "" ) { } struct Config { + Config() + : listTests( false ), + listTags( false ), + showPassingTests( false ), + breakIntoDebugger( false ), + noThrow( false ), + showHelp( false ), + abortAfter( 0 ) + {} + bool listTests; bool listTags; bool showPassingTests; @@ -590,6 +609,21 @@ TEST_CASE( "growing new Catch cli" ) { .argName( "warning name" ); std::cout << parser << std::endl; + + Config config; + + const char* argv[] = { "test", "-peb" }; + int argc = sizeof(argv)/sizeof(char*); + + parser.parseInto( argc, argv, config ); + + CHECK( config.showPassingTests ); + CHECK( config.noThrow ); + CHECK( config.breakIntoDebugger ); + +// +// REQUIRE_THROWS( parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); + } // !TBD still support this? From 8333e644f2f17db83129f902c9577b01c0335719 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 16 May 2013 19:07:50 +0100 Subject: [PATCH 242/296] Clara: some refactoring - moved all internal stuff into Detail - moved Parser out of CommandLine, encapsulates tokens. - allow unused tokens to be feed into different CommandLine processors --- projects/SelfTest/CmdLineTests.cpp | 600 ++++++++++++++--------------- 1 file changed, 300 insertions(+), 300 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 57c88a33..d03d7473 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -13,154 +13,184 @@ #include "catch_text.h" namespace Clara { + namespace Detail { + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; + template struct IsBool { static const bool value = false; }; + template<> struct IsBool { static const bool value = true; }; - template struct IsBool { static const bool value = false; }; - template<> struct IsBool { static const bool value = true; }; - - template - void convertInto( std::string const& _source, T& _dest ) { - std::stringstream ss; - ss << _source; - ss >> _dest; - if( ss.fail() ) - throw std::runtime_error( "Unable to convert " + _source + " to destination type" ); - } - inline void convertInto( std::string const& _source, std::string& _dest ) { - _dest = _source; - } - inline void convertInto( std::string const& _source, bool& _dest ) { - std::string sourceLC = _source; - std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower ); - if( sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) - _dest = true; - else if( sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) - _dest = false; - else - throw std::runtime_error( "Expected a boolean value but did recognise: '" + _source + "'" ); - } - inline void convertInto( bool _source, bool& _dest ) { - _dest = _source; - } - template - inline void convertInto( bool, T& ) { - throw std::runtime_error( "Invalid conversion" ); - } - - template - struct IBoundMember { - virtual ~IBoundMember() {} - virtual void set( ConfigT& config, std::string const& value ) const = 0; - virtual void setFlag( ConfigT& config ) const = 0; - virtual bool takesArg() const = 0; - virtual IBoundMember* clone() const = 0; - }; - - template - class BoundField { - public: - BoundField( IBoundMember* _boundMember ) : boundMember( _boundMember ) {} - BoundField( BoundField const& other ) : boundMember( other.boundMember->clone() ) {} - BoundField& operator = ( BoundField const& other ) { - IBoundMember newMember = other.clone(); - delete boundMember; - boundMember = newMember; - return *this; + template + void convertInto( std::string const& _source, T& _dest ) { + std::stringstream ss; + ss << _source; + ss >> _dest; + if( ss.fail() ) + throw std::runtime_error( "Unable to convert " + _source + " to destination type" ); + } + inline void convertInto( std::string const& _source, std::string& _dest ) { + _dest = _source; + } + inline void convertInto( std::string const& _source, bool& _dest ) { + std::string sourceLC = _source; + std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower ); + if( sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) + _dest = true; + else if( sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) + _dest = false; + else + throw std::runtime_error( "Expected a boolean value but did recognise: '" + _source + "'" ); + } + inline void convertInto( bool _source, bool& _dest ) { + _dest = _source; + } + template + inline void convertInto( bool, T& ) { + throw std::runtime_error( "Invalid conversion" ); } - ~BoundField() { delete boundMember; } - void set( ConfigT& config, std::string const& value ) const { - boundMember->set( config, value ); - } - void setFlag( ConfigT& config ) const { - boundMember->setFlag( config ); - } - bool takesArg() const { return boundMember->takesArg(); } - private: - IBoundMember* boundMember; - }; + template + struct IBoundMember { + virtual ~IBoundMember() {} + virtual void set( ConfigT& config, std::string const& value ) const = 0; + virtual void setFlag( ConfigT& config ) const = 0; + virtual bool takesArg() const = 0; + virtual IBoundMember* clone() const = 0; + }; + + template + class BoundField { + public: + BoundField( IBoundMember* _boundMember ) : boundMember( _boundMember ) {} + BoundField( BoundField const& other ) : boundMember( other.boundMember->clone() ) {} + BoundField& operator = ( BoundField const& other ) { + IBoundMember newMember = other.clone(); + delete boundMember; + boundMember = newMember; + return *this; + } + ~BoundField() { delete boundMember; } + + void set( ConfigT& config, std::string const& value ) const { + boundMember->set( config, value ); + } + void setFlag( ConfigT& config ) const { + boundMember->setFlag( config ); + } + bool takesArg() const { return boundMember->takesArg(); } + private: + IBoundMember* boundMember; + }; - template - struct BoundDataMember : IBoundMember{ - BoundDataMember( M C::* _member ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - convertInto( stringValue, p.*member ); - } - virtual void setFlag( C& p ) const { - convertInto( true, p.*member ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IBoundMember* clone() const { return new BoundDataMember( *this ); } - M C::* member; - }; - template - struct BoundUnaryMethod : IBoundMember{ - BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - typename RemoveConstRef::type value; - convertInto( stringValue, value ); - (p.*member)( value ); - } - virtual void setFlag( C& p ) const { - typename RemoveConstRef::type value; - convertInto( true, value ); - (p.*member)( value ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IBoundMember* clone() const { return new BoundUnaryMethod( *this ); } - void (C::*member)( M ); - }; - template - struct BoundNullaryMethod : IBoundMember{ - BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - bool value; - convertInto( stringValue, value ); - if( value ) + template + struct BoundDataMember : IBoundMember{ + BoundDataMember( M C::* _member ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + convertInto( stringValue, p.*member ); + } + virtual void setFlag( C& p ) const { + convertInto( true, p.*member ); + } + virtual bool takesArg() const { return !IsBool::value; } + virtual IBoundMember* clone() const { return new BoundDataMember( *this ); } + M C::* member; + }; + template + struct BoundUnaryMethod : IBoundMember{ + BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + typename RemoveConstRef::type value; + convertInto( stringValue, value ); + (p.*member)( value ); + } + virtual void setFlag( C& p ) const { + typename RemoveConstRef::type value; + convertInto( true, value ); + (p.*member)( value ); + } + virtual bool takesArg() const { return !IsBool::value; } + virtual IBoundMember* clone() const { return new BoundUnaryMethod( *this ); } + void (C::*member)( M ); + }; + template + struct BoundNullaryMethod : IBoundMember{ + BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + bool value; + convertInto( stringValue, value ); + if( value ) + (p.*member)(); + } + virtual void setFlag( C& p ) const { (p.*member)(); + } + virtual bool takesArg() const { return false; } + virtual IBoundMember* clone() const { return new BoundNullaryMethod( *this ); } + void (C::*member)(); + }; + + template + BoundField makeBoundField( M C::* _member ) { + return BoundField( new BoundDataMember( _member ) ); } - virtual void setFlag( C& p ) const { - (p.*member)(); + template + BoundField makeBoundField( void (C::*_member)( M ) ) { + return BoundField( new BoundUnaryMethod( _member ) ); } - virtual bool takesArg() const { return false; } - virtual IBoundMember* clone() const { return new BoundNullaryMethod( *this ); } - void (C::*member)(); - }; - - template - BoundField makeBoundField( M C::* _member ) { - return BoundField( new BoundDataMember( _member ) ); - } - template - BoundField makeBoundField( void (C::*_member)( M ) ) { - return BoundField( new BoundUnaryMethod( _member ) ); - } - template - BoundField makeBoundField( void (C::*_member)() ) { - return BoundField( new BoundNullaryMethod( _member ) ); - } + template + BoundField makeBoundField( void (C::*_member)() ) { + return BoundField( new BoundNullaryMethod( _member ) ); + } + } // namespace Detail + struct Parser { + Parser() : separators( " \t=:" ) {} + + struct Token { + enum Type { Positional, ShortOpt, LongOpt }; + Token( Type _type, std::string const& _data ) : type( _type ), data( _data ) {} + Type type; + std::string data; + }; + + void parseIntoTokens( int argc, char const* argv[], std::vector& tokens ) const { + for( int i = 1; i < argc; ++i ) + parseIntoTokens( argv[i] , tokens); + } + void parseIntoTokens( std::string arg, std::vector& tokens ) const { + while( !arg.empty() ) { + Parser::Token token( Parser::Token::Positional, arg ); + arg = ""; + if( token.data[0] == '-' ) { + if( token.data.size() > 1 && token.data[1] == '-' ) { + token = Parser::Token( Parser::Token::LongOpt, token.data.substr( 2 ) ); + } + else { + token = Parser::Token( Parser::Token::ShortOpt, token.data.substr( 1 ) ); + if( token.data.size() > 1 && separators.find( token.data[1] ) == std::string::npos ) { + arg = "-" + token.data.substr( 1 ); + token.data = token.data.substr( 0, 1 ); + } + } + } + if( token.type != Parser::Token::Positional ) { + std::size_t pos = token.data.find_first_of( separators ); + if( pos != std::string::npos ) { + arg = token.data.substr( pos+1 ); + token.data = token.data.substr( 0, pos ); + } + } + tokens.push_back( token ); + } + } + std::string separators; + }; template class CommandLine { - struct ArgToken { - enum TokenType { - Positional, - ShortOpt, - LongOpt - }; - ArgToken() : type( Positional ) {} - ArgToken( TokenType _type, std::string const& _arg ) - : type( _type ), arg( _arg ) {} - - TokenType type; - std::string arg; - }; class ArgBinder { public: @@ -168,26 +198,25 @@ namespace Clara { template ArgBinder& bind( F f ) { - if( !m_cl->opts.empty() ) - m_cl->opts.back().validate(); - m_cl->opts.push_back( Opt( makeBoundField( f ) ) ); + if( !m_cl->m_args.empty() ) + m_cl->m_args.back().validate(); + m_cl->m_args.push_back( Arg( Detail::makeBoundField( f ) ) ); return *this; } - ArgBinder& shortOpt( std::string const& name ) { - m_cl->opts.back().shortNames.push_back( name ); + m_cl->m_args.back().shortNames.push_back( name ); return *this; } ArgBinder& longOpt( std::string const& name ) { - m_cl->opts.back().longName = name; + m_cl->m_args.back().longName = name; return *this; } ArgBinder& describe( std::string const& description ) { - m_cl->opts.back().description = description; + m_cl->m_args.back().description = description; return *this; } ArgBinder& argName( std::string const& argName ) { - m_cl->opts.back().argName = argName; + m_cl->m_args.back().argName = argName; return *this; } ArgBinder& position( int /*position*/ ) { @@ -198,72 +227,67 @@ namespace Clara { CommandLine* m_cl; }; - struct Opt { - public: - Opt( BoundField const& _boundField ) : boundField( _boundField ) {} + struct Arg { + Arg( Detail::BoundField const& _boundField ) : boundField( _boundField ) {} - bool hasShortName( std::string const& shortName ) const { - for( std::vector::const_iterator - it = shortNames.begin(), itEnd = shortNames.end(); - it != itEnd; - ++it ) - if( *it == shortName ) - return true; - return false; + bool hasShortName( std::string const& shortName ) const { + for( std::vector::const_iterator + it = shortNames.begin(), itEnd = shortNames.end(); + it != itEnd; + ++it ) + if( *it == shortName ) + return true; + return false; + } + bool hasLongName( std::string const& _longName ) const { + return _longName == longName; + } + bool takesArg() const { + return !argName.empty(); + } + bool isPositional() const { + return shortNames.empty() && longName.empty(); + } + std::string dbgName() const { + if( !longName.empty() ) + return "--" + longName; + if( !shortNames.empty() ) + return "-" + shortNames[0]; + return "positional args"; + } + void validate() const { + if( boundField.takesArg() && !takesArg() ) + throw std::logic_error( dbgName() + " must specify an arg name" ); + } + std::string commands() const { + std::ostringstream oss; + bool first = true; + std::vector::const_iterator it = shortNames.begin(), itEnd = shortNames.end(); + for(; it != itEnd; ++it ) { + if( first ) + first = false; + else + oss << ", "; + oss << "-" << *it; } - bool hasLongName( std::string const& _longName ) const { - return _longName == longName; + if( !longName.empty() ) { + if( !first ) + oss << ", "; + oss << "--" << longName; } - bool takesArg() const { - return !argName.empty(); - } - bool isPositional() const { - return shortNames.empty() && longName.empty(); - } - std::string dbgName() const { - if( !longName.empty() ) - return "--" + longName; - if( !shortNames.empty() ) - return "-" + shortNames[0]; - return "positional args"; - } - - void validate() const { - if( boundField.takesArg() && !takesArg() ) - throw std::logic_error( dbgName() + " must specify an arg name" ); - } - - std::string commands() const { - std::ostringstream oss; - bool first = true; - std::vector::const_iterator it = shortNames.begin(), itEnd = shortNames.end(); - for(; it != itEnd; ++it ) { - if( first ) - first = false; - else - oss << ", "; - oss << "-" << *it; - } - if( !longName.empty() ) { - if( !first ) - oss << ", "; - oss << "--" << longName; - } - if( !argName.empty() ) - oss << " <" << argName << ">"; - return oss.str(); - } - - BoundField boundField; - std::vector shortNames; - std::string longName; - std::string description; - std::string argName; + if( !argName.empty() ) + oss << " <" << argName << ">"; + return oss.str(); + } + + Detail::BoundField boundField; + std::vector shortNames; + std::string longName; + std::string description; + std::string argName; }; public: - CommandLine() : seperators( " \t=:" ) {} - template ArgBinder bind( F f ) { ArgBinder binder( this ); @@ -271,18 +295,8 @@ namespace Clara { return binder; } - void parseInto( int argc, char const* argv[], ConfigT& config ) const { - if( opts.empty() ) - throw std::logic_error( "No options or arguments specified" ); - opts.back().validate(); - - std::vector tokens; - parseIntoTokens( argc, argv, tokens ); - setFromTokens( tokens, config ); - } - void usage( std::ostream& os ) const { - typename std::vector::const_iterator itBegin = opts.begin(), itEnd = opts.end(), it; + typename std::vector::const_iterator itBegin = m_args.begin(), itEnd = m_args.end(), it; std::size_t maxWidth = 0; for( it = itBegin; it != itEnd; ++it ) maxWidth = (std::max)( maxWidth, it->commands().size() ); @@ -301,8 +315,7 @@ namespace Clara { << desc[i]; os << "\n"; } - } - + } } std::string usage() const { std::ostringstream oss; @@ -314,68 +327,50 @@ namespace Clara { return os; } - private: - void parseIntoTokens( int argc, char const* argv[], std::vector& tokens ) const { - for( int i = 1; i < argc; ++i ) { - std::string arg = argv[i]; - while( !arg.empty() ) { - ArgToken token( ArgToken::Positional, arg ); - arg = ""; - if( token.arg[0] == '-' ) { - if( token.arg.size() > 1 && token.arg[1] == '-' ) { - token = ArgToken( ArgToken::LongOpt, token.arg.substr( 2 ) ); - } - else { - token = ArgToken( ArgToken::ShortOpt, token.arg.substr( 1 ) ); - if( token.arg.size() > 1 && seperators.find( token.arg[1] ) == std::string::npos ) { - arg = "-" + token.arg.substr( 1 ); - token.arg = token.arg.substr( 0, 1 ); - } - } - } - if( token.type != ArgToken::Positional ) { - std::size_t pos = token.arg.find_first_of( seperators ); - if( pos != std::string::npos ) { - arg = token.arg.substr( pos+1 ); - token.arg = token.arg.substr( 0, pos ); - } - } - tokens.push_back( token ); - } - } + std::vector parseInto( int argc, char const* argv[], ConfigT& config ) const { + std::vector tokens; + Parser parser; + parser.parseIntoTokens( argc, argv, tokens ); + return populate( tokens, config ); } - void setFromTokens( std::vectorconst & tokens, ConfigT& config ) const { + + std::vector populate( std::vector const& tokens, ConfigT& config ) const { + if( m_args.empty() ) + throw std::logic_error( "No options or arguments specified" ); + m_args.back().validate(); + + std::vector unusedTokens; for( std::size_t i = 0; i < tokens.size(); ++i ) { - ArgToken const& token = tokens[i]; - typename std::vector::const_iterator it = opts.begin(), itEnd = opts.end(); + Parser::Token const& token = tokens[i]; + typename std::vector::const_iterator it = m_args.begin(), itEnd = m_args.end(); for(; it != itEnd; ++it ) { - Opt const& opt = *it; + Arg const& arg = *it; - if( ( token.type == ArgToken::ShortOpt && opt.hasShortName( token.arg ) ) || - ( token.type == ArgToken::LongOpt && opt.hasLongName( token.arg ) ) ) { - if( opt.takesArg() ) { - if( i == tokens.size()-1 || tokens[i+1].type != ArgToken::Positional ) - throw std::domain_error( "Expected argument to option " + token.arg ); - opt.boundField.set( config, tokens[++i].arg ); + if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) || + ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) { + if( arg.takesArg() ) { + if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional ) + throw std::domain_error( "Expected argument to option " + token.data ); + arg.boundField.set( config, tokens[++i].data ); } else { - opt.boundField.setFlag( config ); + arg.boundField.setFlag( config ); } break; } - else if( token.type == ArgToken::Positional && opt.isPositional() ) { - opt.boundField.set( config, token.arg ); + else if( token.type == Parser::Token::Positional && arg.isPositional() ) { + arg.boundField.set( config, token.data ); break; } } if( it == itEnd ) - unhandledTokens.push_back( token ); + unusedTokens.push_back( token ); } + return unusedTokens; } - std::string seperators; - std::vector opts; - mutable std::vector unhandledTokens; // !TBD + private: + std::vector m_args; }; } // end namespace Clara @@ -401,11 +396,11 @@ struct TestOpt2 { #ifdef CATCH_CONFIG_VARIADIC_MACROS -TEST_CASE( "cmdline", "" ) { +TEST_CASE( "cmdline" ) { TestOpt config; - Clara::CommandLine parser; - parser.bind( &TestOpt::fileName ) + Clara::CommandLine cli; + cli.bind( &TestOpt::fileName ) .describe( "specifies output file" ) .shortOpt( "o" ) .longOpt( "output" ) @@ -414,42 +409,42 @@ TEST_CASE( "cmdline", "" ) { SECTION( "plain filename" ) { const char* argv[] = { "test", "-o filename.ext" }; - parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "filename.ext" ); } SECTION( "plain filename with colon" ) { const char* argv[] = { "test", "-o:filename.ext" }; - parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "filename.ext" ); } SECTION( "plain filename with =" ) { const char* argv[] = { "test", "-o=filename.ext" }; - parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "filename.ext" ); } SECTION( "long opt" ) { const char* argv[] = { "test", "--output %stdout" }; - parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "%stdout" ); } - parser.bind( &TestOpt::number ) + cli.bind( &TestOpt::number ) .shortOpt( "n" ) .argName( "" ); SECTION( "a number" ) { const char* argv[] = { "test", "-n 42" }; - parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.number == 42 ); } SECTION( "not a number" ) { const char* argv[] = { "test", "-n forty-two" }; - CHECK_THROWS( parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); + CHECK_THROWS( cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); CHECK( config.number == 0 ); } @@ -457,9 +452,9 @@ TEST_CASE( "cmdline", "" ) { TestOpt config1; TestOpt2 config2; - Clara::CommandLine parser2; + Clara::CommandLine cli2; - parser2.bind( &TestOpt2::description ) + cli2.bind( &TestOpt2::description ) .describe( "description" ) .shortOpt( "d" ) .longOpt( "description" ) @@ -467,17 +462,16 @@ TEST_CASE( "cmdline", "" ) { const char* argv[] = { "test", "-n 42", "-d some text" }; - parser.parseInto( sizeof(argv)/sizeof(char*), argv, config1 ); + std::vector unusedTokens = cli.parseInto( sizeof(argv)/sizeof(char*), argv, config1 ); CHECK( config1.number == 42 ); -// !TBD -// parser2.parseRemainingArgs( parser, config2 ); -// CHECK( config2.description == "some text" ); - + REQUIRE_FALSE( unusedTokens.empty() ); + cli2.populate( unusedTokens, config2 ); + CHECK( config2.description == "some text" ); } SECTION( "methods" ) { - parser.bind( &TestOpt::setValidIndex ) + cli.bind( &TestOpt::setValidIndex ) .describe( "An index, which is an integer between 0 and 10, inclusive" ) .shortOpt( "i" ) .argName( "" ); @@ -485,31 +479,31 @@ TEST_CASE( "cmdline", "" ) { SECTION( "in range" ) { const char* argv[] = { "test", "-i 3" }; - parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); REQUIRE( config.index == 3 ); } SECTION( "out of range" ) { const char* argv[] = { "test", "-i 42" }; - REQUIRE_THROWS( parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); + REQUIRE_THROWS( cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); } } SECTION( "flags" ) { - parser.bind( &TestOpt::flag ) + cli.bind( &TestOpt::flag ) .describe( "A flag" ) .shortOpt( "f" ); SECTION( "set" ) { const char* argv[] = { "test", "-f" }; - parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); REQUIRE( config.flag ); } SECTION( "not set" ) { const char* argv[] = { "test" }; - parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); REQUIRE( config.flag == false ); } } @@ -538,91 +532,97 @@ struct Config { std::string fileName; std::string suiteName; std::vector warnings; + std::vector testsOrTags; void abortAfterFirst() { abortAfter = 1; } void abortAfterX( int x ) { abortAfter = x; } void addWarning( std::string const& _warning ) { warnings.push_back( _warning ); } + void addTestOrTags( std::string const& _testSpec ) { testsOrTags.push_back( _testSpec ); } }; TEST_CASE( "growing new Catch cli" ) { - Clara::CommandLine parser; + Clara::CommandLine cli; - parser.bind( &Config::showHelp ) + cli.bind( &Config::showHelp ) .describe( "display usage information" ) .shortOpt( "?") .shortOpt( "h") .longOpt( "help" ); - parser.bind( &Config::listTests ) + cli.bind( &Config::listTests ) .describe( "list all (or matching) test cases" ) .shortOpt( "l") .longOpt( "list" ); - parser.bind( &Config::listTags ) + cli.bind( &Config::listTags ) .describe( "list all (or matching) tags" ) .shortOpt( "t") .longOpt( "tags" ); - parser.bind( &Config::showPassingTests ) + cli.bind( &Config::showPassingTests ) .describe( "show passing test output" ) .shortOpt( "p") .longOpt( "passing" ); - parser.bind( &Config::breakIntoDebugger ) + cli.bind( &Config::breakIntoDebugger ) .describe( "break into debugger on failure" ) .shortOpt( "b") .longOpt( "break" ); - parser.bind( &Config::noThrow ) + cli.bind( &Config::noThrow ) .describe( "Skip exception tests" ) .shortOpt( "e") .longOpt( "nothrow" ); - parser.bind( &Config::fileName ) + cli.bind( &Config::fileName ) .describe( "output filename" ) .shortOpt( "o") .longOpt( "out" ) .argName( "file name" ); - parser.bind( &Config::suiteName ) + cli.bind( &Config::suiteName ) .describe( "suite name" ) .shortOpt( "n") .longOpt( "name" ) .argName( "name" ); - parser.bind( &Config::abortAfterFirst ) + cli.bind( &Config::abortAfterFirst ) .describe( "abort at first failure" ) .shortOpt( "a") .longOpt( "abort" ); - parser.bind( &Config::abortAfterX ) + cli.bind( &Config::abortAfterX ) .describe( "abort after x failures" ) .shortOpt( "x") .longOpt( "abortx" ) .argName( "number of failures" ); - parser.bind( &Config::addWarning ) + cli.bind( &Config::addWarning ) .describe( "enables warnings" ) .shortOpt( "w") .longOpt( "warn" ) .argName( "warning name" ); - std::cout << parser << std::endl; + cli.bind( &Config::addTestOrTags ) + .describe( "which test or tests to use" ) + .argName( "test name, pattern or tags" ); + + std::cout << cli << std::endl; Config config; const char* argv[] = { "test", "-peb" }; int argc = sizeof(argv)/sizeof(char*); - parser.parseInto( argc, argv, config ); + cli.parseInto( argc, argv, config ); CHECK( config.showPassingTests ); CHECK( config.noThrow ); CHECK( config.breakIntoDebugger ); // -// REQUIRE_THROWS( parser.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); +// REQUIRE_THROWS( cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); } From 8d1100daa6c7c9aa75e0ef6cbdf8578f6635ba57 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 17 May 2013 07:43:58 +0100 Subject: [PATCH 243/296] Clara: added -r option --- projects/SelfTest/CmdLineTests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index d03d7473..dde70245 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -531,6 +531,7 @@ struct Config { std::string reporterName; std::string fileName; std::string suiteName; + std::string reporter; std::vector warnings; std::vector testsOrTags; @@ -581,6 +582,12 @@ TEST_CASE( "growing new Catch cli" ) { .longOpt( "out" ) .argName( "file name" ); + cli.bind( &Config::reporter ) + .describe( "e.g. console | xml | junit" ) + .shortOpt( "r") + .longOpt( "reporter" ) + .argName( "reporter name[:filename]" ); + cli.bind( &Config::suiteName ) .describe( "suite name" ) .shortOpt( "n") From 6574f639a317240b39f926b47e7360a59b8f1271 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 17 May 2013 08:00:57 +0100 Subject: [PATCH 244/296] Refactored CLI tests and converted main one into a scenario --- projects/SelfTest/CmdLineTests.cpp | 188 ++++++++++++++++------------- 1 file changed, 102 insertions(+), 86 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index dde70245..0d7d4875 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -375,6 +375,13 @@ namespace Clara { } // end namespace Clara +// Helper to deduce size from array literals and pass on to parser +template +std::vector parseInto( Clara::CommandLine& cli, char const* (&argv)[size], ConfigT& config ) { + return cli.parseInto( size, argv, config ); +} + + struct TestOpt { TestOpt() : number( 0 ), index( 0 ), flag( false ) {} @@ -408,26 +415,26 @@ TEST_CASE( "cmdline" ) { SECTION( "plain filename" ) { const char* argv[] = { "test", "-o filename.ext" }; - - cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); + parseInto( cli, argv, config ); + CHECK( config.fileName == "filename.ext" ); } SECTION( "plain filename with colon" ) { const char* argv[] = { "test", "-o:filename.ext" }; + parseInto( cli, argv, config ); - cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "filename.ext" ); } SECTION( "plain filename with =" ) { const char* argv[] = { "test", "-o=filename.ext" }; + parseInto( cli, argv, config ); - cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "filename.ext" ); } SECTION( "long opt" ) { const char* argv[] = { "test", "--output %stdout" }; + parseInto( cli, argv, config ); - cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.fileName == "%stdout" ); } @@ -437,14 +444,14 @@ TEST_CASE( "cmdline" ) { SECTION( "a number" ) { const char* argv[] = { "test", "-n 42" }; + parseInto( cli, argv, config ); - cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); CHECK( config.number == 42 ); } SECTION( "not a number" ) { const char* argv[] = { "test", "-n forty-two" }; + CHECK_THROWS( parseInto( cli, argv, config ) ); - CHECK_THROWS( cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); CHECK( config.number == 0 ); } @@ -461,8 +468,8 @@ TEST_CASE( "cmdline" ) { .argName( "" ); const char* argv[] = { "test", "-n 42", "-d some text" }; + std::vector unusedTokens = parseInto( cli, argv, config1 ); - std::vector unusedTokens = cli.parseInto( sizeof(argv)/sizeof(char*), argv, config1 ); CHECK( config1.number == 42 ); REQUIRE_FALSE( unusedTokens.empty() ); @@ -478,14 +485,14 @@ TEST_CASE( "cmdline" ) { SECTION( "in range" ) { const char* argv[] = { "test", "-i 3" }; + parseInto( cli, argv, config ); - cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); REQUIRE( config.index == 3 ); } SECTION( "out of range" ) { const char* argv[] = { "test", "-i 42" }; - REQUIRE_THROWS( cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); + REQUIRE_THROWS( parseInto( cli, argv, config ) ); } } @@ -496,14 +503,14 @@ TEST_CASE( "cmdline" ) { SECTION( "set" ) { const char* argv[] = { "test", "-f" }; + parseInto( cli, argv, config ); - cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); REQUIRE( config.flag ); } SECTION( "not set" ) { const char* argv[] = { "test" }; + parseInto( cli, argv, config ); - cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ); REQUIRE( config.flag == false ); } } @@ -542,95 +549,104 @@ struct Config { }; -TEST_CASE( "growing new Catch cli" ) { - Clara::CommandLine cli; +SCENARIO( "New Catch commandline interface", "[cli]" ) { - cli.bind( &Config::showHelp ) - .describe( "display usage information" ) - .shortOpt( "?") - .shortOpt( "h") - .longOpt( "help" ); + GIVEN( "A built cli parser for Catch" ) { + Clara::CommandLine cli; - cli.bind( &Config::listTests ) - .describe( "list all (or matching) test cases" ) - .shortOpt( "l") - .longOpt( "list" ); + cli.bind( &Config::showHelp ) + .describe( "display usage information" ) + .shortOpt( "?") + .shortOpt( "h") + .longOpt( "help" ); - cli.bind( &Config::listTags ) - .describe( "list all (or matching) tags" ) - .shortOpt( "t") - .longOpt( "tags" ); + cli.bind( &Config::listTests ) + .describe( "list all (or matching) test cases" ) + .shortOpt( "l") + .longOpt( "list" ); - cli.bind( &Config::showPassingTests ) - .describe( "show passing test output" ) - .shortOpt( "p") - .longOpt( "passing" ); + cli.bind( &Config::listTags ) + .describe( "list all (or matching) tags" ) + .shortOpt( "t") + .longOpt( "tags" ); - cli.bind( &Config::breakIntoDebugger ) - .describe( "break into debugger on failure" ) - .shortOpt( "b") - .longOpt( "break" ); + cli.bind( &Config::showPassingTests ) + .describe( "show passing test output" ) + .shortOpt( "p") + .longOpt( "passing" ); - cli.bind( &Config::noThrow ) - .describe( "Skip exception tests" ) - .shortOpt( "e") - .longOpt( "nothrow" ); + cli.bind( &Config::breakIntoDebugger ) + .describe( "break into debugger on failure" ) + .shortOpt( "b") + .longOpt( "break" ); - cli.bind( &Config::fileName ) - .describe( "output filename" ) - .shortOpt( "o") - .longOpt( "out" ) - .argName( "file name" ); + cli.bind( &Config::noThrow ) + .describe( "Skip exception tests" ) + .shortOpt( "e") + .longOpt( "nothrow" ); - cli.bind( &Config::reporter ) - .describe( "e.g. console | xml | junit" ) - .shortOpt( "r") - .longOpt( "reporter" ) - .argName( "reporter name[:filename]" ); + cli.bind( &Config::fileName ) + .describe( "output filename" ) + .shortOpt( "o") + .longOpt( "out" ) + .argName( "file name" ); - cli.bind( &Config::suiteName ) - .describe( "suite name" ) - .shortOpt( "n") - .longOpt( "name" ) - .argName( "name" ); + cli.bind( &Config::reporter ) + .describe( "e.g. console | xml | junit" ) + .shortOpt( "r") + .longOpt( "reporter" ) + .argName( "reporter name[:filename]" ); - cli.bind( &Config::abortAfterFirst ) - .describe( "abort at first failure" ) - .shortOpt( "a") - .longOpt( "abort" ); + cli.bind( &Config::suiteName ) + .describe( "suite name" ) + .shortOpt( "n") + .longOpt( "name" ) + .argName( "name" ); - cli.bind( &Config::abortAfterX ) - .describe( "abort after x failures" ) - .shortOpt( "x") - .longOpt( "abortx" ) - .argName( "number of failures" ); + cli.bind( &Config::abortAfterFirst ) + .describe( "abort at first failure" ) + .shortOpt( "a") + .longOpt( "abort" ); - cli.bind( &Config::addWarning ) - .describe( "enables warnings" ) - .shortOpt( "w") - .longOpt( "warn" ) - .argName( "warning name" ); + cli.bind( &Config::abortAfterX ) + .describe( "abort after x failures" ) + .shortOpt( "x") + .longOpt( "abortx" ) + .argName( "number of failures" ); - cli.bind( &Config::addTestOrTags ) - .describe( "which test or tests to use" ) - .argName( "test name, pattern or tags" ); + cli.bind( &Config::addWarning ) + .describe( "enables warnings" ) + .shortOpt( "w") + .longOpt( "warn" ) + .argName( "warning name" ); - std::cout << cli << std::endl; - - Config config; - - const char* argv[] = { "test", "-peb" }; - int argc = sizeof(argv)/sizeof(char*); - - cli.parseInto( argc, argv, config ); - - CHECK( config.showPassingTests ); - CHECK( config.noThrow ); - CHECK( config.breakIntoDebugger ); - -// -// REQUIRE_THROWS( cli.parseInto( sizeof(argv)/sizeof(char*), argv, config ) ); + cli.bind( &Config::addTestOrTags ) + .describe( "which test or tests to use" ) + .argName( "test name, pattern or tags" ); + + WHEN( "It is streamed" ) + THEN( "It prints the usage strings" ) + std::cout << cli << std::endl; + + Config config; + + WHEN( "Multiple flags are combined" ) { + + CHECK_FALSE( config.showPassingTests ); + CHECK_FALSE( config.noThrow ); + CHECK_FALSE( config.breakIntoDebugger ); + + const char* argv[] = { "test", "-peb" }; + parseInto( cli, argv, config ); + + THEN( "All the flags are set" ) { + CHECK( config.showPassingTests ); + CHECK( config.noThrow ); + CHECK( config.breakIntoDebugger ); + } + } + } } // !TBD still support this? From 374335fc84d207c00fbfc23e2a347425a49d5d92 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 17 May 2013 08:18:42 +0100 Subject: [PATCH 245/296] Approved current output --- .../SelfTest/Baselines/approvedResults.txt | 646 +++++++++++++++++- 1 file changed, 631 insertions(+), 15 deletions(-) diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 9aaf62f6..bc909c9a 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -5290,10 +5290,10 @@ with expansion: ------------------------------------------------------------------------------- Anonymous test case 1 ------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:11 +VariadicMacrosTests.cpp:13 ............................................................................... -VariadicMacrosTests.cpp:13: +VariadicMacrosTests.cpp:15: PASSED: with message: anonymous test case @@ -5301,10 +5301,10 @@ with message: ------------------------------------------------------------------------------- Test case with one argument ------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:16 +VariadicMacrosTests.cpp:18 ............................................................................... -VariadicMacrosTests.cpp:18: +VariadicMacrosTests.cpp:20: PASSED: with message: no assertions @@ -5313,10 +5313,10 @@ with message: Variadic macros Section with one argument ------------------------------------------------------------------------------- -VariadicMacrosTests.cpp:23 +VariadicMacrosTests.cpp:25 ............................................................................... -VariadicMacrosTests.cpp:25: +VariadicMacrosTests.cpp:27: PASSED: with message: no assertions @@ -5542,8 +5542,248 @@ PASSED: with message: boo! +------------------------------------------------------------------------------- +cmdline + plain filename +------------------------------------------------------------------------------- +CmdLineTests.cpp:416 +............................................................................... + +CmdLineTests.cpp:420: +PASSED: + CHECK( config.fileName == "filename.ext" ) +with expansion: + "filename.ext" == "filename.ext" + +------------------------------------------------------------------------------- +cmdline + plain filename with colon +------------------------------------------------------------------------------- +CmdLineTests.cpp:422 +............................................................................... + +CmdLineTests.cpp:426: +PASSED: + CHECK( config.fileName == "filename.ext" ) +with expansion: + "filename.ext" == "filename.ext" + +------------------------------------------------------------------------------- +cmdline + plain filename with = +------------------------------------------------------------------------------- +CmdLineTests.cpp:428 +............................................................................... + +CmdLineTests.cpp:432: +PASSED: + CHECK( config.fileName == "filename.ext" ) +with expansion: + "filename.ext" == "filename.ext" + +------------------------------------------------------------------------------- +cmdline + long opt +------------------------------------------------------------------------------- +CmdLineTests.cpp:434 +............................................................................... + +CmdLineTests.cpp:438: +PASSED: + CHECK( config.fileName == "%stdout" ) +with expansion: + "%stdout" == "%stdout" + +------------------------------------------------------------------------------- +cmdline + a number +------------------------------------------------------------------------------- +CmdLineTests.cpp:445 +............................................................................... + +CmdLineTests.cpp:449: +PASSED: + CHECK( config.number == 42 ) +with expansion: + 42 == 42 + +------------------------------------------------------------------------------- +cmdline + not a number +------------------------------------------------------------------------------- +CmdLineTests.cpp:451 +............................................................................... + +CmdLineTests.cpp:453: +PASSED: + CHECK_THROWS( parseInto( cli, argv, config ) ) + +CmdLineTests.cpp:455: +PASSED: + CHECK( config.number == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +cmdline + two parsers +------------------------------------------------------------------------------- +CmdLineTests.cpp:458 +............................................................................... + +CmdLineTests.cpp:473: +PASSED: + CHECK( config1.number == 42 ) +with expansion: + 42 == 42 + +CmdLineTests.cpp:475: +PASSED: + REQUIRE_FALSE( !unusedTokens.empty() ) +with expansion: + !false + +CmdLineTests.cpp:477: +PASSED: + CHECK( config2.description == "some text" ) +with expansion: + "some text" == "some text" + +------------------------------------------------------------------------------- +cmdline + methods + in range +------------------------------------------------------------------------------- +CmdLineTests.cpp:486 +............................................................................... + +CmdLineTests.cpp:490: +PASSED: + REQUIRE( config.index == 3 ) +with expansion: + 3 == 3 + +------------------------------------------------------------------------------- +cmdline + methods + out of range +------------------------------------------------------------------------------- +CmdLineTests.cpp:492 +............................................................................... + +CmdLineTests.cpp:495: +PASSED: + REQUIRE_THROWS( parseInto( cli, argv, config ) ) + +------------------------------------------------------------------------------- +cmdline + flags + set +------------------------------------------------------------------------------- +CmdLineTests.cpp:504 +............................................................................... + +CmdLineTests.cpp:508: +PASSED: + REQUIRE( config.flag ) +with expansion: + true + +------------------------------------------------------------------------------- +cmdline + flags + not set +------------------------------------------------------------------------------- +CmdLineTests.cpp:510 +............................................................................... + +CmdLineTests.cpp:514: +PASSED: + REQUIRE( config.flag == false ) +with expansion: + false == false + +-?, -h, --help display usage information +-l, --list list all (or matching) test cases +-t, --tags list all (or matching) tags +-p, --passing show passing test output +-b, --break break into debugger on failure +-e, --nothrow Skip exception tests +-o, --out output filename +-r, --reporter e.g. console | xml | junit +-n, --name suite name +-a, --abort abort at first failure +-x, --abortx abort after x failures +-w, --warn enables warnings + which test or tests to use + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: It is streamed + Then: It prints the usage strings +------------------------------------------------------------------------------- +CmdLineTests.cpp:628 +............................................................................... + + +No assertions in section, ' Then: It prints the usage strings' + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: Multiple flags are combined +------------------------------------------------------------------------------- +CmdLineTests.cpp:633 +............................................................................... + +CmdLineTests.cpp:635: +PASSED: + CHECK_FALSE( !config.showPassingTests ) +with expansion: + !false + +CmdLineTests.cpp:636: +PASSED: + CHECK_FALSE( !config.noThrow ) +with expansion: + !false + +CmdLineTests.cpp:637: +PASSED: + CHECK_FALSE( !config.breakIntoDebugger ) +with expansion: + !false + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: Multiple flags are combined + Then: All the flags are set +------------------------------------------------------------------------------- +CmdLineTests.cpp:642 +............................................................................... + +CmdLineTests.cpp:643: +PASSED: + CHECK( config.showPassingTests ) +with expansion: + true + +CmdLineTests.cpp:644: +PASSED: + CHECK( config.noThrow ) +with expansion: + true + +CmdLineTests.cpp:645: +PASSED: + CHECK( config.breakIntoDebugger ) +with expansion: + true + =============================================================================== -113 test cases - 49 failed (707 assertions - 106 failed) +115 test cases - 50 failed (728 assertions - 107 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -5864,7 +6104,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -6371,6 +6611,24 @@ TrickyTests.cpp:106 + + + +-?, -h, --help display usage information +-l, --list list all (or matching) test cases +-t, --tags list all (or matching) tags +-p, --passing show passing test output +-b, --break break into debugger on failure +-e, --nothrow Skip exception tests +-o, --out <file name> output filename +-r, --reporter <reporter name[:filename]> e.g. console | xml | junit +-n, --name <name> suite name +-a, --abort abort at first failure +-x, --abortx <number of failures> abort after x failures +-w, --warn <warning name> enables warnings + <test name, pattern or tags> which test or tests to use + + Message from section one @@ -6387,6 +6645,20 @@ Some information hello hello + +-?, -h, --help display usage information +-l, --list list all (or matching) test cases +-t, --tags list all (or matching) tags +-p, --passing show passing test output +-b, --break break into debugger on failure +-e, --nothrow Skip exception tests +-o, --out <file name> output filename +-r, --reporter <reporter name[:filename]> e.g. console | xml | junit +-n, --name <name> suite name +-a, --abort abort at first failure +-x, --abortx <number of failures> abort after x failures +-w, --warn <warning name> enables warnings + <test name, pattern or tags> which test or tests to use An error @@ -12300,9 +12572,247 @@ BDDTests.cpp" line="54">
- + +
+CmdLineTests.cpp" line="420"> + + config.fileName == "filename.ext" + + + "filename.ext" == "filename.ext" + + + +
+
+CmdLineTests.cpp" line="426"> + + config.fileName == "filename.ext" + + + "filename.ext" == "filename.ext" + + + +
+
+CmdLineTests.cpp" line="432"> + + config.fileName == "filename.ext" + + + "filename.ext" == "filename.ext" + + + +
+
+CmdLineTests.cpp" line="438"> + + config.fileName == "%stdout" + + + "%stdout" == "%stdout" + + + +
+
+CmdLineTests.cpp" line="449"> + + config.number == 42 + + + 42 == 42 + + + +
+
+CmdLineTests.cpp" line="453"> + + parseInto( cli, argv, config ) + + + parseInto( cli, argv, config ) + + +CmdLineTests.cpp" line="455"> + + config.number == 0 + + + 0 == 0 + + + +
+
+CmdLineTests.cpp" line="473"> + + config1.number == 42 + + + 42 == 42 + + +CmdLineTests.cpp" line="475"> + + !unusedTokens.empty() + + + !false + + +CmdLineTests.cpp" line="477"> + + config2.description == "some text" + + + "some text" == "some text" + + + +
+
+
+CmdLineTests.cpp" line="490"> + + config.index == 3 + + + 3 == 3 + + + +
+ +
+
+
+CmdLineTests.cpp" line="495"> + + parseInto( cli, argv, config ) + + + parseInto( cli, argv, config ) + + + +
+ +
+
+ +
+
+
+CmdLineTests.cpp" line="508"> + + config.flag + + + true + + + +
+ +
+
+
+CmdLineTests.cpp" line="514"> + + config.flag == false + + + false == false + + + +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+CmdLineTests.cpp" line="635"> + + !config.showPassingTests + + + !false + + +CmdLineTests.cpp" line="636"> + + !config.noThrow + + + !false + + +CmdLineTests.cpp" line="637"> + + !config.breakIntoDebugger + + + !false + + +
+CmdLineTests.cpp" line="643"> + + config.showPassingTests + + + true + + +CmdLineTests.cpp" line="644"> + + config.noThrow + + + true + + +CmdLineTests.cpp" line="645"> + + config.breakIntoDebugger + + + true + + + +
+ +
+ +
+ +
+ - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -14037,18 +14547,18 @@ TrickyTests.cpp:349: s == "7" succeeded for: "7" == "7" [Finished: 'non streamable - with conv. op' All tests passed (1 assertion in 1 test case)] [Running: Anonymous test case 1] -VariadicMacrosTests.cpp:13: succeeded +VariadicMacrosTests.cpp:15: succeeded [with message: anonymous test case] [Finished: 'Anonymous test case 1' All tests passed (1 assertion in 1 test case)] [Running: Test case with one argument] -VariadicMacrosTests.cpp:18: succeeded +VariadicMacrosTests.cpp:20: succeeded [with message: no assertions] [Finished: 'Test case with one argument' All tests passed (1 assertion in 1 test case)] [Running: Variadic macros] [Started section: 'Section with one argument'] -VariadicMacrosTests.cpp:25: succeeded +VariadicMacrosTests.cpp:27: succeeded [with message: no assertions] [End of section: 'Section with one argument' 1 assertion passed] @@ -14147,10 +14657,116 @@ BDDTests.cpp:67: succeeded [End of section: ' Given: A section name that is so long that it cannot fit in a single console width' 1 assertion passed] [Finished: 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' All tests passed (1 assertion in 1 test case)] -[End of group: '~dummy'. 49 of 113 test cases failed (106 of 707 assertions failed)] + +[Running: cmdline] +[Started section: 'plain filename'] +CmdLineTests.cpp:420: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +[End of section: 'plain filename' 1 assertion passed] + +[Started section: 'plain filename with colon'] +CmdLineTests.cpp:426: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +[End of section: 'plain filename with colon' 1 assertion passed] + +[Started section: 'plain filename with ='] +CmdLineTests.cpp:432: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +[End of section: 'plain filename with =' 1 assertion passed] + +[Started section: 'long opt'] +CmdLineTests.cpp:438: config.fileName == "%stdout" succeeded for: "%stdout" == "%stdout" +[End of section: 'long opt' 1 assertion passed] + +[Started section: 'a number'] +CmdLineTests.cpp:449: config.number == 42 succeeded for: 42 == 42 +[End of section: 'a number' 1 assertion passed] + +[Started section: 'not a number'] +CmdLineTests.cpp:453: parseInto( cli, argv, config ) succeeded +CmdLineTests.cpp:455: config.number == 0 succeeded for: 0 == 0 +[End of section: 'not a number' All 2 assertions passed] + +[Started section: 'two parsers'] +CmdLineTests.cpp:473: config1.number == 42 succeeded for: 42 == 42 +CmdLineTests.cpp:475: !unusedTokens.empty() succeeded for: !false +CmdLineTests.cpp:477: config2.description == "some text" succeeded for: "some text" == "some text" +[End of section: 'two parsers' All 3 assertions passed] + +[Started section: 'methods'] +[Started section: 'in range'] +CmdLineTests.cpp:490: config.index == 3 succeeded for: 3 == 3 +[End of section: 'in range' 1 assertion passed] + +[End of section: 'methods' 1 assertion passed] + +[Started section: 'methods'] +[Started section: 'out of range'] +CmdLineTests.cpp:495: parseInto( cli, argv, config ) succeeded +[End of section: 'out of range' 1 assertion passed] + +[End of section: 'methods' 1 assertion passed] + +[Started section: 'flags'] +[Started section: 'set'] +CmdLineTests.cpp:508: config.flag succeeded for: true +[End of section: 'set' 1 assertion passed] + +[End of section: 'flags' 1 assertion passed] + +[Started section: 'flags'] +[Started section: 'not set'] +CmdLineTests.cpp:514: config.flag == false succeeded for: false == false +[End of section: 'not set' 1 assertion passed] + +[End of section: 'flags' 1 assertion passed] + +[Finished: 'cmdline' All tests passed (14 assertions in 1 test case)] +-?, -h, --help display usage information +-l, --list list all (or matching) test cases +-t, --tags list all (or matching) tags +-p, --passing show passing test output +-b, --break break into debugger on failure +-e, --nothrow Skip exception tests +-o, --out output filename +-r, --reporter e.g. console | xml | junit +-n, --name suite name +-a, --abort abort at first failure +-x, --abortx abort after x failures +-w, --warn enables warnings + which test or tests to use -[Testing completed. 49 of 113 test cases failed (106 of 707 assertions failed)] +[Running: Scenario: New Catch commandline interface] +[Started section: ' Given: A built cli parser for Catch'] +[Started section: ' When: It is streamed'] +[Started section: ' Then: It prints the usage strings'] + +No assertions in section, ' Then: It prints the usage strings' + +[End of section: ' Then: It prints the usage strings' 1 assertion failed] + +[End of section: ' When: It is streamed' 1 assertion failed] + +[End of section: ' Given: A built cli parser for Catch' 1 assertion failed] + +[Started section: ' Given: A built cli parser for Catch'] +[Started section: ' When: Multiple flags are combined'] +CmdLineTests.cpp:635: !config.showPassingTests succeeded for: !false +CmdLineTests.cpp:636: !config.noThrow succeeded for: !false +CmdLineTests.cpp:637: !config.breakIntoDebugger succeeded for: !false +[Started section: ' Then: All the flags are set'] +CmdLineTests.cpp:643: config.showPassingTests succeeded for: true +CmdLineTests.cpp:644: config.noThrow succeeded for: true +CmdLineTests.cpp:645: config.breakIntoDebugger succeeded for: true +[End of section: ' Then: All the flags are set' All 3 assertions passed] + +[End of section: ' When: Multiple flags are combined' All 6 assertions passed] + +[End of section: ' Given: A built cli parser for Catch' All 6 assertions passed] + +[Finished: 'Scenario: New Catch commandline interface' 1 test case failed (1 of 7 assertions failed)] +[End of group: '~dummy'. 50 of 115 test cases failed (107 of 728 assertions failed)] + + +[Testing completed. 50 of 115 test cases failed (107 of 728 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] From d4305377b78d81fa11281ac649ef2b67f6e417e5 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 17 May 2013 19:35:33 +0100 Subject: [PATCH 246/296] Fixed inconsistency in reporting of _FALSE (negated) expressions --- include/internal/catch_assertionresult.h | 1 + include/internal/catch_assertionresult.hpp | 16 +++++++++---- include/reporters/catch_reporter_console.hpp | 6 +---- .../SelfTest/Baselines/approvedResults.txt | 24 +++++++++---------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/include/internal/catch_assertionresult.h b/include/internal/catch_assertionresult.h index b3f63e04..fb230adc 100644 --- a/include/internal/catch_assertionresult.h +++ b/include/internal/catch_assertionresult.h @@ -48,6 +48,7 @@ namespace Catch { bool hasExpression() const; bool hasMessage() const; std::string getExpression() const; + std::string getExpressionInMacro() const; bool hasExpandedExpression() const; std::string getExpandedExpression() const; std::string getMessage() const; diff --git a/include/internal/catch_assertionresult.hpp b/include/internal/catch_assertionresult.hpp index 5ba2f458..392270d8 100644 --- a/include/internal/catch_assertionresult.hpp +++ b/include/internal/catch_assertionresult.hpp @@ -21,10 +21,7 @@ namespace Catch { lineInfo( _lineInfo ), capturedExpression( _capturedExpression ), resultDisposition( _resultDisposition ) - { - if( shouldNegate( resultDisposition ) ) - capturedExpression = "!" + _capturedExpression; - } + {} AssertionResult::AssertionResult() {} @@ -58,7 +55,16 @@ namespace Catch { } std::string AssertionResult::getExpression() const { - return m_info.capturedExpression; + if( shouldNegate( m_info.resultDisposition ) ) + return "!" + m_info.capturedExpression; + else + return m_info.capturedExpression; + } + std::string AssertionResult::getExpressionInMacro() const { + if( m_info.macroName.empty() ) + return m_info.capturedExpression; + else + return m_info.macroName + "( " + m_info.capturedExpression + " )"; } bool AssertionResult::hasExpandedExpression() const { diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 99ba0bc3..658492a1 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -191,11 +191,7 @@ namespace Catch { if( result.hasExpression() ) { Colour colourGuard( Colour::OriginalExpression ); stream << " "; - if( !result.getTestMacroName().empty() ) - stream << result.getTestMacroName() << "( "; - stream << result.getExpression(); - if( !result.getTestMacroName().empty() ) - stream << " )"; + stream << result.getExpressionInMacro(); stream << "\n"; } } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index bc909c9a..e676dfb1 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -954,7 +954,7 @@ with expansion: ConditionTests.cpp:323: PASSED: - REQUIRE_FALSE( !false ) + REQUIRE_FALSE( false ) ConditionTests.cpp:325: PASSED: @@ -964,7 +964,7 @@ with expansion: ConditionTests.cpp:326: PASSED: - REQUIRE_FALSE( !falseValue ) + REQUIRE_FALSE( falseValue ) with expansion: !false @@ -976,7 +976,7 @@ with expansion: ConditionTests.cpp:329: PASSED: - REQUIRE_FALSE( !1 == 2 ) + REQUIRE_FALSE( 1 == 2 ) with expansion: !(1 == 2) @@ -998,7 +998,7 @@ with expansion: false ConditionTests.cpp:340: FAILED: - CHECK_FALSE( !true ) + CHECK_FALSE( true ) ConditionTests.cpp:342: FAILED: CHECK( !trueValue ) @@ -1006,7 +1006,7 @@ with expansion: false ConditionTests.cpp:343: FAILED: - CHECK_FALSE( !trueValue ) + CHECK_FALSE( trueValue ) with expansion: !true @@ -1016,7 +1016,7 @@ with expansion: false ConditionTests.cpp:346: FAILED: - CHECK_FALSE( !1 == 1 ) + CHECK_FALSE( 1 == 1 ) with expansion: !(1 == 1) @@ -5169,7 +5169,7 @@ with expansion: TrickyTests.cpp:281: PASSED: - REQUIRE_FALSE( !is_true::value ) + REQUIRE_FALSE( is_true::value ) with expansion: !false @@ -5193,7 +5193,7 @@ with expansion: TrickyTests.cpp:315: PASSED: - CHECK_FALSE( !False ) + CHECK_FALSE( False ) with expansion: !false @@ -5639,7 +5639,7 @@ with expansion: CmdLineTests.cpp:475: PASSED: - REQUIRE_FALSE( !unusedTokens.empty() ) + REQUIRE_FALSE( unusedTokens.empty() ) with expansion: !false @@ -5739,19 +5739,19 @@ CmdLineTests.cpp:633 CmdLineTests.cpp:635: PASSED: - CHECK_FALSE( !config.showPassingTests ) + CHECK_FALSE( config.showPassingTests ) with expansion: !false CmdLineTests.cpp:636: PASSED: - CHECK_FALSE( !config.noThrow ) + CHECK_FALSE( config.noThrow ) with expansion: !false CmdLineTests.cpp:637: PASSED: - CHECK_FALSE( !config.breakIntoDebugger ) + CHECK_FALSE( config.breakIntoDebugger ) with expansion: !false From d44f2cf40f67e866c7c53080f52db5fd59b5db41 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 20 May 2013 08:31:12 +0100 Subject: [PATCH 247/296] Added binding to free functions (and renamed hierarchy) --- projects/SelfTest/CmdLineTests.cpp | 97 ++++++++++++++++++++---------- 1 file changed, 64 insertions(+), 33 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 0d7d4875..b65d9b19 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -52,41 +52,41 @@ namespace Clara { } template - struct IBoundMember { - virtual ~IBoundMember() {} + struct IArgFunction { + virtual ~IArgFunction() {} virtual void set( ConfigT& config, std::string const& value ) const = 0; virtual void setFlag( ConfigT& config ) const = 0; virtual bool takesArg() const = 0; - virtual IBoundMember* clone() const = 0; + virtual IArgFunction* clone() const = 0; }; template - class BoundField { + class BoundArgFunction { public: - BoundField( IBoundMember* _boundMember ) : boundMember( _boundMember ) {} - BoundField( BoundField const& other ) : boundMember( other.boundMember->clone() ) {} - BoundField& operator = ( BoundField const& other ) { - IBoundMember newMember = other.clone(); - delete boundMember; - boundMember = newMember; + BoundArgFunction( IArgFunction* _functionObj ) : functionObj( _functionObj ) {} + BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj->clone() ) {} + BoundArgFunction& operator = ( BoundArgFunction const& other ) { + IArgFunction newFunctionObj = other.clone(); + delete functionObj; + functionObj = newFunctionObj; return *this; } - ~BoundField() { delete boundMember; } + ~BoundArgFunction() { delete functionObj; } void set( ConfigT& config, std::string const& value ) const { - boundMember->set( config, value ); + functionObj->set( config, value ); } void setFlag( ConfigT& config ) const { - boundMember->setFlag( config ); + functionObj->setFlag( config ); } - bool takesArg() const { return boundMember->takesArg(); } + bool takesArg() const { return functionObj->takesArg(); } private: - IBoundMember* boundMember; + IArgFunction* functionObj; }; template - struct BoundDataMember : IBoundMember{ + struct BoundDataMember : IArgFunction{ BoundDataMember( M C::* _member ) : member( _member ) {} virtual void set( C& p, std::string const& stringValue ) const { convertInto( stringValue, p.*member ); @@ -95,11 +95,11 @@ namespace Clara { convertInto( true, p.*member ); } virtual bool takesArg() const { return !IsBool::value; } - virtual IBoundMember* clone() const { return new BoundDataMember( *this ); } + virtual IArgFunction* clone() const { return new BoundDataMember( *this ); } M C::* member; }; template - struct BoundUnaryMethod : IBoundMember{ + struct BoundUnaryMethod : IArgFunction{ BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {} virtual void set( C& p, std::string const& stringValue ) const { typename RemoveConstRef::type value; @@ -112,11 +112,11 @@ namespace Clara { (p.*member)( value ); } virtual bool takesArg() const { return !IsBool::value; } - virtual IBoundMember* clone() const { return new BoundUnaryMethod( *this ); } + virtual IArgFunction* clone() const { return new BoundUnaryMethod( *this ); } void (C::*member)( M ); }; template - struct BoundNullaryMethod : IBoundMember{ + struct BoundNullaryMethod : IArgFunction{ BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {} virtual void set( C& p, std::string const& stringValue ) const { bool value; @@ -128,21 +128,42 @@ namespace Clara { (p.*member)(); } virtual bool takesArg() const { return false; } - virtual IBoundMember* clone() const { return new BoundNullaryMethod( *this ); } + virtual IArgFunction* clone() const { return new BoundNullaryMethod( *this ); } void (C::*member)(); }; + + template + struct BoundUnaryFunction : IArgFunction{ + BoundUnaryFunction( void (*_function)( C& ) ) : function( _function ) {} + virtual void set( C& obj, std::string const& stringValue ) const { + bool value; + convertInto( stringValue, value ); + if( value ) + function( obj ); + } + virtual void setFlag( C& p ) const { + function( p ); + } + virtual bool takesArg() const { return false; } + virtual IArgFunction* clone() const { return new BoundUnaryFunction( *this ); } + void (*function)( C& ); + }; template - BoundField makeBoundField( M C::* _member ) { - return BoundField( new BoundDataMember( _member ) ); + BoundArgFunction makeBoundField( M C::* _member ) { + return BoundArgFunction( new BoundDataMember( _member ) ); } template - BoundField makeBoundField( void (C::*_member)( M ) ) { - return BoundField( new BoundUnaryMethod( _member ) ); + BoundArgFunction makeBoundField( void (C::*_member)( M ) ) { + return BoundArgFunction( new BoundUnaryMethod( _member ) ); } template - BoundField makeBoundField( void (C::*_member)() ) { - return BoundField( new BoundNullaryMethod( _member ) ); + BoundArgFunction makeBoundField( void (C::*_member)() ) { + return BoundArgFunction( new BoundNullaryMethod( _member ) ); + } + template + BoundArgFunction makeBoundField( void (*_function)( C& ) ) { + return BoundArgFunction( new BoundUnaryFunction( _function ) ); } } // namespace Detail @@ -228,7 +249,7 @@ namespace Clara { }; struct Arg { - Arg( Detail::BoundField const& _boundField ) : boundField( _boundField ) {} + Arg( Detail::BoundArgFunction const& _boundField ) : boundField( _boundField ) {} bool hasShortName( std::string const& shortName ) const { for( std::vector::const_iterator @@ -280,7 +301,7 @@ namespace Clara { return oss.str(); } - Detail::BoundField boundField; + Detail::BoundArgFunction boundField; std::vector shortNames; std::string longName; std::string description; @@ -542,12 +563,14 @@ struct Config { std::vector warnings; std::vector testsOrTags; - void abortAfterFirst() { abortAfter = 1; } +// void abortAfterFirst() { abortAfter = 1; } void abortAfterX( int x ) { abortAfter = x; } void addWarning( std::string const& _warning ) { warnings.push_back( _warning ); } void addTestOrTags( std::string const& _testSpec ) { testsOrTags.push_back( _testSpec ); } }; +inline void abortAfterFirst( Config& config ) { config.abortAfter = 1; } + SCENARIO( "New Catch commandline interface", "[cli]" ) { @@ -589,10 +612,10 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { .describe( "output filename" ) .shortOpt( "o") .longOpt( "out" ) - .argName( "file name" ); + .argName( "filename" ); cli.bind( &Config::reporter ) - .describe( "e.g. console | xml | junit" ) + .describe( "reporter to use - defaults to console" ) .shortOpt( "r") .longOpt( "reporter" ) .argName( "reporter name[:filename]" ); @@ -603,7 +626,7 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { .longOpt( "name" ) .argName( "name" ); - cli.bind( &Config::abortAfterFirst ) + cli.bind( &abortAfterFirst ) .describe( "abort at first failure" ) .shortOpt( "a") .longOpt( "abort" ); @@ -645,6 +668,14 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { CHECK( config.breakIntoDebugger ); } } + WHEN( "A flag is set via a nullary method" ) { + CHECK( config.abortAfter == 0 ); + + const char* argv[] = { "test", "-a" }; + parseInto( cli, argv, config ); + + REQUIRE( config.abortAfter == 1 ); + } } } From 3dde25be7d05ae63569557b2c92cc19f813a82d5 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 20 May 2013 18:40:51 +0100 Subject: [PATCH 248/296] Clara: support for binary functions --- projects/SelfTest/CmdLineTests.cpp | 45 ++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index b65d9b19..6624e8cd 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -149,6 +149,24 @@ namespace Clara { void (*function)( C& ); }; + template + struct BoundBinaryFunction : IArgFunction{ + BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {} + virtual void set( C& obj, std::string const& stringValue ) const { + typename RemoveConstRef::type value; + convertInto( stringValue, value ); + function( obj, value ); + } + virtual void setFlag( C& obj ) const { + typename RemoveConstRef::type value; + convertInto( true, value ); + function( obj, value ); + } + virtual bool takesArg() const { return !IsBool::value; } + virtual IArgFunction* clone() const { return new BoundBinaryFunction( *this ); } + void (*function)( C&, T ); + }; + template BoundArgFunction makeBoundField( M C::* _member ) { return BoundArgFunction( new BoundDataMember( _member ) ); @@ -165,6 +183,10 @@ namespace Clara { BoundArgFunction makeBoundField( void (*_function)( C& ) ) { return BoundArgFunction( new BoundUnaryFunction( _function ) ); } + template + BoundArgFunction makeBoundField( void (*_function)( C&, T ) ) { + return BoundArgFunction( new BoundBinaryFunction( _function ) ); + } } // namespace Detail struct Parser { @@ -564,12 +586,15 @@ struct Config { std::vector testsOrTags; // void abortAfterFirst() { abortAfter = 1; } - void abortAfterX( int x ) { abortAfter = x; } - void addWarning( std::string const& _warning ) { warnings.push_back( _warning ); } - void addTestOrTags( std::string const& _testSpec ) { testsOrTags.push_back( _testSpec ); } +// void abortAfterX( int x ) { abortAfter = x; } +// void addWarning( std::string const& _warning ) { warnings.push_back( _warning ); } +// void addTestOrTags( std::string const& _testSpec ) { testsOrTags.push_back( _testSpec ); } }; inline void abortAfterFirst( Config& config ) { config.abortAfter = 1; } +inline void abortAfterX( Config& config, int x ) { config.abortAfter = x; } +inline void addWarning( Config& config, std::string const& _warning ) { config.warnings.push_back( _warning ); } +inline void addTestOrTags( Config& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); } SCENARIO( "New Catch commandline interface", "[cli]" ) { @@ -631,19 +656,19 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { .shortOpt( "a") .longOpt( "abort" ); - cli.bind( &Config::abortAfterX ) + cli.bind( &abortAfterX ) .describe( "abort after x failures" ) .shortOpt( "x") .longOpt( "abortx" ) .argName( "number of failures" ); - cli.bind( &Config::addWarning ) + cli.bind( &addWarning ) .describe( "enables warnings" ) .shortOpt( "w") .longOpt( "warn" ) .argName( "warning name" ); - cli.bind( &Config::addTestOrTags ) + cli.bind( &addTestOrTags ) .describe( "which test or tests to use" ) .argName( "test name, pattern or tags" ); @@ -676,6 +701,14 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { REQUIRE( config.abortAfter == 1 ); } + WHEN( "A flag is set via a unary method" ) { + CHECK( config.abortAfter == 0 ); + + const char* argv[] = { "test", "-x", "2" }; + parseInto( cli, argv, config ); + + REQUIRE( config.abortAfter == 2 ); + } } } From 30cb460d426c426e86b1196ec91ed4ecb3f71da0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 20 May 2013 18:45:33 +0100 Subject: [PATCH 249/296] Clara: added test for positional arg --- projects/SelfTest/CmdLineTests.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 6624e8cd..6689b60c 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -584,11 +584,6 @@ struct Config { std::string reporter; std::vector warnings; std::vector testsOrTags; - -// void abortAfterFirst() { abortAfter = 1; } -// void abortAfterX( int x ) { abortAfter = x; } -// void addWarning( std::string const& _warning ) { warnings.push_back( _warning ); } -// void addTestOrTags( std::string const& _testSpec ) { testsOrTags.push_back( _testSpec ); } }; inline void abortAfterFirst( Config& config ) { config.abortAfter = 1; } @@ -699,7 +694,8 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { const char* argv[] = { "test", "-a" }; parseInto( cli, argv, config ); - REQUIRE( config.abortAfter == 1 ); + THEN( "The flag is set" ) + REQUIRE( config.abortAfter == 1 ); } WHEN( "A flag is set via a unary method" ) { CHECK( config.abortAfter == 0 ); @@ -707,7 +703,18 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { const char* argv[] = { "test", "-x", "2" }; parseInto( cli, argv, config ); - REQUIRE( config.abortAfter == 2 ); + THEN( "The flag is set" ) + REQUIRE( config.abortAfter == 2 ); + } + WHEN( "A positional argument is supplied" ) { + + const char* argv[] = { "test", "[hello]" }; + parseInto( cli, argv, config ); + + THEN( "The argument is in the testOrTags collection" ) { + REQUIRE( config.testsOrTags.size() == 1 ); + REQUIRE( config.testsOrTags[0] == "[hello]" ); + } } } From ed79d726be3b5066aa9b620da0eb10d9fcdc08f7 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 21 May 2013 08:15:50 +0100 Subject: [PATCH 250/296] Clara: support for positional arguments --- projects/SelfTest/CmdLineTests.cpp | 178 +++++++++++++++++++++-------- 1 file changed, 129 insertions(+), 49 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 6689b60c..1c65552a 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -235,43 +235,8 @@ namespace Clara { template class CommandLine { - class ArgBinder { - public: - ArgBinder( CommandLine* cl ) : m_cl( cl ) {} - - template - ArgBinder& bind( F f ) { - if( !m_cl->m_args.empty() ) - m_cl->m_args.back().validate(); - m_cl->m_args.push_back( Arg( Detail::makeBoundField( f ) ) ); - return *this; - } - ArgBinder& shortOpt( std::string const& name ) { - m_cl->m_args.back().shortNames.push_back( name ); - return *this; - } - ArgBinder& longOpt( std::string const& name ) { - m_cl->m_args.back().longName = name; - return *this; - } - ArgBinder& describe( std::string const& description ) { - m_cl->m_args.back().description = description; - return *this; - } - ArgBinder& argName( std::string const& argName ) { - m_cl->m_args.back().argName = argName; - return *this; - } - ArgBinder& position( int /*position*/ ) { - // !TBD: Support for positional args in fixed positions - return *this; - } - private: - CommandLine* m_cl; - }; - struct Arg { - Arg( Detail::BoundArgFunction const& _boundField ) : boundField( _boundField ) {} + Arg( Detail::BoundArgFunction const& _boundField ) : boundField( _boundField ), position( -1 ) {} bool hasShortName( std::string const& shortName ) const { for( std::vector::const_iterator @@ -288,8 +253,11 @@ namespace Clara { bool takesArg() const { return !argName.empty(); } - bool isPositional() const { - return shortNames.empty() && longName.empty(); + bool isFixedPositional() const { + return position != -1; + } + bool isAnyPositional() const { + return position == -1 && shortNames.empty() && longName.empty(); } std::string dbgName() const { if( !longName.empty() ) @@ -328,18 +296,70 @@ namespace Clara { std::string longName; std::string description; std::string argName; + int position; + }; + + class ArgBinder { + public: + template + ArgBinder( CommandLine* cl, F f ) + : m_cl( cl ), + m_arg( Detail::makeBoundField( f ) ) + {} + ArgBinder( ArgBinder& other ) + : m_cl( other.m_cl ), + m_arg( other.m_arg ) + { + other.m_cl = NULL; + } + ~ArgBinder() { + if( m_cl ) { + m_arg.validate(); + if( m_arg.isFixedPositional() ) + m_cl->m_positionalArgs.push_back( m_arg ); + else if( m_arg.isAnyPositional() ) { + if( m_cl->m_arg.get() ) + throw std::logic_error( "Only one unpositional argument can be added" ); + m_cl->m_arg = std::auto_ptr( new Arg( m_arg ) ); + } + else + m_cl->m_options.push_back( m_arg ); + } + } + ArgBinder& shortOpt( std::string const& name ) { + m_arg.shortNames.push_back( name ); + return *this; + } + ArgBinder& longOpt( std::string const& name ) { + m_arg.longName = name; + return *this; + } + ArgBinder& describe( std::string const& description ) { + m_arg.description = description; + return *this; + } + ArgBinder& argName( std::string const& argName ) { + m_arg.argName = argName; + return *this; + } + ArgBinder& position( int position ) { + m_arg.position = position; + return *this; + } + private: + CommandLine* m_cl; + Arg m_arg; }; public: template ArgBinder bind( F f ) { - ArgBinder binder( this ); - binder.bind( f ); + ArgBinder binder( this, f ); return binder; } void usage( std::ostream& os ) const { - typename std::vector::const_iterator itBegin = m_args.begin(), itEnd = m_args.end(), it; + typename std::vector::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it; std::size_t maxWidth = 0; for( it = itBegin; it != itEnd; ++it ) maxWidth = (std::max)( maxWidth, it->commands().size() ); @@ -378,14 +398,20 @@ namespace Clara { } std::vector populate( std::vector const& tokens, ConfigT& config ) const { - if( m_args.empty() ) + if( m_options.empty() && m_positionalArgs.empty() ) throw std::logic_error( "No options or arguments specified" ); - m_args.back().validate(); + std::vector unusedTokens = populateOptions( tokens, config ); + unusedTokens = populateFixedArgs( unusedTokens, config ); + unusedTokens = populateFloatingArgs( unusedTokens, config ); + return unusedTokens; + } + + std::vector populateOptions( std::vector const& tokens, ConfigT& config ) const { std::vector unusedTokens; for( std::size_t i = 0; i < tokens.size(); ++i ) { Parser::Token const& token = tokens[i]; - typename std::vector::const_iterator it = m_args.begin(), itEnd = m_args.end(); + typename std::vector::const_iterator it = m_options.begin(), itEnd = m_options.end(); for(; it != itEnd; ++it ) { Arg const& arg = *it; @@ -401,19 +427,50 @@ namespace Clara { } break; } - else if( token.type == Parser::Token::Positional && arg.isPositional() ) { - arg.boundField.set( config, token.data ); - break; - } } if( it == itEnd ) unusedTokens.push_back( token ); } return unusedTokens; } + std::vector populateFixedArgs( std::vector const& tokens, ConfigT& config ) const { + std::vector unusedTokens; + int position = 1; + for( std::size_t i = 0; i < tokens.size(); ++i ) { + Parser::Token const& token = tokens[i]; + typename std::vector::const_iterator it = m_positionalArgs.begin(), itEnd = m_positionalArgs.end(); + for(; it != itEnd; ++it ) { + Arg const& arg = *it; + if( token.type == Parser::Token::Positional ) + if( arg.position == position ) { + position++; + arg.boundField.set( config, token.data ); + break; + } + } + if( it == itEnd ) + unusedTokens.push_back( token ); + } + return unusedTokens; + } + std::vector populateFloatingArgs( std::vector const& tokens, ConfigT& config ) const { + if( !m_arg.get() ) + return tokens; + std::vector unusedTokens; + for( std::size_t i = 0; i < tokens.size(); ++i ) { + Parser::Token const& token = tokens[i]; + if( token.type == Parser::Token::Positional ) + m_arg->boundField.set( config, token.data ); + else + unusedTokens.push_back( token ); + } + return unusedTokens; + } private: - std::vector m_args; + std::vector m_options; + std::vector m_positionalArgs; + std::auto_ptr m_arg; }; } // end namespace Clara @@ -432,6 +489,9 @@ struct TestOpt { int number; int index; bool flag; + std::string firstPos; + std::string secondPos; + std::string unpositional; void setValidIndex( int i ) { if( i < 0 || i > 10 ) @@ -557,6 +617,26 @@ TEST_CASE( "cmdline" ) { REQUIRE( config.flag == false ); } } + SECTION( "positional" ) { + cli.bind( &TestOpt::secondPos ) + .describe( "Second position" ) + .argName( "second arg" ) + .position( 2 ); + cli.bind( &TestOpt::unpositional ) + .argName( "any arg" ) + .describe( "Unpositional" ); + cli.bind( &TestOpt::firstPos ) + .describe( "First position" ) + .argName( "first arg" ) + .position( 1 ); + + const char* argv[] = { "test", "-f", "1st", "-o", "filename", "2nd", "3rd" }; + parseInto( cli, argv, config ); + + REQUIRE( config.firstPos == "1st" ); + REQUIRE( config.secondPos == "2nd" ); + REQUIRE( config.unpositional == "3rd" ); + } } struct Config { From b7632659f58dd43a4f88cc32b294b6925b6ba4b7 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 21 May 2013 19:21:24 +0100 Subject: [PATCH 251/296] Clara: Usage strings for args --- projects/SelfTest/CmdLineTests.cpp | 106 +++++++++++++++++++++-------- 1 file changed, 77 insertions(+), 29 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 1c65552a..868740b0 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -315,8 +315,11 @@ namespace Clara { ~ArgBinder() { if( m_cl ) { m_arg.validate(); - if( m_arg.isFixedPositional() ) - m_cl->m_positionalArgs.push_back( m_arg ); + if( m_arg.isFixedPositional() ) { + m_cl->m_positionalArgs.insert( std::make_pair( m_arg.position, m_arg ) ); + if( m_arg.position > m_cl->m_highestSpecifiedArgPosition ) + m_cl->m_highestSpecifiedArgPosition = m_arg.position; + } else if( m_arg.isAnyPositional() ) { if( m_cl->m_arg.get() ) throw std::logic_error( "Only one unpositional argument can be added" ); @@ -352,43 +355,89 @@ namespace Clara { }; public: + + CommandLine() : m_highestSpecifiedArgPosition( 0 ) {} + template ArgBinder bind( F f ) { ArgBinder binder( this, f ); return binder; } - void usage( std::ostream& os ) const { + void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = CATCH_CONFIG_CONSOLE_WIDTH ) const { typename std::vector::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it; std::size_t maxWidth = 0; for( it = itBegin; it != itEnd; ++it ) maxWidth = (std::max)( maxWidth, it->commands().size() ); for( it = itBegin; it != itEnd; ++it ) { - Catch::Text usage( it->commands(), Catch::TextAttributes().setWidth( maxWidth ) ); + Catch::Text usage( it->commands(), Catch::TextAttributes() + .setWidth( maxWidth+indent ) + .setIndent( indent ) ); // !TBD handle longer usage strings - Catch::Text desc( it->description, Catch::TextAttributes().setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxWidth -3 ) ); + Catch::Text desc( it->description, Catch::TextAttributes() + .setWidth( width - maxWidth -3 ) ); for( std::size_t i = 0; i < std::max( usage.size(), desc.size() ); ++i ) { std::string usageCol = i < usage.size() ? usage[i] : ""; os << usageCol; if( i < desc.size() && !desc[i].empty() ) - os << std::string( 2 + maxWidth - usageCol.size(), ' ' ) + os << std::string( indent + 2 + maxWidth - usageCol.size(), ' ' ) << desc[i]; os << "\n"; } } } - std::string usage() const { + std::string optUsage() const { std::ostringstream oss; - usage( oss ); + optUsage( oss ); return oss.str(); } - friend std::ostream& operator << ( std::ostream& os, CommandLine const& parser ) { - parser.usage( os ); - return os; + + void argSynopsis( std::ostream& os ) const { + for( int i = 1; i <= m_highestSpecifiedArgPosition; ++i ) { + if( i > 1 ) + os << " "; + typename std::map::const_iterator it = m_positionalArgs.find( i ); + if( it != m_positionalArgs.end() ) + os << "<" << it->second.argName << ">"; + else if( m_arg.get() ) + os << "<" << m_arg->argName << ">"; + else + throw std::logic_error( "non consecutive positional arguments with no floating args" ); + } + // !TBD No indication of mandatory args + if( m_arg.get() ) { + if( m_highestSpecifiedArgPosition > 1 ) + os << " "; + os << "[<" << m_arg->argName << "> ...]"; + } } + std::string argSynopsis() const { + std::ostringstream oss; + argSynopsis( oss ); + return oss.str(); + } + + + void usage( std::ostream& os, std::string const& procName ) const { + os << "usage:\n"; + os << " " << procName << " "; + argSynopsis( os ); + if( !m_options.empty() ) { + os << " [options]\n\n"; + os << "where options are: \n"; + optUsage( os, 2 ); + + } + os << "\n"; + } + std::string usage( std::string const& procName ) const { + std::ostringstream oss; + usage( oss, procName ); + return oss.str(); + } std::vector parseInto( int argc, char const* argv[], ConfigT& config ) const { std::vector tokens; @@ -438,18 +487,13 @@ namespace Clara { int position = 1; for( std::size_t i = 0; i < tokens.size(); ++i ) { Parser::Token const& token = tokens[i]; - typename std::vector::const_iterator it = m_positionalArgs.begin(), itEnd = m_positionalArgs.end(); - for(; it != itEnd; ++it ) { - Arg const& arg = *it; - if( token.type == Parser::Token::Positional ) - if( arg.position == position ) { - position++; - arg.boundField.set( config, token.data ); - break; - } - } - if( it == itEnd ) + typename std::map::const_iterator it = m_positionalArgs.find( position ); + if( it != m_positionalArgs.end() ) + it->second.boundField.set( config, token.data ); + else unusedTokens.push_back( token ); + if( token.type == Parser::Token::Positional ) + position++; } return unusedTokens; } @@ -469,8 +513,9 @@ namespace Clara { private: std::vector m_options; - std::vector m_positionalArgs; + std::map m_positionalArgs; std::auto_ptr m_arg; + int m_highestSpecifiedArgPosition; }; } // end namespace Clara @@ -514,7 +559,7 @@ TEST_CASE( "cmdline" ) { .describe( "specifies output file" ) .shortOpt( "o" ) .longOpt( "output" ) - .argName( "" ); + .argName( "filename" ); SECTION( "plain filename" ) { const char* argv[] = { "test", "-o filename.ext" }; @@ -543,7 +588,7 @@ TEST_CASE( "cmdline" ) { cli.bind( &TestOpt::number ) .shortOpt( "n" ) - .argName( "" ); + .argName( "an integral value" ); SECTION( "a number" ) { const char* argv[] = { "test", "-n 42" }; @@ -568,7 +613,7 @@ TEST_CASE( "cmdline" ) { .describe( "description" ) .shortOpt( "d" ) .longOpt( "description" ) - .argName( "" ); + .argName( "some text" ); const char* argv[] = { "test", "-n 42", "-d some text" }; std::vector unusedTokens = parseInto( cli, argv, config1 ); @@ -584,7 +629,7 @@ TEST_CASE( "cmdline" ) { cli.bind( &TestOpt::setValidIndex ) .describe( "An index, which is an integer between 0 and 10, inclusive" ) .shortOpt( "i" ) - .argName( "" ); + .argName( "index" ); SECTION( "in range" ) { const char* argv[] = { "test", "-i 3" }; @@ -630,6 +675,8 @@ TEST_CASE( "cmdline" ) { .argName( "first arg" ) .position( 1 ); + std::cout << cli.usage( "testApp" ) << std::endl; + const char* argv[] = { "test", "-f", "1st", "-o", "filename", "2nd", "3rd" }; parseInto( cli, argv, config ); @@ -747,9 +794,9 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { .describe( "which test or tests to use" ) .argName( "test name, pattern or tags" ); - WHEN( "It is streamed" ) + WHEN( "We ask for usage strings" ) THEN( "It prints the usage strings" ) - std::cout << cli << std::endl; + std::cout << cli.usage( "CatchTestApp" ) << std::endl; Config config; @@ -798,6 +845,7 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { } } + // !TBD: print positional args in usage } // !TBD still support this? From ab6dd55fcf81fe08b76c3ced09cb7282157c29b5 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 23 May 2013 19:01:10 +0100 Subject: [PATCH 252/296] Clara: formatting and code tweaks --- projects/SelfTest/CmdLineTests.cpp | 36 ++++++------------------------ 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 868740b0..9fee6d25 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -422,14 +422,11 @@ namespace Clara { void usage( std::ostream& os, std::string const& procName ) const { - os << "usage:\n"; - os << " " << procName << " "; + os << "usage:\n " << procName << " "; argSynopsis( os ); if( !m_options.empty() ) { - os << " [options]\n\n"; - os << "where options are: \n"; - optUsage( os, 2 ); - + os << " [options]\n\nwhere options are: \n"; + optUsage( os, 2 ); } os << "\n"; } @@ -561,19 +558,19 @@ TEST_CASE( "cmdline" ) { .longOpt( "output" ) .argName( "filename" ); - SECTION( "plain filename" ) { + SECTION( "arg separated by spaces" ) { const char* argv[] = { "test", "-o filename.ext" }; parseInto( cli, argv, config ); CHECK( config.fileName == "filename.ext" ); } - SECTION( "plain filename with colon" ) { + SECTION( "arg separated by colon" ) { const char* argv[] = { "test", "-o:filename.ext" }; parseInto( cli, argv, config ); CHECK( config.fileName == "filename.ext" ); } - SECTION( "plain filename with =" ) { + SECTION( "arg separated by =" ) { const char* argv[] = { "test", "-o=filename.ext" }; parseInto( cli, argv, config ); @@ -765,7 +762,7 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { .describe( "reporter to use - defaults to console" ) .shortOpt( "r") .longOpt( "reporter" ) - .argName( "reporter name[:filename]" ); + .argName( "name[:filename]" ); cli.bind( &Config::suiteName ) .describe( "suite name" ) @@ -843,25 +840,6 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { REQUIRE( config.testsOrTags[0] == "[hello]" ); } } - } - // !TBD: print positional args in usage } - -// !TBD still support this? -// Clara::Parser -// ( "-h, --help display usage information", &Config::showHelp ) -// ( "-l, --list list all (or matching) test cases", &Config::listTests ) -// ( "-t, --tags list all (or matching) tags", &Config::listTags ) -// ( "-p, --passing show passing test output", &Config::showPassingTests ) -// ( "-b, --break break into debugger on failure", &Config::breakIntoDebugger ) -// ( "-e, --nothrow Skip exception tests", &Config::noThrow ) -// ( "-o, --out output filename", &Config::fileName ) -// ( "-n, --name suite name", &Config::suiteName ) -// ( "-a, --abort abort at first failure", &Config::abortAfterFirst ) -// ( "-x, --abortx abort after x failures", &Config::abortAfterX ) -// ( "-w, --warn enables warnings", &Config::addWarning ); -// .parseInto( argc, argv, config ); - #endif - From 1e547afe79c6cc6de13403ec602690b47e726902 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 24 May 2013 19:23:44 +0100 Subject: [PATCH 253/296] Tweaked some option names and added verbosity --- projects/SelfTest/CmdLineTests.cpp | 53 ++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 9fee6d25..137f29fc 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -687,21 +687,26 @@ struct Config { Config() : listTests( false ), listTags( false ), - showPassingTests( false ), + showSuccessfulTests( false ), breakIntoDebugger( false ), noThrow( false ), showHelp( false ), - abortAfter( 0 ) + abortAfter( 0 ), + verbosity( Normal ) {} bool listTests; bool listTags; - bool showPassingTests; + bool listReporters; + + bool showSuccessfulTests; bool breakIntoDebugger; bool noThrow; bool showHelp; - + int abortAfter; + enum Verbosity { NoOutput = 0, Quiet, Normal }; + Verbosity verbosity; std::string reporterName; std::string fileName; std::string suiteName; @@ -714,6 +719,7 @@ inline void abortAfterFirst( Config& config ) { config.abortAfter = 1; } inline void abortAfterX( Config& config, int x ) { config.abortAfter = x; } inline void addWarning( Config& config, std::string const& _warning ) { config.warnings.push_back( _warning ); } inline void addTestOrTags( Config& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); } +inline void setVerbosity( Config& config, int level ) { config.verbosity = (Config::Verbosity)level; } SCENARIO( "New Catch commandline interface", "[cli]" ) { @@ -730,17 +736,21 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { cli.bind( &Config::listTests ) .describe( "list all (or matching) test cases" ) .shortOpt( "l") - .longOpt( "list" ); + .longOpt( "list-tests" ); cli.bind( &Config::listTags ) .describe( "list all (or matching) tags" ) .shortOpt( "t") - .longOpt( "tags" ); + .longOpt( "list-tags" ); - cli.bind( &Config::showPassingTests ) - .describe( "show passing test output" ) - .shortOpt( "p") - .longOpt( "passing" ); + cli.bind( &Config::listTags ) + .describe( "list all reporters" ) + .longOpt( "list-reporters" ); + + cli.bind( &Config::showSuccessfulTests ) + .describe( "include successful tests in output" ) + .shortOpt( "s") + .longOpt( "success" ); cli.bind( &Config::breakIntoDebugger ) .describe( "break into debugger on failure" ) @@ -782,11 +792,17 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { .argName( "number of failures" ); cli.bind( &addWarning ) - .describe( "enables warnings" ) + .describe( "enable warnings" ) .shortOpt( "w") .longOpt( "warn" ) .argName( "warning name" ); + cli.bind( &setVerbosity ) + .describe( "level of verbosity (0=no output)" ) + .shortOpt( "v") + .longOpt( "verbosity" ) + .argName( "level" ); + cli.bind( &addTestOrTags ) .describe( "which test or tests to use" ) .argName( "test name, pattern or tags" ); @@ -799,15 +815,15 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { WHEN( "Multiple flags are combined" ) { - CHECK_FALSE( config.showPassingTests ); + CHECK_FALSE( config.showSuccessfulTests ); CHECK_FALSE( config.noThrow ); CHECK_FALSE( config.breakIntoDebugger ); - const char* argv[] = { "test", "-peb" }; + const char* argv[] = { "test", "-seb" }; parseInto( cli, argv, config ); THEN( "All the flags are set" ) { - CHECK( config.showPassingTests ); + CHECK( config.showSuccessfulTests ); CHECK( config.noThrow ); CHECK( config.breakIntoDebugger ); } @@ -840,6 +856,15 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { REQUIRE( config.testsOrTags[0] == "[hello]" ); } } + WHEN( "And enum opt is set by numeric value" ) { + CHECK( config.verbosity == Config::Normal ); + + const char* argv[] = { "test", "-v 0" }; + parseInto( cli, argv, config ); + + THEN( "The member is set to the enum value" ) + REQUIRE( config.verbosity == Config::NoOutput ); + } } } #endif From 10fa0593db7352228793dc0014b713202d288947 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 27 May 2013 10:52:58 +0100 Subject: [PATCH 254/296] Moved Clara into its (her?) own file --- include/internal/clara.h | 519 +++++++++++++++++ projects/SelfTest/CmdLineTests.cpp | 541 +----------------- .../CatchSelfTest.xcodeproj/project.pbxproj | 10 + 3 files changed, 556 insertions(+), 514 deletions(-) create mode 100644 include/internal/clara.h diff --git a/include/internal/clara.h b/include/internal/clara.h new file mode 100644 index 00000000..0fad01dd --- /dev/null +++ b/include/internal/clara.h @@ -0,0 +1,519 @@ +/* + * Created by Phil on 25/05/2013. + * Copyright 2013 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_CLARA_H_INCLUDED +#define TWOBLUECUBES_CLARA_H_INCLUDED + +#include "catch_text.h" // This will get moved out too + +namespace Clara { + namespace Detail { + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + + template struct IsBool { static const bool value = false; }; + template<> struct IsBool { static const bool value = true; }; + + template + void convertInto( std::string const& _source, T& _dest ) { + std::stringstream ss; + ss << _source; + ss >> _dest; + if( ss.fail() ) + throw std::runtime_error( "Unable to convert " + _source + " to destination type" ); + } + inline void convertInto( std::string const& _source, std::string& _dest ) { + _dest = _source; + } + inline void convertInto( std::string const& _source, bool& _dest ) { + std::string sourceLC = _source; + std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower ); + if( sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) + _dest = true; + else if( sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) + _dest = false; + else + throw std::runtime_error( "Expected a boolean value but did recognise: '" + _source + "'" ); + } + inline void convertInto( bool _source, bool& _dest ) { + _dest = _source; + } + template + inline void convertInto( bool, T& ) { + throw std::runtime_error( "Invalid conversion" ); + } + + template + struct IArgFunction { + virtual ~IArgFunction() {} + virtual void set( ConfigT& config, std::string const& value ) const = 0; + virtual void setFlag( ConfigT& config ) const = 0; + virtual bool takesArg() const = 0; + virtual IArgFunction* clone() const = 0; + }; + + template + class BoundArgFunction { + public: + BoundArgFunction( IArgFunction* _functionObj ) : functionObj( _functionObj ) {} + BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj->clone() ) {} + BoundArgFunction& operator = ( BoundArgFunction const& other ) { + IArgFunction newFunctionObj = other.clone(); + delete functionObj; + functionObj = newFunctionObj; + return *this; + } + ~BoundArgFunction() { delete functionObj; } + + void set( ConfigT& config, std::string const& value ) const { + functionObj->set( config, value ); + } + void setFlag( ConfigT& config ) const { + functionObj->setFlag( config ); + } + bool takesArg() const { return functionObj->takesArg(); } + private: + IArgFunction* functionObj; + }; + + + template + struct BoundDataMember : IArgFunction{ + BoundDataMember( M C::* _member ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + convertInto( stringValue, p.*member ); + } + virtual void setFlag( C& p ) const { + convertInto( true, p.*member ); + } + virtual bool takesArg() const { return !IsBool::value; } + virtual IArgFunction* clone() const { return new BoundDataMember( *this ); } + M C::* member; + }; + template + struct BoundUnaryMethod : IArgFunction{ + BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + typename RemoveConstRef::type value; + convertInto( stringValue, value ); + (p.*member)( value ); + } + virtual void setFlag( C& p ) const { + typename RemoveConstRef::type value; + convertInto( true, value ); + (p.*member)( value ); + } + virtual bool takesArg() const { return !IsBool::value; } + virtual IArgFunction* clone() const { return new BoundUnaryMethod( *this ); } + void (C::*member)( M ); + }; + template + struct BoundNullaryMethod : IArgFunction{ + BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + bool value; + convertInto( stringValue, value ); + if( value ) + (p.*member)(); + } + virtual void setFlag( C& p ) const { + (p.*member)(); + } + virtual bool takesArg() const { return false; } + virtual IArgFunction* clone() const { return new BoundNullaryMethod( *this ); } + void (C::*member)(); + }; + + template + struct BoundUnaryFunction : IArgFunction{ + BoundUnaryFunction( void (*_function)( C& ) ) : function( _function ) {} + virtual void set( C& obj, std::string const& stringValue ) const { + bool value; + convertInto( stringValue, value ); + if( value ) + function( obj ); + } + virtual void setFlag( C& p ) const { + function( p ); + } + virtual bool takesArg() const { return false; } + virtual IArgFunction* clone() const { return new BoundUnaryFunction( *this ); } + void (*function)( C& ); + }; + + template + struct BoundBinaryFunction : IArgFunction{ + BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {} + virtual void set( C& obj, std::string const& stringValue ) const { + typename RemoveConstRef::type value; + convertInto( stringValue, value ); + function( obj, value ); + } + virtual void setFlag( C& obj ) const { + typename RemoveConstRef::type value; + convertInto( true, value ); + function( obj, value ); + } + virtual bool takesArg() const { return !IsBool::value; } + virtual IArgFunction* clone() const { return new BoundBinaryFunction( *this ); } + void (*function)( C&, T ); + }; + + template + BoundArgFunction makeBoundField( M C::* _member ) { + return BoundArgFunction( new BoundDataMember( _member ) ); + } + template + BoundArgFunction makeBoundField( void (C::*_member)( M ) ) { + return BoundArgFunction( new BoundUnaryMethod( _member ) ); + } + template + BoundArgFunction makeBoundField( void (C::*_member)() ) { + return BoundArgFunction( new BoundNullaryMethod( _member ) ); + } + template + BoundArgFunction makeBoundField( void (*_function)( C& ) ) { + return BoundArgFunction( new BoundUnaryFunction( _function ) ); + } + template + BoundArgFunction makeBoundField( void (*_function)( C&, T ) ) { + return BoundArgFunction( new BoundBinaryFunction( _function ) ); + } + } // namespace Detail + + struct Parser { + Parser() : separators( " \t=:" ) {} + + struct Token { + enum Type { Positional, ShortOpt, LongOpt }; + Token( Type _type, std::string const& _data ) : type( _type ), data( _data ) {} + Type type; + std::string data; + }; + + void parseIntoTokens( int argc, char const* argv[], std::vector& tokens ) const { + for( int i = 1; i < argc; ++i ) + parseIntoTokens( argv[i] , tokens); + } + void parseIntoTokens( std::string arg, std::vector& tokens ) const { + while( !arg.empty() ) { + Parser::Token token( Parser::Token::Positional, arg ); + arg = ""; + if( token.data[0] == '-' ) { + if( token.data.size() > 1 && token.data[1] == '-' ) { + token = Parser::Token( Parser::Token::LongOpt, token.data.substr( 2 ) ); + } + else { + token = Parser::Token( Parser::Token::ShortOpt, token.data.substr( 1 ) ); + if( token.data.size() > 1 && separators.find( token.data[1] ) == std::string::npos ) { + arg = "-" + token.data.substr( 1 ); + token.data = token.data.substr( 0, 1 ); + } + } + } + if( token.type != Parser::Token::Positional ) { + std::size_t pos = token.data.find_first_of( separators ); + if( pos != std::string::npos ) { + arg = token.data.substr( pos+1 ); + token.data = token.data.substr( 0, pos ); + } + } + tokens.push_back( token ); + } + } + std::string separators; + }; + + template + class CommandLine { + + struct Arg { + Arg( Detail::BoundArgFunction const& _boundField ) : boundField( _boundField ), position( -1 ) {} + + bool hasShortName( std::string const& shortName ) const { + for( std::vector::const_iterator + it = shortNames.begin(), itEnd = shortNames.end(); + it != itEnd; + ++it ) + if( *it == shortName ) + return true; + return false; + } + bool hasLongName( std::string const& _longName ) const { + return _longName == longName; + } + bool takesArg() const { + return !argName.empty(); + } + bool isFixedPositional() const { + return position != -1; + } + bool isAnyPositional() const { + return position == -1 && shortNames.empty() && longName.empty(); + } + std::string dbgName() const { + if( !longName.empty() ) + return "--" + longName; + if( !shortNames.empty() ) + return "-" + shortNames[0]; + return "positional args"; + } + void validate() const { + if( boundField.takesArg() && !takesArg() ) + throw std::logic_error( dbgName() + " must specify an arg name" ); + } + std::string commands() const { + std::ostringstream oss; + bool first = true; + std::vector::const_iterator it = shortNames.begin(), itEnd = shortNames.end(); + for(; it != itEnd; ++it ) { + if( first ) + first = false; + else + oss << ", "; + oss << "-" << *it; + } + if( !longName.empty() ) { + if( !first ) + oss << ", "; + oss << "--" << longName; + } + if( !argName.empty() ) + oss << " <" << argName << ">"; + return oss.str(); + } + + Detail::BoundArgFunction boundField; + std::vector shortNames; + std::string longName; + std::string description; + std::string argName; + int position; + }; + + class ArgBinder { + public: + template + ArgBinder( CommandLine* cl, F f ) + : m_cl( cl ), + m_arg( Detail::makeBoundField( f ) ) + {} + ArgBinder( ArgBinder& other ) + : m_cl( other.m_cl ), + m_arg( other.m_arg ) + { + other.m_cl = NULL; + } + ~ArgBinder() { + if( m_cl ) { + m_arg.validate(); + if( m_arg.isFixedPositional() ) { + m_cl->m_positionalArgs.insert( std::make_pair( m_arg.position, m_arg ) ); + if( m_arg.position > m_cl->m_highestSpecifiedArgPosition ) + m_cl->m_highestSpecifiedArgPosition = m_arg.position; + } + else if( m_arg.isAnyPositional() ) { + if( m_cl->m_arg.get() ) + throw std::logic_error( "Only one unpositional argument can be added" ); + m_cl->m_arg = std::auto_ptr( new Arg( m_arg ) ); + } + else + m_cl->m_options.push_back( m_arg ); + } + } + ArgBinder& shortOpt( std::string const& name ) { + m_arg.shortNames.push_back( name ); + return *this; + } + ArgBinder& longOpt( std::string const& name ) { + m_arg.longName = name; + return *this; + } + ArgBinder& describe( std::string const& description ) { + m_arg.description = description; + return *this; + } + ArgBinder& argName( std::string const& argName ) { + m_arg.argName = argName; + return *this; + } + ArgBinder& position( int position ) { + m_arg.position = position; + return *this; + } + private: + CommandLine* m_cl; + Arg m_arg; + }; + + public: + + CommandLine() : m_highestSpecifiedArgPosition( 0 ) {} + + template + ArgBinder bind( F f ) { + ArgBinder binder( this, f ); + return binder; + } + + void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = CATCH_CONFIG_CONSOLE_WIDTH ) const { + typename std::vector::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it; + std::size_t maxWidth = 0; + for( it = itBegin; it != itEnd; ++it ) + maxWidth = (std::max)( maxWidth, it->commands().size() ); + + for( it = itBegin; it != itEnd; ++it ) { + Catch::Text usage( it->commands(), Catch::TextAttributes() + .setWidth( maxWidth+indent ) + .setIndent( indent ) ); + // !TBD handle longer usage strings + Catch::Text desc( it->description, Catch::TextAttributes() + .setWidth( width - maxWidth -3 ) ); + + for( std::size_t i = 0; i < std::max( usage.size(), desc.size() ); ++i ) { + std::string usageCol = i < usage.size() ? usage[i] : ""; + os << usageCol; + + if( i < desc.size() && !desc[i].empty() ) + os << std::string( indent + 2 + maxWidth - usageCol.size(), ' ' ) + << desc[i]; + os << "\n"; + } + } + } + std::string optUsage() const { + std::ostringstream oss; + optUsage( oss ); + return oss.str(); + } + + void argSynopsis( std::ostream& os ) const { + for( int i = 1; i <= m_highestSpecifiedArgPosition; ++i ) { + if( i > 1 ) + os << " "; + typename std::map::const_iterator it = m_positionalArgs.find( i ); + if( it != m_positionalArgs.end() ) + os << "<" << it->second.argName << ">"; + else if( m_arg.get() ) + os << "<" << m_arg->argName << ">"; + else + throw std::logic_error( "non consecutive positional arguments with no floating args" ); + } + // !TBD No indication of mandatory args + if( m_arg.get() ) { + if( m_highestSpecifiedArgPosition > 1 ) + os << " "; + os << "[<" << m_arg->argName << "> ...]"; + } + } + std::string argSynopsis() const { + std::ostringstream oss; + argSynopsis( oss ); + return oss.str(); + } + + + void usage( std::ostream& os, std::string const& procName ) const { + os << "usage:\n " << procName << " "; + argSynopsis( os ); + if( !m_options.empty() ) { + os << " [options]\n\nwhere options are: \n"; + optUsage( os, 2 ); + } + os << "\n"; + } + std::string usage( std::string const& procName ) const { + std::ostringstream oss; + usage( oss, procName ); + return oss.str(); + } + + std::vector parseInto( int argc, char const* argv[], ConfigT& config ) const { + std::vector tokens; + Parser parser; + parser.parseIntoTokens( argc, argv, tokens ); + return populate( tokens, config ); + } + + std::vector populate( std::vector const& tokens, ConfigT& config ) const { + if( m_options.empty() && m_positionalArgs.empty() ) + throw std::logic_error( "No options or arguments specified" ); + + std::vector unusedTokens = populateOptions( tokens, config ); + unusedTokens = populateFixedArgs( unusedTokens, config ); + unusedTokens = populateFloatingArgs( unusedTokens, config ); + return unusedTokens; + } + + std::vector populateOptions( std::vector const& tokens, ConfigT& config ) const { + std::vector unusedTokens; + for( std::size_t i = 0; i < tokens.size(); ++i ) { + Parser::Token const& token = tokens[i]; + typename std::vector::const_iterator it = m_options.begin(), itEnd = m_options.end(); + for(; it != itEnd; ++it ) { + Arg const& arg = *it; + + if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) || + ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) { + if( arg.takesArg() ) { + if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional ) + throw std::domain_error( "Expected argument to option " + token.data ); + arg.boundField.set( config, tokens[++i].data ); + } + else { + arg.boundField.setFlag( config ); + } + break; + } + } + if( it == itEnd ) + unusedTokens.push_back( token ); + } + return unusedTokens; + } + std::vector populateFixedArgs( std::vector const& tokens, ConfigT& config ) const { + std::vector unusedTokens; + int position = 1; + for( std::size_t i = 0; i < tokens.size(); ++i ) { + Parser::Token const& token = tokens[i]; + typename std::map::const_iterator it = m_positionalArgs.find( position ); + if( it != m_positionalArgs.end() ) + it->second.boundField.set( config, token.data ); + else + unusedTokens.push_back( token ); + if( token.type == Parser::Token::Positional ) + position++; + } + return unusedTokens; + } + std::vector populateFloatingArgs( std::vector const& tokens, ConfigT& config ) const { + if( !m_arg.get() ) + return tokens; + std::vector unusedTokens; + for( std::size_t i = 0; i < tokens.size(); ++i ) { + Parser::Token const& token = tokens[i]; + if( token.type == Parser::Token::Positional ) + m_arg->boundField.set( config, token.data ); + else + unusedTokens.push_back( token ); + } + return unusedTokens; + } + + private: + std::vector m_options; + std::map m_positionalArgs; + std::auto_ptr m_arg; + int m_highestSpecifiedArgPosition; + }; + +} // end namespace Clara + + +#endif // TWOBLUECUBES_CLARA_H_INCLUDED diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 137f29fc..9175dcde 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -9,513 +9,10 @@ #pragma clang diagnostic ignored "-Wpadded" #endif +#include "internal/clara.h" + #include "catch.hpp" -#include "catch_text.h" -namespace Clara { - namespace Detail { - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - - template struct IsBool { static const bool value = false; }; - template<> struct IsBool { static const bool value = true; }; - - template - void convertInto( std::string const& _source, T& _dest ) { - std::stringstream ss; - ss << _source; - ss >> _dest; - if( ss.fail() ) - throw std::runtime_error( "Unable to convert " + _source + " to destination type" ); - } - inline void convertInto( std::string const& _source, std::string& _dest ) { - _dest = _source; - } - inline void convertInto( std::string const& _source, bool& _dest ) { - std::string sourceLC = _source; - std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower ); - if( sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) - _dest = true; - else if( sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) - _dest = false; - else - throw std::runtime_error( "Expected a boolean value but did recognise: '" + _source + "'" ); - } - inline void convertInto( bool _source, bool& _dest ) { - _dest = _source; - } - template - inline void convertInto( bool, T& ) { - throw std::runtime_error( "Invalid conversion" ); - } - - template - struct IArgFunction { - virtual ~IArgFunction() {} - virtual void set( ConfigT& config, std::string const& value ) const = 0; - virtual void setFlag( ConfigT& config ) const = 0; - virtual bool takesArg() const = 0; - virtual IArgFunction* clone() const = 0; - }; - - template - class BoundArgFunction { - public: - BoundArgFunction( IArgFunction* _functionObj ) : functionObj( _functionObj ) {} - BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj->clone() ) {} - BoundArgFunction& operator = ( BoundArgFunction const& other ) { - IArgFunction newFunctionObj = other.clone(); - delete functionObj; - functionObj = newFunctionObj; - return *this; - } - ~BoundArgFunction() { delete functionObj; } - - void set( ConfigT& config, std::string const& value ) const { - functionObj->set( config, value ); - } - void setFlag( ConfigT& config ) const { - functionObj->setFlag( config ); - } - bool takesArg() const { return functionObj->takesArg(); } - private: - IArgFunction* functionObj; - }; - - - template - struct BoundDataMember : IArgFunction{ - BoundDataMember( M C::* _member ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - convertInto( stringValue, p.*member ); - } - virtual void setFlag( C& p ) const { - convertInto( true, p.*member ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IArgFunction* clone() const { return new BoundDataMember( *this ); } - M C::* member; - }; - template - struct BoundUnaryMethod : IArgFunction{ - BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - typename RemoveConstRef::type value; - convertInto( stringValue, value ); - (p.*member)( value ); - } - virtual void setFlag( C& p ) const { - typename RemoveConstRef::type value; - convertInto( true, value ); - (p.*member)( value ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IArgFunction* clone() const { return new BoundUnaryMethod( *this ); } - void (C::*member)( M ); - }; - template - struct BoundNullaryMethod : IArgFunction{ - BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - bool value; - convertInto( stringValue, value ); - if( value ) - (p.*member)(); - } - virtual void setFlag( C& p ) const { - (p.*member)(); - } - virtual bool takesArg() const { return false; } - virtual IArgFunction* clone() const { return new BoundNullaryMethod( *this ); } - void (C::*member)(); - }; - - template - struct BoundUnaryFunction : IArgFunction{ - BoundUnaryFunction( void (*_function)( C& ) ) : function( _function ) {} - virtual void set( C& obj, std::string const& stringValue ) const { - bool value; - convertInto( stringValue, value ); - if( value ) - function( obj ); - } - virtual void setFlag( C& p ) const { - function( p ); - } - virtual bool takesArg() const { return false; } - virtual IArgFunction* clone() const { return new BoundUnaryFunction( *this ); } - void (*function)( C& ); - }; - - template - struct BoundBinaryFunction : IArgFunction{ - BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {} - virtual void set( C& obj, std::string const& stringValue ) const { - typename RemoveConstRef::type value; - convertInto( stringValue, value ); - function( obj, value ); - } - virtual void setFlag( C& obj ) const { - typename RemoveConstRef::type value; - convertInto( true, value ); - function( obj, value ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IArgFunction* clone() const { return new BoundBinaryFunction( *this ); } - void (*function)( C&, T ); - }; - - template - BoundArgFunction makeBoundField( M C::* _member ) { - return BoundArgFunction( new BoundDataMember( _member ) ); - } - template - BoundArgFunction makeBoundField( void (C::*_member)( M ) ) { - return BoundArgFunction( new BoundUnaryMethod( _member ) ); - } - template - BoundArgFunction makeBoundField( void (C::*_member)() ) { - return BoundArgFunction( new BoundNullaryMethod( _member ) ); - } - template - BoundArgFunction makeBoundField( void (*_function)( C& ) ) { - return BoundArgFunction( new BoundUnaryFunction( _function ) ); - } - template - BoundArgFunction makeBoundField( void (*_function)( C&, T ) ) { - return BoundArgFunction( new BoundBinaryFunction( _function ) ); - } - } // namespace Detail - - struct Parser { - Parser() : separators( " \t=:" ) {} - - struct Token { - enum Type { Positional, ShortOpt, LongOpt }; - Token( Type _type, std::string const& _data ) : type( _type ), data( _data ) {} - Type type; - std::string data; - }; - - void parseIntoTokens( int argc, char const* argv[], std::vector& tokens ) const { - for( int i = 1; i < argc; ++i ) - parseIntoTokens( argv[i] , tokens); - } - void parseIntoTokens( std::string arg, std::vector& tokens ) const { - while( !arg.empty() ) { - Parser::Token token( Parser::Token::Positional, arg ); - arg = ""; - if( token.data[0] == '-' ) { - if( token.data.size() > 1 && token.data[1] == '-' ) { - token = Parser::Token( Parser::Token::LongOpt, token.data.substr( 2 ) ); - } - else { - token = Parser::Token( Parser::Token::ShortOpt, token.data.substr( 1 ) ); - if( token.data.size() > 1 && separators.find( token.data[1] ) == std::string::npos ) { - arg = "-" + token.data.substr( 1 ); - token.data = token.data.substr( 0, 1 ); - } - } - } - if( token.type != Parser::Token::Positional ) { - std::size_t pos = token.data.find_first_of( separators ); - if( pos != std::string::npos ) { - arg = token.data.substr( pos+1 ); - token.data = token.data.substr( 0, pos ); - } - } - tokens.push_back( token ); - } - } - std::string separators; - }; - - template - class CommandLine { - - struct Arg { - Arg( Detail::BoundArgFunction const& _boundField ) : boundField( _boundField ), position( -1 ) {} - - bool hasShortName( std::string const& shortName ) const { - for( std::vector::const_iterator - it = shortNames.begin(), itEnd = shortNames.end(); - it != itEnd; - ++it ) - if( *it == shortName ) - return true; - return false; - } - bool hasLongName( std::string const& _longName ) const { - return _longName == longName; - } - bool takesArg() const { - return !argName.empty(); - } - bool isFixedPositional() const { - return position != -1; - } - bool isAnyPositional() const { - return position == -1 && shortNames.empty() && longName.empty(); - } - std::string dbgName() const { - if( !longName.empty() ) - return "--" + longName; - if( !shortNames.empty() ) - return "-" + shortNames[0]; - return "positional args"; - } - void validate() const { - if( boundField.takesArg() && !takesArg() ) - throw std::logic_error( dbgName() + " must specify an arg name" ); - } - std::string commands() const { - std::ostringstream oss; - bool first = true; - std::vector::const_iterator it = shortNames.begin(), itEnd = shortNames.end(); - for(; it != itEnd; ++it ) { - if( first ) - first = false; - else - oss << ", "; - oss << "-" << *it; - } - if( !longName.empty() ) { - if( !first ) - oss << ", "; - oss << "--" << longName; - } - if( !argName.empty() ) - oss << " <" << argName << ">"; - return oss.str(); - } - - Detail::BoundArgFunction boundField; - std::vector shortNames; - std::string longName; - std::string description; - std::string argName; - int position; - }; - - class ArgBinder { - public: - template - ArgBinder( CommandLine* cl, F f ) - : m_cl( cl ), - m_arg( Detail::makeBoundField( f ) ) - {} - ArgBinder( ArgBinder& other ) - : m_cl( other.m_cl ), - m_arg( other.m_arg ) - { - other.m_cl = NULL; - } - ~ArgBinder() { - if( m_cl ) { - m_arg.validate(); - if( m_arg.isFixedPositional() ) { - m_cl->m_positionalArgs.insert( std::make_pair( m_arg.position, m_arg ) ); - if( m_arg.position > m_cl->m_highestSpecifiedArgPosition ) - m_cl->m_highestSpecifiedArgPosition = m_arg.position; - } - else if( m_arg.isAnyPositional() ) { - if( m_cl->m_arg.get() ) - throw std::logic_error( "Only one unpositional argument can be added" ); - m_cl->m_arg = std::auto_ptr( new Arg( m_arg ) ); - } - else - m_cl->m_options.push_back( m_arg ); - } - } - ArgBinder& shortOpt( std::string const& name ) { - m_arg.shortNames.push_back( name ); - return *this; - } - ArgBinder& longOpt( std::string const& name ) { - m_arg.longName = name; - return *this; - } - ArgBinder& describe( std::string const& description ) { - m_arg.description = description; - return *this; - } - ArgBinder& argName( std::string const& argName ) { - m_arg.argName = argName; - return *this; - } - ArgBinder& position( int position ) { - m_arg.position = position; - return *this; - } - private: - CommandLine* m_cl; - Arg m_arg; - }; - - public: - - CommandLine() : m_highestSpecifiedArgPosition( 0 ) {} - - template - ArgBinder bind( F f ) { - ArgBinder binder( this, f ); - return binder; - } - - void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = CATCH_CONFIG_CONSOLE_WIDTH ) const { - typename std::vector::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it; - std::size_t maxWidth = 0; - for( it = itBegin; it != itEnd; ++it ) - maxWidth = (std::max)( maxWidth, it->commands().size() ); - - for( it = itBegin; it != itEnd; ++it ) { - Catch::Text usage( it->commands(), Catch::TextAttributes() - .setWidth( maxWidth+indent ) - .setIndent( indent ) ); - // !TBD handle longer usage strings - Catch::Text desc( it->description, Catch::TextAttributes() - .setWidth( width - maxWidth -3 ) ); - - for( std::size_t i = 0; i < std::max( usage.size(), desc.size() ); ++i ) { - std::string usageCol = i < usage.size() ? usage[i] : ""; - os << usageCol; - - if( i < desc.size() && !desc[i].empty() ) - os << std::string( indent + 2 + maxWidth - usageCol.size(), ' ' ) - << desc[i]; - os << "\n"; - } - } - } - std::string optUsage() const { - std::ostringstream oss; - optUsage( oss ); - return oss.str(); - } - - void argSynopsis( std::ostream& os ) const { - for( int i = 1; i <= m_highestSpecifiedArgPosition; ++i ) { - if( i > 1 ) - os << " "; - typename std::map::const_iterator it = m_positionalArgs.find( i ); - if( it != m_positionalArgs.end() ) - os << "<" << it->second.argName << ">"; - else if( m_arg.get() ) - os << "<" << m_arg->argName << ">"; - else - throw std::logic_error( "non consecutive positional arguments with no floating args" ); - } - // !TBD No indication of mandatory args - if( m_arg.get() ) { - if( m_highestSpecifiedArgPosition > 1 ) - os << " "; - os << "[<" << m_arg->argName << "> ...]"; - } - } - std::string argSynopsis() const { - std::ostringstream oss; - argSynopsis( oss ); - return oss.str(); - } - - - void usage( std::ostream& os, std::string const& procName ) const { - os << "usage:\n " << procName << " "; - argSynopsis( os ); - if( !m_options.empty() ) { - os << " [options]\n\nwhere options are: \n"; - optUsage( os, 2 ); - } - os << "\n"; - } - std::string usage( std::string const& procName ) const { - std::ostringstream oss; - usage( oss, procName ); - return oss.str(); - } - - std::vector parseInto( int argc, char const* argv[], ConfigT& config ) const { - std::vector tokens; - Parser parser; - parser.parseIntoTokens( argc, argv, tokens ); - return populate( tokens, config ); - } - - std::vector populate( std::vector const& tokens, ConfigT& config ) const { - if( m_options.empty() && m_positionalArgs.empty() ) - throw std::logic_error( "No options or arguments specified" ); - - std::vector unusedTokens = populateOptions( tokens, config ); - unusedTokens = populateFixedArgs( unusedTokens, config ); - unusedTokens = populateFloatingArgs( unusedTokens, config ); - return unusedTokens; - } - - std::vector populateOptions( std::vector const& tokens, ConfigT& config ) const { - std::vector unusedTokens; - for( std::size_t i = 0; i < tokens.size(); ++i ) { - Parser::Token const& token = tokens[i]; - typename std::vector::const_iterator it = m_options.begin(), itEnd = m_options.end(); - for(; it != itEnd; ++it ) { - Arg const& arg = *it; - - if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) || - ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) { - if( arg.takesArg() ) { - if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional ) - throw std::domain_error( "Expected argument to option " + token.data ); - arg.boundField.set( config, tokens[++i].data ); - } - else { - arg.boundField.setFlag( config ); - } - break; - } - } - if( it == itEnd ) - unusedTokens.push_back( token ); - } - return unusedTokens; - } - std::vector populateFixedArgs( std::vector const& tokens, ConfigT& config ) const { - std::vector unusedTokens; - int position = 1; - for( std::size_t i = 0; i < tokens.size(); ++i ) { - Parser::Token const& token = tokens[i]; - typename std::map::const_iterator it = m_positionalArgs.find( position ); - if( it != m_positionalArgs.end() ) - it->second.boundField.set( config, token.data ); - else - unusedTokens.push_back( token ); - if( token.type == Parser::Token::Positional ) - position++; - } - return unusedTokens; - } - std::vector populateFloatingArgs( std::vector const& tokens, ConfigT& config ) const { - if( !m_arg.get() ) - return tokens; - std::vector unusedTokens; - for( std::size_t i = 0; i < tokens.size(); ++i ) { - Parser::Token const& token = tokens[i]; - if( token.type == Parser::Token::Positional ) - m_arg->boundField.set( config, token.data ); - else - unusedTokens.push_back( token ); - } - return unusedTokens; - } - - private: - std::vector m_options; - std::map m_positionalArgs; - std::auto_ptr m_arg; - int m_highestSpecifiedArgPosition; - }; - -} // end namespace Clara // Helper to deduce size from array literals and pass on to parser template @@ -684,6 +181,10 @@ TEST_CASE( "cmdline" ) { } struct Config { + + struct Verbosity { enum Level { NoOutput = 0, Quiet, Normal }; }; + struct Warning { enum Types { Nothing = 0x00, NoAssertions = 0x01 }; }; + Config() : listTests( false ), listTags( false ), @@ -692,7 +193,7 @@ struct Config { noThrow( false ), showHelp( false ), abortAfter( 0 ), - verbosity( Normal ) + verbosity( Verbosity::Normal ) {} bool listTests; @@ -705,21 +206,33 @@ struct Config { bool showHelp; int abortAfter; - enum Verbosity { NoOutput = 0, Quiet, Normal }; - Verbosity verbosity; + + Verbosity::Level verbosity; + Warning::Types warnings; + std::string reporterName; std::string fileName; std::string suiteName; std::string reporter; - std::vector warnings; + std::vector testsOrTags; }; inline void abortAfterFirst( Config& config ) { config.abortAfter = 1; } inline void abortAfterX( Config& config, int x ) { config.abortAfter = x; } -inline void addWarning( Config& config, std::string const& _warning ) { config.warnings.push_back( _warning ); } -inline void addTestOrTags( Config& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); } -inline void setVerbosity( Config& config, int level ) { config.verbosity = (Config::Verbosity)level; } +inline void addTestOrTags( Config& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); } + +inline void addWarning( Config& config, std::string const& _warning ) { + if( _warning == "NoAssertions" ) + config.warnings = (Config::Warning::Types)( config.warnings | Config::Warning::NoAssertions ); + else + throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" ); + +} +inline void setVerbosity( Config& config, int level ) { + // !TBD: accept strings? + config.verbosity = (Config::Verbosity::Level)level; +} SCENARIO( "New Catch commandline interface", "[cli]" ) { @@ -857,13 +370,13 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { } } WHEN( "And enum opt is set by numeric value" ) { - CHECK( config.verbosity == Config::Normal ); + CHECK( config.verbosity == Config::Verbosity::Normal ); const char* argv[] = { "test", "-v 0" }; parseInto( cli, argv, config ); THEN( "The member is set to the enum value" ) - REQUIRE( config.verbosity == Config::NoOutput ); + REQUIRE( config.verbosity == Config::Verbosity::NoOutput ); } } } diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index c178f5ec..3e99d94c 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -68,6 +68,7 @@ 26847E5C16BBACB60043B9C1 /* catch_message.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_message.hpp; sourceTree = ""; }; 26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = ""; }; 2694A1FB16A0000E004816E3 /* catch_text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = catch_text.cpp; sourceTree = ""; }; + 26C5F3EC17514B970056FB3C /* clara.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = clara.h; path = ../../../../include/internal/clara.h; sourceTree = ""; }; 26DACF2F17206D3400A21326 /* catch_text.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_text.h; sourceTree = ""; }; 4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_test_case_info.hpp; sourceTree = ""; }; 4A084F1D15DAD15F0027E631 /* catch_test_spec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_test_spec.h; sourceTree = ""; }; @@ -186,6 +187,14 @@ name = "Introspective Tests"; sourceTree = ""; }; + 26C5F3EB17514B670056FB3C /* External */ = { + isa = PBXGroup; + children = ( + 26C5F3EC17514B970056FB3C /* clara.h */, + ); + name = External; + sourceTree = ""; + }; 4A6D0C15149B3D3B00DB3EAA = { isa = PBXGroup; children = ( @@ -236,6 +245,7 @@ 4A6D0C41149B3DE900DB3EAA /* Catch */ = { isa = PBXGroup; children = ( + 26C5F3EB17514B670056FB3C /* External */, 4A7DB2CD1652FE4B00FA6523 /* catch_version.h */, 4AA7B8B4165428BA003155F6 /* catch_version.hpp */, 4A8E4DCF160A34E200194CBD /* SurrogateCpps */, From e1459955f1fd5c5cb04ecf81f36c5fe611e62496 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 28 May 2013 18:39:32 +0100 Subject: [PATCH 255/296] Refactoring towards interface based config --- include/catch_runner.hpp | 50 +- include/internal/catch_config.hpp | 23 +- include/internal/catch_context.h | 7 +- include/internal/catch_context_impl.hpp | 6 +- include/internal/catch_interfaces_config.h | 11 +- include/internal/catch_interfaces_reporter.h | 19 +- .../internal/catch_legacy_reporter_adapter.h | 3 +- .../catch_legacy_reporter_adapter.hpp | 5 +- .../internal/catch_reporter_registrars.hpp | 2 +- include/internal/catch_reporter_registry.hpp | 4 +- include/internal/catch_runner_impl.hpp | 20 +- include/reporters/catch_reporter_basic.hpp | 6 +- include/reporters/catch_reporter_console.hpp | 2 +- include/reporters/catch_reporter_junit.hpp | 7 +- include/reporters/catch_reporter_xml.hpp | 8 +- .../SelfTest/Baselines/approvedResults.txt | 822 ++++++++++++++---- projects/SelfTest/catch_self_test.cpp | 4 +- 17 files changed, 754 insertions(+), 245 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 7f24d5b5..2998c866 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -24,9 +24,8 @@ namespace Catch { class Runner2 { // This will become Runner when Runner becomes Context public: - Runner2( Config& configWrapper ) - : m_configWrapper( configWrapper ), - m_config( configWrapper.data() ) + Runner2( Ptr const& config ) + : m_config( config ) { openStream(); makeReporter(); @@ -34,13 +33,13 @@ namespace Catch { Totals runTests() { - std::vector filterGroups = m_config.filters; + std::vector filterGroups = m_config->data().filters; if( filterGroups.empty() ) { TestCaseFilters filterGroup( "" ); filterGroups.push_back( filterGroup ); } - Runner context( m_configWrapper, m_reporter ); // This Runner will be renamed Context + Runner context( m_config, m_reporter ); // This Runner will be renamed Context Totals totals; for( std::size_t i=0; i < filterGroups.size() && !context.aborting(); ++i ) { @@ -77,28 +76,26 @@ namespace Catch { private: void openStream() { - if( !m_config.stream.empty() ) - m_configWrapper.useStream( m_config.stream ); + if( !m_config->data().stream.empty() ) + m_config->useStream( m_config->data().stream ); // Open output file, if specified - if( !m_config.outputFilename.empty() ) { - m_ofs.open( m_config.outputFilename.c_str() ); + if( !m_config->getFilename().empty() ) { + m_ofs.open( m_config->getFilename().c_str() ); if( m_ofs.fail() ) { std::ostringstream oss; - oss << "Unable to open file: '" << m_config.outputFilename << "'"; + oss << "Unable to open file: '" << m_config->getFilename() << "'"; throw std::domain_error( oss.str() ); } - m_configWrapper.setStreamBuf( m_ofs.rdbuf() ); + m_config->setStreamBuf( m_ofs.rdbuf() ); } } void makeReporter() { - std::string reporterName = m_config.reporter.empty() - ? "console" - : m_config.reporter; + std::string reporterName = m_config->data().reporter.empty() + ? "console" + : m_config->data().reporter; - ReporterConfig reporterConfig( m_configWrapper.stream(), m_config ); - - m_reporter = getRegistryHub().getReporterRegistry().create( reporterName, reporterConfig ); + m_reporter = getRegistryHub().getReporterRegistry().create( reporterName, m_config.get() ); if( !m_reporter ) { std::ostringstream oss; oss << "No reporter registered with name: '" << reporterName << "'"; @@ -107,24 +104,23 @@ namespace Catch { } private: - Config& m_configWrapper; - const ConfigData& m_config; + Ptr m_config; std::ofstream m_ofs; Ptr m_reporter; std::set m_testsAlreadyRun; }; - inline int Main( Config& configWrapper ) { + inline int Main( Ptr const& config ) { int result = 0; try { - Runner2 runner( configWrapper ); + Runner2 runner( config ); - const ConfigData& config = configWrapper.data(); + const ConfigData& configData = config->data(); // Handle list request - if( config.listSpec != List::None ) { - list( config ); + if( configData.listSpec != List::None ) { + list( configData ); Catch::cleanUp(); return 0; } @@ -177,7 +173,7 @@ namespace Catch { } } - inline int Main( int argc, char* const argv[], Config& config ) { + inline int Main( int argc, char* const argv[], Ptr const& config ) { try { CommandParser parser( argc, argv ); @@ -193,7 +189,7 @@ namespace Catch { AllOptions options; - options.parseIntoConfig( parser, config.data() ); + options.parseIntoConfig( parser, config->data() ); } catch( std::exception& ex ) { std::cerr << ex.what() << "\n\nUsage: ...\n\n"; @@ -206,7 +202,7 @@ namespace Catch { } inline int Main( int argc, char* const argv[] ) { - Config config; + Ptr config = new Config(); // !TBD: This doesn't always work, for some reason // if( isDebuggerActive() ) // config.useStream( "debug" ); diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 87c7d734..41415e4e 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -75,7 +75,7 @@ namespace Catch { }; - class Config : public IConfig { + class Config : public SharedImpl { private: Config( Config const& other ); Config& operator = ( Config const& other ); @@ -123,10 +123,6 @@ namespace Catch { bool shouldDebugBreak() const { return m_data.shouldDebugBreak; } - - virtual std::ostream& stream() const { - return m_os; - } void setStreamBuf( std::streambuf* buf ) { m_os.rdbuf( buf ? buf : std::cout.rdbuf() ); @@ -144,19 +140,11 @@ namespace Catch { filters.addFilter( TestCaseFilter( testSpec ) ); m_data.filters.push_back( filters ); } - - virtual bool includeSuccessfulResults() const { - return m_data.includeWhichResults == Include::SuccessfulResults; - } - + int getCutoff() const { return m_data.cutoff; } - virtual bool allowThrows() const { - return m_data.allowThrows; - } - ConfigData const& data() const { return m_data; } @@ -164,6 +152,13 @@ namespace Catch { return m_data; } + // IConfig interface + virtual bool allowThrows() const { return m_data.allowThrows; } + virtual std::ostream& stream() const { return m_os; } + virtual std::string name() const { return m_data.name; } + virtual bool includeSuccessfulResults() const { return m_data.includeWhichResults == Include::SuccessfulResults; } + virtual bool warnAboutMissingAssertions() const { return m_data.warnings & ConfigData::WarnAbout::NoAssertions; } + private: ConfigData m_data; diff --git a/include/internal/catch_context.h b/include/internal/catch_context.h index 5b4976c6..c419544b 100644 --- a/include/internal/catch_context.h +++ b/include/internal/catch_context.h @@ -9,6 +9,7 @@ #define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED #include "catch_interfaces_generators.h" +#include "catch_ptr.hpp" #include #include @@ -31,15 +32,15 @@ namespace Catch { virtual IRunner& getRunner() = 0; virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0; virtual bool advanceGeneratorsForCurrentTest() = 0; - virtual const IConfig* getConfig() const = 0; + virtual Ptr getConfig() const = 0; }; - + struct IMutableContext : IContext { virtual ~IMutableContext(); virtual void setResultCapture( IResultCapture* resultCapture ) = 0; virtual void setRunner( IRunner* runner ) = 0; - virtual void setConfig( const IConfig* config ) = 0; + virtual void setConfig( Ptr const& config ) = 0; }; IContext& getCurrentContext(); diff --git a/include/internal/catch_context_impl.hpp b/include/internal/catch_context_impl.hpp index d14aed40..3adcb9ce 100644 --- a/include/internal/catch_context_impl.hpp +++ b/include/internal/catch_context_impl.hpp @@ -38,7 +38,7 @@ namespace Catch { return generators && generators->moveNext(); } - virtual const IConfig* getConfig() const { + virtual Ptr getConfig() const { return m_config; } @@ -49,7 +49,7 @@ namespace Catch { virtual void setRunner( IRunner* runner ) { m_runner = runner; } - virtual void setConfig( const IConfig* config ) { + virtual void setConfig( Ptr const& config ) { m_config = config; } @@ -79,7 +79,7 @@ namespace Catch { private: IRunner* m_runner; IResultCapture* m_resultCapture; - const IConfig* m_config; + Ptr m_config; std::map m_generatorsByTestName; }; diff --git a/include/internal/catch_interfaces_config.h b/include/internal/catch_interfaces_config.h index 01abe56e..3db8bf2d 100644 --- a/include/internal/catch_interfaces_config.h +++ b/include/internal/catch_interfaces_config.h @@ -8,13 +8,22 @@ #ifndef TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED #define TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED +#include +#include + +#include "catch_ptr.hpp" + namespace Catch { - struct IConfig { + struct IConfig : IShared { virtual ~IConfig(); virtual bool allowThrows() const = 0; + virtual std::ostream& stream() const = 0; + virtual std::string name() const = 0; + virtual bool includeSuccessfulResults() const = 0; + virtual bool warnAboutMissingAssertions() const = 0; }; } diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 751135b8..6419afc0 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -24,17 +24,18 @@ namespace Catch { struct ReporterConfig { - ReporterConfig( std::ostream& _stream, ConfigData const& _fullConfig ) + explicit ReporterConfig( Ptr const& _fullConfig ) + : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {} + + ReporterConfig( Ptr const& _fullConfig, std::ostream& _stream ) : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} - std::ostream& stream() const { return *m_stream; } - std::string name() const { return m_fullConfig.name; } - bool includeSuccessfulResults() const { return m_fullConfig.includeWhichResults == Include::SuccessfulResults; } - bool warnAboutMissingAssertions() const { return m_fullConfig.warnings & ConfigData::WarnAbout::NoAssertions; } + std::ostream& stream() const { return *m_stream; } + Ptr fullConfig() const { return m_fullConfig; } private: std::ostream* m_stream; - ConfigData m_fullConfig; + Ptr m_fullConfig; }; struct ReporterPreferences { @@ -217,7 +218,7 @@ namespace Catch struct StreamingReporterBase : SharedImpl { StreamingReporterBase( ReporterConfig const& _config ) - : m_config( _config ), + : m_config( _config.fullConfig() ), stream( _config.stream() ) {} @@ -264,7 +265,7 @@ namespace Catch testRunInfo.reset(); } - ReporterConfig m_config; + Ptr m_config; Option testRunInfo; Option unusedGroupInfo; Option unusedTestCaseInfo; @@ -321,7 +322,7 @@ namespace Catch typedef std::map FactoryMap; virtual ~IReporterRegistry(); - virtual IStreamingReporter* create( std::string const& name, ReporterConfig const& config ) const = 0; + virtual IStreamingReporter* create( std::string const& name, Ptr const& config ) const = 0; virtual FactoryMap const& getFactories() const = 0; }; diff --git a/include/internal/catch_legacy_reporter_adapter.h b/include/internal/catch_legacy_reporter_adapter.h index 4d5457e6..08bf6854 100644 --- a/include/internal/catch_legacy_reporter_adapter.h +++ b/include/internal/catch_legacy_reporter_adapter.h @@ -15,7 +15,7 @@ namespace Catch class LegacyReporterAdapter : public SharedImpl { public: - LegacyReporterAdapter( Ptr const& legacyReporter, ReporterConfig const& config ); + LegacyReporterAdapter( Ptr const& legacyReporter ); virtual ~LegacyReporterAdapter(); virtual ReporterPreferences getPreferences() const; @@ -33,7 +33,6 @@ namespace Catch private: Ptr m_legacyReporter; - ReporterConfig m_config; }; } diff --git a/include/internal/catch_legacy_reporter_adapter.hpp b/include/internal/catch_legacy_reporter_adapter.hpp index 44d90af8..27ffc1e1 100644 --- a/include/internal/catch_legacy_reporter_adapter.hpp +++ b/include/internal/catch_legacy_reporter_adapter.hpp @@ -12,9 +12,8 @@ namespace Catch { - LegacyReporterAdapter::LegacyReporterAdapter( Ptr const& legacyReporter, ReporterConfig const& config ) - : m_legacyReporter( legacyReporter ), - m_config( config ) + LegacyReporterAdapter::LegacyReporterAdapter( Ptr const& legacyReporter ) + : m_legacyReporter( legacyReporter ) {} LegacyReporterAdapter::~LegacyReporterAdapter() {} diff --git a/include/internal/catch_reporter_registrars.hpp b/include/internal/catch_reporter_registrars.hpp index f2c482b2..9e765c21 100644 --- a/include/internal/catch_reporter_registrars.hpp +++ b/include/internal/catch_reporter_registrars.hpp @@ -19,7 +19,7 @@ namespace Catch { class ReporterFactory : public IReporterFactory { virtual IStreamingReporter* create( ReporterConfig const& config ) const { - return new LegacyReporterAdapter( new T( config ), config ); + return new LegacyReporterAdapter( new T( config ) ); } virtual std::string getDescription() const { diff --git a/include/internal/catch_reporter_registry.hpp b/include/internal/catch_reporter_registry.hpp index 8298758c..ac3ed683 100644 --- a/include/internal/catch_reporter_registry.hpp +++ b/include/internal/catch_reporter_registry.hpp @@ -22,11 +22,11 @@ namespace Catch { deleteAllValues( m_factories ); } - virtual IStreamingReporter* create( std::string const& name, ReporterConfig const& config ) const { + virtual IStreamingReporter* create( std::string const& name, Ptr const& config ) const { FactoryMap::const_iterator it = m_factories.find( name ); if( it == m_factories.end() ) return NULL; - return it->second->create( config ); + return it->second->create( ReporterConfig( config ) ); } void registerReporter( std::string const& name, IReporterFactory* factory ) { diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 18a3e03b..0451072e 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -56,8 +56,8 @@ namespace Catch { public: - explicit Runner( Config const& config, Ptr const& reporter ) - : m_runInfo( config.data().name ), + explicit Runner( Ptr const& config, Ptr const& reporter ) + : m_runInfo( config->name() ), m_context( getCurrentMutableContext() ), m_runningTest( NULL ), m_config( config ), @@ -67,7 +67,7 @@ namespace Catch { m_prevConfig( m_context.getConfig() ) { m_context.setRunner( this ); - m_context.setConfig( &m_config ); + m_context.setConfig( m_config.get() ); m_context.setResultCapture( this ); m_reporter->testRunStarting( m_runInfo ); } @@ -127,7 +127,7 @@ namespace Catch { Totals deltaTotals = m_totals.delta( prevTotals ); bool missingAssertions = false; if( deltaTotals.assertions.total() == 0 && - ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) ) { + ( m_config->data().warnings & ConfigData::WarnAbout::NoAssertions ) ) { m_totals.assertions.failed++; deltaTotals = m_totals.delta( prevTotals ); missingAssertions = true; @@ -149,7 +149,7 @@ namespace Catch { return deltaTotals; } - Config const& config() const { + Ptr config() const { return m_config; } @@ -209,7 +209,7 @@ namespace Catch { Counts assertions = m_totals.assertions - prevAssertions; bool missingAssertions = false; if( assertions.total() == 0 && - ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) && + ( m_config->data().warnings & ConfigData::WarnAbout::NoAssertions ) && !m_runningTest->isBranchSection() ) { m_totals.assertions.failed++; assertions.failed++; @@ -231,7 +231,7 @@ namespace Catch { } virtual bool shouldDebugBreak() const { - return m_config.shouldDebugBreak(); + return m_config->shouldDebugBreak(); } virtual std::string getCurrentTestName() const { @@ -247,7 +247,7 @@ namespace Catch { public: // !TBD We need to do this another way! bool aborting() const { - return m_totals.assertions.failed == static_cast( m_config.getCutoff() ); + return m_totals.assertions.failed == static_cast( m_config->getCutoff() ); } private: @@ -315,13 +315,13 @@ namespace Catch { RunningTest* m_runningTest; AssertionResult m_lastResult; - Config const& m_config; + Ptr m_config; Totals m_totals; Ptr m_reporter; std::vector m_messages; IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; - const IConfig* m_prevConfig; + Ptr m_prevConfig; AssertionInfo m_lastAssertionInfo; std::vector m_unfinishedSections; }; diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 13a4481f..296d4d89 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -160,7 +160,7 @@ namespace Catch { } virtual void Result( const AssertionResult& assertionResult ) { - if( !m_config.includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok ) + if( !m_config.fullConfig()->includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok ) return; startSpansLazily(); @@ -289,10 +289,10 @@ namespace Catch { void startSpansLazily() { if( !m_testingSpan.emitted ) { - if( m_config.name().empty() ) + if( m_config.fullConfig()->name().empty() ) m_config.stream() << "[Started testing]" << std::endl; else - m_config.stream() << "[Started testing: " << m_config.name() << "]" << std::endl; + m_config.stream() << "[Started testing: " << m_config.fullConfig()->name() << "]" << std::endl; m_testingSpan.emitted = true; } diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 658492a1..12640a2a 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -43,7 +43,7 @@ namespace Catch { AssertionResult const& result = _assertionStats.assertionResult; // Drop out if result was successful and we're not printing those - if( !m_config.includeSuccessfulResults() && result.isOk() ) + if( !m_config->includeSuccessfulResults() && result.isOk() ) return; lazyPrint(); diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 7e2f4b2b..62b97a42 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -65,7 +65,7 @@ namespace Catch { }; public: - JunitReporter( const ReporterConfig& config ) + JunitReporter( ReporterConfig const& config ) : m_config( config ), m_testSuiteStats( "AllTests" ), m_currentStats( &m_testSuiteStats ) @@ -86,7 +86,7 @@ namespace Catch { virtual void StartGroup( const std::string& groupName ) { if( groupName.empty() ) - m_statsForSuites.push_back( Stats( m_config.name() ) ); + m_statsForSuites.push_back( Stats( m_config.fullConfig()->name() ) ); else m_statsForSuites.push_back( Stats( groupName ) ); m_currentStats = &m_statsForSuites.back(); @@ -110,7 +110,7 @@ namespace Catch { } virtual void Result( const Catch::AssertionResult& assertionResult ) { - if( assertionResult.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults() ) { + if( assertionResult.getResultType() != ResultWas::Ok || m_config.fullConfig()->includeSuccessfulResults() ) { TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back(); TestStats stats; std::ostringstream oss; @@ -238,7 +238,6 @@ namespace Catch { private: ReporterConfig m_config; -// bool m_currentTestSuccess; Stats m_testSuiteStats; Stats* m_currentStats; diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index ae3af3c6..da040b46 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -16,7 +16,7 @@ namespace Catch { class XmlReporter : public SharedImpl { public: - XmlReporter( const ReporterConfig& config ) : m_config( config ) {} + XmlReporter( ReporterConfig const& config ) : m_config( config ) {} static std::string getDescription() { return "Reports test results as an XML document"; @@ -32,8 +32,8 @@ namespace Catch { virtual void StartTesting() { m_xml = XmlWriter( m_config.stream() ); m_xml.startElement( "Catch" ); - if( !m_config.name().empty() ) - m_xml.writeAttribute( "name", m_config.name() ); + if( !m_config.fullConfig()->name().empty() ) + m_xml.writeAttribute( "name", m_config.fullConfig()->name() ); } virtual void EndTesting( const Totals& totals ) { @@ -76,7 +76,7 @@ namespace Catch { } virtual void Result( const Catch::AssertionResult& assertionResult ) { - if( !m_config.includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok ) + if( !m_config.fullConfig()->includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok ) return; if( assertionResult.hasExpression() ) { diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index e676dfb1..9330b7b2 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -5544,12 +5544,12 @@ with message: ------------------------------------------------------------------------------- cmdline - plain filename + arg separated by spaces ------------------------------------------------------------------------------- -CmdLineTests.cpp:416 +CmdLineTests.cpp:58 ............................................................................... -CmdLineTests.cpp:420: +CmdLineTests.cpp:62: PASSED: CHECK( config.fileName == "filename.ext" ) with expansion: @@ -5557,12 +5557,12 @@ with expansion: ------------------------------------------------------------------------------- cmdline - plain filename with colon + arg separated by colon ------------------------------------------------------------------------------- -CmdLineTests.cpp:422 +CmdLineTests.cpp:64 ............................................................................... -CmdLineTests.cpp:426: +CmdLineTests.cpp:68: PASSED: CHECK( config.fileName == "filename.ext" ) with expansion: @@ -5570,12 +5570,12 @@ with expansion: ------------------------------------------------------------------------------- cmdline - plain filename with = + arg separated by = ------------------------------------------------------------------------------- -CmdLineTests.cpp:428 +CmdLineTests.cpp:70 ............................................................................... -CmdLineTests.cpp:432: +CmdLineTests.cpp:74: PASSED: CHECK( config.fileName == "filename.ext" ) with expansion: @@ -5585,10 +5585,10 @@ with expansion: cmdline long opt ------------------------------------------------------------------------------- -CmdLineTests.cpp:434 +CmdLineTests.cpp:76 ............................................................................... -CmdLineTests.cpp:438: +CmdLineTests.cpp:80: PASSED: CHECK( config.fileName == "%stdout" ) with expansion: @@ -5598,10 +5598,10 @@ with expansion: cmdline a number ------------------------------------------------------------------------------- -CmdLineTests.cpp:445 +CmdLineTests.cpp:87 ............................................................................... -CmdLineTests.cpp:449: +CmdLineTests.cpp:91: PASSED: CHECK( config.number == 42 ) with expansion: @@ -5611,14 +5611,14 @@ with expansion: cmdline not a number ------------------------------------------------------------------------------- -CmdLineTests.cpp:451 +CmdLineTests.cpp:93 ............................................................................... -CmdLineTests.cpp:453: +CmdLineTests.cpp:95: PASSED: CHECK_THROWS( parseInto( cli, argv, config ) ) -CmdLineTests.cpp:455: +CmdLineTests.cpp:97: PASSED: CHECK( config.number == 0 ) with expansion: @@ -5628,22 +5628,22 @@ with expansion: cmdline two parsers ------------------------------------------------------------------------------- -CmdLineTests.cpp:458 +CmdLineTests.cpp:100 ............................................................................... -CmdLineTests.cpp:473: +CmdLineTests.cpp:115: PASSED: CHECK( config1.number == 42 ) with expansion: 42 == 42 -CmdLineTests.cpp:475: +CmdLineTests.cpp:117: PASSED: REQUIRE_FALSE( unusedTokens.empty() ) with expansion: !false -CmdLineTests.cpp:477: +CmdLineTests.cpp:119: PASSED: CHECK( config2.description == "some text" ) with expansion: @@ -5654,10 +5654,10 @@ cmdline methods in range ------------------------------------------------------------------------------- -CmdLineTests.cpp:486 +CmdLineTests.cpp:128 ............................................................................... -CmdLineTests.cpp:490: +CmdLineTests.cpp:132: PASSED: REQUIRE( config.index == 3 ) with expansion: @@ -5668,10 +5668,10 @@ cmdline methods out of range ------------------------------------------------------------------------------- -CmdLineTests.cpp:492 +CmdLineTests.cpp:134 ............................................................................... -CmdLineTests.cpp:495: +CmdLineTests.cpp:137: PASSED: REQUIRE_THROWS( parseInto( cli, argv, config ) ) @@ -5680,10 +5680,10 @@ cmdline flags set ------------------------------------------------------------------------------- -CmdLineTests.cpp:504 +CmdLineTests.cpp:146 ............................................................................... -CmdLineTests.cpp:508: +CmdLineTests.cpp:150: PASSED: REQUIRE( config.flag ) with expansion: @@ -5694,36 +5694,75 @@ cmdline flags not set ------------------------------------------------------------------------------- -CmdLineTests.cpp:510 +CmdLineTests.cpp:152 ............................................................................... -CmdLineTests.cpp:514: +CmdLineTests.cpp:156: PASSED: REQUIRE( config.flag == false ) with expansion: false == false --?, -h, --help display usage information --l, --list list all (or matching) test cases --t, --tags list all (or matching) tags --p, --passing show passing test output --b, --break break into debugger on failure --e, --nothrow Skip exception tests --o, --out output filename --r, --reporter e.g. console | xml | junit --n, --name suite name --a, --abort abort at first failure --x, --abortx abort after x failures --w, --warn enables warnings - which test or tests to use +usage: + testApp [ ...] [options] + +where options are: + -o, --output specifies output file + -n + + +------------------------------------------------------------------------------- +cmdline + positional +------------------------------------------------------------------------------- +CmdLineTests.cpp:159 +............................................................................... + +CmdLineTests.cpp:177: +PASSED: + REQUIRE( config.firstPos == "1st" ) +with expansion: + "1st" == "1st" + +CmdLineTests.cpp:178: +PASSED: + REQUIRE( config.secondPos == "2nd" ) +with expansion: + "2nd" == "2nd" + +CmdLineTests.cpp:179: +PASSED: + REQUIRE( config.unpositional == "3rd" ) +with expansion: + "3rd" == "3rd" + +usage: + CatchTestApp [ ...] [options] + +where options are: + -?, -h, --help display usage information + -l, --list-tests list all (or matching) test cases + -t, --list-tags list all (or matching) tags + --list-reporters list all reporters + -s, --success include successful tests in output + -b, --break break into debugger on failure + -e, --nothrow Skip exception tests + -o, --out output filename + -r, --reporter reporter to use - defaults to console + -n, --name suite name + -a, --abort abort at first failure + -x, --abortx abort after x failures + -w, --warn enable warnings + -v, --verbosity level of verbosity (0=no output) + ------------------------------------------------------------------------------- Scenario: New Catch commandline interface Given: A built cli parser for Catch - When: It is streamed + When: We ask for usage strings Then: It prints the usage strings ------------------------------------------------------------------------------- -CmdLineTests.cpp:628 +CmdLineTests.cpp:324 ............................................................................... @@ -5734,22 +5773,22 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: Multiple flags are combined ------------------------------------------------------------------------------- -CmdLineTests.cpp:633 +CmdLineTests.cpp:329 ............................................................................... -CmdLineTests.cpp:635: +CmdLineTests.cpp:331: PASSED: - CHECK_FALSE( config.showPassingTests ) + CHECK_FALSE( config.showSuccessfulTests ) with expansion: !false -CmdLineTests.cpp:636: +CmdLineTests.cpp:332: PASSED: CHECK_FALSE( config.noThrow ) with expansion: !false -CmdLineTests.cpp:637: +CmdLineTests.cpp:333: PASSED: CHECK_FALSE( config.breakIntoDebugger ) with expansion: @@ -5761,29 +5800,191 @@ Scenario: New Catch commandline interface When: Multiple flags are combined Then: All the flags are set ------------------------------------------------------------------------------- -CmdLineTests.cpp:642 +CmdLineTests.cpp:338 ............................................................................... -CmdLineTests.cpp:643: +CmdLineTests.cpp:339: PASSED: - CHECK( config.showPassingTests ) + CHECK( config.showSuccessfulTests ) with expansion: true -CmdLineTests.cpp:644: +CmdLineTests.cpp:340: PASSED: CHECK( config.noThrow ) with expansion: true -CmdLineTests.cpp:645: +CmdLineTests.cpp:341: PASSED: CHECK( config.breakIntoDebugger ) with expansion: true +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: Multiple flags are combined +------------------------------------------------------------------------------- +CmdLineTests.cpp:329 +............................................................................... + +CmdLineTests.cpp:331: +PASSED: + CHECK_FALSE( config.showSuccessfulTests ) +with expansion: + !false + +CmdLineTests.cpp:332: +PASSED: + CHECK_FALSE( config.noThrow ) +with expansion: + !false + +CmdLineTests.cpp:333: +PASSED: + CHECK_FALSE( config.breakIntoDebugger ) +with expansion: + !false + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: A flag is set via a nullary method +------------------------------------------------------------------------------- +CmdLineTests.cpp:344 +............................................................................... + +CmdLineTests.cpp:345: +PASSED: + CHECK( config.abortAfter == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: A flag is set via a nullary method + Then: The flag is set +------------------------------------------------------------------------------- +CmdLineTests.cpp:350 +............................................................................... + +CmdLineTests.cpp:351: +PASSED: + REQUIRE( config.abortAfter == 1 ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: A flag is set via a nullary method +------------------------------------------------------------------------------- +CmdLineTests.cpp:344 +............................................................................... + +CmdLineTests.cpp:345: +PASSED: + CHECK( config.abortAfter == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: A flag is set via a unary method +------------------------------------------------------------------------------- +CmdLineTests.cpp:353 +............................................................................... + +CmdLineTests.cpp:354: +PASSED: + CHECK( config.abortAfter == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: A flag is set via a unary method + Then: The flag is set +------------------------------------------------------------------------------- +CmdLineTests.cpp:359 +............................................................................... + +CmdLineTests.cpp:360: +PASSED: + REQUIRE( config.abortAfter == 2 ) +with expansion: + 2 == 2 + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: A flag is set via a unary method +------------------------------------------------------------------------------- +CmdLineTests.cpp:353 +............................................................................... + +CmdLineTests.cpp:354: +PASSED: + CHECK( config.abortAfter == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: A positional argument is supplied + Then: The argument is in the testOrTags collection +------------------------------------------------------------------------------- +CmdLineTests.cpp:367 +............................................................................... + +CmdLineTests.cpp:368: +PASSED: + REQUIRE( config.testsOrTags.size() == 1 ) +with expansion: + 1 == 1 + +CmdLineTests.cpp:369: +PASSED: + REQUIRE( config.testsOrTags[0] == "[hello]" ) +with expansion: + "[hello]" == "[hello]" + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: And enum opt is set by numeric value +------------------------------------------------------------------------------- +CmdLineTests.cpp:372 +............................................................................... + +CmdLineTests.cpp:373: +PASSED: + CHECK( config.verbosity == Config::Verbosity::Normal ) +with expansion: + 2 == 2 + +------------------------------------------------------------------------------- +Scenario: New Catch commandline interface + Given: A built cli parser for Catch + When: And enum opt is set by numeric value + Then: The member is set to the enum value +------------------------------------------------------------------------------- +CmdLineTests.cpp:378 +............................................................................... + +CmdLineTests.cpp:379: +PASSED: + REQUIRE( config.verbosity == Config::Verbosity::NoOutput ) +with expansion: + 0 == 0 + =============================================================================== -115 test cases - 50 failed (728 assertions - 107 failed) +115 test cases - 50 failed (744 assertions - 107 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -6104,7 +6305,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -6611,22 +6812,36 @@ TrickyTests.cpp:106 - + + +usage: + testApp <first arg> <second arg> [<any arg> ...] [options] + +where options are: + -o, --output <filename> specifies output file + -n <an integral value> + + --?, -h, --help display usage information --l, --list list all (or matching) test cases --t, --tags list all (or matching) tags --p, --passing show passing test output --b, --break break into debugger on failure --e, --nothrow Skip exception tests --o, --out <file name> output filename --r, --reporter <reporter name[:filename]> e.g. console | xml | junit --n, --name <name> suite name --a, --abort abort at first failure --x, --abortx <number of failures> abort after x failures --w, --warn <warning name> enables warnings - <test name, pattern or tags> which test or tests to use +usage: + CatchTestApp [<test name, pattern or tags> ...] [options] + +where options are: + -?, -h, --help display usage information + -l, --list-tests list all (or matching) test cases + -t, --list-tags list all (or matching) tags + --list-reporters list all reporters + -s, --success include successful tests in output + -b, --break break into debugger on failure + -e, --nothrow Skip exception tests + -o, --out <filename> output filename + -r, --reporter <name[:filename]> reporter to use - defaults to console + -n, --name <name> suite name + -a, --abort abort at first failure + -x, --abortx <number of failures> abort after x failures + -w, --warn <warning name> enable warnings + -v, --verbosity <level> level of verbosity (0=no output) @@ -6646,19 +6861,33 @@ Some information hello hello --?, -h, --help display usage information --l, --list list all (or matching) test cases --t, --tags list all (or matching) tags --p, --passing show passing test output --b, --break break into debugger on failure --e, --nothrow Skip exception tests --o, --out <file name> output filename --r, --reporter <reporter name[:filename]> e.g. console | xml | junit --n, --name <name> suite name --a, --abort abort at first failure --x, --abortx <number of failures> abort after x failures --w, --warn <warning name> enables warnings - <test name, pattern or tags> which test or tests to use +usage: + testApp <first arg> <second arg> [<any arg> ...] [options] + +where options are: + -o, --output <filename> specifies output file + -n <an integral value> + + + +usage: + CatchTestApp [<test name, pattern or tags> ...] [options] + +where options are: + -?, -h, --help display usage information + -l, --list-tests list all (or matching) test cases + -t, --list-tags list all (or matching) tags + --list-reporters list all reporters + -s, --success include successful tests in output + -b, --break break into debugger on failure + -e, --nothrow Skip exception tests + -o, --out <filename> output filename + -r, --reporter <name[:filename]> reporter to use - defaults to console + -n, --name <name> suite name + -a, --abort abort at first failure + -x, --abortx <number of failures> abort after x failures + -w, --warn <warning name> enable warnings + -v, --verbosity <level> level of verbosity (0=no output) An error @@ -12573,8 +12802,8 @@ BDDTests.cpp" line="54"> -
-CmdLineTests.cpp" line="420"> +
+CmdLineTests.cpp" line="62"> config.fileName == "filename.ext" @@ -12584,8 +12813,8 @@ CmdLineTests.cpp" line="420">
-
-CmdLineTests.cpp" line="426"> +
+CmdLineTests.cpp" line="68"> config.fileName == "filename.ext" @@ -12595,8 +12824,8 @@ CmdLineTests.cpp" line="426">
-
-CmdLineTests.cpp" line="432"> +
+CmdLineTests.cpp" line="74"> config.fileName == "filename.ext" @@ -12607,7 +12836,7 @@ CmdLineTests.cpp" line="432">
-CmdLineTests.cpp" line="438"> +CmdLineTests.cpp" line="80"> config.fileName == "%stdout" @@ -12618,7 +12847,7 @@ CmdLineTests.cpp" line="438">
-CmdLineTests.cpp" line="449"> +CmdLineTests.cpp" line="91"> config.number == 42 @@ -12629,7 +12858,7 @@ CmdLineTests.cpp" line="449">
-CmdLineTests.cpp" line="453"> +CmdLineTests.cpp" line="95"> parseInto( cli, argv, config ) @@ -12637,7 +12866,7 @@ CmdLineTests.cpp" line="453"> parseInto( cli, argv, config ) -CmdLineTests.cpp" line="455"> +CmdLineTests.cpp" line="97"> config.number == 0 @@ -12648,7 +12877,7 @@ CmdLineTests.cpp" line="455">
-CmdLineTests.cpp" line="473"> +CmdLineTests.cpp" line="115"> config1.number == 42 @@ -12656,7 +12885,7 @@ CmdLineTests.cpp" line="473"> 42 == 42 -CmdLineTests.cpp" line="475"> +CmdLineTests.cpp" line="117"> !unusedTokens.empty() @@ -12664,7 +12893,7 @@ CmdLineTests.cpp" line="475"> !false -CmdLineTests.cpp" line="477"> +CmdLineTests.cpp" line="119"> config2.description == "some text" @@ -12676,7 +12905,7 @@ CmdLineTests.cpp" line="477">
-CmdLineTests.cpp" line="490"> +CmdLineTests.cpp" line="132"> config.index == 3 @@ -12690,7 +12919,7 @@ CmdLineTests.cpp" line="490">
-CmdLineTests.cpp" line="495"> +CmdLineTests.cpp" line="137"> parseInto( cli, argv, config ) @@ -12707,7 +12936,7 @@ CmdLineTests.cpp" line="495">
-CmdLineTests.cpp" line="508"> +CmdLineTests.cpp" line="150"> config.flag @@ -12721,7 +12950,7 @@ CmdLineTests.cpp" line="508">
-CmdLineTests.cpp" line="514"> +CmdLineTests.cpp" line="156"> config.flag == false @@ -12733,11 +12962,41 @@ CmdLineTests.cpp" line="514">
+
+ +
+
+CmdLineTests.cpp" line="177"> + + config.firstPos == "1st" + + + "1st" == "1st" + + +CmdLineTests.cpp" line="178"> + + config.secondPos == "2nd" + + + "2nd" == "2nd" + + +CmdLineTests.cpp" line="179"> + + config.unpositional == "3rd" + + + "3rd" == "3rd" + + + +
-
+
@@ -12746,22 +13005,22 @@ CmdLineTests.cpp" line="514">
-
+
-CmdLineTests.cpp" line="635"> +CmdLineTests.cpp" line="331"> - !config.showPassingTests + !config.showSuccessfulTests !false -CmdLineTests.cpp" line="636"> +CmdLineTests.cpp" line="332"> !config.noThrow @@ -12769,7 +13028,7 @@ CmdLineTests.cpp" line="636"> !false -CmdLineTests.cpp" line="637"> +CmdLineTests.cpp" line="333"> !config.breakIntoDebugger @@ -12778,15 +13037,15 @@ CmdLineTests.cpp" line="637">
-CmdLineTests.cpp" line="643"> +CmdLineTests.cpp" line="339"> - config.showPassingTests + config.showSuccessfulTests true -CmdLineTests.cpp" line="644"> +CmdLineTests.cpp" line="340"> config.noThrow @@ -12794,7 +13053,7 @@ CmdLineTests.cpp" line="644"> true -CmdLineTests.cpp" line="645"> +CmdLineTests.cpp" line="341"> config.breakIntoDebugger @@ -12808,11 +13067,175 @@ CmdLineTests.cpp" line="645">
+
+
+CmdLineTests.cpp" line="331"> + + !config.showSuccessfulTests + + + !false + + +CmdLineTests.cpp" line="332"> + + !config.noThrow + + + !false + + +CmdLineTests.cpp" line="333"> + + !config.breakIntoDebugger + + + !false + + + +
+ +
+
+
+CmdLineTests.cpp" line="345"> + + config.abortAfter == 0 + + + 0 == 0 + + +
+CmdLineTests.cpp" line="351"> + + config.abortAfter == 1 + + + 1 == 1 + + + +
+ +
+ +
+
+
+CmdLineTests.cpp" line="345"> + + config.abortAfter == 0 + + + 0 == 0 + + + +
+ +
+
+
+CmdLineTests.cpp" line="354"> + + config.abortAfter == 0 + + + 0 == 0 + + +
+CmdLineTests.cpp" line="360"> + + config.abortAfter == 2 + + + 2 == 2 + + + +
+ +
+ +
+
+
+CmdLineTests.cpp" line="354"> + + config.abortAfter == 0 + + + 0 == 0 + + + +
+ +
+
+
+
+CmdLineTests.cpp" line="368"> + + config.testsOrTags.size() == 1 + + + 1 == 1 + + +CmdLineTests.cpp" line="369"> + + config.testsOrTags[0] == "[hello]" + + + "[hello]" == "[hello]" + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+CmdLineTests.cpp" line="373"> + + config.verbosity == Config::Verbosity::Normal + + + 2 == 2 + + +
+CmdLineTests.cpp" line="379"> + + config.verbosity == Config::Verbosity::NoOutput + + + 0 == 0 + + + +
+ +
+ +
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -14659,114 +15082,201 @@ BDDTests.cpp:67: succeeded [Finished: 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' All tests passed (1 assertion in 1 test case)] [Running: cmdline] -[Started section: 'plain filename'] -CmdLineTests.cpp:420: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -[End of section: 'plain filename' 1 assertion passed] +[Started section: 'arg separated by spaces'] +CmdLineTests.cpp:62: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +[End of section: 'arg separated by spaces' 1 assertion passed] -[Started section: 'plain filename with colon'] -CmdLineTests.cpp:426: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -[End of section: 'plain filename with colon' 1 assertion passed] +[Started section: 'arg separated by colon'] +CmdLineTests.cpp:68: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +[End of section: 'arg separated by colon' 1 assertion passed] -[Started section: 'plain filename with ='] -CmdLineTests.cpp:432: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -[End of section: 'plain filename with =' 1 assertion passed] +[Started section: 'arg separated by ='] +CmdLineTests.cpp:74: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +[End of section: 'arg separated by =' 1 assertion passed] [Started section: 'long opt'] -CmdLineTests.cpp:438: config.fileName == "%stdout" succeeded for: "%stdout" == "%stdout" +CmdLineTests.cpp:80: config.fileName == "%stdout" succeeded for: "%stdout" == "%stdout" [End of section: 'long opt' 1 assertion passed] [Started section: 'a number'] -CmdLineTests.cpp:449: config.number == 42 succeeded for: 42 == 42 +CmdLineTests.cpp:91: config.number == 42 succeeded for: 42 == 42 [End of section: 'a number' 1 assertion passed] [Started section: 'not a number'] -CmdLineTests.cpp:453: parseInto( cli, argv, config ) succeeded -CmdLineTests.cpp:455: config.number == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:95: parseInto( cli, argv, config ) succeeded +CmdLineTests.cpp:97: config.number == 0 succeeded for: 0 == 0 [End of section: 'not a number' All 2 assertions passed] [Started section: 'two parsers'] -CmdLineTests.cpp:473: config1.number == 42 succeeded for: 42 == 42 -CmdLineTests.cpp:475: !unusedTokens.empty() succeeded for: !false -CmdLineTests.cpp:477: config2.description == "some text" succeeded for: "some text" == "some text" +CmdLineTests.cpp:115: config1.number == 42 succeeded for: 42 == 42 +CmdLineTests.cpp:117: !unusedTokens.empty() succeeded for: !false +CmdLineTests.cpp:119: config2.description == "some text" succeeded for: "some text" == "some text" [End of section: 'two parsers' All 3 assertions passed] [Started section: 'methods'] [Started section: 'in range'] -CmdLineTests.cpp:490: config.index == 3 succeeded for: 3 == 3 +CmdLineTests.cpp:132: config.index == 3 succeeded for: 3 == 3 [End of section: 'in range' 1 assertion passed] [End of section: 'methods' 1 assertion passed] [Started section: 'methods'] [Started section: 'out of range'] -CmdLineTests.cpp:495: parseInto( cli, argv, config ) succeeded +CmdLineTests.cpp:137: parseInto( cli, argv, config ) succeeded [End of section: 'out of range' 1 assertion passed] [End of section: 'methods' 1 assertion passed] [Started section: 'flags'] [Started section: 'set'] -CmdLineTests.cpp:508: config.flag succeeded for: true +CmdLineTests.cpp:150: config.flag succeeded for: true [End of section: 'set' 1 assertion passed] [End of section: 'flags' 1 assertion passed] [Started section: 'flags'] [Started section: 'not set'] -CmdLineTests.cpp:514: config.flag == false succeeded for: false == false +CmdLineTests.cpp:156: config.flag == false succeeded for: false == false [End of section: 'not set' 1 assertion passed] [End of section: 'flags' 1 assertion passed] -[Finished: 'cmdline' All tests passed (14 assertions in 1 test case)] --?, -h, --help display usage information --l, --list list all (or matching) test cases --t, --tags list all (or matching) tags --p, --passing show passing test output --b, --break break into debugger on failure --e, --nothrow Skip exception tests --o, --out output filename --r, --reporter e.g. console | xml | junit --n, --name suite name --a, --abort abort at first failure --x, --abortx abort after x failures --w, --warn enables warnings - which test or tests to use +usage: + testApp [ ...] [options] + +where options are: + -o, --output specifies output file + -n + + +[Started section: 'positional'] +CmdLineTests.cpp:177: config.firstPos == "1st" succeeded for: "1st" == "1st" +CmdLineTests.cpp:178: config.secondPos == "2nd" succeeded for: "2nd" == "2nd" +CmdLineTests.cpp:179: config.unpositional == "3rd" succeeded for: "3rd" == "3rd" +[End of section: 'positional' All 3 assertions passed] + +[Finished: 'cmdline' All tests passed (17 assertions in 1 test case)] +usage: + CatchTestApp [ ...] [options] + +where options are: + -?, -h, --help display usage information + -l, --list-tests list all (or matching) test cases + -t, --list-tags list all (or matching) tags + --list-reporters list all reporters + -s, --success include successful tests in output + -b, --break break into debugger on failure + -e, --nothrow Skip exception tests + -o, --out output filename + -r, --reporter reporter to use - defaults to console + -n, --name suite name + -a, --abort abort at first failure + -x, --abortx abort after x failures + -w, --warn enable warnings + -v, --verbosity level of verbosity (0=no output) + [Running: Scenario: New Catch commandline interface] [Started section: ' Given: A built cli parser for Catch'] -[Started section: ' When: It is streamed'] +[Started section: ' When: We ask for usage strings'] [Started section: ' Then: It prints the usage strings'] No assertions in section, ' Then: It prints the usage strings' [End of section: ' Then: It prints the usage strings' 1 assertion failed] -[End of section: ' When: It is streamed' 1 assertion failed] +[End of section: ' When: We ask for usage strings' 1 assertion failed] [End of section: ' Given: A built cli parser for Catch' 1 assertion failed] [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: Multiple flags are combined'] -CmdLineTests.cpp:635: !config.showPassingTests succeeded for: !false -CmdLineTests.cpp:636: !config.noThrow succeeded for: !false -CmdLineTests.cpp:637: !config.breakIntoDebugger succeeded for: !false +CmdLineTests.cpp:331: !config.showSuccessfulTests succeeded for: !false +CmdLineTests.cpp:332: !config.noThrow succeeded for: !false +CmdLineTests.cpp:333: !config.breakIntoDebugger succeeded for: !false [Started section: ' Then: All the flags are set'] -CmdLineTests.cpp:643: config.showPassingTests succeeded for: true -CmdLineTests.cpp:644: config.noThrow succeeded for: true -CmdLineTests.cpp:645: config.breakIntoDebugger succeeded for: true +CmdLineTests.cpp:339: config.showSuccessfulTests succeeded for: true +CmdLineTests.cpp:340: config.noThrow succeeded for: true +CmdLineTests.cpp:341: config.breakIntoDebugger succeeded for: true [End of section: ' Then: All the flags are set' All 3 assertions passed] [End of section: ' When: Multiple flags are combined' All 6 assertions passed] [End of section: ' Given: A built cli parser for Catch' All 6 assertions passed] -[Finished: 'Scenario: New Catch commandline interface' 1 test case failed (1 of 7 assertions failed)] -[End of group: '~dummy'. 50 of 115 test cases failed (107 of 728 assertions failed)] +[Started section: ' Given: A built cli parser for Catch'] +[Started section: ' When: Multiple flags are combined'] +CmdLineTests.cpp:331: !config.showSuccessfulTests succeeded for: !false +CmdLineTests.cpp:332: !config.noThrow succeeded for: !false +CmdLineTests.cpp:333: !config.breakIntoDebugger succeeded for: !false +[End of section: ' When: Multiple flags are combined' All 3 assertions passed] + +[End of section: ' Given: A built cli parser for Catch' All 3 assertions passed] + +[Started section: ' Given: A built cli parser for Catch'] +[Started section: ' When: A flag is set via a nullary method'] +CmdLineTests.cpp:345: config.abortAfter == 0 succeeded for: 0 == 0 +[Started section: ' Then: The flag is set'] +CmdLineTests.cpp:351: config.abortAfter == 1 succeeded for: 1 == 1 +[End of section: ' Then: The flag is set' 1 assertion passed] + +[End of section: ' When: A flag is set via a nullary method' All 2 assertions passed] + +[End of section: ' Given: A built cli parser for Catch' All 2 assertions passed] + +[Started section: ' Given: A built cli parser for Catch'] +[Started section: ' When: A flag is set via a nullary method'] +CmdLineTests.cpp:345: config.abortAfter == 0 succeeded for: 0 == 0 +[End of section: ' When: A flag is set via a nullary method' 1 assertion passed] + +[End of section: ' Given: A built cli parser for Catch' 1 assertion passed] + +[Started section: ' Given: A built cli parser for Catch'] +[Started section: ' When: A flag is set via a unary method'] +CmdLineTests.cpp:354: config.abortAfter == 0 succeeded for: 0 == 0 +[Started section: ' Then: The flag is set'] +CmdLineTests.cpp:360: config.abortAfter == 2 succeeded for: 2 == 2 +[End of section: ' Then: The flag is set' 1 assertion passed] + +[End of section: ' When: A flag is set via a unary method' All 2 assertions passed] + +[End of section: ' Given: A built cli parser for Catch' All 2 assertions passed] + +[Started section: ' Given: A built cli parser for Catch'] +[Started section: ' When: A flag is set via a unary method'] +CmdLineTests.cpp:354: config.abortAfter == 0 succeeded for: 0 == 0 +[End of section: ' When: A flag is set via a unary method' 1 assertion passed] + +[End of section: ' Given: A built cli parser for Catch' 1 assertion passed] + +[Started section: ' Given: A built cli parser for Catch'] +[Started section: ' When: A positional argument is supplied'] +[Started section: ' Then: The argument is in the testOrTags collection'] +CmdLineTests.cpp:368: config.testsOrTags.size() == 1 succeeded for: 1 == 1 +CmdLineTests.cpp:369: config.testsOrTags[0] == "[hello]" succeeded for: "[hello]" == "[hello]" +[End of section: ' Then: The argument is in the testOrTags collection' All 2 assertions passed] + +[End of section: ' When: A positional argument is supplied' All 2 assertions passed] + +[End of section: ' Given: A built cli parser for Catch' All 2 assertions passed] + +[Started section: ' Given: A built cli parser for Catch'] +[Started section: ' When: And enum opt is set by numeric value'] +CmdLineTests.cpp:373: config.verbosity == Config::Verbosity::Normal succeeded for: 2 == 2 +[Started section: ' Then: The member is set to the enum value'] +CmdLineTests.cpp:379: config.verbosity == Config::Verbosity::NoOutput succeeded for: 0 == 0 +[End of section: ' Then: The member is set to the enum value' 1 assertion passed] + +[End of section: ' When: And enum opt is set by numeric value' All 2 assertions passed] + +[End of section: ' Given: A built cli parser for Catch' All 2 assertions passed] + +[Finished: 'Scenario: New Catch commandline interface' 1 test case failed (1 of 20 assertions failed)] +[End of group: '~dummy'. 50 of 115 test cases failed (107 of 744 assertions failed)] -[Testing completed. 50 of 115 test cases failed (107 of 728 assertions failed)] +[Testing completed. 50 of 115 test cases failed (107 of 744 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index 9bd40b5a..af26510f 100644 --- a/projects/SelfTest/catch_self_test.cpp +++ b/projects/SelfTest/catch_self_test.cpp @@ -15,8 +15,8 @@ namespace Catch{ Totals EmbeddedRunner::runMatching( const std::string& rawTestSpec, std::size_t groupIndex, std::size_t groupsCount, const std::string& ) { std::ostringstream oss; - Config config; - config.setStreamBuf( oss.rdbuf() ); + Ptr config = new Config(); + config->setStreamBuf( oss.rdbuf() ); Totals totals; From ca9b92f8fa9ae8a004040364f8baf35cefcc55cb Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 28 May 2013 18:51:53 +0100 Subject: [PATCH 256/296] Most of system now uses Ptr --- include/catch_runner.hpp | 2 +- include/internal/catch_config.hpp | 2 +- include/internal/catch_context.h | 4 ++-- include/internal/catch_context_impl.hpp | 6 +++--- include/internal/catch_interfaces_config.h | 2 ++ include/internal/catch_runner_impl.hpp | 19 +++++++++---------- projects/SelfTest/catch_self_test.cpp | 2 +- 7 files changed, 19 insertions(+), 18 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 2998c866..dd820fe2 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -39,7 +39,7 @@ namespace Catch { filterGroups.push_back( filterGroup ); } - Runner context( m_config, m_reporter ); // This Runner will be renamed Context + Runner context( m_config.get(), m_reporter ); // This Runner will be renamed Context Totals totals; for( std::size_t i=0; i < filterGroups.size() && !context.aborting(); ++i ) { diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 41415e4e..11e1e86d 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -141,7 +141,7 @@ namespace Catch { m_data.filters.push_back( filters ); } - int getCutoff() const { + int abortAfter() const { return m_data.cutoff; } diff --git a/include/internal/catch_context.h b/include/internal/catch_context.h index c419544b..a1468dfb 100644 --- a/include/internal/catch_context.h +++ b/include/internal/catch_context.h @@ -32,7 +32,7 @@ namespace Catch { virtual IRunner& getRunner() = 0; virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0; virtual bool advanceGeneratorsForCurrentTest() = 0; - virtual Ptr getConfig() const = 0; + virtual Ptr getConfig() const = 0; }; struct IMutableContext : IContext @@ -40,7 +40,7 @@ namespace Catch { virtual ~IMutableContext(); virtual void setResultCapture( IResultCapture* resultCapture ) = 0; virtual void setRunner( IRunner* runner ) = 0; - virtual void setConfig( Ptr const& config ) = 0; + virtual void setConfig( Ptr const& config ) = 0; }; IContext& getCurrentContext(); diff --git a/include/internal/catch_context_impl.hpp b/include/internal/catch_context_impl.hpp index 3adcb9ce..e870324f 100644 --- a/include/internal/catch_context_impl.hpp +++ b/include/internal/catch_context_impl.hpp @@ -38,7 +38,7 @@ namespace Catch { return generators && generators->moveNext(); } - virtual Ptr getConfig() const { + virtual Ptr getConfig() const { return m_config; } @@ -49,7 +49,7 @@ namespace Catch { virtual void setRunner( IRunner* runner ) { m_runner = runner; } - virtual void setConfig( Ptr const& config ) { + virtual void setConfig( Ptr const& config ) { m_config = config; } @@ -79,7 +79,7 @@ namespace Catch { private: IRunner* m_runner; IResultCapture* m_resultCapture; - Ptr m_config; + Ptr m_config; std::map m_generatorsByTestName; }; diff --git a/include/internal/catch_interfaces_config.h b/include/internal/catch_interfaces_config.h index 3db8bf2d..87ee35b4 100644 --- a/include/internal/catch_interfaces_config.h +++ b/include/internal/catch_interfaces_config.h @@ -23,7 +23,9 @@ namespace Catch { virtual std::ostream& stream() const = 0; virtual std::string name() const = 0; virtual bool includeSuccessfulResults() const = 0; + virtual bool shouldDebugBreak() const = 0; virtual bool warnAboutMissingAssertions() const = 0; + virtual int abortAfter() const = 0; }; } diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 0451072e..66a57923 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -56,7 +56,7 @@ namespace Catch { public: - explicit Runner( Ptr const& config, Ptr const& reporter ) + explicit Runner( Ptr const& config, Ptr const& reporter ) : m_runInfo( config->name() ), m_context( getCurrentMutableContext() ), m_runningTest( NULL ), @@ -67,7 +67,7 @@ namespace Catch { m_prevConfig( m_context.getConfig() ) { m_context.setRunner( this ); - m_context.setConfig( m_config.get() ); + m_context.setConfig( m_config ); m_context.setResultCapture( this ); m_reporter->testRunStarting( m_runInfo ); } @@ -126,8 +126,7 @@ namespace Catch { Totals deltaTotals = m_totals.delta( prevTotals ); bool missingAssertions = false; - if( deltaTotals.assertions.total() == 0 && - ( m_config->data().warnings & ConfigData::WarnAbout::NoAssertions ) ) { + if( deltaTotals.assertions.total() == 0 && m_config->warnAboutMissingAssertions() ) { m_totals.assertions.failed++; deltaTotals = m_totals.delta( prevTotals ); missingAssertions = true; @@ -149,7 +148,7 @@ namespace Catch { return deltaTotals; } - Ptr config() const { + Ptr config() const { return m_config; } @@ -209,8 +208,8 @@ namespace Catch { Counts assertions = m_totals.assertions - prevAssertions; bool missingAssertions = false; if( assertions.total() == 0 && - ( m_config->data().warnings & ConfigData::WarnAbout::NoAssertions ) && - !m_runningTest->isBranchSection() ) { + m_config->warnAboutMissingAssertions() && + !m_runningTest->isBranchSection() ) { m_totals.assertions.failed++; assertions.failed++; missingAssertions = true; @@ -247,7 +246,7 @@ namespace Catch { public: // !TBD We need to do this another way! bool aborting() const { - return m_totals.assertions.failed == static_cast( m_config->getCutoff() ); + return m_totals.assertions.failed == static_cast( m_config->abortAfter() ); } private: @@ -315,13 +314,13 @@ namespace Catch { RunningTest* m_runningTest; AssertionResult m_lastResult; - Ptr m_config; + Ptr m_config; Totals m_totals; Ptr m_reporter; std::vector m_messages; IRunner* m_prevRunner; IResultCapture* m_prevResultCapture; - Ptr m_prevConfig; + Ptr m_prevConfig; AssertionInfo m_lastAssertionInfo; std::vector m_unfinishedSections; }; diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp index af26510f..089f8e1d 100644 --- a/projects/SelfTest/catch_self_test.cpp +++ b/projects/SelfTest/catch_self_test.cpp @@ -22,7 +22,7 @@ namespace Catch{ // Scoped because Runner doesn't report EndTesting until its destructor { - Runner runner( config, m_reporter.get() ); + Runner runner( config.get(), m_reporter.get() ); totals = runner.runMatching( rawTestSpec, groupIndex, groupsCount ); } return totals; From 43fe6c6e9edae209947101295edcf0e9e217716c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 28 May 2013 18:59:29 +0100 Subject: [PATCH 257/296] Main() functions deal with raw ConfigData --- include/catch_runner.hpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index dd820fe2..1dfd21fc 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -24,8 +24,8 @@ namespace Catch { class Runner2 { // This will become Runner when Runner becomes Context public: - Runner2( Ptr const& config ) - : m_config( config ) + Runner2( ConfigData const& config ) + : m_config( new Config( config ) ) { openStream(); makeReporter(); @@ -110,13 +110,11 @@ namespace Catch { std::set m_testsAlreadyRun; }; - inline int Main( Ptr const& config ) { + inline int Main( ConfigData const& configData ) { int result = 0; try { - Runner2 runner( config ); - - const ConfigData& configData = config->data(); + Runner2 runner( configData ); // Handle list request if( configData.listSpec != List::None ) { @@ -173,7 +171,7 @@ namespace Catch { } } - inline int Main( int argc, char* const argv[], Ptr const& config ) { + inline int Main( int argc, char* const argv[], ConfigData configData = ConfigData() ) { try { CommandParser parser( argc, argv ); @@ -189,7 +187,7 @@ namespace Catch { AllOptions options; - options.parseIntoConfig( parser, config->data() ); + options.parseIntoConfig( parser, configData ); } catch( std::exception& ex ) { std::cerr << ex.what() << "\n\nUsage: ...\n\n"; @@ -198,15 +196,7 @@ namespace Catch { return (std::numeric_limits::max)(); } - return Main( config ); - } - - inline int Main( int argc, char* const argv[] ) { - Ptr config = new Config(); -// !TBD: This doesn't always work, for some reason -// if( isDebuggerActive() ) -// config.useStream( "debug" ); - return Main( argc, argv, config ); + return Main( configData ); } } // end namespace Catch From 6b8837bd9360f26c03112ce4e104ec7aa96b264d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 28 May 2013 19:07:29 +0100 Subject: [PATCH 258/296] Final refactoring to remove direct access to encapsulated ConfigData once in Config --- include/catch_runner.hpp | 10 +++++----- include/internal/catch_config.hpp | 16 +++++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 1dfd21fc..b0cef9be 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -33,7 +33,7 @@ namespace Catch { Totals runTests() { - std::vector filterGroups = m_config->data().filters; + std::vector filterGroups = m_config->filters(); if( filterGroups.empty() ) { TestCaseFilters filterGroup( "" ); filterGroups.push_back( filterGroup ); @@ -76,8 +76,8 @@ namespace Catch { private: void openStream() { - if( !m_config->data().stream.empty() ) - m_config->useStream( m_config->data().stream ); + if( !m_config->getStreamName().empty() ) + m_config->useStream( m_config->getStreamName() ); // Open output file, if specified if( !m_config->getFilename().empty() ) { @@ -91,9 +91,9 @@ namespace Catch { } } void makeReporter() { - std::string reporterName = m_config->data().reporter.empty() + std::string reporterName = m_config->getReporterName().empty() ? "console" - : m_config->data().reporter; + : m_config->getReporterName(); m_reporter = getRegistryHub().getReporterRegistry().create( reporterName, m_config.get() ); if( !m_reporter ) { diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 11e1e86d..baaad59f 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -88,7 +88,8 @@ namespace Catch { Config( ConfigData const& data ) : m_data( data ), - m_os( std::cout.rdbuf() ) + m_os( std::cout.rdbuf() ), + m_filters( data.filters ) {} virtual ~Config() { @@ -134,6 +135,10 @@ namespace Catch { m_stream.release(); m_stream = stream; } + + std::string getStreamName() const { return m_data.stream; } + + std::string getReporterName() const { return m_data.reporter; } void addTestSpec( std::string const& testSpec ) { TestCaseFilters filters( testSpec ); @@ -145,11 +150,8 @@ namespace Catch { return m_data.cutoff; } - ConfigData const& data() const { - return m_data; - } - ConfigData& data() { - return m_data; + std::vector const& filters() const { + return m_filters; } // IConfig interface @@ -162,9 +164,9 @@ namespace Catch { private: ConfigData m_data; - // !TBD Move these out of here Stream m_stream; mutable std::ostream m_os; + std::vector m_filters; }; From f6892bfdf0e230f6a77b3215d71be412f778ec17 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 29 May 2013 07:59:01 +0100 Subject: [PATCH 259/296] Listing is now in terms of interface (and calls to bool functions) --- include/catch_runner.hpp | 15 ++++++------- include/internal/catch_config.hpp | 14 +++--------- include/internal/catch_list.hpp | 36 ++++++++++++++++++------------- 3 files changed, 31 insertions(+), 34 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index b0cef9be..5c699c95 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -24,8 +24,8 @@ namespace Catch { class Runner2 { // This will become Runner when Runner becomes Context public: - Runner2( ConfigData const& config ) - : m_config( new Config( config ) ) + Runner2( Ptr const& config ) + : m_config( config ) { openStream(); makeReporter(); @@ -110,15 +110,14 @@ namespace Catch { std::set m_testsAlreadyRun; }; - inline int Main( ConfigData const& configData ) { + inline int Main( Ptr const& config ) { int result = 0; try { - Runner2 runner( configData ); + Runner2 runner( config ); // Handle list request - if( configData.listSpec != List::None ) { - list( configData ); + if( list( config ) ) { Catch::cleanUp(); return 0; } @@ -195,8 +194,8 @@ namespace Catch { Catch::cleanUp(); return (std::numeric_limits::max)(); } - - return Main( configData ); + Ptr config = new Config( configData ); + return Main( config ); } } // end namespace Catch diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index baaad59f..dc320553 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -101,22 +101,14 @@ namespace Catch { m_data.outputFilename = filename; } - List::What getListSpec( void ) const { - return m_data.listSpec; - } - std::string const& getFilename() const { return m_data.outputFilename ; } - List::What listWhat() const { - return static_cast( m_data.listSpec & List::WhatMask ); - } + bool listTests() const { return m_data.listSpec & List::Tests; } + bool listTags() const { return m_data.listSpec & List::Tags; } + bool listReporters() const { return m_data.listSpec & List::Reports; } - List::What listAs() const { - return static_cast( m_data.listSpec & List::AsMask ); - } - std::string getName() const { return m_data.name; } diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index aa47b132..e583bb87 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -25,8 +25,8 @@ namespace Catch { return true; } - inline void listTests( ConfigData const& config ) { - if( config.filters.empty() ) + inline void listTests( Ptr const& config ) { + if( config->filters().empty() ) std::cout << "All available test cases:\n"; else std::cout << "Matching test cases:\n"; @@ -37,7 +37,7 @@ namespace Catch { std::size_t maxTagLen = 0; std::size_t maxNameLen = 0; for(; it != itEnd; ++it ) { - if( matchesFilters( config.filters, *it ) ) { + if( matchesFilters( config->filters(), *it ) ) { maxTagLen = (std::max)( it->getTestCaseInfo().tagsAsString.size(), maxTagLen ); maxNameLen = (std::max)( it->getTestCaseInfo().name.size(), maxNameLen ); } @@ -54,7 +54,7 @@ namespace Catch { std::size_t matchedTests = 0; for( it = allTests.begin(); it != itEnd; ++it ) { - if( matchesFilters( config.filters, *it ) ) { + if( matchesFilters( config->filters(), *it ) ) { matchedTests++; // !TBD: consider listAs() Text nameWrapper( it->getTestCaseInfo().name, @@ -94,14 +94,14 @@ namespace Catch { } } } - if( config.filters.empty() ) + if( config->filters().empty() ) std::cout << pluralise( matchedTests, "test case" ) << std::endl; else std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; } - inline void listTags( ConfigData const& config ) { - if( config.filters.empty() ) + inline void listTags( Ptr const& config ) { + if( config->filters().empty() ) std::cout << "All available tags:\n"; else std::cout << "Matching tags:\n"; @@ -113,7 +113,7 @@ namespace Catch { std::size_t maxTagLen = 0; for(; it != itEnd; ++it ) { - if( matchesFilters( config.filters, *it ) ) { + if( matchesFilters( config->filters(), *it ) ) { for( std::set::const_iterator tagIt = it->getTestCaseInfo().tags.begin(), tagItEnd = it->getTestCaseInfo().tags.end(); tagIt != tagItEnd; @@ -152,7 +152,7 @@ namespace Catch { std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; } - inline void listReporters( ConfigData const& /*config*/ ) { + inline void listReporters( Ptr const& /*config*/ ) { std::cout << "Available reports:\n"; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); IReporterRegistry::FactoryMap::const_iterator it = factories.begin(), itEnd = factories.end(); @@ -163,15 +163,21 @@ namespace Catch { std::cout << std::endl; } - inline void list( ConfigData const& config ) { - if( config.listSpec & List::Tests ) + inline bool list( Ptr const& config ) { + bool listed = false; + if( config->listTests() ) { listTests( config ); - if( config.listSpec & List::Tags ) + listed = true; + } + if( config->listTags() ) { listTags( config ); - if( config.listSpec & List::Reports ) + listed = true; + } + if( config->listReporters() ) { listReporters( config ); - if( ( config.listSpec & List::All ) == 0 ) - throw std::logic_error( "Unknown list type" ); + listed = true; + } + return listed; } } // end namespace Catch From be8fd82f2021b48299d170e0f4f54df35e742328 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 29 May 2013 08:12:57 +0100 Subject: [PATCH 260/296] Started nudging ConfigData towards new layout --- include/internal/catch_config.hpp | 32 ++-- .../SelfTest/Baselines/approvedResults.txt | 140 +++++++++--------- projects/SelfTest/CmdLineTests.cpp | 3 +- 3 files changed, 93 insertions(+), 82 deletions(-) diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index dc320553..7c88edd8 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -47,6 +47,11 @@ namespace Catch { struct ConfigData { + struct Verbosity { enum Level { + NoOutput = 0, + Quiet, + Normal + }; }; struct WarnAbout { enum What { Nothing = 0x00, NoAssertions = 0x01 @@ -54,24 +59,31 @@ namespace Catch { ConfigData() : listSpec( List::None ), - shouldDebugBreak( false ), includeWhichResults( Include::FailedOnly ), - cutoff( -1 ), + shouldDebugBreak( false ), allowThrows( true ), + cutoff( -1 ), warnings( WarnAbout::Nothing ) {} + List::What listSpec; // !TBD Split into bools + Include::WhichResults includeWhichResults; // !TBD bool + bool shouldDebugBreak; + bool allowThrows; // !TBD invert +// bool showHelp; // !TBD + + int cutoff; + +// Verbosity::Level verbosity; + WarnAbout::What warnings; + std::string reporter; std::string outputFilename; - List::What listSpec; - std::vector filters; - bool shouldDebugBreak; - std::string stream; - Include::WhichResults includeWhichResults; std::string name; - int cutoff; - bool allowThrows; - WarnAbout::What warnings; + + std::vector filters; // !TBD strings + + std::string stream; }; diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 9330b7b2..e5304af8 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -5762,7 +5762,7 @@ Scenario: New Catch commandline interface When: We ask for usage strings Then: It prints the usage strings ------------------------------------------------------------------------------- -CmdLineTests.cpp:324 +CmdLineTests.cpp:323 ............................................................................... @@ -5773,22 +5773,22 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: Multiple flags are combined ------------------------------------------------------------------------------- -CmdLineTests.cpp:329 +CmdLineTests.cpp:328 ............................................................................... -CmdLineTests.cpp:331: +CmdLineTests.cpp:330: PASSED: CHECK_FALSE( config.showSuccessfulTests ) with expansion: !false -CmdLineTests.cpp:332: +CmdLineTests.cpp:331: PASSED: CHECK_FALSE( config.noThrow ) with expansion: !false -CmdLineTests.cpp:333: +CmdLineTests.cpp:332: PASSED: CHECK_FALSE( config.breakIntoDebugger ) with expansion: @@ -5800,22 +5800,22 @@ Scenario: New Catch commandline interface When: Multiple flags are combined Then: All the flags are set ------------------------------------------------------------------------------- -CmdLineTests.cpp:338 +CmdLineTests.cpp:337 ............................................................................... -CmdLineTests.cpp:339: +CmdLineTests.cpp:338: PASSED: CHECK( config.showSuccessfulTests ) with expansion: true -CmdLineTests.cpp:340: +CmdLineTests.cpp:339: PASSED: CHECK( config.noThrow ) with expansion: true -CmdLineTests.cpp:341: +CmdLineTests.cpp:340: PASSED: CHECK( config.breakIntoDebugger ) with expansion: @@ -5826,22 +5826,22 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: Multiple flags are combined ------------------------------------------------------------------------------- -CmdLineTests.cpp:329 +CmdLineTests.cpp:328 ............................................................................... -CmdLineTests.cpp:331: +CmdLineTests.cpp:330: PASSED: CHECK_FALSE( config.showSuccessfulTests ) with expansion: !false -CmdLineTests.cpp:332: +CmdLineTests.cpp:331: PASSED: CHECK_FALSE( config.noThrow ) with expansion: !false -CmdLineTests.cpp:333: +CmdLineTests.cpp:332: PASSED: CHECK_FALSE( config.breakIntoDebugger ) with expansion: @@ -5852,10 +5852,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a nullary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:344 +CmdLineTests.cpp:343 ............................................................................... -CmdLineTests.cpp:345: +CmdLineTests.cpp:344: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5867,10 +5867,10 @@ Scenario: New Catch commandline interface When: A flag is set via a nullary method Then: The flag is set ------------------------------------------------------------------------------- -CmdLineTests.cpp:350 +CmdLineTests.cpp:349 ............................................................................... -CmdLineTests.cpp:351: +CmdLineTests.cpp:350: PASSED: REQUIRE( config.abortAfter == 1 ) with expansion: @@ -5881,10 +5881,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a nullary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:344 +CmdLineTests.cpp:343 ............................................................................... -CmdLineTests.cpp:345: +CmdLineTests.cpp:344: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5895,10 +5895,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a unary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:353 +CmdLineTests.cpp:352 ............................................................................... -CmdLineTests.cpp:354: +CmdLineTests.cpp:353: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5910,10 +5910,10 @@ Scenario: New Catch commandline interface When: A flag is set via a unary method Then: The flag is set ------------------------------------------------------------------------------- -CmdLineTests.cpp:359 +CmdLineTests.cpp:358 ............................................................................... -CmdLineTests.cpp:360: +CmdLineTests.cpp:359: PASSED: REQUIRE( config.abortAfter == 2 ) with expansion: @@ -5924,10 +5924,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a unary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:353 +CmdLineTests.cpp:352 ............................................................................... -CmdLineTests.cpp:354: +CmdLineTests.cpp:353: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5939,16 +5939,16 @@ Scenario: New Catch commandline interface When: A positional argument is supplied Then: The argument is in the testOrTags collection ------------------------------------------------------------------------------- -CmdLineTests.cpp:367 +CmdLineTests.cpp:366 ............................................................................... -CmdLineTests.cpp:368: +CmdLineTests.cpp:367: PASSED: REQUIRE( config.testsOrTags.size() == 1 ) with expansion: 1 == 1 -CmdLineTests.cpp:369: +CmdLineTests.cpp:368: PASSED: REQUIRE( config.testsOrTags[0] == "[hello]" ) with expansion: @@ -5959,10 +5959,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: And enum opt is set by numeric value ------------------------------------------------------------------------------- -CmdLineTests.cpp:372 +CmdLineTests.cpp:371 ............................................................................... -CmdLineTests.cpp:373: +CmdLineTests.cpp:372: PASSED: CHECK( config.verbosity == Config::Verbosity::Normal ) with expansion: @@ -5974,10 +5974,10 @@ Scenario: New Catch commandline interface When: And enum opt is set by numeric value Then: The member is set to the enum value ------------------------------------------------------------------------------- -CmdLineTests.cpp:378 +CmdLineTests.cpp:377 ............................................................................... -CmdLineTests.cpp:379: +CmdLineTests.cpp:378: PASSED: REQUIRE( config.verbosity == Config::Verbosity::NoOutput ) with expansion: @@ -13012,7 +13012,7 @@ CmdLineTests.cpp" line="179">
-CmdLineTests.cpp" line="331"> +CmdLineTests.cpp" line="330"> !config.showSuccessfulTests @@ -13020,7 +13020,7 @@ CmdLineTests.cpp" line="331"> !false -CmdLineTests.cpp" line="332"> +CmdLineTests.cpp" line="331"> !config.noThrow @@ -13028,7 +13028,7 @@ CmdLineTests.cpp" line="332"> !false -CmdLineTests.cpp" line="333"> +CmdLineTests.cpp" line="332"> !config.breakIntoDebugger @@ -13037,7 +13037,7 @@ CmdLineTests.cpp" line="333">
-CmdLineTests.cpp" line="339"> +CmdLineTests.cpp" line="338"> config.showSuccessfulTests @@ -13045,7 +13045,7 @@ CmdLineTests.cpp" line="339"> true -CmdLineTests.cpp" line="340"> +CmdLineTests.cpp" line="339"> config.noThrow @@ -13053,7 +13053,7 @@ CmdLineTests.cpp" line="340"> true -CmdLineTests.cpp" line="341"> +CmdLineTests.cpp" line="340"> config.breakIntoDebugger @@ -13069,7 +13069,7 @@ CmdLineTests.cpp" line="341">
-CmdLineTests.cpp" line="331"> +CmdLineTests.cpp" line="330"> !config.showSuccessfulTests @@ -13077,7 +13077,7 @@ CmdLineTests.cpp" line="331"> !false -CmdLineTests.cpp" line="332"> +CmdLineTests.cpp" line="331"> !config.noThrow @@ -13085,7 +13085,7 @@ CmdLineTests.cpp" line="332"> !false -CmdLineTests.cpp" line="333"> +CmdLineTests.cpp" line="332"> !config.breakIntoDebugger @@ -13099,7 +13099,7 @@ CmdLineTests.cpp" line="333">
-CmdLineTests.cpp" line="345"> +CmdLineTests.cpp" line="344"> config.abortAfter == 0 @@ -13108,7 +13108,7 @@ CmdLineTests.cpp" line="345">
-CmdLineTests.cpp" line="351"> +CmdLineTests.cpp" line="350"> config.abortAfter == 1 @@ -13124,7 +13124,7 @@ CmdLineTests.cpp" line="351">
-CmdLineTests.cpp" line="345"> +CmdLineTests.cpp" line="344"> config.abortAfter == 0 @@ -13138,7 +13138,7 @@ CmdLineTests.cpp" line="345">
-CmdLineTests.cpp" line="354"> +CmdLineTests.cpp" line="353"> config.abortAfter == 0 @@ -13147,7 +13147,7 @@ CmdLineTests.cpp" line="354">
-CmdLineTests.cpp" line="360"> +CmdLineTests.cpp" line="359"> config.abortAfter == 2 @@ -13163,7 +13163,7 @@ CmdLineTests.cpp" line="360">
-CmdLineTests.cpp" line="354"> +CmdLineTests.cpp" line="353"> config.abortAfter == 0 @@ -13178,7 +13178,7 @@ CmdLineTests.cpp" line="354">
-CmdLineTests.cpp" line="368"> +CmdLineTests.cpp" line="367"> config.testsOrTags.size() == 1 @@ -13186,7 +13186,7 @@ CmdLineTests.cpp" line="368"> 1 == 1 -CmdLineTests.cpp" line="369"> +CmdLineTests.cpp" line="368"> config.testsOrTags[0] == "[hello]" @@ -13208,7 +13208,7 @@ CmdLineTests.cpp" line="369">
-CmdLineTests.cpp" line="373"> +CmdLineTests.cpp" line="372"> config.verbosity == Config::Verbosity::Normal @@ -13217,7 +13217,7 @@ CmdLineTests.cpp" line="373">
-CmdLineTests.cpp" line="379"> +CmdLineTests.cpp" line="378"> config.verbosity == Config::Verbosity::NoOutput @@ -15192,13 +15192,13 @@ No assertions in section, ' Then: It prints the usage strings' [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: Multiple flags are combined'] -CmdLineTests.cpp:331: !config.showSuccessfulTests succeeded for: !false -CmdLineTests.cpp:332: !config.noThrow succeeded for: !false -CmdLineTests.cpp:333: !config.breakIntoDebugger succeeded for: !false +CmdLineTests.cpp:330: !config.showSuccessfulTests succeeded for: !false +CmdLineTests.cpp:331: !config.noThrow succeeded for: !false +CmdLineTests.cpp:332: !config.breakIntoDebugger succeeded for: !false [Started section: ' Then: All the flags are set'] -CmdLineTests.cpp:339: config.showSuccessfulTests succeeded for: true -CmdLineTests.cpp:340: config.noThrow succeeded for: true -CmdLineTests.cpp:341: config.breakIntoDebugger succeeded for: true +CmdLineTests.cpp:338: config.showSuccessfulTests succeeded for: true +CmdLineTests.cpp:339: config.noThrow succeeded for: true +CmdLineTests.cpp:340: config.breakIntoDebugger succeeded for: true [End of section: ' Then: All the flags are set' All 3 assertions passed] [End of section: ' When: Multiple flags are combined' All 6 assertions passed] @@ -15207,18 +15207,18 @@ CmdLineTests.cpp:341: config.breakIntoDebugger succeeded for: true [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: Multiple flags are combined'] -CmdLineTests.cpp:331: !config.showSuccessfulTests succeeded for: !false -CmdLineTests.cpp:332: !config.noThrow succeeded for: !false -CmdLineTests.cpp:333: !config.breakIntoDebugger succeeded for: !false +CmdLineTests.cpp:330: !config.showSuccessfulTests succeeded for: !false +CmdLineTests.cpp:331: !config.noThrow succeeded for: !false +CmdLineTests.cpp:332: !config.breakIntoDebugger succeeded for: !false [End of section: ' When: Multiple flags are combined' All 3 assertions passed] [End of section: ' Given: A built cli parser for Catch' All 3 assertions passed] [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a nullary method'] -CmdLineTests.cpp:345: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:344: config.abortAfter == 0 succeeded for: 0 == 0 [Started section: ' Then: The flag is set'] -CmdLineTests.cpp:351: config.abortAfter == 1 succeeded for: 1 == 1 +CmdLineTests.cpp:350: config.abortAfter == 1 succeeded for: 1 == 1 [End of section: ' Then: The flag is set' 1 assertion passed] [End of section: ' When: A flag is set via a nullary method' All 2 assertions passed] @@ -15227,16 +15227,16 @@ CmdLineTests.cpp:351: config.abortAfter == 1 succeeded for: 1 == 1 [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a nullary method'] -CmdLineTests.cpp:345: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:344: config.abortAfter == 0 succeeded for: 0 == 0 [End of section: ' When: A flag is set via a nullary method' 1 assertion passed] [End of section: ' Given: A built cli parser for Catch' 1 assertion passed] [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a unary method'] -CmdLineTests.cpp:354: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:353: config.abortAfter == 0 succeeded for: 0 == 0 [Started section: ' Then: The flag is set'] -CmdLineTests.cpp:360: config.abortAfter == 2 succeeded for: 2 == 2 +CmdLineTests.cpp:359: config.abortAfter == 2 succeeded for: 2 == 2 [End of section: ' Then: The flag is set' 1 assertion passed] [End of section: ' When: A flag is set via a unary method' All 2 assertions passed] @@ -15245,7 +15245,7 @@ CmdLineTests.cpp:360: config.abortAfter == 2 succeeded for: 2 == 2 [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a unary method'] -CmdLineTests.cpp:354: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:353: config.abortAfter == 0 succeeded for: 0 == 0 [End of section: ' When: A flag is set via a unary method' 1 assertion passed] [End of section: ' Given: A built cli parser for Catch' 1 assertion passed] @@ -15253,8 +15253,8 @@ CmdLineTests.cpp:354: config.abortAfter == 0 succeeded for: 0 == 0 [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A positional argument is supplied'] [Started section: ' Then: The argument is in the testOrTags collection'] -CmdLineTests.cpp:368: config.testsOrTags.size() == 1 succeeded for: 1 == 1 -CmdLineTests.cpp:369: config.testsOrTags[0] == "[hello]" succeeded for: "[hello]" == "[hello]" +CmdLineTests.cpp:367: config.testsOrTags.size() == 1 succeeded for: 1 == 1 +CmdLineTests.cpp:368: config.testsOrTags[0] == "[hello]" succeeded for: "[hello]" == "[hello]" [End of section: ' Then: The argument is in the testOrTags collection' All 2 assertions passed] [End of section: ' When: A positional argument is supplied' All 2 assertions passed] @@ -15263,9 +15263,9 @@ CmdLineTests.cpp:369: config.testsOrTags[0] == "[hello]" succeeded for: "[hello] [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: And enum opt is set by numeric value'] -CmdLineTests.cpp:373: config.verbosity == Config::Verbosity::Normal succeeded for: 2 == 2 +CmdLineTests.cpp:372: config.verbosity == Config::Verbosity::Normal succeeded for: 2 == 2 [Started section: ' Then: The member is set to the enum value'] -CmdLineTests.cpp:379: config.verbosity == Config::Verbosity::NoOutput succeeded for: 0 == 0 +CmdLineTests.cpp:378: config.verbosity == Config::Verbosity::NoOutput succeeded for: 0 == 0 [End of section: ' Then: The member is set to the enum value' 1 assertion passed] [End of section: ' When: And enum opt is set by numeric value' All 2 assertions passed] diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 9175dcde..1e9b3116 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -213,7 +213,6 @@ struct Config { std::string reporterName; std::string fileName; std::string suiteName; - std::string reporter; std::vector testsOrTags; }; @@ -281,7 +280,7 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) { .longOpt( "out" ) .argName( "filename" ); - cli.bind( &Config::reporter ) + cli.bind( &Config::reporterName ) .describe( "reporter to use - defaults to console" ) .shortOpt( "r") .longOpt( "reporter" ) From 3c3beb57c36b5d55c05f4af164f28d7fd76db249 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 29 May 2013 18:34:11 +0100 Subject: [PATCH 261/296] More config refactoring --- include/internal/catch_commandline.hpp | 4 +- include/internal/catch_config.hpp | 12 +++--- .../SelfTest/Baselines/approvedResults.txt | 40 +++++++++---------- projects/SelfTest/TestMain.cpp | 8 ++-- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 6c050f55..2eda8912 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -466,7 +466,7 @@ namespace Catch { "just pass this option."; } virtual void parseIntoConfig( Command const&, ConfigData& config ) { - config.includeWhichResults = Include::SuccessfulResults; + config.showSuccessfulTests = true; } }; @@ -590,7 +590,7 @@ namespace Catch { } virtual void parseIntoConfig( Command const&, ConfigData& config ) { - config.allowThrows = false; + config.noThrow = true; } }; diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 7c88edd8..141ac437 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -59,17 +59,17 @@ namespace Catch { ConfigData() : listSpec( List::None ), - includeWhichResults( Include::FailedOnly ), + showSuccessfulTests( false ), shouldDebugBreak( false ), - allowThrows( true ), + noThrow( false ), cutoff( -1 ), warnings( WarnAbout::Nothing ) {} List::What listSpec; // !TBD Split into bools - Include::WhichResults includeWhichResults; // !TBD bool + bool showSuccessfulTests; bool shouldDebugBreak; - bool allowThrows; // !TBD invert + bool noThrow; // bool showHelp; // !TBD int cutoff; @@ -159,10 +159,10 @@ namespace Catch { } // IConfig interface - virtual bool allowThrows() const { return m_data.allowThrows; } + virtual bool allowThrows() const { return !m_data.noThrow; } virtual std::ostream& stream() const { return m_os; } virtual std::string name() const { return m_data.name; } - virtual bool includeSuccessfulResults() const { return m_data.includeWhichResults == Include::SuccessfulResults; } + virtual bool includeSuccessfulResults() const { return m_data.showSuccessfulTests; } virtual bool warnAboutMissingAssertions() const { return m_data.warnings & ConfigData::WarnAbout::NoAssertions; } private: diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index e5304af8..d599d648 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -3564,9 +3564,9 @@ with expansion: TestMain.cpp:102: PASSED: - CHECK( config.allowThrows == true ) + CHECK( config.noThrow == false ) with expansion: - true == true + false == false TestMain.cpp:103: PASSED: @@ -3990,9 +3990,9 @@ PASSED: TestMain.cpp:243: PASSED: - REQUIRE( config.allowThrows == false ) + REQUIRE( config.noThrow == true ) with expansion: - false == false + true == true ------------------------------------------------------------------------------- selftest/parser/2 @@ -4008,9 +4008,9 @@ PASSED: TestMain.cpp:249: PASSED: - REQUIRE( config.allowThrows == false ) + REQUIRE( config.noThrow == true ) with expansion: - false == false + true == true ------------------------------------------------------------------------------- selftest/parser/2 @@ -4104,9 +4104,9 @@ with expansion: TestMain.cpp:283: PASSED: - CHECK( config.allowThrows == false ) + CHECK( config.noThrow == true ) with expansion: - false == false + true == true ------------------------------------------------------------------------------- selftest/test filter @@ -10636,10 +10636,10 @@ TestMain.cpp" line="101"> TestMain.cpp" line="102"> - config.allowThrows == true + config.noThrow == false - true == true + false == false TestMain.cpp" line="103"> @@ -11150,10 +11150,10 @@ TestMain.cpp" line="241"> TestMain.cpp" line="243"> - config.allowThrows == false + config.noThrow == true - false == false + true == true @@ -11172,10 +11172,10 @@ TestMain.cpp" line="247"> TestMain.cpp" line="249"> - config.allowThrows == false + config.noThrow == true - false == false + true == true @@ -11298,10 +11298,10 @@ TestMain.cpp" line="282"> TestMain.cpp" line="283"> - config.allowThrows == false + config.noThrow == true - false == false + true == true @@ -14258,7 +14258,7 @@ TestMain.cpp:59: totals.assertions.failed == 1 succeeded for: 1 == 1 TestMain.cpp:98: parseIntoConfig( argv, config ) succeeded TestMain.cpp:100: config.shouldDebugBreak == false succeeded for: false == false TestMain.cpp:101: config.cutoff == -1 succeeded for: -1 == -1 -TestMain.cpp:102: config.allowThrows == true succeeded for: true == true +TestMain.cpp:102: config.noThrow == false succeeded for: false == false TestMain.cpp:103: config.reporter.empty() succeeded for: true [End of section: 'default' All 5 assertions passed] @@ -14430,7 +14430,7 @@ TestMain.cpp:234: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and [Started section: 'nothrow'] [Started section: '-nt'] TestMain.cpp:241: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:243: config.allowThrows == false succeeded for: false == false +TestMain.cpp:243: config.noThrow == true succeeded for: true == true [End of section: '-nt' All 2 assertions passed] [End of section: 'nothrow' All 2 assertions passed] @@ -14438,7 +14438,7 @@ TestMain.cpp:243: config.allowThrows == false succeeded for: false == false [Started section: 'nothrow'] [Started section: '--nothrow'] TestMain.cpp:247: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:249: config.allowThrows == false succeeded for: false == false +TestMain.cpp:249: config.noThrow == true succeeded for: true == true [End of section: '--nothrow' All 2 assertions passed] [End of section: 'nothrow' All 2 assertions passed] @@ -14474,7 +14474,7 @@ TestMain.cpp:272: config.outputFilename == "filename.ext" succeeded for: "filena TestMain.cpp:279: parseIntoConfig( argv, config ) succeeded TestMain.cpp:281: config.cutoff == 1 succeeded for: 1 == 1 TestMain.cpp:282: config.shouldDebugBreak succeeded for: true -TestMain.cpp:283: config.allowThrows == false succeeded for: false == false +TestMain.cpp:283: config.noThrow == true succeeded for: true == true [End of section: '-a -b' All 4 assertions passed] [End of section: 'combinations' All 4 assertions passed] diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 7b31bbba..a0d941fc 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -99,7 +99,7 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { CHECK( config.shouldDebugBreak == false ); CHECK( config.cutoff == -1 ); - CHECK( config.allowThrows == true ); + CHECK( config.noThrow == false ); CHECK( config.reporter.empty() ); } @@ -240,13 +240,13 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { const char* argv[] = { "test", "-nt" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.allowThrows == false ); + REQUIRE( config.noThrow == true ); } SECTION( "--nothrow", "" ) { const char* argv[] = { "test", "--nothrow" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.allowThrows == false ); + REQUIRE( config.noThrow == true ); } } @@ -280,7 +280,7 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { CHECK( config.cutoff == 1 ); CHECK( config.shouldDebugBreak ); - CHECK( config.allowThrows == false ); + CHECK( config.noThrow == true ); } } } From c2ca80d9fb4d06e2893942bd061613115ade6bae Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 29 May 2013 18:42:46 +0100 Subject: [PATCH 262/296] Config refactoring: split List enum into three bools --- include/internal/catch_commandline.hpp | 24 ++- include/internal/catch_config.hpp | 36 ++--- .../SelfTest/Baselines/approvedResults.txt | 140 +++++++++--------- projects/SelfTest/CmdLineTests.cpp | 1 + 4 files changed, 90 insertions(+), 111 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 2eda8912..e0cccd70 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -317,7 +317,7 @@ namespace Catch { class ListOptionParser : public OptionParser { public: - ListOptionParser() : OptionParser( 0, 2 ) { + ListOptionParser() : OptionParser( 0, 1 ) { m_optionNames.push_back( "-l" ); m_optionNames.push_back( "--list" ); } @@ -346,27 +346,21 @@ namespace Catch { } virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { - config.listSpec = List::Tests; if( cmd.argsCount() >= 1 ) { - if( cmd[0] == "all" ) - config.listSpec = List::All; + if( cmd[0] == "all" ) { + config.listTests = true; + config.listTags = true; + config.listReporters = true; + } else if( cmd[0] == "tests" ) - config.listSpec = List::Tests; + config.listTests = true; else if( cmd[0] == "tags" ) - config.listSpec = List::Tags; + config.listTags = true; else if( cmd[0] == "reporters" ) - config.listSpec = List::Reports; + config.listReporters = true; else cmd.raiseError( "Expected tests, reporters or tags" ); } - if( cmd.argsCount() >= 2 ) { - if( cmd[1] == "xml" ) - config.listSpec = static_cast( config.listSpec | List::AsXml ); - else if( cmd[1] == "text" ) - config.listSpec = static_cast( config.listSpec | List::AsText ); - else - cmd.raiseError( "Expected xml or text" ); - } } }; diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 141ac437..9472a422 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -23,27 +23,6 @@ #endif namespace Catch { - - struct Include { enum WhichResults { - FailedOnly, - SuccessfulResults - }; }; - - struct List{ enum What { - None = 0, - - Reports = 1, - Tests = 2, - Tags = 4, - All = Reports | Tests | Tags, - - WhatMask = 0xf, - - AsText = 0x10, - AsXml = 0x20, - - AsMask = 0xf0 - }; }; struct ConfigData { @@ -52,13 +31,16 @@ namespace Catch { Quiet, Normal }; }; + struct WarnAbout { enum What { Nothing = 0x00, NoAssertions = 0x01 }; }; ConfigData() - : listSpec( List::None ), + : listTests( false ), + listTags( false ), + listReporters( false ), showSuccessfulTests( false ), shouldDebugBreak( false ), noThrow( false ), @@ -66,7 +48,9 @@ namespace Catch { warnings( WarnAbout::Nothing ) {} - List::What listSpec; // !TBD Split into bools + bool listTests; + bool listTags; + bool listReporters; bool showSuccessfulTests; bool shouldDebugBreak; bool noThrow; @@ -117,9 +101,9 @@ namespace Catch { return m_data.outputFilename ; } - bool listTests() const { return m_data.listSpec & List::Tests; } - bool listTags() const { return m_data.listSpec & List::Tags; } - bool listReporters() const { return m_data.listSpec & List::Reports; } + bool listTests() const { return m_data.listTests; } + bool listTags() const { return m_data.listTags; } + bool listReporters() const { return m_data.listReporters; } std::string getName() const { return m_data.name; diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index d599d648..08eda83f 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -5762,7 +5762,7 @@ Scenario: New Catch commandline interface When: We ask for usage strings Then: It prints the usage strings ------------------------------------------------------------------------------- -CmdLineTests.cpp:323 +CmdLineTests.cpp:324 ............................................................................... @@ -5773,22 +5773,22 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: Multiple flags are combined ------------------------------------------------------------------------------- -CmdLineTests.cpp:328 +CmdLineTests.cpp:329 ............................................................................... -CmdLineTests.cpp:330: +CmdLineTests.cpp:331: PASSED: CHECK_FALSE( config.showSuccessfulTests ) with expansion: !false -CmdLineTests.cpp:331: +CmdLineTests.cpp:332: PASSED: CHECK_FALSE( config.noThrow ) with expansion: !false -CmdLineTests.cpp:332: +CmdLineTests.cpp:333: PASSED: CHECK_FALSE( config.breakIntoDebugger ) with expansion: @@ -5800,22 +5800,22 @@ Scenario: New Catch commandline interface When: Multiple flags are combined Then: All the flags are set ------------------------------------------------------------------------------- -CmdLineTests.cpp:337 +CmdLineTests.cpp:338 ............................................................................... -CmdLineTests.cpp:338: +CmdLineTests.cpp:339: PASSED: CHECK( config.showSuccessfulTests ) with expansion: true -CmdLineTests.cpp:339: +CmdLineTests.cpp:340: PASSED: CHECK( config.noThrow ) with expansion: true -CmdLineTests.cpp:340: +CmdLineTests.cpp:341: PASSED: CHECK( config.breakIntoDebugger ) with expansion: @@ -5826,22 +5826,22 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: Multiple flags are combined ------------------------------------------------------------------------------- -CmdLineTests.cpp:328 +CmdLineTests.cpp:329 ............................................................................... -CmdLineTests.cpp:330: +CmdLineTests.cpp:331: PASSED: CHECK_FALSE( config.showSuccessfulTests ) with expansion: !false -CmdLineTests.cpp:331: +CmdLineTests.cpp:332: PASSED: CHECK_FALSE( config.noThrow ) with expansion: !false -CmdLineTests.cpp:332: +CmdLineTests.cpp:333: PASSED: CHECK_FALSE( config.breakIntoDebugger ) with expansion: @@ -5852,10 +5852,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a nullary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:343 +CmdLineTests.cpp:344 ............................................................................... -CmdLineTests.cpp:344: +CmdLineTests.cpp:345: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5867,10 +5867,10 @@ Scenario: New Catch commandline interface When: A flag is set via a nullary method Then: The flag is set ------------------------------------------------------------------------------- -CmdLineTests.cpp:349 +CmdLineTests.cpp:350 ............................................................................... -CmdLineTests.cpp:350: +CmdLineTests.cpp:351: PASSED: REQUIRE( config.abortAfter == 1 ) with expansion: @@ -5881,10 +5881,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a nullary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:343 +CmdLineTests.cpp:344 ............................................................................... -CmdLineTests.cpp:344: +CmdLineTests.cpp:345: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5895,10 +5895,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a unary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:352 +CmdLineTests.cpp:353 ............................................................................... -CmdLineTests.cpp:353: +CmdLineTests.cpp:354: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5910,10 +5910,10 @@ Scenario: New Catch commandline interface When: A flag is set via a unary method Then: The flag is set ------------------------------------------------------------------------------- -CmdLineTests.cpp:358 +CmdLineTests.cpp:359 ............................................................................... -CmdLineTests.cpp:359: +CmdLineTests.cpp:360: PASSED: REQUIRE( config.abortAfter == 2 ) with expansion: @@ -5924,10 +5924,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a unary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:352 +CmdLineTests.cpp:353 ............................................................................... -CmdLineTests.cpp:353: +CmdLineTests.cpp:354: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5939,16 +5939,16 @@ Scenario: New Catch commandline interface When: A positional argument is supplied Then: The argument is in the testOrTags collection ------------------------------------------------------------------------------- -CmdLineTests.cpp:366 +CmdLineTests.cpp:367 ............................................................................... -CmdLineTests.cpp:367: +CmdLineTests.cpp:368: PASSED: REQUIRE( config.testsOrTags.size() == 1 ) with expansion: 1 == 1 -CmdLineTests.cpp:368: +CmdLineTests.cpp:369: PASSED: REQUIRE( config.testsOrTags[0] == "[hello]" ) with expansion: @@ -5959,10 +5959,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: And enum opt is set by numeric value ------------------------------------------------------------------------------- -CmdLineTests.cpp:371 +CmdLineTests.cpp:372 ............................................................................... -CmdLineTests.cpp:372: +CmdLineTests.cpp:373: PASSED: CHECK( config.verbosity == Config::Verbosity::Normal ) with expansion: @@ -5974,10 +5974,10 @@ Scenario: New Catch commandline interface When: And enum opt is set by numeric value Then: The member is set to the enum value ------------------------------------------------------------------------------- -CmdLineTests.cpp:377 +CmdLineTests.cpp:378 ............................................................................... -CmdLineTests.cpp:378: +CmdLineTests.cpp:379: PASSED: REQUIRE( config.verbosity == Config::Verbosity::NoOutput ) with expansion: @@ -13012,7 +13012,7 @@ CmdLineTests.cpp" line="179">
-CmdLineTests.cpp" line="330"> +CmdLineTests.cpp" line="331"> !config.showSuccessfulTests @@ -13020,7 +13020,7 @@ CmdLineTests.cpp" line="330"> !false -CmdLineTests.cpp" line="331"> +CmdLineTests.cpp" line="332"> !config.noThrow @@ -13028,7 +13028,7 @@ CmdLineTests.cpp" line="331"> !false -CmdLineTests.cpp" line="332"> +CmdLineTests.cpp" line="333"> !config.breakIntoDebugger @@ -13037,7 +13037,7 @@ CmdLineTests.cpp" line="332">
-CmdLineTests.cpp" line="338"> +CmdLineTests.cpp" line="339"> config.showSuccessfulTests @@ -13045,7 +13045,7 @@ CmdLineTests.cpp" line="338"> true -CmdLineTests.cpp" line="339"> +CmdLineTests.cpp" line="340"> config.noThrow @@ -13053,7 +13053,7 @@ CmdLineTests.cpp" line="339"> true -CmdLineTests.cpp" line="340"> +CmdLineTests.cpp" line="341"> config.breakIntoDebugger @@ -13069,7 +13069,7 @@ CmdLineTests.cpp" line="340">
-CmdLineTests.cpp" line="330"> +CmdLineTests.cpp" line="331"> !config.showSuccessfulTests @@ -13077,7 +13077,7 @@ CmdLineTests.cpp" line="330"> !false -CmdLineTests.cpp" line="331"> +CmdLineTests.cpp" line="332"> !config.noThrow @@ -13085,7 +13085,7 @@ CmdLineTests.cpp" line="331"> !false -CmdLineTests.cpp" line="332"> +CmdLineTests.cpp" line="333"> !config.breakIntoDebugger @@ -13099,7 +13099,7 @@ CmdLineTests.cpp" line="332">
-CmdLineTests.cpp" line="344"> +CmdLineTests.cpp" line="345"> config.abortAfter == 0 @@ -13108,7 +13108,7 @@ CmdLineTests.cpp" line="344">
-CmdLineTests.cpp" line="350"> +CmdLineTests.cpp" line="351"> config.abortAfter == 1 @@ -13124,7 +13124,7 @@ CmdLineTests.cpp" line="350">
-CmdLineTests.cpp" line="344"> +CmdLineTests.cpp" line="345"> config.abortAfter == 0 @@ -13138,7 +13138,7 @@ CmdLineTests.cpp" line="344">
-CmdLineTests.cpp" line="353"> +CmdLineTests.cpp" line="354"> config.abortAfter == 0 @@ -13147,7 +13147,7 @@ CmdLineTests.cpp" line="353">
-CmdLineTests.cpp" line="359"> +CmdLineTests.cpp" line="360"> config.abortAfter == 2 @@ -13163,7 +13163,7 @@ CmdLineTests.cpp" line="359">
-CmdLineTests.cpp" line="353"> +CmdLineTests.cpp" line="354"> config.abortAfter == 0 @@ -13178,7 +13178,7 @@ CmdLineTests.cpp" line="353">
-CmdLineTests.cpp" line="367"> +CmdLineTests.cpp" line="368"> config.testsOrTags.size() == 1 @@ -13186,7 +13186,7 @@ CmdLineTests.cpp" line="367"> 1 == 1 -CmdLineTests.cpp" line="368"> +CmdLineTests.cpp" line="369"> config.testsOrTags[0] == "[hello]" @@ -13208,7 +13208,7 @@ CmdLineTests.cpp" line="368">
-CmdLineTests.cpp" line="372"> +CmdLineTests.cpp" line="373"> config.verbosity == Config::Verbosity::Normal @@ -13217,7 +13217,7 @@ CmdLineTests.cpp" line="372">
-CmdLineTests.cpp" line="378"> +CmdLineTests.cpp" line="379"> config.verbosity == Config::Verbosity::NoOutput @@ -15192,13 +15192,13 @@ No assertions in section, ' Then: It prints the usage strings' [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: Multiple flags are combined'] -CmdLineTests.cpp:330: !config.showSuccessfulTests succeeded for: !false -CmdLineTests.cpp:331: !config.noThrow succeeded for: !false -CmdLineTests.cpp:332: !config.breakIntoDebugger succeeded for: !false +CmdLineTests.cpp:331: !config.showSuccessfulTests succeeded for: !false +CmdLineTests.cpp:332: !config.noThrow succeeded for: !false +CmdLineTests.cpp:333: !config.breakIntoDebugger succeeded for: !false [Started section: ' Then: All the flags are set'] -CmdLineTests.cpp:338: config.showSuccessfulTests succeeded for: true -CmdLineTests.cpp:339: config.noThrow succeeded for: true -CmdLineTests.cpp:340: config.breakIntoDebugger succeeded for: true +CmdLineTests.cpp:339: config.showSuccessfulTests succeeded for: true +CmdLineTests.cpp:340: config.noThrow succeeded for: true +CmdLineTests.cpp:341: config.breakIntoDebugger succeeded for: true [End of section: ' Then: All the flags are set' All 3 assertions passed] [End of section: ' When: Multiple flags are combined' All 6 assertions passed] @@ -15207,18 +15207,18 @@ CmdLineTests.cpp:340: config.breakIntoDebugger succeeded for: true [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: Multiple flags are combined'] -CmdLineTests.cpp:330: !config.showSuccessfulTests succeeded for: !false -CmdLineTests.cpp:331: !config.noThrow succeeded for: !false -CmdLineTests.cpp:332: !config.breakIntoDebugger succeeded for: !false +CmdLineTests.cpp:331: !config.showSuccessfulTests succeeded for: !false +CmdLineTests.cpp:332: !config.noThrow succeeded for: !false +CmdLineTests.cpp:333: !config.breakIntoDebugger succeeded for: !false [End of section: ' When: Multiple flags are combined' All 3 assertions passed] [End of section: ' Given: A built cli parser for Catch' All 3 assertions passed] [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a nullary method'] -CmdLineTests.cpp:344: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:345: config.abortAfter == 0 succeeded for: 0 == 0 [Started section: ' Then: The flag is set'] -CmdLineTests.cpp:350: config.abortAfter == 1 succeeded for: 1 == 1 +CmdLineTests.cpp:351: config.abortAfter == 1 succeeded for: 1 == 1 [End of section: ' Then: The flag is set' 1 assertion passed] [End of section: ' When: A flag is set via a nullary method' All 2 assertions passed] @@ -15227,16 +15227,16 @@ CmdLineTests.cpp:350: config.abortAfter == 1 succeeded for: 1 == 1 [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a nullary method'] -CmdLineTests.cpp:344: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:345: config.abortAfter == 0 succeeded for: 0 == 0 [End of section: ' When: A flag is set via a nullary method' 1 assertion passed] [End of section: ' Given: A built cli parser for Catch' 1 assertion passed] [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a unary method'] -CmdLineTests.cpp:353: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:354: config.abortAfter == 0 succeeded for: 0 == 0 [Started section: ' Then: The flag is set'] -CmdLineTests.cpp:359: config.abortAfter == 2 succeeded for: 2 == 2 +CmdLineTests.cpp:360: config.abortAfter == 2 succeeded for: 2 == 2 [End of section: ' Then: The flag is set' 1 assertion passed] [End of section: ' When: A flag is set via a unary method' All 2 assertions passed] @@ -15245,7 +15245,7 @@ CmdLineTests.cpp:359: config.abortAfter == 2 succeeded for: 2 == 2 [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a unary method'] -CmdLineTests.cpp:353: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:354: config.abortAfter == 0 succeeded for: 0 == 0 [End of section: ' When: A flag is set via a unary method' 1 assertion passed] [End of section: ' Given: A built cli parser for Catch' 1 assertion passed] @@ -15253,8 +15253,8 @@ CmdLineTests.cpp:353: config.abortAfter == 0 succeeded for: 0 == 0 [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A positional argument is supplied'] [Started section: ' Then: The argument is in the testOrTags collection'] -CmdLineTests.cpp:367: config.testsOrTags.size() == 1 succeeded for: 1 == 1 -CmdLineTests.cpp:368: config.testsOrTags[0] == "[hello]" succeeded for: "[hello]" == "[hello]" +CmdLineTests.cpp:368: config.testsOrTags.size() == 1 succeeded for: 1 == 1 +CmdLineTests.cpp:369: config.testsOrTags[0] == "[hello]" succeeded for: "[hello]" == "[hello]" [End of section: ' Then: The argument is in the testOrTags collection' All 2 assertions passed] [End of section: ' When: A positional argument is supplied' All 2 assertions passed] @@ -15263,9 +15263,9 @@ CmdLineTests.cpp:368: config.testsOrTags[0] == "[hello]" succeeded for: "[hello] [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: And enum opt is set by numeric value'] -CmdLineTests.cpp:372: config.verbosity == Config::Verbosity::Normal succeeded for: 2 == 2 +CmdLineTests.cpp:373: config.verbosity == Config::Verbosity::Normal succeeded for: 2 == 2 [Started section: ' Then: The member is set to the enum value'] -CmdLineTests.cpp:378: config.verbosity == Config::Verbosity::NoOutput succeeded for: 0 == 0 +CmdLineTests.cpp:379: config.verbosity == Config::Verbosity::NoOutput succeeded for: 0 == 0 [End of section: ' Then: The member is set to the enum value' 1 assertion passed] [End of section: ' When: And enum opt is set by numeric value' All 2 assertions passed] diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 1e9b3116..3626c61c 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -188,6 +188,7 @@ struct Config { Config() : listTests( false ), listTags( false ), + listReporters( false ), showSuccessfulTests( false ), breakIntoDebugger( false ), noThrow( false ), From 20ddb0055f0c07f879962d2030a3ef6c8012d408 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 29 May 2013 18:56:29 +0100 Subject: [PATCH 263/296] ConfigData just keeps strings for test names/ specs/ tags (processed in Config actor) --- include/internal/catch_commandline.hpp | 26 +- include/internal/catch_config.hpp | 29 +- .../SelfTest/Baselines/approvedResults.txt | 1250 ++++++++--------- projects/SelfTest/TestMain.cpp | 51 +- 4 files changed, 679 insertions(+), 677 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index e0cccd70..3408c145 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -255,20 +255,8 @@ namespace Catch { } virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { - std::string groupName; - for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { - if( i != 0 ) - groupName += " "; - groupName += cmd[i]; - } - TestCaseFilters filters( groupName ); - for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { - if( startsWith( cmd[i], "[" ) || startsWith( cmd[i], "~[" ) ) - filters.addTags( cmd[i] ); - else - filters.addFilter( TestCaseFilter( cmd[i] ) ); - } - config.filters.push_back( filters ); + for( std::size_t i = 0; i < cmd.argsCount(); ++i ) + config.testsOrTags.push_back( cmd[i] ); } }; @@ -301,16 +289,8 @@ namespace Catch { } virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { - std::string groupName; - for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { - if( i != 0 ) - groupName += " "; - groupName += cmd[i]; - } - TestCaseFilters filters( groupName ); for( std::size_t i = 0; i < cmd.argsCount(); ++i ) - filters.addTags( cmd[i] ); - config.filters.push_back( filters ); + config.testsOrTags.push_back( cmd[i] ); } }; diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 9472a422..f29b58e1 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -65,7 +65,7 @@ namespace Catch { std::string outputFilename; std::string name; - std::vector filters; // !TBD strings + std::vector testsOrTags; std::string stream; }; @@ -84,9 +84,24 @@ namespace Catch { Config( ConfigData const& data ) : m_data( data ), - m_os( std::cout.rdbuf() ), - m_filters( data.filters ) - {} + m_os( std::cout.rdbuf() ) + { + std::string groupName; + for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) { + if( i != 0 ) + groupName += " "; + groupName += data.testsOrTags[i]; + } + TestCaseFilters filters( groupName ); + for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) { + std::string filter = data.testsOrTags[i]; + if( startsWith( filter, "[" ) || startsWith( filter, "~[" ) ) + filters.addTags( filter ); + else + filters.addFilter( TestCaseFilter( filter ) ); + } + m_filterSets.push_back( filters ); + } virtual ~Config() { m_os.rdbuf( std::cout.rdbuf() ); @@ -131,7 +146,7 @@ namespace Catch { void addTestSpec( std::string const& testSpec ) { TestCaseFilters filters( testSpec ); filters.addFilter( TestCaseFilter( testSpec ) ); - m_data.filters.push_back( filters ); + m_filterSets.push_back( filters ); } int abortAfter() const { @@ -139,7 +154,7 @@ namespace Catch { } std::vector const& filters() const { - return m_filters; + return m_filterSets; } // IConfig interface @@ -154,7 +169,7 @@ namespace Catch { Stream m_stream; mutable std::ostream m_os; - std::vector m_filters; + std::vector m_filterSets; }; diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 08eda83f..0baba78f 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -3586,21 +3586,21 @@ TestMain.cpp:109: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:111: +TestMain.cpp:112: PASSED: - REQUIRE( config.filters.size() == 1 ) + REQUIRE( cfg.filters().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:112: +TestMain.cpp:113: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:113: +TestMain.cpp:114: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true @@ -3609,28 +3609,28 @@ selftest/parser/2 test lists -t/exclude:1 ------------------------------------------------------------------------------- -TestMain.cpp:115 +TestMain.cpp:116 ............................................................................... -TestMain.cpp:117: +TestMain.cpp:118: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:119: +TestMain.cpp:121: PASSED: - REQUIRE( config.filters.size() == 1 ) + REQUIRE( cfg.filters().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:120: +TestMain.cpp:122: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:121: +TestMain.cpp:123: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true @@ -3639,28 +3639,28 @@ selftest/parser/2 test lists --test/1 ------------------------------------------------------------------------------- -TestMain.cpp:124 +TestMain.cpp:126 ............................................................................... -TestMain.cpp:126: -PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) - TestMain.cpp:128: PASSED: - REQUIRE( config.filters.size() == 1 ) + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + +TestMain.cpp:131: +PASSED: + REQUIRE( cfg.filters().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:129: +TestMain.cpp:132: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:130: +TestMain.cpp:133: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true @@ -3669,28 +3669,28 @@ selftest/parser/2 test lists --test/exclude:1 ------------------------------------------------------------------------------- -TestMain.cpp:133 +TestMain.cpp:136 ............................................................................... -TestMain.cpp:135: -PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) - -TestMain.cpp:137: -PASSED: - REQUIRE( config.filters.size() == 1 ) -with expansion: - 1 == 1 - TestMain.cpp:138: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + +TestMain.cpp:141: +PASSED: + REQUIRE( cfg.filters().size() == 1 ) +with expansion: + 1 == 1 + +TestMain.cpp:142: +PASSED: + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) with expansion: false == false -TestMain.cpp:139: +TestMain.cpp:143: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true @@ -3699,28 +3699,28 @@ selftest/parser/2 test lists --test/exclude:2 ------------------------------------------------------------------------------- -TestMain.cpp:142 +TestMain.cpp:146 ............................................................................... -TestMain.cpp:144: -PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) - -TestMain.cpp:146: -PASSED: - REQUIRE( config.filters.size() == 1 ) -with expansion: - 1 == 1 - -TestMain.cpp:147: -PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) -with expansion: - false == false - TestMain.cpp:148: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + +TestMain.cpp:151: +PASSED: + REQUIRE( cfg.filters().size() == 1 ) +with expansion: + 1 == 1 + +TestMain.cpp:152: +PASSED: + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) +with expansion: + false == false + +TestMain.cpp:153: +PASSED: + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true @@ -3729,34 +3729,34 @@ selftest/parser/2 test lists -t/2 ------------------------------------------------------------------------------- -TestMain.cpp:151 +TestMain.cpp:156 ............................................................................... -TestMain.cpp:153: -PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) - -TestMain.cpp:155: -PASSED: - REQUIRE( config.filters.size() == 1 ) -with expansion: - 1 == 1 - -TestMain.cpp:156: -PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) -with expansion: - false == false - -TestMain.cpp:157: -PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) -with expansion: - true - TestMain.cpp:158: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ) + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + +TestMain.cpp:161: +PASSED: + REQUIRE( cfg.filters().size() == 1 ) +with expansion: + 1 == 1 + +TestMain.cpp:162: +PASSED: + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) +with expansion: + false == false + +TestMain.cpp:163: +PASSED: + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ) +with expansion: + true + +TestMain.cpp:164: +PASSED: + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test2" ) ) ) with expansion: true @@ -3765,10 +3765,10 @@ selftest/parser/2 test lists -t/0 ------------------------------------------------------------------------------- -TestMain.cpp:161 +TestMain.cpp:167 ............................................................................... -TestMain.cpp:163: +TestMain.cpp:169: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) ) with expansion: @@ -3780,14 +3780,14 @@ selftest/parser/2 reporter -r/console ------------------------------------------------------------------------------- -TestMain.cpp:168 +TestMain.cpp:174 ............................................................................... -TestMain.cpp:170: +TestMain.cpp:176: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:172: +TestMain.cpp:178: PASSED: REQUIRE( config.reporter == "console" ) with expansion: @@ -3798,14 +3798,14 @@ selftest/parser/2 reporter -r/xml ------------------------------------------------------------------------------- -TestMain.cpp:174 +TestMain.cpp:180 ............................................................................... -TestMain.cpp:176: +TestMain.cpp:182: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:178: +TestMain.cpp:184: PASSED: REQUIRE( config.reporter == "xml" ) with expansion: @@ -3816,14 +3816,14 @@ selftest/parser/2 reporter --reporter/junit ------------------------------------------------------------------------------- -TestMain.cpp:180 +TestMain.cpp:186 ............................................................................... -TestMain.cpp:182: +TestMain.cpp:188: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:184: +TestMain.cpp:190: PASSED: REQUIRE( config.reporter == "junit" ) with expansion: @@ -3834,10 +3834,10 @@ selftest/parser/2 reporter -r/error ------------------------------------------------------------------------------- -TestMain.cpp:186 +TestMain.cpp:192 ............................................................................... -TestMain.cpp:188: +TestMain.cpp:194: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) ) with expansion: @@ -3849,14 +3849,14 @@ selftest/parser/2 debugger -b ------------------------------------------------------------------------------- -TestMain.cpp:193 +TestMain.cpp:199 ............................................................................... -TestMain.cpp:195: +TestMain.cpp:201: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:197: +TestMain.cpp:203: PASSED: REQUIRE( config.shouldDebugBreak == true ) with expansion: @@ -3867,14 +3867,14 @@ selftest/parser/2 debugger --break ------------------------------------------------------------------------------- -TestMain.cpp:199 +TestMain.cpp:205 ............................................................................... -TestMain.cpp:201: +TestMain.cpp:207: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:203: +TestMain.cpp:209: PASSED: REQUIRE( config.shouldDebugBreak ) with expansion: @@ -3885,10 +3885,10 @@ selftest/parser/2 debugger -b ------------------------------------------------------------------------------- -TestMain.cpp:205 +TestMain.cpp:211 ............................................................................... -TestMain.cpp:207: +TestMain.cpp:213: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) ) with expansion: @@ -3900,14 +3900,14 @@ selftest/parser/2 abort -a ------------------------------------------------------------------------------- -TestMain.cpp:212 +TestMain.cpp:218 ............................................................................... -TestMain.cpp:214: +TestMain.cpp:220: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:216: +TestMain.cpp:222: PASSED: REQUIRE( config.cutoff == 1 ) with expansion: @@ -3918,14 +3918,14 @@ selftest/parser/2 abort -a/2 ------------------------------------------------------------------------------- -TestMain.cpp:218 +TestMain.cpp:224 ............................................................................... -TestMain.cpp:220: +TestMain.cpp:226: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:222: +TestMain.cpp:228: PASSED: REQUIRE( config.cutoff == 2 ) with expansion: @@ -3936,10 +3936,10 @@ selftest/parser/2 abort -a/error/0 ------------------------------------------------------------------------------- -TestMain.cpp:224 +TestMain.cpp:230 ............................................................................... -TestMain.cpp:226: +TestMain.cpp:232: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: @@ -3951,10 +3951,10 @@ selftest/parser/2 abort -a/error/non numeric ------------------------------------------------------------------------------- -TestMain.cpp:228 +TestMain.cpp:234 ............................................................................... -TestMain.cpp:230: +TestMain.cpp:236: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: @@ -3966,10 +3966,10 @@ selftest/parser/2 abort -a/error/two args ------------------------------------------------------------------------------- -TestMain.cpp:232 +TestMain.cpp:238 ............................................................................... -TestMain.cpp:234: +TestMain.cpp:240: PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) ) with expansion: @@ -3981,24 +3981,6 @@ selftest/parser/2 nothrow -nt ------------------------------------------------------------------------------- -TestMain.cpp:239 -............................................................................... - -TestMain.cpp:241: -PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) - -TestMain.cpp:243: -PASSED: - REQUIRE( config.noThrow == true ) -with expansion: - true == true - -------------------------------------------------------------------------------- -selftest/parser/2 - nothrow - --nothrow -------------------------------------------------------------------------------- TestMain.cpp:245 ............................................................................... @@ -4014,23 +3996,41 @@ with expansion: ------------------------------------------------------------------------------- selftest/parser/2 - streams - -o filename + nothrow + --nothrow ------------------------------------------------------------------------------- -TestMain.cpp:254 +TestMain.cpp:251 ............................................................................... -TestMain.cpp:256: +TestMain.cpp:253: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:258: +TestMain.cpp:255: +PASSED: + REQUIRE( config.noThrow == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +selftest/parser/2 + streams + -o filename +------------------------------------------------------------------------------- +TestMain.cpp:260 +............................................................................... + +TestMain.cpp:262: +PASSED: + CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + +TestMain.cpp:264: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: "filename.ext" == "filename.ext" -TestMain.cpp:259: +TestMain.cpp:265: PASSED: REQUIRE( config.stream.empty() ) with expansion: @@ -4041,20 +4041,20 @@ selftest/parser/2 streams -o %stdout ------------------------------------------------------------------------------- -TestMain.cpp:261 +TestMain.cpp:267 ............................................................................... -TestMain.cpp:263: +TestMain.cpp:269: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:265: +TestMain.cpp:271: PASSED: REQUIRE( config.stream == "stdout" ) with expansion: "stdout" == "stdout" -TestMain.cpp:266: +TestMain.cpp:272: PASSED: REQUIRE( config.outputFilename.empty() ) with expansion: @@ -4065,14 +4065,14 @@ selftest/parser/2 streams --out ------------------------------------------------------------------------------- -TestMain.cpp:268 +TestMain.cpp:274 ............................................................................... -TestMain.cpp:270: +TestMain.cpp:276: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:272: +TestMain.cpp:278: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: @@ -4083,26 +4083,26 @@ selftest/parser/2 combinations -a -b ------------------------------------------------------------------------------- -TestMain.cpp:277 +TestMain.cpp:283 ............................................................................... -TestMain.cpp:279: +TestMain.cpp:285: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:281: +TestMain.cpp:287: PASSED: CHECK( config.cutoff == 1 ) with expansion: 1 == 1 -TestMain.cpp:282: +TestMain.cpp:288: PASSED: CHECK( config.shouldDebugBreak ) with expansion: true -TestMain.cpp:283: +TestMain.cpp:289: PASSED: CHECK( config.noThrow == true ) with expansion: @@ -4111,40 +4111,40 @@ with expansion: ------------------------------------------------------------------------------- selftest/test filter ------------------------------------------------------------------------------- -TestMain.cpp:288 +TestMain.cpp:294 ............................................................................... -TestMain.cpp:292: +TestMain.cpp:298: PASSED: CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -TestMain.cpp:293: +TestMain.cpp:299: PASSED: CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:298: +TestMain.cpp:304: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:299: +TestMain.cpp:305: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -TestMain.cpp:301: +TestMain.cpp:307: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ) with expansion: true -TestMain.cpp:302: +TestMain.cpp:308: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ) with expansion: @@ -4153,28 +4153,28 @@ with expansion: ------------------------------------------------------------------------------- selftest/test filters ------------------------------------------------------------------------------- -TestMain.cpp:305 +TestMain.cpp:311 ............................................................................... -TestMain.cpp:313: +TestMain.cpp:319: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -TestMain.cpp:315: +TestMain.cpp:321: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:316: +TestMain.cpp:322: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -TestMain.cpp:317: +TestMain.cpp:323: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ) with expansion: @@ -4183,24 +4183,6 @@ with expansion: ------------------------------------------------------------------------------- selftest/filter/prefix wildcard ------------------------------------------------------------------------------- -TestMain.cpp:320 -............................................................................... - -TestMain.cpp:323: -PASSED: - CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) -with expansion: - true - -TestMain.cpp:324: -PASSED: - CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -selftest/filter/wildcard at both ends -------------------------------------------------------------------------------- TestMain.cpp:326 ............................................................................... @@ -4211,18 +4193,36 @@ with expansion: true TestMain.cpp:330: +PASSED: + CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +selftest/filter/wildcard at both ends +------------------------------------------------------------------------------- +TestMain.cpp:332 +............................................................................... + +TestMain.cpp:335: +PASSED: + CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) +with expansion: + true + +TestMain.cpp:336: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ) with expansion: true -TestMain.cpp:331: +TestMain.cpp:337: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ) with expansion: true -TestMain.cpp:332: +TestMain.cpp:338: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ) with expansion: @@ -4231,28 +4231,28 @@ with expansion: ------------------------------------------------------------------------------- selftest/option parsers ------------------------------------------------------------------------------- -TestMain.cpp:341 +TestMain.cpp:347 ............................................................................... -TestMain.cpp:352: +TestMain.cpp:358: PASSED: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) -TestMain.cpp:354: +TestMain.cpp:361: PASSED: - REQUIRE( config.filters.size() == 1 ) + REQUIRE( cfg.filters().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:355: +TestMain.cpp:362: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:356: +TestMain.cpp:363: PASSED: - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: true @@ -4260,52 +4260,52 @@ with expansion: selftest/tags one tag ------------------------------------------------------------------------------- -TestMain.cpp:367 +TestMain.cpp:374 ............................................................................... -TestMain.cpp:370: +TestMain.cpp:377: PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:371: +TestMain.cpp:378: PASSED: CHECK( oneTag.hasTag( "one" ) ) with expansion: true -TestMain.cpp:372: +TestMain.cpp:379: PASSED: CHECK( oneTag.getTags().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:374: +TestMain.cpp:381: PASSED: CHECK( oneTag.matchesTags( p1 ) == true ) with expansion: true == true -TestMain.cpp:375: +TestMain.cpp:382: PASSED: CHECK( oneTag.matchesTags( p2 ) == true ) with expansion: true == true -TestMain.cpp:376: +TestMain.cpp:383: PASSED: CHECK( oneTag.matchesTags( p3 ) == false ) with expansion: false == false -TestMain.cpp:377: +TestMain.cpp:384: PASSED: CHECK( oneTag.matchesTags( p4 ) == false ) with expansion: false == false -TestMain.cpp:378: +TestMain.cpp:385: PASSED: CHECK( oneTag.matchesTags( p5 ) == false ) with expansion: @@ -4315,70 +4315,70 @@ with expansion: selftest/tags two tags ------------------------------------------------------------------------------- -TestMain.cpp:381 +TestMain.cpp:388 ............................................................................... -TestMain.cpp:384: +TestMain.cpp:391: PASSED: CHECK( twoTags.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:385: +TestMain.cpp:392: PASSED: CHECK( twoTags.hasTag( "one" ) ) with expansion: true -TestMain.cpp:386: +TestMain.cpp:393: PASSED: CHECK( twoTags.hasTag( "two" ) ) with expansion: true -TestMain.cpp:387: +TestMain.cpp:394: PASSED: CHECK( twoTags.hasTag( "Two" ) ) with expansion: true -TestMain.cpp:388: +TestMain.cpp:395: PASSED: CHECK( twoTags.hasTag( "three" ) == false ) with expansion: false == false -TestMain.cpp:389: +TestMain.cpp:396: PASSED: CHECK( twoTags.getTags().size() == 2 ) with expansion: 2 == 2 -TestMain.cpp:391: +TestMain.cpp:398: PASSED: CHECK( twoTags.matchesTags( p1 ) == true ) with expansion: true == true -TestMain.cpp:392: +TestMain.cpp:399: PASSED: CHECK( twoTags.matchesTags( p2 ) == true ) with expansion: true == true -TestMain.cpp:393: +TestMain.cpp:400: PASSED: CHECK( twoTags.matchesTags( p3 ) == true ) with expansion: true == true -TestMain.cpp:394: +TestMain.cpp:401: PASSED: CHECK( twoTags.matchesTags( p4 ) == true ) with expansion: true == true -TestMain.cpp:395: +TestMain.cpp:402: PASSED: CHECK( twoTags.matchesTags( p5 ) == true ) with expansion: @@ -4388,28 +4388,28 @@ with expansion: selftest/tags one tag with characters either side ------------------------------------------------------------------------------- -TestMain.cpp:398 +TestMain.cpp:405 ............................................................................... -TestMain.cpp:401: +TestMain.cpp:408: PASSED: CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) with expansion: "1234" == "1234" -TestMain.cpp:402: +TestMain.cpp:409: PASSED: CHECK( oneTagWithExtras.hasTag( "one" ) ) with expansion: true -TestMain.cpp:403: +TestMain.cpp:410: PASSED: CHECK( oneTagWithExtras.hasTag( "two" ) == false ) with expansion: false == false -TestMain.cpp:404: +TestMain.cpp:411: PASSED: CHECK( oneTagWithExtras.getTags().size() == 1 ) with expansion: @@ -4419,22 +4419,22 @@ with expansion: selftest/tags start of a tag, but not closed ------------------------------------------------------------------------------- -TestMain.cpp:407 +TestMain.cpp:414 ............................................................................... -TestMain.cpp:411: +TestMain.cpp:418: PASSED: CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) with expansion: "[one" == "[one" -TestMain.cpp:412: +TestMain.cpp:419: PASSED: CHECK( oneTagOpen.hasTag( "one" ) == false ) with expansion: false == false -TestMain.cpp:413: +TestMain.cpp:420: PASSED: CHECK( oneTagOpen.getTags().size() == 0 ) with expansion: @@ -4444,28 +4444,28 @@ with expansion: selftest/tags hidden ------------------------------------------------------------------------------- -TestMain.cpp:416 +TestMain.cpp:423 ............................................................................... -TestMain.cpp:419: +TestMain.cpp:426: PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:420: +TestMain.cpp:427: PASSED: CHECK( oneTag.hasTag( "hide" ) ) with expansion: true -TestMain.cpp:421: +TestMain.cpp:428: PASSED: CHECK( oneTag.isHidden() ) with expansion: true -TestMain.cpp:423: +TestMain.cpp:430: PASSED: CHECK( oneTag.matchesTags( "~[hide]" ) == false ) with expansion: @@ -4476,10 +4476,10 @@ Long strings can be wrapped plain string No wrapping ------------------------------------------------------------------------------- -TestMain.cpp:435 +TestMain.cpp:442 ............................................................................... -TestMain.cpp:436: +TestMain.cpp:443: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString ) with expansion: @@ -4487,7 +4487,7 @@ with expansion: == "one two three four" -TestMain.cpp:437: +TestMain.cpp:444: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString ) with expansion: @@ -4500,10 +4500,10 @@ Long strings can be wrapped plain string Wrapped once ------------------------------------------------------------------------------- -TestMain.cpp:439 +TestMain.cpp:446 ............................................................................... -TestMain.cpp:440: +TestMain.cpp:447: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" ) with expansion: @@ -4513,7 +4513,7 @@ with expansion: "one two three four" -TestMain.cpp:441: +TestMain.cpp:448: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" ) with expansion: @@ -4523,7 +4523,7 @@ with expansion: "one two three four" -TestMain.cpp:442: +TestMain.cpp:449: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" ) with expansion: @@ -4533,7 +4533,7 @@ with expansion: "one two three four" -TestMain.cpp:443: +TestMain.cpp:450: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" ) with expansion: @@ -4543,7 +4543,7 @@ with expansion: "one two three four" -TestMain.cpp:444: +TestMain.cpp:451: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" ) with expansion: @@ -4558,10 +4558,10 @@ Long strings can be wrapped plain string Wrapped twice ------------------------------------------------------------------------------- -TestMain.cpp:446 +TestMain.cpp:453 ............................................................................... -TestMain.cpp:447: +TestMain.cpp:454: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4573,7 +4573,7 @@ with expansion: three four" -TestMain.cpp:448: +TestMain.cpp:455: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4585,7 +4585,7 @@ with expansion: three four" -TestMain.cpp:449: +TestMain.cpp:456: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4602,10 +4602,10 @@ Long strings can be wrapped plain string Wrapped three times ------------------------------------------------------------------------------- -TestMain.cpp:451 +TestMain.cpp:458 ............................................................................... -TestMain.cpp:452: +TestMain.cpp:459: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" ) with expansion: @@ -4619,7 +4619,7 @@ with expansion: three four" -TestMain.cpp:453: +TestMain.cpp:460: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" ) with expansion: @@ -4638,10 +4638,10 @@ Long strings can be wrapped plain string Short wrap ------------------------------------------------------------------------------- -TestMain.cpp:455 +TestMain.cpp:462 ............................................................................... -TestMain.cpp:456: +TestMain.cpp:463: PASSED: CHECK( Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" ) with expansion: @@ -4651,7 +4651,7 @@ with expansion: "abc- def" -TestMain.cpp:457: +TestMain.cpp:464: PASSED: CHECK( Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" ) with expansion: @@ -4661,7 +4661,7 @@ with expansion: "abc- defg" -TestMain.cpp:458: +TestMain.cpp:465: PASSED: CHECK( Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" ) with expansion: @@ -4673,7 +4673,7 @@ with expansion: def- gh" -TestMain.cpp:460: +TestMain.cpp:467: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" ) with expansion: @@ -4689,7 +4689,7 @@ with expansion: ee four" -TestMain.cpp:461: +TestMain.cpp:468: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ) with expansion: @@ -4712,34 +4712,34 @@ Long strings can be wrapped plain string As container ------------------------------------------------------------------------------- -TestMain.cpp:463 +TestMain.cpp:470 ............................................................................... -TestMain.cpp:465: +TestMain.cpp:472: PASSED: REQUIRE( text.size() == 4 ) with expansion: 4 == 4 -TestMain.cpp:466: +TestMain.cpp:473: PASSED: CHECK( text[0] == "one" ) with expansion: "one" == "one" -TestMain.cpp:467: +TestMain.cpp:474: PASSED: CHECK( text[1] == "two" ) with expansion: "two" == "two" -TestMain.cpp:468: +TestMain.cpp:475: PASSED: CHECK( text[2] == "three" ) with expansion: "three" == "three" -TestMain.cpp:469: +TestMain.cpp:476: PASSED: CHECK( text[3] == "four" ) with expansion: @@ -4750,10 +4750,10 @@ Long strings can be wrapped plain string Indent first line differently ------------------------------------------------------------------------------- -TestMain.cpp:471 +TestMain.cpp:478 ............................................................................... -TestMain.cpp:476: +TestMain.cpp:483: PASSED: CHECK( text.toString() == " one two\n three\n four" ) with expansion: @@ -4770,10 +4770,10 @@ Long strings can be wrapped With newlines No wrapping ------------------------------------------------------------------------------- -TestMain.cpp:486 +TestMain.cpp:493 ............................................................................... -TestMain.cpp:487: +TestMain.cpp:494: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString ) with expansion: @@ -4783,7 +4783,7 @@ with expansion: "one two three four" -TestMain.cpp:488: +TestMain.cpp:495: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString ) with expansion: @@ -4793,7 +4793,7 @@ with expansion: "one two three four" -TestMain.cpp:489: +TestMain.cpp:496: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString ) with expansion: @@ -4808,10 +4808,10 @@ Long strings can be wrapped With newlines Trailing newline ------------------------------------------------------------------------------- -TestMain.cpp:491 +TestMain.cpp:498 ............................................................................... -TestMain.cpp:492: +TestMain.cpp:499: PASSED: CHECK( Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" ) with expansion: @@ -4821,13 +4821,13 @@ with expansion: "abcdef " -TestMain.cpp:493: +TestMain.cpp:500: PASSED: CHECK( Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" ) with expansion: "abcdef" == "abcdef" -TestMain.cpp:494: +TestMain.cpp:501: PASSED: CHECK( Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" ) with expansion: @@ -4842,10 +4842,10 @@ Long strings can be wrapped With newlines Wrapped once ------------------------------------------------------------------------------- -TestMain.cpp:496 +TestMain.cpp:503 ............................................................................... -TestMain.cpp:497: +TestMain.cpp:504: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4857,7 +4857,7 @@ with expansion: three four" -TestMain.cpp:498: +TestMain.cpp:505: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4869,7 +4869,7 @@ with expansion: three four" -TestMain.cpp:499: +TestMain.cpp:506: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4886,10 +4886,10 @@ Long strings can be wrapped With newlines Wrapped twice ------------------------------------------------------------------------------- -TestMain.cpp:501 +TestMain.cpp:508 ............................................................................... -TestMain.cpp:502: +TestMain.cpp:509: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" ) with expansion: @@ -4907,10 +4907,10 @@ with expansion: Long strings can be wrapped With tabs ------------------------------------------------------------------------------- -TestMain.cpp:506 +TestMain.cpp:513 ............................................................................... -TestMain.cpp:512: +TestMain.cpp:519: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" ) with expansion: @@ -4929,7 +4929,7 @@ hello ------------------------------------------------------------------------------- Strings can be rendered with colour ------------------------------------------------------------------------------- -TestMain.cpp:591 +TestMain.cpp:598 ............................................................................... @@ -4938,16 +4938,16 @@ No assertions in test case, 'Strings can be rendered with colour' ------------------------------------------------------------------------------- Text can be formatted using the Text class ------------------------------------------------------------------------------- -TestMain.cpp:610 +TestMain.cpp:617 ............................................................................... -TestMain.cpp:612: +TestMain.cpp:619: PASSED: CHECK( Text( "hi there" ).toString() == "hi there" ) with expansion: "hi there" == "hi there" -TestMain.cpp:617: +TestMain.cpp:624: PASSED: CHECK( Text( "hi there", narrow ).toString() == "hi\nthere" ) with expansion: @@ -10662,25 +10662,25 @@ TestMain.cpp" line="109"> parseIntoConfig( argv, config ) -TestMain.cpp" line="111"> +TestMain.cpp" line="112"> - config.filters.size() == 1 + cfg.filters().size() == 1 1 == 1 -TestMain.cpp" line="112"> +TestMain.cpp" line="113"> - config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false + cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false false == false -TestMain.cpp" line="113"> +TestMain.cpp" line="114"> - config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) + cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) true @@ -10692,7 +10692,7 @@ TestMain.cpp" line="113">
-TestMain.cpp" line="117"> +TestMain.cpp" line="118"> parseIntoConfig( argv, config ) @@ -10700,25 +10700,25 @@ TestMain.cpp" line="117"> parseIntoConfig( argv, config ) -TestMain.cpp" line="119"> +TestMain.cpp" line="121"> - config.filters.size() == 1 + cfg.filters().size() == 1 1 == 1 -TestMain.cpp" line="120"> +TestMain.cpp" line="122"> - config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false + cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false false == false -TestMain.cpp" line="121"> +TestMain.cpp" line="123"> - config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) + cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) true @@ -10730,7 +10730,7 @@ TestMain.cpp" line="121">
-TestMain.cpp" line="126"> +TestMain.cpp" line="128"> parseIntoConfig( argv, config ) @@ -10738,25 +10738,25 @@ TestMain.cpp" line="126"> parseIntoConfig( argv, config ) -TestMain.cpp" line="128"> +TestMain.cpp" line="131"> - config.filters.size() == 1 + cfg.filters().size() == 1 1 == 1 -TestMain.cpp" line="129"> +TestMain.cpp" line="132"> - config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false + cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false false == false -TestMain.cpp" line="130"> +TestMain.cpp" line="133"> - config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) + cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) true @@ -10768,7 +10768,7 @@ TestMain.cpp" line="130">
-TestMain.cpp" line="135"> +TestMain.cpp" line="138"> parseIntoConfig( argv, config ) @@ -10776,25 +10776,25 @@ TestMain.cpp" line="135"> parseIntoConfig( argv, config ) -TestMain.cpp" line="137"> +TestMain.cpp" line="141"> - config.filters.size() == 1 + cfg.filters().size() == 1 1 == 1 -TestMain.cpp" line="138"> +TestMain.cpp" line="142"> - config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false + cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false false == false -TestMain.cpp" line="139"> +TestMain.cpp" line="143"> - config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) + cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) true @@ -10806,7 +10806,7 @@ TestMain.cpp" line="139">
-TestMain.cpp" line="144"> +TestMain.cpp" line="148"> parseIntoConfig( argv, config ) @@ -10814,25 +10814,25 @@ TestMain.cpp" line="144"> parseIntoConfig( argv, config ) -TestMain.cpp" line="146"> +TestMain.cpp" line="151"> - config.filters.size() == 1 + cfg.filters().size() == 1 1 == 1 -TestMain.cpp" line="147"> +TestMain.cpp" line="152"> - config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false + cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false false == false -TestMain.cpp" line="148"> +TestMain.cpp" line="153"> - config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) + cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) true @@ -10844,7 +10844,7 @@ TestMain.cpp" line="148">
-TestMain.cpp" line="153"> +TestMain.cpp" line="158"> parseIntoConfig( argv, config ) @@ -10852,33 +10852,33 @@ TestMain.cpp" line="153"> parseIntoConfig( argv, config ) -TestMain.cpp" line="155"> +TestMain.cpp" line="161"> - config.filters.size() == 1 + cfg.filters().size() == 1 1 == 1 -TestMain.cpp" line="156"> +TestMain.cpp" line="162"> - config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false + cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false false == false -TestMain.cpp" line="157"> +TestMain.cpp" line="163"> - config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) + cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) true -TestMain.cpp" line="158"> +TestMain.cpp" line="164"> - config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) + cfg.filters()[0].shouldInclude( fakeTestCase( "test2" ) ) true @@ -10890,7 +10890,7 @@ TestMain.cpp" line="158">
-TestMain.cpp" line="163"> +TestMain.cpp" line="169"> parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) @@ -10907,7 +10907,7 @@ TestMain.cpp" line="163">
-TestMain.cpp" line="170"> +TestMain.cpp" line="176"> parseIntoConfig( argv, config ) @@ -10915,7 +10915,7 @@ TestMain.cpp" line="170"> parseIntoConfig( argv, config ) -TestMain.cpp" line="172"> +TestMain.cpp" line="178"> config.reporter == "console" @@ -10929,7 +10929,7 @@ TestMain.cpp" line="172">
-TestMain.cpp" line="176"> +TestMain.cpp" line="182"> parseIntoConfig( argv, config ) @@ -10937,7 +10937,7 @@ TestMain.cpp" line="176"> parseIntoConfig( argv, config ) -TestMain.cpp" line="178"> +TestMain.cpp" line="184"> config.reporter == "xml" @@ -10951,7 +10951,7 @@ TestMain.cpp" line="178">
-TestMain.cpp" line="182"> +TestMain.cpp" line="188"> parseIntoConfig( argv, config ) @@ -10959,7 +10959,7 @@ TestMain.cpp" line="182"> parseIntoConfig( argv, config ) -TestMain.cpp" line="184"> +TestMain.cpp" line="190"> config.reporter == "junit" @@ -10973,7 +10973,7 @@ TestMain.cpp" line="184">
-TestMain.cpp" line="188"> +TestMain.cpp" line="194"> parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) @@ -10990,7 +10990,7 @@ TestMain.cpp" line="188">
-TestMain.cpp" line="195"> +TestMain.cpp" line="201"> parseIntoConfig( argv, config ) @@ -10998,7 +10998,7 @@ TestMain.cpp" line="195"> parseIntoConfig( argv, config ) -TestMain.cpp" line="197"> +TestMain.cpp" line="203"> config.shouldDebugBreak == true @@ -11012,7 +11012,7 @@ TestMain.cpp" line="197">
-TestMain.cpp" line="201"> +TestMain.cpp" line="207"> parseIntoConfig( argv, config ) @@ -11020,7 +11020,7 @@ TestMain.cpp" line="201"> parseIntoConfig( argv, config ) -TestMain.cpp" line="203"> +TestMain.cpp" line="209"> config.shouldDebugBreak @@ -11034,7 +11034,7 @@ TestMain.cpp" line="203">
-TestMain.cpp" line="207"> +TestMain.cpp" line="213"> parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) @@ -11051,7 +11051,7 @@ TestMain.cpp" line="207">
-TestMain.cpp" line="214"> +TestMain.cpp" line="220"> parseIntoConfig( argv, config ) @@ -11059,7 +11059,7 @@ TestMain.cpp" line="214"> parseIntoConfig( argv, config ) -TestMain.cpp" line="216"> +TestMain.cpp" line="222"> config.cutoff == 1 @@ -11073,7 +11073,7 @@ TestMain.cpp" line="216">
-TestMain.cpp" line="220"> +TestMain.cpp" line="226"> parseIntoConfig( argv, config ) @@ -11081,7 +11081,7 @@ TestMain.cpp" line="220"> parseIntoConfig( argv, config ) -TestMain.cpp" line="222"> +TestMain.cpp" line="228"> config.cutoff == 2 @@ -11095,7 +11095,7 @@ TestMain.cpp" line="222">
-TestMain.cpp" line="226"> +TestMain.cpp" line="232"> parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) @@ -11109,7 +11109,7 @@ TestMain.cpp" line="226">
-TestMain.cpp" line="230"> +TestMain.cpp" line="236"> parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) @@ -11123,7 +11123,7 @@ TestMain.cpp" line="230">
-TestMain.cpp" line="234"> +TestMain.cpp" line="240"> parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) @@ -11140,28 +11140,6 @@ TestMain.cpp" line="234">
-TestMain.cpp" line="241"> - - parseIntoConfig( argv, config ) - - - parseIntoConfig( argv, config ) - - -TestMain.cpp" line="243"> - - config.noThrow == true - - - true == true - - - -
- -
-
-
TestMain.cpp" line="247"> parseIntoConfig( argv, config ) @@ -11183,11 +11161,8 @@ TestMain.cpp" line="249">
- -
-
-
-TestMain.cpp" line="256"> +
+TestMain.cpp" line="253"> parseIntoConfig( argv, config ) @@ -11195,7 +11170,32 @@ TestMain.cpp" line="256"> parseIntoConfig( argv, config ) -TestMain.cpp" line="258"> +TestMain.cpp" line="255"> + + config.noThrow == true + + + true == true + + + +
+ +
+
+ +
+
+
+TestMain.cpp" line="262"> + + parseIntoConfig( argv, config ) + + + parseIntoConfig( argv, config ) + + +TestMain.cpp" line="264"> config.outputFilename == "filename.ext" @@ -11203,7 +11203,7 @@ TestMain.cpp" line="258"> "filename.ext" == "filename.ext" -TestMain.cpp" line="259"> +TestMain.cpp" line="265"> config.stream.empty() @@ -11217,7 +11217,7 @@ TestMain.cpp" line="259">
-TestMain.cpp" line="263"> +TestMain.cpp" line="269"> parseIntoConfig( argv, config ) @@ -11225,7 +11225,7 @@ TestMain.cpp" line="263"> parseIntoConfig( argv, config ) -TestMain.cpp" line="265"> +TestMain.cpp" line="271"> config.stream == "stdout" @@ -11233,7 +11233,7 @@ TestMain.cpp" line="265"> "stdout" == "stdout" -TestMain.cpp" line="266"> +TestMain.cpp" line="272"> config.outputFilename.empty() @@ -11247,7 +11247,7 @@ TestMain.cpp" line="266">
-TestMain.cpp" line="270"> +TestMain.cpp" line="276"> parseIntoConfig( argv, config ) @@ -11255,7 +11255,7 @@ TestMain.cpp" line="270"> parseIntoConfig( argv, config ) -TestMain.cpp" line="272"> +TestMain.cpp" line="278"> config.outputFilename == "filename.ext" @@ -11272,7 +11272,7 @@ TestMain.cpp" line="272">
-TestMain.cpp" line="279"> +TestMain.cpp" line="285"> parseIntoConfig( argv, config ) @@ -11280,7 +11280,7 @@ TestMain.cpp" line="279"> parseIntoConfig( argv, config ) -TestMain.cpp" line="281"> +TestMain.cpp" line="287"> config.cutoff == 1 @@ -11288,7 +11288,7 @@ TestMain.cpp" line="281"> 1 == 1 -TestMain.cpp" line="282"> +TestMain.cpp" line="288"> config.shouldDebugBreak @@ -11296,7 +11296,7 @@ TestMain.cpp" line="282"> true -TestMain.cpp" line="283"> +TestMain.cpp" line="289"> config.noThrow == true @@ -11311,7 +11311,7 @@ TestMain.cpp" line="283"> -TestMain.cpp" line="292"> +TestMain.cpp" line="298"> matchAny.shouldInclude( fakeTestCase( "any" ) ) @@ -11319,7 +11319,7 @@ TestMain.cpp" line="292"> true -TestMain.cpp" line="293"> +TestMain.cpp" line="299"> matchNone.shouldInclude( fakeTestCase( "any" ) ) == false @@ -11327,7 +11327,7 @@ TestMain.cpp" line="293"> false == false -TestMain.cpp" line="298"> +TestMain.cpp" line="304"> matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false @@ -11335,7 +11335,7 @@ TestMain.cpp" line="298"> false == false -TestMain.cpp" line="299"> +TestMain.cpp" line="305"> matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) @@ -11343,7 +11343,7 @@ TestMain.cpp" line="299"> true -TestMain.cpp" line="301"> +TestMain.cpp" line="307"> matchHidden.shouldInclude( fakeTestCase( "./any" ) ) @@ -11351,7 +11351,7 @@ TestMain.cpp" line="301"> true -TestMain.cpp" line="302"> +TestMain.cpp" line="308"> matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false @@ -11362,7 +11362,7 @@ TestMain.cpp" line="302"> -TestMain.cpp" line="313"> +TestMain.cpp" line="319"> matchHidden.shouldInclude( fakeTestCase( "./something" ) ) @@ -11370,7 +11370,7 @@ TestMain.cpp" line="313"> true -TestMain.cpp" line="315"> +TestMain.cpp" line="321"> filters.shouldInclude( fakeTestCase( "any" ) ) == false @@ -11378,7 +11378,7 @@ TestMain.cpp" line="315"> false == false -TestMain.cpp" line="316"> +TestMain.cpp" line="322"> filters.shouldInclude( fakeTestCase( "./something" ) ) @@ -11386,7 +11386,7 @@ TestMain.cpp" line="316"> true -TestMain.cpp" line="317"> +TestMain.cpp" line="323"> filters.shouldInclude( fakeTestCase( "./anything" ) ) == false @@ -11397,25 +11397,6 @@ TestMain.cpp" line="317"> -TestMain.cpp" line="323"> - - matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) - - - true - - -TestMain.cpp" line="324"> - - matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false - - - false == false - - - - - TestMain.cpp" line="329"> matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) @@ -11425,6 +11406,25 @@ TestMain.cpp" line="329"> TestMain.cpp" line="330"> + + matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false + + + false == false + + + + + +TestMain.cpp" line="335"> + + matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) + + + true + + +TestMain.cpp" line="336"> matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) @@ -11432,7 +11432,7 @@ TestMain.cpp" line="330"> true -TestMain.cpp" line="331"> +TestMain.cpp" line="337"> matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) @@ -11440,7 +11440,7 @@ TestMain.cpp" line="331"> true -TestMain.cpp" line="332"> +TestMain.cpp" line="338"> matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false @@ -11451,7 +11451,7 @@ TestMain.cpp" line="332"> -TestMain.cpp" line="352"> +TestMain.cpp" line="358"> opt.parseIntoConfig( parser, config ) @@ -11459,25 +11459,25 @@ TestMain.cpp" line="352"> opt.parseIntoConfig( parser, config ) -TestMain.cpp" line="354"> +TestMain.cpp" line="361"> - config.filters.size() == 1 + cfg.filters().size() == 1 1 == 1 -TestMain.cpp" line="355"> +TestMain.cpp" line="362"> - config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false + cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false false == false -TestMain.cpp" line="356"> +TestMain.cpp" line="363"> - config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) + cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) true @@ -11487,7 +11487,7 @@ TestMain.cpp" line="356">
-TestMain.cpp" line="370"> +TestMain.cpp" line="377"> oneTag.getTestCaseInfo().description == "" @@ -11495,7 +11495,7 @@ TestMain.cpp" line="370"> "" == "" -TestMain.cpp" line="371"> +TestMain.cpp" line="378"> oneTag.hasTag( "one" ) @@ -11503,7 +11503,7 @@ TestMain.cpp" line="371"> true -TestMain.cpp" line="372"> +TestMain.cpp" line="379"> oneTag.getTags().size() == 1 @@ -11511,7 +11511,7 @@ TestMain.cpp" line="372"> 1 == 1 -TestMain.cpp" line="374"> +TestMain.cpp" line="381"> oneTag.matchesTags( p1 ) == true @@ -11519,7 +11519,7 @@ TestMain.cpp" line="374"> true == true -TestMain.cpp" line="375"> +TestMain.cpp" line="382"> oneTag.matchesTags( p2 ) == true @@ -11527,7 +11527,7 @@ TestMain.cpp" line="375"> true == true -TestMain.cpp" line="376"> +TestMain.cpp" line="383"> oneTag.matchesTags( p3 ) == false @@ -11535,7 +11535,7 @@ TestMain.cpp" line="376"> false == false -TestMain.cpp" line="377"> +TestMain.cpp" line="384"> oneTag.matchesTags( p4 ) == false @@ -11543,7 +11543,7 @@ TestMain.cpp" line="377"> false == false -TestMain.cpp" line="378"> +TestMain.cpp" line="385"> oneTag.matchesTags( p5 ) == false @@ -11554,7 +11554,7 @@ TestMain.cpp" line="378">
-TestMain.cpp" line="384"> +TestMain.cpp" line="391"> twoTags.getTestCaseInfo().description == "" @@ -11562,7 +11562,7 @@ TestMain.cpp" line="384"> "" == "" -TestMain.cpp" line="385"> +TestMain.cpp" line="392"> twoTags.hasTag( "one" ) @@ -11570,7 +11570,7 @@ TestMain.cpp" line="385"> true -TestMain.cpp" line="386"> +TestMain.cpp" line="393"> twoTags.hasTag( "two" ) @@ -11578,7 +11578,7 @@ TestMain.cpp" line="386"> true -TestMain.cpp" line="387"> +TestMain.cpp" line="394"> twoTags.hasTag( "Two" ) @@ -11586,7 +11586,7 @@ TestMain.cpp" line="387"> true -TestMain.cpp" line="388"> +TestMain.cpp" line="395"> twoTags.hasTag( "three" ) == false @@ -11594,7 +11594,7 @@ TestMain.cpp" line="388"> false == false -TestMain.cpp" line="389"> +TestMain.cpp" line="396"> twoTags.getTags().size() == 2 @@ -11602,7 +11602,7 @@ TestMain.cpp" line="389"> 2 == 2 -TestMain.cpp" line="391"> +TestMain.cpp" line="398"> twoTags.matchesTags( p1 ) == true @@ -11610,7 +11610,7 @@ TestMain.cpp" line="391"> true == true -TestMain.cpp" line="392"> +TestMain.cpp" line="399"> twoTags.matchesTags( p2 ) == true @@ -11618,7 +11618,7 @@ TestMain.cpp" line="392"> true == true -TestMain.cpp" line="393"> +TestMain.cpp" line="400"> twoTags.matchesTags( p3 ) == true @@ -11626,7 +11626,7 @@ TestMain.cpp" line="393"> true == true -TestMain.cpp" line="394"> +TestMain.cpp" line="401"> twoTags.matchesTags( p4 ) == true @@ -11634,7 +11634,7 @@ TestMain.cpp" line="394"> true == true -TestMain.cpp" line="395"> +TestMain.cpp" line="402"> twoTags.matchesTags( p5 ) == true @@ -11645,7 +11645,7 @@ TestMain.cpp" line="395">
-TestMain.cpp" line="401"> +TestMain.cpp" line="408"> oneTagWithExtras.getTestCaseInfo().description == "1234" @@ -11653,7 +11653,7 @@ TestMain.cpp" line="401"> "1234" == "1234" -TestMain.cpp" line="402"> +TestMain.cpp" line="409"> oneTagWithExtras.hasTag( "one" ) @@ -11661,7 +11661,7 @@ TestMain.cpp" line="402"> true -TestMain.cpp" line="403"> +TestMain.cpp" line="410"> oneTagWithExtras.hasTag( "two" ) == false @@ -11669,7 +11669,7 @@ TestMain.cpp" line="403"> false == false -TestMain.cpp" line="404"> +TestMain.cpp" line="411"> oneTagWithExtras.getTags().size() == 1 @@ -11680,7 +11680,7 @@ TestMain.cpp" line="404">
-TestMain.cpp" line="411"> +TestMain.cpp" line="418"> oneTagOpen.getTestCaseInfo().description == "[one" @@ -11688,7 +11688,7 @@ TestMain.cpp" line="411"> "[one" == "[one" -TestMain.cpp" line="412"> +TestMain.cpp" line="419"> oneTagOpen.hasTag( "one" ) == false @@ -11696,7 +11696,7 @@ TestMain.cpp" line="412"> false == false -TestMain.cpp" line="413"> +TestMain.cpp" line="420"> oneTagOpen.getTags().size() == 0 @@ -11707,7 +11707,7 @@ TestMain.cpp" line="413">
-TestMain.cpp" line="419"> +TestMain.cpp" line="426"> oneTag.getTestCaseInfo().description == "" @@ -11715,7 +11715,7 @@ TestMain.cpp" line="419"> "" == "" -TestMain.cpp" line="420"> +TestMain.cpp" line="427"> oneTag.hasTag( "hide" ) @@ -11723,7 +11723,7 @@ TestMain.cpp" line="420"> true -TestMain.cpp" line="421"> +TestMain.cpp" line="428"> oneTag.isHidden() @@ -11731,7 +11731,7 @@ TestMain.cpp" line="421"> true -TestMain.cpp" line="423"> +TestMain.cpp" line="430"> oneTag.matchesTags( "~[hide]" ) == false @@ -11746,7 +11746,7 @@ TestMain.cpp" line="423">
-TestMain.cpp" line="436"> +TestMain.cpp" line="443"> Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString @@ -11756,7 +11756,7 @@ TestMain.cpp" line="436"> "one two three four" -TestMain.cpp" line="437"> +TestMain.cpp" line="444"> Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString @@ -11772,7 +11772,7 @@ TestMain.cpp" line="437">
-TestMain.cpp" line="440"> +TestMain.cpp" line="447"> Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" @@ -11784,7 +11784,7 @@ four" four" -TestMain.cpp" line="441"> +TestMain.cpp" line="448"> Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" @@ -11796,7 +11796,7 @@ four" four" -TestMain.cpp" line="442"> +TestMain.cpp" line="449"> Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" @@ -11808,7 +11808,7 @@ four" four" -TestMain.cpp" line="443"> +TestMain.cpp" line="450"> Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" @@ -11820,7 +11820,7 @@ four" four" -TestMain.cpp" line="444"> +TestMain.cpp" line="451"> Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" @@ -11838,7 +11838,7 @@ three four"
-TestMain.cpp" line="447"> +TestMain.cpp" line="454"> Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" @@ -11852,7 +11852,7 @@ three four" -TestMain.cpp" line="448"> +TestMain.cpp" line="455"> Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" @@ -11866,7 +11866,7 @@ three four" -TestMain.cpp" line="449"> +TestMain.cpp" line="456"> Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" @@ -11886,7 +11886,7 @@ four"
-TestMain.cpp" line="452"> +TestMain.cpp" line="459"> Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" @@ -11902,7 +11902,7 @@ three four" -TestMain.cpp" line="453"> +TestMain.cpp" line="460"> Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" @@ -11924,7 +11924,7 @@ four"
-TestMain.cpp" line="456"> +TestMain.cpp" line="463"> Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" @@ -11936,7 +11936,7 @@ def" def" -TestMain.cpp" line="457"> +TestMain.cpp" line="464"> Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" @@ -11948,7 +11948,7 @@ defg" defg" -TestMain.cpp" line="458"> +TestMain.cpp" line="465"> Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" @@ -11962,7 +11962,7 @@ def- gh" -TestMain.cpp" line="460"> +TestMain.cpp" line="467"> Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" @@ -11980,7 +11980,7 @@ ee four" -TestMain.cpp" line="461"> +TestMain.cpp" line="468"> Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" @@ -12006,7 +12006,7 @@ ur"
-TestMain.cpp" line="465"> +TestMain.cpp" line="472"> text.size() == 4 @@ -12014,7 +12014,7 @@ TestMain.cpp" line="465"> 4 == 4 -TestMain.cpp" line="466"> +TestMain.cpp" line="473"> text[0] == "one" @@ -12022,7 +12022,7 @@ TestMain.cpp" line="466"> "one" == "one" -TestMain.cpp" line="467"> +TestMain.cpp" line="474"> text[1] == "two" @@ -12030,7 +12030,7 @@ TestMain.cpp" line="467"> "two" == "two" -TestMain.cpp" line="468"> +TestMain.cpp" line="475"> text[2] == "three" @@ -12038,7 +12038,7 @@ TestMain.cpp" line="468"> "three" == "three" -TestMain.cpp" line="469"> +TestMain.cpp" line="476"> text[3] == "four" @@ -12052,7 +12052,7 @@ TestMain.cpp" line="469">
-TestMain.cpp" line="476"> +TestMain.cpp" line="483"> text.toString() == " one two\n three\n four" @@ -12075,7 +12075,7 @@ TestMain.cpp" line="476">
-TestMain.cpp" line="487"> +TestMain.cpp" line="494"> Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString @@ -12087,7 +12087,7 @@ three four" three four" -TestMain.cpp" line="488"> +TestMain.cpp" line="495"> Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString @@ -12099,7 +12099,7 @@ three four" three four" -TestMain.cpp" line="489"> +TestMain.cpp" line="496"> Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString @@ -12117,7 +12117,7 @@ three four"
-TestMain.cpp" line="492"> +TestMain.cpp" line="499"> Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" @@ -12129,7 +12129,7 @@ TestMain.cpp" line="492"> " -TestMain.cpp" line="493"> +TestMain.cpp" line="500"> Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" @@ -12137,7 +12137,7 @@ TestMain.cpp" line="493"> "abcdef" == "abcdef" -TestMain.cpp" line="494"> +TestMain.cpp" line="501"> Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" @@ -12155,7 +12155,7 @@ TestMain.cpp" line="494">
-TestMain.cpp" line="497"> +TestMain.cpp" line="504"> Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" @@ -12169,7 +12169,7 @@ three four" -TestMain.cpp" line="498"> +TestMain.cpp" line="505"> Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" @@ -12183,7 +12183,7 @@ three four" -TestMain.cpp" line="499"> +TestMain.cpp" line="506"> Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" @@ -12203,7 +12203,7 @@ four"
-TestMain.cpp" line="502"> +TestMain.cpp" line="509"> Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" @@ -12227,7 +12227,7 @@ four"
-TestMain.cpp" line="512"> +TestMain.cpp" line="519"> Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" @@ -12251,7 +12251,7 @@ TestMain.cpp" line="512"> -TestMain.cpp" line="612"> +TestMain.cpp" line="619"> Text( "hi there" ).toString() == "hi there" @@ -12259,7 +12259,7 @@ TestMain.cpp" line="612"> "hi there" == "hi there" -TestMain.cpp" line="617"> +TestMain.cpp" line="624"> Text( "hi there", narrow ).toString() == "hi\nthere" @@ -14265,67 +14265,67 @@ TestMain.cpp:103: config.reporter.empty() succeeded for: true [Started section: 'test lists'] [Started section: '-t/1'] TestMain.cpp:109: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:111: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:112: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:113: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:112: cfg.filters().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:113: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:114: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [End of section: '-t/1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '-t/exclude:1'] -TestMain.cpp:117: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:119: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:120: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:121: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:118: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:121: cfg.filters().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:122: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:123: cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '-t/exclude:1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '--test/1'] -TestMain.cpp:126: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:128: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:129: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:130: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:128: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:131: cfg.filters().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:132: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:133: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [End of section: '--test/1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '--test/exclude:1'] -TestMain.cpp:135: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:137: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:138: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:139: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:138: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:141: cfg.filters().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:142: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:143: cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '--test/exclude:1' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '--test/exclude:2'] -TestMain.cpp:144: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:146: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:147: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:148: config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +TestMain.cpp:148: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:151: cfg.filters().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:152: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:153: cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true [End of section: '--test/exclude:2' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] [Started section: '-t/2'] -TestMain.cpp:153: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:155: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:156: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:157: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -TestMain.cpp:158: config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true +TestMain.cpp:158: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:161: cfg.filters().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:162: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:163: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:164: cfg.filters()[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true [End of section: '-t/2' All 5 assertions passed] [End of section: 'test lists' All 5 assertions passed] [Started section: 'test lists'] [Started section: '-t/0'] -TestMain.cpp:163: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: +TestMain.cpp:169: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" [End of section: '-t/0' 1 assertion passed] @@ -14333,31 +14333,31 @@ TestMain.cpp:163: parseIntoConfigAndReturnError( argv, config ) Contains( "at le [Started section: 'reporter'] [Started section: '-r/console'] -TestMain.cpp:170: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:172: config.reporter == "console" succeeded for: "console" == "console" +TestMain.cpp:176: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:178: config.reporter == "console" succeeded for: "console" == "console" [End of section: '-r/console' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '-r/xml'] -TestMain.cpp:176: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:178: config.reporter == "xml" succeeded for: "xml" == "xml" +TestMain.cpp:182: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:184: config.reporter == "xml" succeeded for: "xml" == "xml" [End of section: '-r/xml' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '--reporter/junit'] -TestMain.cpp:182: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:184: config.reporter == "junit" succeeded for: "junit" == "junit" +TestMain.cpp:188: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:190: config.reporter == "junit" succeeded for: "junit" == "junit" [End of section: '--reporter/junit' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '-r/error'] -TestMain.cpp:188: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: +TestMain.cpp:194: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" [End of section: '-r/error' 1 assertion passed] @@ -14365,23 +14365,23 @@ TestMain.cpp:188: parseIntoConfigAndReturnError( argv, config ) Contains( "1 arg [Started section: 'debugger'] [Started section: '-b'] -TestMain.cpp:195: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:197: config.shouldDebugBreak == true succeeded for: true == true +TestMain.cpp:201: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:203: config.shouldDebugBreak == true succeeded for: true == true [End of section: '-b' All 2 assertions passed] [End of section: 'debugger' All 2 assertions passed] [Started section: 'debugger'] [Started section: '--break'] -TestMain.cpp:201: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:203: config.shouldDebugBreak succeeded for: true +TestMain.cpp:207: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:209: config.shouldDebugBreak succeeded for: true [End of section: '--break' All 2 assertions passed] [End of section: 'debugger' All 2 assertions passed] [Started section: 'debugger'] [Started section: '-b'] -TestMain.cpp:207: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: +TestMain.cpp:213: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" [End of section: '-b' 1 assertion passed] @@ -14389,23 +14389,23 @@ TestMain.cpp:207: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arg [Started section: 'abort'] [Started section: '-a'] -TestMain.cpp:214: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:216: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:220: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:222: config.cutoff == 1 succeeded for: 1 == 1 [End of section: '-a' All 2 assertions passed] [End of section: 'abort' All 2 assertions passed] [Started section: 'abort'] [Started section: '-a/2'] -TestMain.cpp:220: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:222: config.cutoff == 2 succeeded for: 2 == 2 +TestMain.cpp:226: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:228: config.cutoff == 2 succeeded for: 2 == 2 [End of section: '-a/2' All 2 assertions passed] [End of section: 'abort' All 2 assertions passed] [Started section: 'abort'] [Started section: '-a/error/0'] -TestMain.cpp:226: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +TestMain.cpp:232: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" [End of section: '-a/error/0' 1 assertion passed] @@ -14413,7 +14413,7 @@ TestMain.cpp:226: parseIntoConfigAndReturnError( argv, config ) Contains( "great [Started section: 'abort'] [Started section: '-a/error/non numeric'] -TestMain.cpp:230: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +TestMain.cpp:236: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" [End of section: '-a/error/non numeric' 1 assertion passed] @@ -14421,7 +14421,7 @@ TestMain.cpp:230: parseIntoConfigAndReturnError( argv, config ) Contains( "great [Started section: 'abort'] [Started section: '-a/error/two args'] -TestMain.cpp:234: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: +TestMain.cpp:240: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" [End of section: '-a/error/two args' 1 assertion passed] @@ -14429,52 +14429,52 @@ TestMain.cpp:234: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and [Started section: 'nothrow'] [Started section: '-nt'] -TestMain.cpp:241: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:243: config.noThrow == true succeeded for: true == true +TestMain.cpp:247: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:249: config.noThrow == true succeeded for: true == true [End of section: '-nt' All 2 assertions passed] [End of section: 'nothrow' All 2 assertions passed] [Started section: 'nothrow'] [Started section: '--nothrow'] -TestMain.cpp:247: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:249: config.noThrow == true succeeded for: true == true +TestMain.cpp:253: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:255: config.noThrow == true succeeded for: true == true [End of section: '--nothrow' All 2 assertions passed] [End of section: 'nothrow' All 2 assertions passed] [Started section: 'streams'] [Started section: '-o filename'] -TestMain.cpp:256: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:258: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -TestMain.cpp:259: config.stream.empty() succeeded for: true +TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:264: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:265: config.stream.empty() succeeded for: true [End of section: '-o filename' All 3 assertions passed] [End of section: 'streams' All 3 assertions passed] [Started section: 'streams'] [Started section: '-o %stdout'] -TestMain.cpp:263: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:265: config.stream == "stdout" succeeded for: "stdout" == "stdout" -TestMain.cpp:266: config.outputFilename.empty() succeeded for: true +TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:271: config.stream == "stdout" succeeded for: "stdout" == "stdout" +TestMain.cpp:272: config.outputFilename.empty() succeeded for: true [End of section: '-o %stdout' All 3 assertions passed] [End of section: 'streams' All 3 assertions passed] [Started section: 'streams'] [Started section: '--out'] -TestMain.cpp:270: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:272: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:276: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:278: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" [End of section: '--out' All 2 assertions passed] [End of section: 'streams' All 2 assertions passed] [Started section: 'combinations'] [Started section: '-a -b'] -TestMain.cpp:279: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:281: config.cutoff == 1 succeeded for: 1 == 1 -TestMain.cpp:282: config.shouldDebugBreak succeeded for: true -TestMain.cpp:283: config.noThrow == true succeeded for: true == true +TestMain.cpp:285: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:287: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:288: config.shouldDebugBreak succeeded for: true +TestMain.cpp:289: config.noThrow == true succeeded for: true == true [End of section: '-a -b' All 4 assertions passed] [End of section: 'combinations' All 4 assertions passed] @@ -14482,84 +14482,84 @@ TestMain.cpp:283: config.noThrow == true succeeded for: true == true [Finished: 'selftest/parser/2' All tests passed (66 assertions in 1 test case)] [Running: selftest/test filter] -TestMain.cpp:292: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -TestMain.cpp:293: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:298: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:299: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -TestMain.cpp:301: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true -TestMain.cpp:302: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false +TestMain.cpp:298: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:299: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:304: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:305: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:307: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true +TestMain.cpp:308: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false [Finished: 'selftest/test filter' All tests passed (6 assertions in 1 test case)] [Running: selftest/test filters] -TestMain.cpp:313: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:316: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -TestMain.cpp:317: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false +TestMain.cpp:319: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:321: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:322: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:323: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false [Finished: 'selftest/test filters' All tests passed (4 assertions in 1 test case)] [Running: selftest/filter/prefix wildcard] -TestMain.cpp:323: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -TestMain.cpp:324: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false +TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/prefix wildcard' All tests passed (2 assertions in 1 test case)] [Running: selftest/filter/wildcard at both ends] -TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true -TestMain.cpp:331: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true -TestMain.cpp:332: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false +TestMain.cpp:335: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:336: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true +TestMain.cpp:337: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true +TestMain.cpp:338: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/wildcard at both ends' All tests passed (4 assertions in 1 test case)] [Running: selftest/option parsers] -TestMain.cpp:352: opt.parseIntoConfig( parser, config ) succeeded -TestMain.cpp:354: config.filters.size() == 1 succeeded for: 1 == 1 -TestMain.cpp:355: config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:356: config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:358: opt.parseIntoConfig( parser, config ) succeeded +TestMain.cpp:361: cfg.filters().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:362: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:363: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [Finished: 'selftest/option parsers' All tests passed (4 assertions in 1 test case)] [Running: selftest/tags] [Started section: 'one tag'] -TestMain.cpp:370: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:371: oneTag.hasTag( "one" ) succeeded for: true -TestMain.cpp:372: oneTag.getTags().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:374: oneTag.matchesTags( p1 ) == true succeeded for: true == true -TestMain.cpp:375: oneTag.matchesTags( p2 ) == true succeeded for: true == true -TestMain.cpp:376: oneTag.matchesTags( p3 ) == false succeeded for: false == false -TestMain.cpp:377: oneTag.matchesTags( p4 ) == false succeeded for: false == false -TestMain.cpp:378: oneTag.matchesTags( p5 ) == false succeeded for: false == false +TestMain.cpp:377: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:378: oneTag.hasTag( "one" ) succeeded for: true +TestMain.cpp:379: oneTag.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:381: oneTag.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:382: oneTag.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:383: oneTag.matchesTags( p3 ) == false succeeded for: false == false +TestMain.cpp:384: oneTag.matchesTags( p4 ) == false succeeded for: false == false +TestMain.cpp:385: oneTag.matchesTags( p5 ) == false succeeded for: false == false [End of section: 'one tag' All 8 assertions passed] [Started section: 'two tags'] -TestMain.cpp:384: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:385: twoTags.hasTag( "one" ) succeeded for: true -TestMain.cpp:386: twoTags.hasTag( "two" ) succeeded for: true -TestMain.cpp:387: twoTags.hasTag( "Two" ) succeeded for: true -TestMain.cpp:388: twoTags.hasTag( "three" ) == false succeeded for: false == false -TestMain.cpp:389: twoTags.getTags().size() == 2 succeeded for: 2 == 2 -TestMain.cpp:391: twoTags.matchesTags( p1 ) == true succeeded for: true == true -TestMain.cpp:392: twoTags.matchesTags( p2 ) == true succeeded for: true == true -TestMain.cpp:393: twoTags.matchesTags( p3 ) == true succeeded for: true == true -TestMain.cpp:394: twoTags.matchesTags( p4 ) == true succeeded for: true == true -TestMain.cpp:395: twoTags.matchesTags( p5 ) == true succeeded for: true == true +TestMain.cpp:391: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:392: twoTags.hasTag( "one" ) succeeded for: true +TestMain.cpp:393: twoTags.hasTag( "two" ) succeeded for: true +TestMain.cpp:394: twoTags.hasTag( "Two" ) succeeded for: true +TestMain.cpp:395: twoTags.hasTag( "three" ) == false succeeded for: false == false +TestMain.cpp:396: twoTags.getTags().size() == 2 succeeded for: 2 == 2 +TestMain.cpp:398: twoTags.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:399: twoTags.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:400: twoTags.matchesTags( p3 ) == true succeeded for: true == true +TestMain.cpp:401: twoTags.matchesTags( p4 ) == true succeeded for: true == true +TestMain.cpp:402: twoTags.matchesTags( p5 ) == true succeeded for: true == true [End of section: 'two tags' All 11 assertions passed] [Started section: 'one tag with characters either side'] -TestMain.cpp:401: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" -TestMain.cpp:402: oneTagWithExtras.hasTag( "one" ) succeeded for: true -TestMain.cpp:403: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false -TestMain.cpp:404: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:408: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" +TestMain.cpp:409: oneTagWithExtras.hasTag( "one" ) succeeded for: true +TestMain.cpp:410: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false +TestMain.cpp:411: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 [End of section: 'one tag with characters either side' All 4 assertions passed] [Started section: 'start of a tag, but not closed'] -TestMain.cpp:411: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" -TestMain.cpp:412: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false -TestMain.cpp:413: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 +TestMain.cpp:418: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" +TestMain.cpp:419: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false +TestMain.cpp:420: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 [End of section: 'start of a tag, but not closed' All 3 assertions passed] [Started section: 'hidden'] -TestMain.cpp:419: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:420: oneTag.hasTag( "hide" ) succeeded for: true -TestMain.cpp:421: oneTag.isHidden() succeeded for: true -TestMain.cpp:423: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false +TestMain.cpp:426: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:427: oneTag.hasTag( "hide" ) succeeded for: true +TestMain.cpp:428: oneTag.isHidden() succeeded for: true +TestMain.cpp:430: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false [End of section: 'hidden' All 4 assertions passed] [Finished: 'selftest/tags' All tests passed (30 assertions in 1 test case)] @@ -14567,11 +14567,11 @@ TestMain.cpp:423: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false [Running: Long strings can be wrapped] [Started section: 'plain string'] [Started section: 'No wrapping'] -TestMain.cpp:436: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: +TestMain.cpp:443: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:437: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: +TestMain.cpp:444: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" @@ -14581,31 +14581,31 @@ TestMain.cpp:437: Text( testString, TextAttributes().setWidth( 18 ) ).toString() [Started section: 'plain string'] [Started section: 'Wrapped once'] -TestMain.cpp:440: Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:447: Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:441: Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:448: Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:442: Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:449: Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:443: Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:450: Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:444: Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" succeeded for: +TestMain.cpp:451: Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" succeeded for: "one two three four" == @@ -14617,7 +14617,7 @@ three four" [Started section: 'plain string'] [Started section: 'Wrapped twice'] -TestMain.cpp:447: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:454: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14625,7 +14625,7 @@ four" "one two three four" -TestMain.cpp:448: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:455: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14633,7 +14633,7 @@ four" "one two three four" -TestMain.cpp:449: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:456: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14647,7 +14647,7 @@ four" [Started section: 'plain string'] [Started section: 'Wrapped three times'] -TestMain.cpp:452: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:459: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -14657,7 +14657,7 @@ four" two three four" -TestMain.cpp:453: Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:460: Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -14673,24 +14673,24 @@ four" [Started section: 'plain string'] [Started section: 'Short wrap'] -TestMain.cpp:456: Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" succeeded for: "abc- +TestMain.cpp:463: Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" succeeded for: "abc- def" == "abc- def" -TestMain.cpp:457: Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" succeeded for: "abc- +TestMain.cpp:464: Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" succeeded for: "abc- defg" == "abc- defg" -TestMain.cpp:458: Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- +TestMain.cpp:465: Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- def- gh" == "abc- def- gh" -TestMain.cpp:460: Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: +TestMain.cpp:467: Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: "one two thr- @@ -14702,7 +14702,7 @@ two thr- ee four" -TestMain.cpp:461: Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: +TestMain.cpp:468: Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: "one two th- @@ -14722,18 +14722,18 @@ ur" [Started section: 'plain string'] [Started section: 'As container'] -TestMain.cpp:465: text.size() == 4 succeeded for: 4 == 4 -TestMain.cpp:466: text[0] == "one" succeeded for: "one" == "one" -TestMain.cpp:467: text[1] == "two" succeeded for: "two" == "two" -TestMain.cpp:468: text[2] == "three" succeeded for: "three" == "three" -TestMain.cpp:469: text[3] == "four" succeeded for: "four" == "four" +TestMain.cpp:472: text.size() == 4 succeeded for: 4 == 4 +TestMain.cpp:473: text[0] == "one" succeeded for: "one" == "one" +TestMain.cpp:474: text[1] == "two" succeeded for: "two" == "two" +TestMain.cpp:475: text[2] == "three" succeeded for: "three" == "three" +TestMain.cpp:476: text[3] == "four" succeeded for: "four" == "four" [End of section: 'As container' All 5 assertions passed] [End of section: 'plain string' All 5 assertions passed] [Started section: 'plain string'] [Started section: 'Indent first line differently'] -TestMain.cpp:476: text.toString() == " one two\n three\n four" succeeded for: +TestMain.cpp:483: text.toString() == " one two\n three\n four" succeeded for: " one two three four" @@ -14747,19 +14747,19 @@ TestMain.cpp:476: text.toString() == " one two\n three\n four" succeeded f [Started section: 'With newlines'] [Started section: 'No wrapping'] -TestMain.cpp:487: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: +TestMain.cpp:494: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:488: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: +TestMain.cpp:495: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:489: Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString succeeded for: +TestMain.cpp:496: Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString succeeded for: "one two three four" == @@ -14771,13 +14771,13 @@ three four" [Started section: 'With newlines'] [Started section: 'Trailing newline'] -TestMain.cpp:492: Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:499: Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef " -TestMain.cpp:493: Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" -TestMain.cpp:494: Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:500: Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" +TestMain.cpp:501: Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef @@ -14788,7 +14788,7 @@ TestMain.cpp:494: Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() [Started section: 'With newlines'] [Started section: 'Wrapped once'] -TestMain.cpp:497: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:504: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14796,7 +14796,7 @@ four" "one two three four" -TestMain.cpp:498: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:505: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14804,7 +14804,7 @@ four" "one two three four" -TestMain.cpp:499: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:506: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14818,7 +14818,7 @@ four" [Started section: 'With newlines'] [Started section: 'Wrapped twice'] -TestMain.cpp:502: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:509: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -14833,7 +14833,7 @@ four" [End of section: 'With newlines' 1 assertion passed] [Started section: 'With tabs'] -TestMain.cpp:512: Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" succeeded for: +TestMain.cpp:519: Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" succeeded for: "one two three four five @@ -14856,8 +14856,8 @@ No assertions in test case, 'Strings can be rendered with colour' [Finished: 'Strings can be rendered with colour' 1 test case failed (1 assertion failed)] [Running: Text can be formatted using the Text class] -TestMain.cpp:612: Text( "hi there" ).toString() == "hi there" succeeded for: "hi there" == "hi there" -TestMain.cpp:617: Text( "hi there", narrow ).toString() == "hi\nthere" succeeded for: "hi +TestMain.cpp:619: Text( "hi there" ).toString() == "hi there" succeeded for: "hi there" == "hi there" +TestMain.cpp:624: Text( "hi there", narrow ).toString() == "hi\nthere" succeeded for: "hi there" == "hi diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index a0d941fc..626c026b 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -108,54 +108,60 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { const char* argv[] = { "test", "-t", "test1" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ); + Catch::Config cfg( config ); + REQUIRE( cfg.filters().size() == 1 ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ); } SECTION( "-t/exclude:1", "Specify one test case exclusion using -t exclude:" ) { const char* argv[] = { "test", "-t", "exclude:test1" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); + Catch::Config cfg( config ); + REQUIRE( cfg.filters().size() == 1 ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); } SECTION( "--test/1", "Specify one test case using --test" ) { const char* argv[] = { "test", "--test", "test1" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ); + Catch::Config cfg( config ); + REQUIRE( cfg.filters().size() == 1 ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ); } SECTION( "--test/exclude:1", "Specify one test case exclusion using --test exclude:" ) { const char* argv[] = { "test", "--test", "exclude:test1" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); + Catch::Config cfg( config ); + REQUIRE( cfg.filters().size() == 1 ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); } SECTION( "--test/exclude:2", "Specify one test case exclusion using --test ~" ) { const char* argv[] = { "test", "--test", "~test1" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); + Catch::Config cfg( config ); + REQUIRE( cfg.filters().size() == 1 ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); } SECTION( "-t/2", "Specify two test cases using -t" ) { const char* argv[] = { "test", "-t", "test1", "test2" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ); + Catch::Config cfg( config ); + REQUIRE( cfg.filters().size() == 1 ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test2" ) ) ); } SECTION( "-t/0", "When no test names are supplied it is an error" ) { @@ -351,9 +357,10 @@ TEST_CASE( "selftest/option parsers", "" ) CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ); - REQUIRE( config.filters.size() == 1 ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); - REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ); + Catch::Config cfg( config ); + REQUIRE( cfg.filters().size() == 1 ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); + REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ); } TEST_CASE( "selftest/tags", "" ) { From 3f184e22e86939b808c9416848e4b6ba1d74490e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 29 May 2013 19:01:06 +0100 Subject: [PATCH 264/296] ConfigData now looks virtually identical to the Clara test Config --- include/internal/catch_config.hpp | 7 +- .../SelfTest/Baselines/approvedResults.txt | 140 +++++++++--------- projects/SelfTest/CmdLineTests.cpp | 3 +- 3 files changed, 77 insertions(+), 73 deletions(-) diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index f29b58e1..70554969 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -44,21 +44,24 @@ namespace Catch { showSuccessfulTests( false ), shouldDebugBreak( false ), noThrow( false ), + showHelp( false ), cutoff( -1 ), + verbosity( Verbosity::Normal ), warnings( WarnAbout::Nothing ) {} bool listTests; bool listTags; bool listReporters; + bool showSuccessfulTests; bool shouldDebugBreak; bool noThrow; -// bool showHelp; // !TBD + bool showHelp; int cutoff; -// Verbosity::Level verbosity; + Verbosity::Level verbosity; WarnAbout::What warnings; std::string reporter; diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 0baba78f..d5bccb29 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -5762,7 +5762,7 @@ Scenario: New Catch commandline interface When: We ask for usage strings Then: It prints the usage strings ------------------------------------------------------------------------------- -CmdLineTests.cpp:324 +CmdLineTests.cpp:325 ............................................................................... @@ -5773,22 +5773,22 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: Multiple flags are combined ------------------------------------------------------------------------------- -CmdLineTests.cpp:329 +CmdLineTests.cpp:330 ............................................................................... -CmdLineTests.cpp:331: +CmdLineTests.cpp:332: PASSED: CHECK_FALSE( config.showSuccessfulTests ) with expansion: !false -CmdLineTests.cpp:332: +CmdLineTests.cpp:333: PASSED: CHECK_FALSE( config.noThrow ) with expansion: !false -CmdLineTests.cpp:333: +CmdLineTests.cpp:334: PASSED: CHECK_FALSE( config.breakIntoDebugger ) with expansion: @@ -5800,22 +5800,22 @@ Scenario: New Catch commandline interface When: Multiple flags are combined Then: All the flags are set ------------------------------------------------------------------------------- -CmdLineTests.cpp:338 +CmdLineTests.cpp:339 ............................................................................... -CmdLineTests.cpp:339: +CmdLineTests.cpp:340: PASSED: CHECK( config.showSuccessfulTests ) with expansion: true -CmdLineTests.cpp:340: +CmdLineTests.cpp:341: PASSED: CHECK( config.noThrow ) with expansion: true -CmdLineTests.cpp:341: +CmdLineTests.cpp:342: PASSED: CHECK( config.breakIntoDebugger ) with expansion: @@ -5826,22 +5826,22 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: Multiple flags are combined ------------------------------------------------------------------------------- -CmdLineTests.cpp:329 +CmdLineTests.cpp:330 ............................................................................... -CmdLineTests.cpp:331: +CmdLineTests.cpp:332: PASSED: CHECK_FALSE( config.showSuccessfulTests ) with expansion: !false -CmdLineTests.cpp:332: +CmdLineTests.cpp:333: PASSED: CHECK_FALSE( config.noThrow ) with expansion: !false -CmdLineTests.cpp:333: +CmdLineTests.cpp:334: PASSED: CHECK_FALSE( config.breakIntoDebugger ) with expansion: @@ -5852,10 +5852,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a nullary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:344 +CmdLineTests.cpp:345 ............................................................................... -CmdLineTests.cpp:345: +CmdLineTests.cpp:346: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5867,10 +5867,10 @@ Scenario: New Catch commandline interface When: A flag is set via a nullary method Then: The flag is set ------------------------------------------------------------------------------- -CmdLineTests.cpp:350 +CmdLineTests.cpp:351 ............................................................................... -CmdLineTests.cpp:351: +CmdLineTests.cpp:352: PASSED: REQUIRE( config.abortAfter == 1 ) with expansion: @@ -5881,10 +5881,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a nullary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:344 +CmdLineTests.cpp:345 ............................................................................... -CmdLineTests.cpp:345: +CmdLineTests.cpp:346: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5895,10 +5895,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a unary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:353 +CmdLineTests.cpp:354 ............................................................................... -CmdLineTests.cpp:354: +CmdLineTests.cpp:355: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5910,10 +5910,10 @@ Scenario: New Catch commandline interface When: A flag is set via a unary method Then: The flag is set ------------------------------------------------------------------------------- -CmdLineTests.cpp:359 +CmdLineTests.cpp:360 ............................................................................... -CmdLineTests.cpp:360: +CmdLineTests.cpp:361: PASSED: REQUIRE( config.abortAfter == 2 ) with expansion: @@ -5924,10 +5924,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: A flag is set via a unary method ------------------------------------------------------------------------------- -CmdLineTests.cpp:353 +CmdLineTests.cpp:354 ............................................................................... -CmdLineTests.cpp:354: +CmdLineTests.cpp:355: PASSED: CHECK( config.abortAfter == 0 ) with expansion: @@ -5939,16 +5939,16 @@ Scenario: New Catch commandline interface When: A positional argument is supplied Then: The argument is in the testOrTags collection ------------------------------------------------------------------------------- -CmdLineTests.cpp:367 +CmdLineTests.cpp:368 ............................................................................... -CmdLineTests.cpp:368: +CmdLineTests.cpp:369: PASSED: REQUIRE( config.testsOrTags.size() == 1 ) with expansion: 1 == 1 -CmdLineTests.cpp:369: +CmdLineTests.cpp:370: PASSED: REQUIRE( config.testsOrTags[0] == "[hello]" ) with expansion: @@ -5959,10 +5959,10 @@ Scenario: New Catch commandline interface Given: A built cli parser for Catch When: And enum opt is set by numeric value ------------------------------------------------------------------------------- -CmdLineTests.cpp:372 +CmdLineTests.cpp:373 ............................................................................... -CmdLineTests.cpp:373: +CmdLineTests.cpp:374: PASSED: CHECK( config.verbosity == Config::Verbosity::Normal ) with expansion: @@ -5974,10 +5974,10 @@ Scenario: New Catch commandline interface When: And enum opt is set by numeric value Then: The member is set to the enum value ------------------------------------------------------------------------------- -CmdLineTests.cpp:378 +CmdLineTests.cpp:379 ............................................................................... -CmdLineTests.cpp:379: +CmdLineTests.cpp:380: PASSED: REQUIRE( config.verbosity == Config::Verbosity::NoOutput ) with expansion: @@ -13012,7 +13012,7 @@ CmdLineTests.cpp" line="179">
-CmdLineTests.cpp" line="331"> +CmdLineTests.cpp" line="332"> !config.showSuccessfulTests @@ -13020,7 +13020,7 @@ CmdLineTests.cpp" line="331"> !false -CmdLineTests.cpp" line="332"> +CmdLineTests.cpp" line="333"> !config.noThrow @@ -13028,7 +13028,7 @@ CmdLineTests.cpp" line="332"> !false -CmdLineTests.cpp" line="333"> +CmdLineTests.cpp" line="334"> !config.breakIntoDebugger @@ -13037,7 +13037,7 @@ CmdLineTests.cpp" line="333">
-CmdLineTests.cpp" line="339"> +CmdLineTests.cpp" line="340"> config.showSuccessfulTests @@ -13045,7 +13045,7 @@ CmdLineTests.cpp" line="339"> true -CmdLineTests.cpp" line="340"> +CmdLineTests.cpp" line="341"> config.noThrow @@ -13053,7 +13053,7 @@ CmdLineTests.cpp" line="340"> true -CmdLineTests.cpp" line="341"> +CmdLineTests.cpp" line="342"> config.breakIntoDebugger @@ -13069,7 +13069,7 @@ CmdLineTests.cpp" line="341">
-CmdLineTests.cpp" line="331"> +CmdLineTests.cpp" line="332"> !config.showSuccessfulTests @@ -13077,7 +13077,7 @@ CmdLineTests.cpp" line="331"> !false -CmdLineTests.cpp" line="332"> +CmdLineTests.cpp" line="333"> !config.noThrow @@ -13085,7 +13085,7 @@ CmdLineTests.cpp" line="332"> !false -CmdLineTests.cpp" line="333"> +CmdLineTests.cpp" line="334"> !config.breakIntoDebugger @@ -13099,7 +13099,7 @@ CmdLineTests.cpp" line="333">
-CmdLineTests.cpp" line="345"> +CmdLineTests.cpp" line="346"> config.abortAfter == 0 @@ -13108,7 +13108,7 @@ CmdLineTests.cpp" line="345">
-CmdLineTests.cpp" line="351"> +CmdLineTests.cpp" line="352"> config.abortAfter == 1 @@ -13124,7 +13124,7 @@ CmdLineTests.cpp" line="351">
-CmdLineTests.cpp" line="345"> +CmdLineTests.cpp" line="346"> config.abortAfter == 0 @@ -13138,7 +13138,7 @@ CmdLineTests.cpp" line="345">
-CmdLineTests.cpp" line="354"> +CmdLineTests.cpp" line="355"> config.abortAfter == 0 @@ -13147,7 +13147,7 @@ CmdLineTests.cpp" line="354">
-CmdLineTests.cpp" line="360"> +CmdLineTests.cpp" line="361"> config.abortAfter == 2 @@ -13163,7 +13163,7 @@ CmdLineTests.cpp" line="360">
-CmdLineTests.cpp" line="354"> +CmdLineTests.cpp" line="355"> config.abortAfter == 0 @@ -13178,7 +13178,7 @@ CmdLineTests.cpp" line="354">
-CmdLineTests.cpp" line="368"> +CmdLineTests.cpp" line="369"> config.testsOrTags.size() == 1 @@ -13186,7 +13186,7 @@ CmdLineTests.cpp" line="368"> 1 == 1 -CmdLineTests.cpp" line="369"> +CmdLineTests.cpp" line="370"> config.testsOrTags[0] == "[hello]" @@ -13208,7 +13208,7 @@ CmdLineTests.cpp" line="369">
-CmdLineTests.cpp" line="373"> +CmdLineTests.cpp" line="374"> config.verbosity == Config::Verbosity::Normal @@ -13217,7 +13217,7 @@ CmdLineTests.cpp" line="373">
-CmdLineTests.cpp" line="379"> +CmdLineTests.cpp" line="380"> config.verbosity == Config::Verbosity::NoOutput @@ -15192,13 +15192,13 @@ No assertions in section, ' Then: It prints the usage strings' [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: Multiple flags are combined'] -CmdLineTests.cpp:331: !config.showSuccessfulTests succeeded for: !false -CmdLineTests.cpp:332: !config.noThrow succeeded for: !false -CmdLineTests.cpp:333: !config.breakIntoDebugger succeeded for: !false +CmdLineTests.cpp:332: !config.showSuccessfulTests succeeded for: !false +CmdLineTests.cpp:333: !config.noThrow succeeded for: !false +CmdLineTests.cpp:334: !config.breakIntoDebugger succeeded for: !false [Started section: ' Then: All the flags are set'] -CmdLineTests.cpp:339: config.showSuccessfulTests succeeded for: true -CmdLineTests.cpp:340: config.noThrow succeeded for: true -CmdLineTests.cpp:341: config.breakIntoDebugger succeeded for: true +CmdLineTests.cpp:340: config.showSuccessfulTests succeeded for: true +CmdLineTests.cpp:341: config.noThrow succeeded for: true +CmdLineTests.cpp:342: config.breakIntoDebugger succeeded for: true [End of section: ' Then: All the flags are set' All 3 assertions passed] [End of section: ' When: Multiple flags are combined' All 6 assertions passed] @@ -15207,18 +15207,18 @@ CmdLineTests.cpp:341: config.breakIntoDebugger succeeded for: true [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: Multiple flags are combined'] -CmdLineTests.cpp:331: !config.showSuccessfulTests succeeded for: !false -CmdLineTests.cpp:332: !config.noThrow succeeded for: !false -CmdLineTests.cpp:333: !config.breakIntoDebugger succeeded for: !false +CmdLineTests.cpp:332: !config.showSuccessfulTests succeeded for: !false +CmdLineTests.cpp:333: !config.noThrow succeeded for: !false +CmdLineTests.cpp:334: !config.breakIntoDebugger succeeded for: !false [End of section: ' When: Multiple flags are combined' All 3 assertions passed] [End of section: ' Given: A built cli parser for Catch' All 3 assertions passed] [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a nullary method'] -CmdLineTests.cpp:345: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:346: config.abortAfter == 0 succeeded for: 0 == 0 [Started section: ' Then: The flag is set'] -CmdLineTests.cpp:351: config.abortAfter == 1 succeeded for: 1 == 1 +CmdLineTests.cpp:352: config.abortAfter == 1 succeeded for: 1 == 1 [End of section: ' Then: The flag is set' 1 assertion passed] [End of section: ' When: A flag is set via a nullary method' All 2 assertions passed] @@ -15227,16 +15227,16 @@ CmdLineTests.cpp:351: config.abortAfter == 1 succeeded for: 1 == 1 [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a nullary method'] -CmdLineTests.cpp:345: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:346: config.abortAfter == 0 succeeded for: 0 == 0 [End of section: ' When: A flag is set via a nullary method' 1 assertion passed] [End of section: ' Given: A built cli parser for Catch' 1 assertion passed] [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a unary method'] -CmdLineTests.cpp:354: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:355: config.abortAfter == 0 succeeded for: 0 == 0 [Started section: ' Then: The flag is set'] -CmdLineTests.cpp:360: config.abortAfter == 2 succeeded for: 2 == 2 +CmdLineTests.cpp:361: config.abortAfter == 2 succeeded for: 2 == 2 [End of section: ' Then: The flag is set' 1 assertion passed] [End of section: ' When: A flag is set via a unary method' All 2 assertions passed] @@ -15245,7 +15245,7 @@ CmdLineTests.cpp:360: config.abortAfter == 2 succeeded for: 2 == 2 [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A flag is set via a unary method'] -CmdLineTests.cpp:354: config.abortAfter == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:355: config.abortAfter == 0 succeeded for: 0 == 0 [End of section: ' When: A flag is set via a unary method' 1 assertion passed] [End of section: ' Given: A built cli parser for Catch' 1 assertion passed] @@ -15253,8 +15253,8 @@ CmdLineTests.cpp:354: config.abortAfter == 0 succeeded for: 0 == 0 [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: A positional argument is supplied'] [Started section: ' Then: The argument is in the testOrTags collection'] -CmdLineTests.cpp:368: config.testsOrTags.size() == 1 succeeded for: 1 == 1 -CmdLineTests.cpp:369: config.testsOrTags[0] == "[hello]" succeeded for: "[hello]" == "[hello]" +CmdLineTests.cpp:369: config.testsOrTags.size() == 1 succeeded for: 1 == 1 +CmdLineTests.cpp:370: config.testsOrTags[0] == "[hello]" succeeded for: "[hello]" == "[hello]" [End of section: ' Then: The argument is in the testOrTags collection' All 2 assertions passed] [End of section: ' When: A positional argument is supplied' All 2 assertions passed] @@ -15263,9 +15263,9 @@ CmdLineTests.cpp:369: config.testsOrTags[0] == "[hello]" succeeded for: "[hello] [Started section: ' Given: A built cli parser for Catch'] [Started section: ' When: And enum opt is set by numeric value'] -CmdLineTests.cpp:373: config.verbosity == Config::Verbosity::Normal succeeded for: 2 == 2 +CmdLineTests.cpp:374: config.verbosity == Config::Verbosity::Normal succeeded for: 2 == 2 [Started section: ' Then: The member is set to the enum value'] -CmdLineTests.cpp:379: config.verbosity == Config::Verbosity::NoOutput succeeded for: 0 == 0 +CmdLineTests.cpp:380: config.verbosity == Config::Verbosity::NoOutput succeeded for: 0 == 0 [End of section: ' Then: The member is set to the enum value' 1 assertion passed] [End of section: ' When: And enum opt is set by numeric value' All 2 assertions passed] diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 3626c61c..5079dc71 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -194,7 +194,8 @@ struct Config { noThrow( false ), showHelp( false ), abortAfter( 0 ), - verbosity( Verbosity::Normal ) + verbosity( Verbosity::Normal ), + warnings( Warning::Nothing ) {} bool listTests; From 40e529740cc3518de60e2002f3b10afe9b1acd9a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 29 May 2013 19:06:25 +0100 Subject: [PATCH 265/296] Removed stream name from config --- include/catch_runner.hpp | 3 - include/internal/catch_commandline.hpp | 5 +- include/internal/catch_config.hpp | 4 - .../SelfTest/Baselines/approvedResults.txt | 720 ++++++++---------- projects/SelfTest/TestMain.cpp | 10 +- 5 files changed, 323 insertions(+), 419 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 5c699c95..ea1389bb 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -76,9 +76,6 @@ namespace Catch { private: void openStream() { - if( !m_config->getStreamName().empty() ) - m_config->useStream( m_config->getStreamName() ); - // Open output file, if specified if( !m_config->getFilename().empty() ) { m_ofs.open( m_config->getFilename().c_str() ); diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 3408c145..2726827b 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -413,10 +413,7 @@ namespace Catch { "OutputDebugString is supported)."; } virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { - if( cmd[0][0] == '%' ) - config.stream = cmd[0].substr( 1 ); - else - config.outputFilename = cmd[0]; + config.outputFilename = cmd[0]; } }; diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 70554969..058e3a33 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -69,8 +69,6 @@ namespace Catch { std::string name; std::vector testsOrTags; - - std::string stream; }; @@ -142,8 +140,6 @@ namespace Catch { m_stream = stream; } - std::string getStreamName() const { return m_data.stream; } - std::string getReporterName() const { return m_data.reporter; } void addTestSpec( std::string const& testSpec ) { diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index d5bccb29..edfcba10 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -4014,7 +4014,7 @@ with expansion: ------------------------------------------------------------------------------- selftest/parser/2 - streams + output filename -o filename ------------------------------------------------------------------------------- TestMain.cpp:260 @@ -4030,49 +4030,19 @@ PASSED: with expansion: "filename.ext" == "filename.ext" -TestMain.cpp:265: -PASSED: - REQUIRE( config.stream.empty() ) -with expansion: - true - ------------------------------------------------------------------------------- selftest/parser/2 - streams - -o %stdout -------------------------------------------------------------------------------- -TestMain.cpp:267 -............................................................................... - -TestMain.cpp:269: -PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) - -TestMain.cpp:271: -PASSED: - REQUIRE( config.stream == "stdout" ) -with expansion: - "stdout" == "stdout" - -TestMain.cpp:272: -PASSED: - REQUIRE( config.outputFilename.empty() ) -with expansion: - true - -------------------------------------------------------------------------------- -selftest/parser/2 - streams + output filename --out ------------------------------------------------------------------------------- -TestMain.cpp:274 +TestMain.cpp:266 ............................................................................... -TestMain.cpp:276: +TestMain.cpp:268: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:278: +TestMain.cpp:270: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: @@ -4083,26 +4053,26 @@ selftest/parser/2 combinations -a -b ------------------------------------------------------------------------------- -TestMain.cpp:283 +TestMain.cpp:275 ............................................................................... -TestMain.cpp:285: +TestMain.cpp:277: PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) -TestMain.cpp:287: +TestMain.cpp:279: PASSED: CHECK( config.cutoff == 1 ) with expansion: 1 == 1 -TestMain.cpp:288: +TestMain.cpp:280: PASSED: CHECK( config.shouldDebugBreak ) with expansion: true -TestMain.cpp:289: +TestMain.cpp:281: PASSED: CHECK( config.noThrow == true ) with expansion: @@ -4111,40 +4081,40 @@ with expansion: ------------------------------------------------------------------------------- selftest/test filter ------------------------------------------------------------------------------- -TestMain.cpp:294 +TestMain.cpp:286 ............................................................................... -TestMain.cpp:298: +TestMain.cpp:290: PASSED: CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -TestMain.cpp:299: +TestMain.cpp:291: PASSED: CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:304: +TestMain.cpp:296: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:305: +TestMain.cpp:297: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ) with expansion: true -TestMain.cpp:307: +TestMain.cpp:299: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ) with expansion: true -TestMain.cpp:308: +TestMain.cpp:300: PASSED: CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ) with expansion: @@ -4153,28 +4123,28 @@ with expansion: ------------------------------------------------------------------------------- selftest/test filters ------------------------------------------------------------------------------- -TestMain.cpp:311 +TestMain.cpp:303 ............................................................................... -TestMain.cpp:319: +TestMain.cpp:311: PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -TestMain.cpp:321: +TestMain.cpp:313: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ) with expansion: false == false -TestMain.cpp:322: +TestMain.cpp:314: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ) with expansion: true -TestMain.cpp:323: +TestMain.cpp:315: PASSED: CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ) with expansion: @@ -4183,16 +4153,16 @@ with expansion: ------------------------------------------------------------------------------- selftest/filter/prefix wildcard ------------------------------------------------------------------------------- -TestMain.cpp:326 +TestMain.cpp:318 ............................................................................... -TestMain.cpp:329: +TestMain.cpp:321: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) with expansion: true -TestMain.cpp:330: +TestMain.cpp:322: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) with expansion: @@ -4201,28 +4171,28 @@ with expansion: ------------------------------------------------------------------------------- selftest/filter/wildcard at both ends ------------------------------------------------------------------------------- -TestMain.cpp:332 +TestMain.cpp:324 ............................................................................... -TestMain.cpp:335: +TestMain.cpp:327: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) with expansion: true -TestMain.cpp:336: +TestMain.cpp:328: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ) with expansion: true -TestMain.cpp:337: +TestMain.cpp:329: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ) with expansion: true -TestMain.cpp:338: +TestMain.cpp:330: PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ) with expansion: @@ -4231,26 +4201,26 @@ with expansion: ------------------------------------------------------------------------------- selftest/option parsers ------------------------------------------------------------------------------- -TestMain.cpp:347 +TestMain.cpp:339 ............................................................................... -TestMain.cpp:358: +TestMain.cpp:350: PASSED: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) -TestMain.cpp:361: +TestMain.cpp:353: PASSED: REQUIRE( cfg.filters().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:362: +TestMain.cpp:354: PASSED: REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false -TestMain.cpp:363: +TestMain.cpp:355: PASSED: REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ) with expansion: @@ -4260,52 +4230,52 @@ with expansion: selftest/tags one tag ------------------------------------------------------------------------------- -TestMain.cpp:374 +TestMain.cpp:366 ............................................................................... -TestMain.cpp:377: +TestMain.cpp:369: PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:378: +TestMain.cpp:370: PASSED: CHECK( oneTag.hasTag( "one" ) ) with expansion: true -TestMain.cpp:379: +TestMain.cpp:371: PASSED: CHECK( oneTag.getTags().size() == 1 ) with expansion: 1 == 1 -TestMain.cpp:381: +TestMain.cpp:373: PASSED: CHECK( oneTag.matchesTags( p1 ) == true ) with expansion: true == true -TestMain.cpp:382: +TestMain.cpp:374: PASSED: CHECK( oneTag.matchesTags( p2 ) == true ) with expansion: true == true -TestMain.cpp:383: +TestMain.cpp:375: PASSED: CHECK( oneTag.matchesTags( p3 ) == false ) with expansion: false == false -TestMain.cpp:384: +TestMain.cpp:376: PASSED: CHECK( oneTag.matchesTags( p4 ) == false ) with expansion: false == false -TestMain.cpp:385: +TestMain.cpp:377: PASSED: CHECK( oneTag.matchesTags( p5 ) == false ) with expansion: @@ -4315,70 +4285,70 @@ with expansion: selftest/tags two tags ------------------------------------------------------------------------------- -TestMain.cpp:388 +TestMain.cpp:380 ............................................................................... -TestMain.cpp:391: +TestMain.cpp:383: PASSED: CHECK( twoTags.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:392: +TestMain.cpp:384: PASSED: CHECK( twoTags.hasTag( "one" ) ) with expansion: true -TestMain.cpp:393: +TestMain.cpp:385: PASSED: CHECK( twoTags.hasTag( "two" ) ) with expansion: true -TestMain.cpp:394: +TestMain.cpp:386: PASSED: CHECK( twoTags.hasTag( "Two" ) ) with expansion: true -TestMain.cpp:395: +TestMain.cpp:387: PASSED: CHECK( twoTags.hasTag( "three" ) == false ) with expansion: false == false -TestMain.cpp:396: +TestMain.cpp:388: PASSED: CHECK( twoTags.getTags().size() == 2 ) with expansion: 2 == 2 -TestMain.cpp:398: +TestMain.cpp:390: PASSED: CHECK( twoTags.matchesTags( p1 ) == true ) with expansion: true == true -TestMain.cpp:399: +TestMain.cpp:391: PASSED: CHECK( twoTags.matchesTags( p2 ) == true ) with expansion: true == true -TestMain.cpp:400: +TestMain.cpp:392: PASSED: CHECK( twoTags.matchesTags( p3 ) == true ) with expansion: true == true -TestMain.cpp:401: +TestMain.cpp:393: PASSED: CHECK( twoTags.matchesTags( p4 ) == true ) with expansion: true == true -TestMain.cpp:402: +TestMain.cpp:394: PASSED: CHECK( twoTags.matchesTags( p5 ) == true ) with expansion: @@ -4388,28 +4358,28 @@ with expansion: selftest/tags one tag with characters either side ------------------------------------------------------------------------------- -TestMain.cpp:405 +TestMain.cpp:397 ............................................................................... -TestMain.cpp:408: +TestMain.cpp:400: PASSED: CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) with expansion: "1234" == "1234" -TestMain.cpp:409: +TestMain.cpp:401: PASSED: CHECK( oneTagWithExtras.hasTag( "one" ) ) with expansion: true -TestMain.cpp:410: +TestMain.cpp:402: PASSED: CHECK( oneTagWithExtras.hasTag( "two" ) == false ) with expansion: false == false -TestMain.cpp:411: +TestMain.cpp:403: PASSED: CHECK( oneTagWithExtras.getTags().size() == 1 ) with expansion: @@ -4419,22 +4389,22 @@ with expansion: selftest/tags start of a tag, but not closed ------------------------------------------------------------------------------- -TestMain.cpp:414 +TestMain.cpp:406 ............................................................................... -TestMain.cpp:418: +TestMain.cpp:410: PASSED: CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) with expansion: "[one" == "[one" -TestMain.cpp:419: +TestMain.cpp:411: PASSED: CHECK( oneTagOpen.hasTag( "one" ) == false ) with expansion: false == false -TestMain.cpp:420: +TestMain.cpp:412: PASSED: CHECK( oneTagOpen.getTags().size() == 0 ) with expansion: @@ -4444,28 +4414,28 @@ with expansion: selftest/tags hidden ------------------------------------------------------------------------------- -TestMain.cpp:423 +TestMain.cpp:415 ............................................................................... -TestMain.cpp:426: +TestMain.cpp:418: PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) with expansion: "" == "" -TestMain.cpp:427: +TestMain.cpp:419: PASSED: CHECK( oneTag.hasTag( "hide" ) ) with expansion: true -TestMain.cpp:428: +TestMain.cpp:420: PASSED: CHECK( oneTag.isHidden() ) with expansion: true -TestMain.cpp:430: +TestMain.cpp:422: PASSED: CHECK( oneTag.matchesTags( "~[hide]" ) == false ) with expansion: @@ -4476,10 +4446,10 @@ Long strings can be wrapped plain string No wrapping ------------------------------------------------------------------------------- -TestMain.cpp:442 +TestMain.cpp:434 ............................................................................... -TestMain.cpp:443: +TestMain.cpp:435: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString ) with expansion: @@ -4487,7 +4457,7 @@ with expansion: == "one two three four" -TestMain.cpp:444: +TestMain.cpp:436: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString ) with expansion: @@ -4500,10 +4470,10 @@ Long strings can be wrapped plain string Wrapped once ------------------------------------------------------------------------------- -TestMain.cpp:446 +TestMain.cpp:438 ............................................................................... -TestMain.cpp:447: +TestMain.cpp:439: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" ) with expansion: @@ -4513,7 +4483,7 @@ with expansion: "one two three four" -TestMain.cpp:448: +TestMain.cpp:440: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" ) with expansion: @@ -4523,7 +4493,7 @@ with expansion: "one two three four" -TestMain.cpp:449: +TestMain.cpp:441: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" ) with expansion: @@ -4533,7 +4503,7 @@ with expansion: "one two three four" -TestMain.cpp:450: +TestMain.cpp:442: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" ) with expansion: @@ -4543,7 +4513,7 @@ with expansion: "one two three four" -TestMain.cpp:451: +TestMain.cpp:443: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" ) with expansion: @@ -4558,10 +4528,10 @@ Long strings can be wrapped plain string Wrapped twice ------------------------------------------------------------------------------- -TestMain.cpp:453 +TestMain.cpp:445 ............................................................................... -TestMain.cpp:454: +TestMain.cpp:446: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4573,7 +4543,7 @@ with expansion: three four" -TestMain.cpp:455: +TestMain.cpp:447: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4585,7 +4555,7 @@ with expansion: three four" -TestMain.cpp:456: +TestMain.cpp:448: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4602,10 +4572,10 @@ Long strings can be wrapped plain string Wrapped three times ------------------------------------------------------------------------------- -TestMain.cpp:458 +TestMain.cpp:450 ............................................................................... -TestMain.cpp:459: +TestMain.cpp:451: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" ) with expansion: @@ -4619,7 +4589,7 @@ with expansion: three four" -TestMain.cpp:460: +TestMain.cpp:452: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" ) with expansion: @@ -4638,10 +4608,10 @@ Long strings can be wrapped plain string Short wrap ------------------------------------------------------------------------------- -TestMain.cpp:462 +TestMain.cpp:454 ............................................................................... -TestMain.cpp:463: +TestMain.cpp:455: PASSED: CHECK( Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" ) with expansion: @@ -4651,7 +4621,7 @@ with expansion: "abc- def" -TestMain.cpp:464: +TestMain.cpp:456: PASSED: CHECK( Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" ) with expansion: @@ -4661,7 +4631,7 @@ with expansion: "abc- defg" -TestMain.cpp:465: +TestMain.cpp:457: PASSED: CHECK( Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" ) with expansion: @@ -4673,7 +4643,7 @@ with expansion: def- gh" -TestMain.cpp:467: +TestMain.cpp:459: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" ) with expansion: @@ -4689,7 +4659,7 @@ with expansion: ee four" -TestMain.cpp:468: +TestMain.cpp:460: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ) with expansion: @@ -4712,34 +4682,34 @@ Long strings can be wrapped plain string As container ------------------------------------------------------------------------------- -TestMain.cpp:470 +TestMain.cpp:462 ............................................................................... -TestMain.cpp:472: +TestMain.cpp:464: PASSED: REQUIRE( text.size() == 4 ) with expansion: 4 == 4 -TestMain.cpp:473: +TestMain.cpp:465: PASSED: CHECK( text[0] == "one" ) with expansion: "one" == "one" -TestMain.cpp:474: +TestMain.cpp:466: PASSED: CHECK( text[1] == "two" ) with expansion: "two" == "two" -TestMain.cpp:475: +TestMain.cpp:467: PASSED: CHECK( text[2] == "three" ) with expansion: "three" == "three" -TestMain.cpp:476: +TestMain.cpp:468: PASSED: CHECK( text[3] == "four" ) with expansion: @@ -4750,10 +4720,10 @@ Long strings can be wrapped plain string Indent first line differently ------------------------------------------------------------------------------- -TestMain.cpp:478 +TestMain.cpp:470 ............................................................................... -TestMain.cpp:483: +TestMain.cpp:475: PASSED: CHECK( text.toString() == " one two\n three\n four" ) with expansion: @@ -4770,10 +4740,10 @@ Long strings can be wrapped With newlines No wrapping ------------------------------------------------------------------------------- -TestMain.cpp:493 +TestMain.cpp:485 ............................................................................... -TestMain.cpp:494: +TestMain.cpp:486: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString ) with expansion: @@ -4783,7 +4753,7 @@ with expansion: "one two three four" -TestMain.cpp:495: +TestMain.cpp:487: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString ) with expansion: @@ -4793,7 +4763,7 @@ with expansion: "one two three four" -TestMain.cpp:496: +TestMain.cpp:488: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString ) with expansion: @@ -4808,10 +4778,10 @@ Long strings can be wrapped With newlines Trailing newline ------------------------------------------------------------------------------- -TestMain.cpp:498 +TestMain.cpp:490 ............................................................................... -TestMain.cpp:499: +TestMain.cpp:491: PASSED: CHECK( Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" ) with expansion: @@ -4821,13 +4791,13 @@ with expansion: "abcdef " -TestMain.cpp:500: +TestMain.cpp:492: PASSED: CHECK( Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" ) with expansion: "abcdef" == "abcdef" -TestMain.cpp:501: +TestMain.cpp:493: PASSED: CHECK( Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" ) with expansion: @@ -4842,10 +4812,10 @@ Long strings can be wrapped With newlines Wrapped once ------------------------------------------------------------------------------- -TestMain.cpp:503 +TestMain.cpp:495 ............................................................................... -TestMain.cpp:504: +TestMain.cpp:496: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4857,7 +4827,7 @@ with expansion: three four" -TestMain.cpp:505: +TestMain.cpp:497: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4869,7 +4839,7 @@ with expansion: three four" -TestMain.cpp:506: +TestMain.cpp:498: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" ) with expansion: @@ -4886,10 +4856,10 @@ Long strings can be wrapped With newlines Wrapped twice ------------------------------------------------------------------------------- -TestMain.cpp:508 +TestMain.cpp:500 ............................................................................... -TestMain.cpp:509: +TestMain.cpp:501: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" ) with expansion: @@ -4907,10 +4877,10 @@ with expansion: Long strings can be wrapped With tabs ------------------------------------------------------------------------------- -TestMain.cpp:513 +TestMain.cpp:505 ............................................................................... -TestMain.cpp:519: +TestMain.cpp:511: PASSED: CHECK( Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" ) with expansion: @@ -4929,7 +4899,7 @@ hello ------------------------------------------------------------------------------- Strings can be rendered with colour ------------------------------------------------------------------------------- -TestMain.cpp:598 +TestMain.cpp:590 ............................................................................... @@ -4938,16 +4908,16 @@ No assertions in test case, 'Strings can be rendered with colour' ------------------------------------------------------------------------------- Text can be formatted using the Text class ------------------------------------------------------------------------------- -TestMain.cpp:617 +TestMain.cpp:609 ............................................................................... -TestMain.cpp:619: +TestMain.cpp:611: PASSED: CHECK( Text( "hi there" ).toString() == "hi there" ) with expansion: "hi there" == "hi there" -TestMain.cpp:624: +TestMain.cpp:616: PASSED: CHECK( Text( "hi there", narrow ).toString() == "hi\nthere" ) with expansion: @@ -5984,7 +5954,7 @@ with expansion: 0 == 0 =============================================================================== -115 test cases - 50 failed (744 assertions - 107 failed) +115 test cases - 50 failed (740 assertions - 107 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -6305,7 +6275,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) - + @@ -11185,7 +11155,7 @@ TestMain.cpp" line="255">
-
+
TestMain.cpp" line="262"> @@ -11203,51 +11173,13 @@ TestMain.cpp" line="264"> "filename.ext" == "filename.ext" -TestMain.cpp" line="265"> - - config.stream.empty() - - - true - - - +
- +
-
-
-TestMain.cpp" line="269"> - - parseIntoConfig( argv, config ) - - - parseIntoConfig( argv, config ) - - -TestMain.cpp" line="271"> - - config.stream == "stdout" - - - "stdout" == "stdout" - - -TestMain.cpp" line="272"> - - config.outputFilename.empty() - - - true - - - -
- -
-
+
-TestMain.cpp" line="276"> +TestMain.cpp" line="268"> parseIntoConfig( argv, config ) @@ -11255,7 +11187,7 @@ TestMain.cpp" line="276"> parseIntoConfig( argv, config ) -TestMain.cpp" line="278"> +TestMain.cpp" line="270"> config.outputFilename == "filename.ext" @@ -11267,12 +11199,12 @@ TestMain.cpp" line="278">
-
+
-TestMain.cpp" line="285"> +TestMain.cpp" line="277"> parseIntoConfig( argv, config ) @@ -11280,7 +11212,7 @@ TestMain.cpp" line="285"> parseIntoConfig( argv, config ) -TestMain.cpp" line="287"> +TestMain.cpp" line="279"> config.cutoff == 1 @@ -11288,7 +11220,7 @@ TestMain.cpp" line="287"> 1 == 1 -TestMain.cpp" line="288"> +TestMain.cpp" line="280"> config.shouldDebugBreak @@ -11296,7 +11228,7 @@ TestMain.cpp" line="288"> true -TestMain.cpp" line="289"> +TestMain.cpp" line="281"> config.noThrow == true @@ -11311,7 +11243,7 @@ TestMain.cpp" line="289"> -TestMain.cpp" line="298"> +TestMain.cpp" line="290"> matchAny.shouldInclude( fakeTestCase( "any" ) ) @@ -11319,7 +11251,7 @@ TestMain.cpp" line="298"> true -TestMain.cpp" line="299"> +TestMain.cpp" line="291"> matchNone.shouldInclude( fakeTestCase( "any" ) ) == false @@ -11327,7 +11259,7 @@ TestMain.cpp" line="299"> false == false -TestMain.cpp" line="304"> +TestMain.cpp" line="296"> matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false @@ -11335,7 +11267,7 @@ TestMain.cpp" line="304"> false == false -TestMain.cpp" line="305"> +TestMain.cpp" line="297"> matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) @@ -11343,7 +11275,7 @@ TestMain.cpp" line="305"> true -TestMain.cpp" line="307"> +TestMain.cpp" line="299"> matchHidden.shouldInclude( fakeTestCase( "./any" ) ) @@ -11351,7 +11283,7 @@ TestMain.cpp" line="307"> true -TestMain.cpp" line="308"> +TestMain.cpp" line="300"> matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false @@ -11362,7 +11294,7 @@ TestMain.cpp" line="308"> -TestMain.cpp" line="319"> +TestMain.cpp" line="311"> matchHidden.shouldInclude( fakeTestCase( "./something" ) ) @@ -11370,7 +11302,7 @@ TestMain.cpp" line="319"> true -TestMain.cpp" line="321"> +TestMain.cpp" line="313"> filters.shouldInclude( fakeTestCase( "any" ) ) == false @@ -11378,7 +11310,7 @@ TestMain.cpp" line="321"> false == false -TestMain.cpp" line="322"> +TestMain.cpp" line="314"> filters.shouldInclude( fakeTestCase( "./something" ) ) @@ -11386,7 +11318,7 @@ TestMain.cpp" line="322"> true -TestMain.cpp" line="323"> +TestMain.cpp" line="315"> filters.shouldInclude( fakeTestCase( "./anything" ) ) == false @@ -11397,7 +11329,7 @@ TestMain.cpp" line="323"> -TestMain.cpp" line="329"> +TestMain.cpp" line="321"> matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) @@ -11405,7 +11337,7 @@ TestMain.cpp" line="329"> true -TestMain.cpp" line="330"> +TestMain.cpp" line="322"> matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false @@ -11416,7 +11348,7 @@ TestMain.cpp" line="330"> -TestMain.cpp" line="335"> +TestMain.cpp" line="327"> matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) @@ -11424,7 +11356,7 @@ TestMain.cpp" line="335"> true -TestMain.cpp" line="336"> +TestMain.cpp" line="328"> matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) @@ -11432,7 +11364,7 @@ TestMain.cpp" line="336"> true -TestMain.cpp" line="337"> +TestMain.cpp" line="329"> matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) @@ -11440,7 +11372,7 @@ TestMain.cpp" line="337"> true -TestMain.cpp" line="338"> +TestMain.cpp" line="330"> matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false @@ -11451,7 +11383,7 @@ TestMain.cpp" line="338"> -TestMain.cpp" line="358"> +TestMain.cpp" line="350"> opt.parseIntoConfig( parser, config ) @@ -11459,7 +11391,7 @@ TestMain.cpp" line="358"> opt.parseIntoConfig( parser, config ) -TestMain.cpp" line="361"> +TestMain.cpp" line="353"> cfg.filters().size() == 1 @@ -11467,7 +11399,7 @@ TestMain.cpp" line="361"> 1 == 1 -TestMain.cpp" line="362"> +TestMain.cpp" line="354"> cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false @@ -11475,7 +11407,7 @@ TestMain.cpp" line="362"> false == false -TestMain.cpp" line="363"> +TestMain.cpp" line="355"> cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) @@ -11487,7 +11419,7 @@ TestMain.cpp" line="363">
-TestMain.cpp" line="377"> +TestMain.cpp" line="369"> oneTag.getTestCaseInfo().description == "" @@ -11495,7 +11427,7 @@ TestMain.cpp" line="377"> "" == "" -TestMain.cpp" line="378"> +TestMain.cpp" line="370"> oneTag.hasTag( "one" ) @@ -11503,7 +11435,7 @@ TestMain.cpp" line="378"> true -TestMain.cpp" line="379"> +TestMain.cpp" line="371"> oneTag.getTags().size() == 1 @@ -11511,7 +11443,7 @@ TestMain.cpp" line="379"> 1 == 1 -TestMain.cpp" line="381"> +TestMain.cpp" line="373"> oneTag.matchesTags( p1 ) == true @@ -11519,7 +11451,7 @@ TestMain.cpp" line="381"> true == true -TestMain.cpp" line="382"> +TestMain.cpp" line="374"> oneTag.matchesTags( p2 ) == true @@ -11527,7 +11459,7 @@ TestMain.cpp" line="382"> true == true -TestMain.cpp" line="383"> +TestMain.cpp" line="375"> oneTag.matchesTags( p3 ) == false @@ -11535,7 +11467,7 @@ TestMain.cpp" line="383"> false == false -TestMain.cpp" line="384"> +TestMain.cpp" line="376"> oneTag.matchesTags( p4 ) == false @@ -11543,7 +11475,7 @@ TestMain.cpp" line="384"> false == false -TestMain.cpp" line="385"> +TestMain.cpp" line="377"> oneTag.matchesTags( p5 ) == false @@ -11554,7 +11486,7 @@ TestMain.cpp" line="385">
-TestMain.cpp" line="391"> +TestMain.cpp" line="383"> twoTags.getTestCaseInfo().description == "" @@ -11562,7 +11494,7 @@ TestMain.cpp" line="391"> "" == "" -TestMain.cpp" line="392"> +TestMain.cpp" line="384"> twoTags.hasTag( "one" ) @@ -11570,7 +11502,7 @@ TestMain.cpp" line="392"> true -TestMain.cpp" line="393"> +TestMain.cpp" line="385"> twoTags.hasTag( "two" ) @@ -11578,7 +11510,7 @@ TestMain.cpp" line="393"> true -TestMain.cpp" line="394"> +TestMain.cpp" line="386"> twoTags.hasTag( "Two" ) @@ -11586,7 +11518,7 @@ TestMain.cpp" line="394"> true -TestMain.cpp" line="395"> +TestMain.cpp" line="387"> twoTags.hasTag( "three" ) == false @@ -11594,7 +11526,7 @@ TestMain.cpp" line="395"> false == false -TestMain.cpp" line="396"> +TestMain.cpp" line="388"> twoTags.getTags().size() == 2 @@ -11602,7 +11534,7 @@ TestMain.cpp" line="396"> 2 == 2 -TestMain.cpp" line="398"> +TestMain.cpp" line="390"> twoTags.matchesTags( p1 ) == true @@ -11610,7 +11542,7 @@ TestMain.cpp" line="398"> true == true -TestMain.cpp" line="399"> +TestMain.cpp" line="391"> twoTags.matchesTags( p2 ) == true @@ -11618,7 +11550,7 @@ TestMain.cpp" line="399"> true == true -TestMain.cpp" line="400"> +TestMain.cpp" line="392"> twoTags.matchesTags( p3 ) == true @@ -11626,7 +11558,7 @@ TestMain.cpp" line="400"> true == true -TestMain.cpp" line="401"> +TestMain.cpp" line="393"> twoTags.matchesTags( p4 ) == true @@ -11634,7 +11566,7 @@ TestMain.cpp" line="401"> true == true -TestMain.cpp" line="402"> +TestMain.cpp" line="394"> twoTags.matchesTags( p5 ) == true @@ -11645,7 +11577,7 @@ TestMain.cpp" line="402">
-TestMain.cpp" line="408"> +TestMain.cpp" line="400"> oneTagWithExtras.getTestCaseInfo().description == "1234" @@ -11653,7 +11585,7 @@ TestMain.cpp" line="408"> "1234" == "1234" -TestMain.cpp" line="409"> +TestMain.cpp" line="401"> oneTagWithExtras.hasTag( "one" ) @@ -11661,7 +11593,7 @@ TestMain.cpp" line="409"> true -TestMain.cpp" line="410"> +TestMain.cpp" line="402"> oneTagWithExtras.hasTag( "two" ) == false @@ -11669,7 +11601,7 @@ TestMain.cpp" line="410"> false == false -TestMain.cpp" line="411"> +TestMain.cpp" line="403"> oneTagWithExtras.getTags().size() == 1 @@ -11680,7 +11612,7 @@ TestMain.cpp" line="411">
-TestMain.cpp" line="418"> +TestMain.cpp" line="410"> oneTagOpen.getTestCaseInfo().description == "[one" @@ -11688,7 +11620,7 @@ TestMain.cpp" line="418"> "[one" == "[one" -TestMain.cpp" line="419"> +TestMain.cpp" line="411"> oneTagOpen.hasTag( "one" ) == false @@ -11696,7 +11628,7 @@ TestMain.cpp" line="419"> false == false -TestMain.cpp" line="420"> +TestMain.cpp" line="412"> oneTagOpen.getTags().size() == 0 @@ -11707,7 +11639,7 @@ TestMain.cpp" line="420">
-TestMain.cpp" line="426"> +TestMain.cpp" line="418"> oneTag.getTestCaseInfo().description == "" @@ -11715,7 +11647,7 @@ TestMain.cpp" line="426"> "" == "" -TestMain.cpp" line="427"> +TestMain.cpp" line="419"> oneTag.hasTag( "hide" ) @@ -11723,7 +11655,7 @@ TestMain.cpp" line="427"> true -TestMain.cpp" line="428"> +TestMain.cpp" line="420"> oneTag.isHidden() @@ -11731,7 +11663,7 @@ TestMain.cpp" line="428"> true -TestMain.cpp" line="430"> +TestMain.cpp" line="422"> oneTag.matchesTags( "~[hide]" ) == false @@ -11746,7 +11678,7 @@ TestMain.cpp" line="430">
-TestMain.cpp" line="443"> +TestMain.cpp" line="435"> Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString @@ -11756,7 +11688,7 @@ TestMain.cpp" line="443"> "one two three four" -TestMain.cpp" line="444"> +TestMain.cpp" line="436"> Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString @@ -11772,7 +11704,7 @@ TestMain.cpp" line="444">
-TestMain.cpp" line="447"> +TestMain.cpp" line="439"> Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" @@ -11784,7 +11716,7 @@ four" four" -TestMain.cpp" line="448"> +TestMain.cpp" line="440"> Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" @@ -11796,7 +11728,7 @@ four" four" -TestMain.cpp" line="449"> +TestMain.cpp" line="441"> Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" @@ -11808,7 +11740,7 @@ four" four" -TestMain.cpp" line="450"> +TestMain.cpp" line="442"> Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" @@ -11820,7 +11752,7 @@ four" four" -TestMain.cpp" line="451"> +TestMain.cpp" line="443"> Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" @@ -11838,7 +11770,7 @@ three four"
-TestMain.cpp" line="454"> +TestMain.cpp" line="446"> Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" @@ -11852,7 +11784,7 @@ three four" -TestMain.cpp" line="455"> +TestMain.cpp" line="447"> Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" @@ -11866,7 +11798,7 @@ three four" -TestMain.cpp" line="456"> +TestMain.cpp" line="448"> Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" @@ -11886,7 +11818,7 @@ four"
-TestMain.cpp" line="459"> +TestMain.cpp" line="451"> Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" @@ -11902,7 +11834,7 @@ three four" -TestMain.cpp" line="460"> +TestMain.cpp" line="452"> Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" @@ -11924,7 +11856,7 @@ four"
-TestMain.cpp" line="463"> +TestMain.cpp" line="455"> Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" @@ -11936,7 +11868,7 @@ def" def" -TestMain.cpp" line="464"> +TestMain.cpp" line="456"> Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" @@ -11948,7 +11880,7 @@ defg" defg" -TestMain.cpp" line="465"> +TestMain.cpp" line="457"> Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" @@ -11962,7 +11894,7 @@ def- gh" -TestMain.cpp" line="467"> +TestMain.cpp" line="459"> Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" @@ -11980,7 +11912,7 @@ ee four" -TestMain.cpp" line="468"> +TestMain.cpp" line="460"> Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" @@ -12006,7 +11938,7 @@ ur"
-TestMain.cpp" line="472"> +TestMain.cpp" line="464"> text.size() == 4 @@ -12014,7 +11946,7 @@ TestMain.cpp" line="472"> 4 == 4 -TestMain.cpp" line="473"> +TestMain.cpp" line="465"> text[0] == "one" @@ -12022,7 +11954,7 @@ TestMain.cpp" line="473"> "one" == "one" -TestMain.cpp" line="474"> +TestMain.cpp" line="466"> text[1] == "two" @@ -12030,7 +11962,7 @@ TestMain.cpp" line="474"> "two" == "two" -TestMain.cpp" line="475"> +TestMain.cpp" line="467"> text[2] == "three" @@ -12038,7 +11970,7 @@ TestMain.cpp" line="475"> "three" == "three" -TestMain.cpp" line="476"> +TestMain.cpp" line="468"> text[3] == "four" @@ -12052,7 +11984,7 @@ TestMain.cpp" line="476">
-TestMain.cpp" line="483"> +TestMain.cpp" line="475"> text.toString() == " one two\n three\n four" @@ -12075,7 +12007,7 @@ TestMain.cpp" line="483">
-TestMain.cpp" line="494"> +TestMain.cpp" line="486"> Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString @@ -12087,7 +12019,7 @@ three four" three four" -TestMain.cpp" line="495"> +TestMain.cpp" line="487"> Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString @@ -12099,7 +12031,7 @@ three four" three four" -TestMain.cpp" line="496"> +TestMain.cpp" line="488"> Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString @@ -12117,7 +12049,7 @@ three four"
-TestMain.cpp" line="499"> +TestMain.cpp" line="491"> Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" @@ -12129,7 +12061,7 @@ TestMain.cpp" line="499"> " -TestMain.cpp" line="500"> +TestMain.cpp" line="492"> Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" @@ -12137,7 +12069,7 @@ TestMain.cpp" line="500"> "abcdef" == "abcdef" -TestMain.cpp" line="501"> +TestMain.cpp" line="493"> Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" @@ -12155,7 +12087,7 @@ TestMain.cpp" line="501">
-TestMain.cpp" line="504"> +TestMain.cpp" line="496"> Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" @@ -12169,7 +12101,7 @@ three four" -TestMain.cpp" line="505"> +TestMain.cpp" line="497"> Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" @@ -12183,7 +12115,7 @@ three four" -TestMain.cpp" line="506"> +TestMain.cpp" line="498"> Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" @@ -12203,7 +12135,7 @@ four"
-TestMain.cpp" line="509"> +TestMain.cpp" line="501"> Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" @@ -12227,7 +12159,7 @@ four"
-TestMain.cpp" line="519"> +TestMain.cpp" line="511"> Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" @@ -12251,7 +12183,7 @@ TestMain.cpp" line="519"> -TestMain.cpp" line="619"> +TestMain.cpp" line="611"> Text( "hi there" ).toString() == "hi there" @@ -12259,7 +12191,7 @@ TestMain.cpp" line="619"> "hi there" == "hi there" -TestMain.cpp" line="624"> +TestMain.cpp" line="616"> Text( "hi there", narrow ).toString() == "hi\nthere" @@ -13233,9 +13165,9 @@ CmdLineTests.cpp" line="380">
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -14443,123 +14375,113 @@ TestMain.cpp:255: config.noThrow == true succeeded for: true == true [End of section: 'nothrow' All 2 assertions passed] -[Started section: 'streams'] +[Started section: 'output filename'] [Started section: '-o filename'] TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded TestMain.cpp:264: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" -TestMain.cpp:265: config.stream.empty() succeeded for: true -[End of section: '-o filename' All 3 assertions passed] +[End of section: '-o filename' All 2 assertions passed] -[End of section: 'streams' All 3 assertions passed] +[End of section: 'output filename' All 2 assertions passed] -[Started section: 'streams'] -[Started section: '-o %stdout'] -TestMain.cpp:269: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:271: config.stream == "stdout" succeeded for: "stdout" == "stdout" -TestMain.cpp:272: config.outputFilename.empty() succeeded for: true -[End of section: '-o %stdout' All 3 assertions passed] - -[End of section: 'streams' All 3 assertions passed] - -[Started section: 'streams'] +[Started section: 'output filename'] [Started section: '--out'] -TestMain.cpp:276: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:278: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:268: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:270: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" [End of section: '--out' All 2 assertions passed] -[End of section: 'streams' All 2 assertions passed] +[End of section: 'output filename' All 2 assertions passed] [Started section: 'combinations'] [Started section: '-a -b'] -TestMain.cpp:285: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:287: config.cutoff == 1 succeeded for: 1 == 1 -TestMain.cpp:288: config.shouldDebugBreak succeeded for: true -TestMain.cpp:289: config.noThrow == true succeeded for: true == true +TestMain.cpp:277: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:279: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:280: config.shouldDebugBreak succeeded for: true +TestMain.cpp:281: config.noThrow == true succeeded for: true == true [End of section: '-a -b' All 4 assertions passed] [End of section: 'combinations' All 4 assertions passed] -[Finished: 'selftest/parser/2' All tests passed (66 assertions in 1 test case)] +[Finished: 'selftest/parser/2' All tests passed (62 assertions in 1 test case)] [Running: selftest/test filter] -TestMain.cpp:298: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -TestMain.cpp:299: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:304: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:305: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -TestMain.cpp:307: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true -TestMain.cpp:308: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false +TestMain.cpp:290: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:291: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:296: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:297: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:299: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true +TestMain.cpp:300: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false [Finished: 'selftest/test filter' All tests passed (6 assertions in 1 test case)] [Running: selftest/test filters] -TestMain.cpp:319: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -TestMain.cpp:321: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:322: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -TestMain.cpp:323: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false +TestMain.cpp:311: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:313: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:314: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false [Finished: 'selftest/test filters' All tests passed (4 assertions in 1 test case)] [Running: selftest/filter/prefix wildcard] -TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false +TestMain.cpp:321: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/prefix wildcard' All tests passed (2 assertions in 1 test case)] [Running: selftest/filter/wildcard at both ends] -TestMain.cpp:335: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -TestMain.cpp:336: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true -TestMain.cpp:337: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true -TestMain.cpp:338: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false +TestMain.cpp:327: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true +TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true +TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/wildcard at both ends' All tests passed (4 assertions in 1 test case)] [Running: selftest/option parsers] -TestMain.cpp:358: opt.parseIntoConfig( parser, config ) succeeded -TestMain.cpp:361: cfg.filters().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:362: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:363: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:350: opt.parseIntoConfig( parser, config ) succeeded +TestMain.cpp:353: cfg.filters().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:354: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:355: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true [Finished: 'selftest/option parsers' All tests passed (4 assertions in 1 test case)] [Running: selftest/tags] [Started section: 'one tag'] -TestMain.cpp:377: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:378: oneTag.hasTag( "one" ) succeeded for: true -TestMain.cpp:379: oneTag.getTags().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:381: oneTag.matchesTags( p1 ) == true succeeded for: true == true -TestMain.cpp:382: oneTag.matchesTags( p2 ) == true succeeded for: true == true -TestMain.cpp:383: oneTag.matchesTags( p3 ) == false succeeded for: false == false -TestMain.cpp:384: oneTag.matchesTags( p4 ) == false succeeded for: false == false -TestMain.cpp:385: oneTag.matchesTags( p5 ) == false succeeded for: false == false +TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:370: oneTag.hasTag( "one" ) succeeded for: true +TestMain.cpp:371: oneTag.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:373: oneTag.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:374: oneTag.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:375: oneTag.matchesTags( p3 ) == false succeeded for: false == false +TestMain.cpp:376: oneTag.matchesTags( p4 ) == false succeeded for: false == false +TestMain.cpp:377: oneTag.matchesTags( p5 ) == false succeeded for: false == false [End of section: 'one tag' All 8 assertions passed] [Started section: 'two tags'] -TestMain.cpp:391: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:392: twoTags.hasTag( "one" ) succeeded for: true -TestMain.cpp:393: twoTags.hasTag( "two" ) succeeded for: true -TestMain.cpp:394: twoTags.hasTag( "Two" ) succeeded for: true -TestMain.cpp:395: twoTags.hasTag( "three" ) == false succeeded for: false == false -TestMain.cpp:396: twoTags.getTags().size() == 2 succeeded for: 2 == 2 -TestMain.cpp:398: twoTags.matchesTags( p1 ) == true succeeded for: true == true -TestMain.cpp:399: twoTags.matchesTags( p2 ) == true succeeded for: true == true -TestMain.cpp:400: twoTags.matchesTags( p3 ) == true succeeded for: true == true -TestMain.cpp:401: twoTags.matchesTags( p4 ) == true succeeded for: true == true -TestMain.cpp:402: twoTags.matchesTags( p5 ) == true succeeded for: true == true +TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:384: twoTags.hasTag( "one" ) succeeded for: true +TestMain.cpp:385: twoTags.hasTag( "two" ) succeeded for: true +TestMain.cpp:386: twoTags.hasTag( "Two" ) succeeded for: true +TestMain.cpp:387: twoTags.hasTag( "three" ) == false succeeded for: false == false +TestMain.cpp:388: twoTags.getTags().size() == 2 succeeded for: 2 == 2 +TestMain.cpp:390: twoTags.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:391: twoTags.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:392: twoTags.matchesTags( p3 ) == true succeeded for: true == true +TestMain.cpp:393: twoTags.matchesTags( p4 ) == true succeeded for: true == true +TestMain.cpp:394: twoTags.matchesTags( p5 ) == true succeeded for: true == true [End of section: 'two tags' All 11 assertions passed] [Started section: 'one tag with characters either side'] -TestMain.cpp:408: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" -TestMain.cpp:409: oneTagWithExtras.hasTag( "one" ) succeeded for: true -TestMain.cpp:410: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false -TestMain.cpp:411: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:400: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" +TestMain.cpp:401: oneTagWithExtras.hasTag( "one" ) succeeded for: true +TestMain.cpp:402: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false +TestMain.cpp:403: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 [End of section: 'one tag with characters either side' All 4 assertions passed] [Started section: 'start of a tag, but not closed'] -TestMain.cpp:418: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" -TestMain.cpp:419: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false -TestMain.cpp:420: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 +TestMain.cpp:410: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" +TestMain.cpp:411: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false +TestMain.cpp:412: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 [End of section: 'start of a tag, but not closed' All 3 assertions passed] [Started section: 'hidden'] -TestMain.cpp:426: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:427: oneTag.hasTag( "hide" ) succeeded for: true -TestMain.cpp:428: oneTag.isHidden() succeeded for: true -TestMain.cpp:430: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false +TestMain.cpp:418: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:419: oneTag.hasTag( "hide" ) succeeded for: true +TestMain.cpp:420: oneTag.isHidden() succeeded for: true +TestMain.cpp:422: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false [End of section: 'hidden' All 4 assertions passed] [Finished: 'selftest/tags' All tests passed (30 assertions in 1 test case)] @@ -14567,11 +14489,11 @@ TestMain.cpp:430: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false [Running: Long strings can be wrapped] [Started section: 'plain string'] [Started section: 'No wrapping'] -TestMain.cpp:443: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: +TestMain.cpp:435: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:444: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: +TestMain.cpp:436: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" @@ -14581,31 +14503,31 @@ TestMain.cpp:444: Text( testString, TextAttributes().setWidth( 18 ) ).toString() [Started section: 'plain string'] [Started section: 'Wrapped once'] -TestMain.cpp:447: Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:439: Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:448: Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:440: Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:449: Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:441: Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:450: Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:442: Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:451: Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" succeeded for: +TestMain.cpp:443: Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" succeeded for: "one two three four" == @@ -14617,7 +14539,7 @@ three four" [Started section: 'plain string'] [Started section: 'Wrapped twice'] -TestMain.cpp:454: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:446: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14625,7 +14547,7 @@ four" "one two three four" -TestMain.cpp:455: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:447: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14633,7 +14555,7 @@ four" "one two three four" -TestMain.cpp:456: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:448: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14647,7 +14569,7 @@ four" [Started section: 'plain string'] [Started section: 'Wrapped three times'] -TestMain.cpp:459: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:451: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -14657,7 +14579,7 @@ four" two three four" -TestMain.cpp:460: Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:452: Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -14673,24 +14595,24 @@ four" [Started section: 'plain string'] [Started section: 'Short wrap'] -TestMain.cpp:463: Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" succeeded for: "abc- +TestMain.cpp:455: Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" succeeded for: "abc- def" == "abc- def" -TestMain.cpp:464: Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" succeeded for: "abc- +TestMain.cpp:456: Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" succeeded for: "abc- defg" == "abc- defg" -TestMain.cpp:465: Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- +TestMain.cpp:457: Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- def- gh" == "abc- def- gh" -TestMain.cpp:467: Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: +TestMain.cpp:459: Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: "one two thr- @@ -14702,7 +14624,7 @@ two thr- ee four" -TestMain.cpp:468: Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: +TestMain.cpp:460: Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: "one two th- @@ -14722,18 +14644,18 @@ ur" [Started section: 'plain string'] [Started section: 'As container'] -TestMain.cpp:472: text.size() == 4 succeeded for: 4 == 4 -TestMain.cpp:473: text[0] == "one" succeeded for: "one" == "one" -TestMain.cpp:474: text[1] == "two" succeeded for: "two" == "two" -TestMain.cpp:475: text[2] == "three" succeeded for: "three" == "three" -TestMain.cpp:476: text[3] == "four" succeeded for: "four" == "four" +TestMain.cpp:464: text.size() == 4 succeeded for: 4 == 4 +TestMain.cpp:465: text[0] == "one" succeeded for: "one" == "one" +TestMain.cpp:466: text[1] == "two" succeeded for: "two" == "two" +TestMain.cpp:467: text[2] == "three" succeeded for: "three" == "three" +TestMain.cpp:468: text[3] == "four" succeeded for: "four" == "four" [End of section: 'As container' All 5 assertions passed] [End of section: 'plain string' All 5 assertions passed] [Started section: 'plain string'] [Started section: 'Indent first line differently'] -TestMain.cpp:483: text.toString() == " one two\n three\n four" succeeded for: +TestMain.cpp:475: text.toString() == " one two\n three\n four" succeeded for: " one two three four" @@ -14747,19 +14669,19 @@ TestMain.cpp:483: text.toString() == " one two\n three\n four" succeeded f [Started section: 'With newlines'] [Started section: 'No wrapping'] -TestMain.cpp:494: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: +TestMain.cpp:486: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:495: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: +TestMain.cpp:487: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:496: Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString succeeded for: +TestMain.cpp:488: Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString succeeded for: "one two three four" == @@ -14771,13 +14693,13 @@ three four" [Started section: 'With newlines'] [Started section: 'Trailing newline'] -TestMain.cpp:499: Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:491: Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef " -TestMain.cpp:500: Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" -TestMain.cpp:501: Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:492: Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" +TestMain.cpp:493: Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef @@ -14788,7 +14710,7 @@ TestMain.cpp:501: Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() [Started section: 'With newlines'] [Started section: 'Wrapped once'] -TestMain.cpp:504: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:496: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14796,7 +14718,7 @@ four" "one two three four" -TestMain.cpp:505: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:497: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14804,7 +14726,7 @@ four" "one two three four" -TestMain.cpp:506: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:498: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14818,7 +14740,7 @@ four" [Started section: 'With newlines'] [Started section: 'Wrapped twice'] -TestMain.cpp:509: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:501: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -14833,7 +14755,7 @@ four" [End of section: 'With newlines' 1 assertion passed] [Started section: 'With tabs'] -TestMain.cpp:519: Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" succeeded for: +TestMain.cpp:511: Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" succeeded for: "one two three four five @@ -14856,8 +14778,8 @@ No assertions in test case, 'Strings can be rendered with colour' [Finished: 'Strings can be rendered with colour' 1 test case failed (1 assertion failed)] [Running: Text can be formatted using the Text class] -TestMain.cpp:619: Text( "hi there" ).toString() == "hi there" succeeded for: "hi there" == "hi there" -TestMain.cpp:624: Text( "hi there", narrow ).toString() == "hi\nthere" succeeded for: "hi +TestMain.cpp:611: Text( "hi there" ).toString() == "hi there" succeeded for: "hi there" == "hi there" +TestMain.cpp:616: Text( "hi there", narrow ).toString() == "hi\nthere" succeeded for: "hi there" == "hi @@ -15273,10 +15195,10 @@ CmdLineTests.cpp:380: config.verbosity == Config::Verbosity::NoOutput succeeded [End of section: ' Given: A built cli parser for Catch' All 2 assertions passed] [Finished: 'Scenario: New Catch commandline interface' 1 test case failed (1 of 20 assertions failed)] -[End of group: '~dummy'. 50 of 115 test cases failed (107 of 744 assertions failed)] +[End of group: '~dummy'. 50 of 115 test cases failed (107 of 740 assertions failed)] -[Testing completed. 50 of 115 test cases failed (107 of 744 assertions failed)] +[Testing completed. 50 of 115 test cases failed (107 of 740 assertions failed)] [Started testing: CatchSelfTest] [Started group: '~dummy'] diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 626c026b..415ad530 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -256,20 +256,12 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { } } - SECTION( "streams", "" ) { + SECTION( "output filename", "" ) { SECTION( "-o filename", "" ) { const char* argv[] = { "test", "-o", "filename.ext" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); REQUIRE( config.outputFilename == "filename.ext" ); - REQUIRE( config.stream.empty() ); - } - SECTION( "-o %stdout", "" ) { - const char* argv[] = { "test", "-o", "%stdout" }; - CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - - REQUIRE( config.stream == "stdout" ); - REQUIRE( config.outputFilename.empty() ); } SECTION( "--out", "" ) { const char* argv[] = { "test", "--out", "filename.ext" }; From c9f0f554517009d541b015898355bf80aebd747e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 31 May 2013 08:01:56 +0100 Subject: [PATCH 266/296] Last changes to ConfigData names (for now) --- include/internal/catch_commandline.hpp | 4 +- include/internal/catch_config.hpp | 12 ++--- .../SelfTest/Baselines/approvedResults.txt | 50 +++++++++---------- projects/SelfTest/TestMain.cpp | 18 +++---- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 2726827b..af38bfa3 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -379,7 +379,7 @@ namespace Catch { } virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) { - config.reporter = cmd[0]; + config.reporterName = cmd[0]; } }; @@ -530,7 +530,7 @@ namespace Catch { if( ss.fail() || threshold <= 0 ) cmd.raiseError( "threshold must be a number greater than zero" ); } - config.cutoff = threshold; + config.abortAfter = threshold; } }; diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 058e3a33..c8b93b01 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -45,7 +45,7 @@ namespace Catch { shouldDebugBreak( false ), noThrow( false ), showHelp( false ), - cutoff( -1 ), + abortAfter( -1 ), verbosity( Verbosity::Normal ), warnings( WarnAbout::Nothing ) {} @@ -59,12 +59,12 @@ namespace Catch { bool noThrow; bool showHelp; - int cutoff; + int abortAfter; Verbosity::Level verbosity; WarnAbout::What warnings; - std::string reporter; + std::string reporterName; std::string outputFilename; std::string name; @@ -140,16 +140,16 @@ namespace Catch { m_stream = stream; } - std::string getReporterName() const { return m_data.reporter; } + std::string getReporterName() const { return m_data.reporterName; } void addTestSpec( std::string const& testSpec ) { TestCaseFilters filters( testSpec ); filters.addFilter( TestCaseFilter( testSpec ) ); m_filterSets.push_back( filters ); } - + int abortAfter() const { - return m_data.cutoff; + return m_data.abortAfter; } std::vector const& filters() const { diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index edfcba10..c79d1855 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -3558,7 +3558,7 @@ with expansion: TestMain.cpp:101: PASSED: - CHECK( config.cutoff == -1 ) + CHECK( config.abortAfter == -1 ) with expansion: -1 == -1 @@ -3570,7 +3570,7 @@ with expansion: TestMain.cpp:103: PASSED: - CHECK( config.reporter.empty() ) + CHECK( config.reporterName.empty() ) with expansion: true @@ -3789,7 +3789,7 @@ PASSED: TestMain.cpp:178: PASSED: - REQUIRE( config.reporter == "console" ) + REQUIRE( config.reporterName == "console" ) with expansion: "console" == "console" @@ -3807,7 +3807,7 @@ PASSED: TestMain.cpp:184: PASSED: - REQUIRE( config.reporter == "xml" ) + REQUIRE( config.reporterName == "xml" ) with expansion: "xml" == "xml" @@ -3825,7 +3825,7 @@ PASSED: TestMain.cpp:190: PASSED: - REQUIRE( config.reporter == "junit" ) + REQUIRE( config.reporterName == "junit" ) with expansion: "junit" == "junit" @@ -3909,7 +3909,7 @@ PASSED: TestMain.cpp:222: PASSED: - REQUIRE( config.cutoff == 1 ) + REQUIRE( config.abortAfter == 1 ) with expansion: 1 == 1 @@ -3927,7 +3927,7 @@ PASSED: TestMain.cpp:228: PASSED: - REQUIRE( config.cutoff == 2 ) + REQUIRE( config.abortAfter == 2 ) with expansion: 2 == 2 @@ -4062,7 +4062,7 @@ PASSED: TestMain.cpp:279: PASSED: - CHECK( config.cutoff == 1 ) + CHECK( config.abortAfter == 1 ) with expansion: 1 == 1 @@ -10598,7 +10598,7 @@ TestMain.cpp" line="100"> TestMain.cpp" line="101"> - config.cutoff == -1 + config.abortAfter == -1 -1 == -1 @@ -10614,7 +10614,7 @@ TestMain.cpp" line="102"> TestMain.cpp" line="103"> - config.reporter.empty() + config.reporterName.empty() true @@ -10887,7 +10887,7 @@ TestMain.cpp" line="176"> TestMain.cpp" line="178"> - config.reporter == "console" + config.reporterName == "console" "console" == "console" @@ -10909,7 +10909,7 @@ TestMain.cpp" line="182"> TestMain.cpp" line="184"> - config.reporter == "xml" + config.reporterName == "xml" "xml" == "xml" @@ -10931,7 +10931,7 @@ TestMain.cpp" line="188"> TestMain.cpp" line="190"> - config.reporter == "junit" + config.reporterName == "junit" "junit" == "junit" @@ -11031,7 +11031,7 @@ TestMain.cpp" line="220"> TestMain.cpp" line="222"> - config.cutoff == 1 + config.abortAfter == 1 1 == 1 @@ -11053,7 +11053,7 @@ TestMain.cpp" line="226"> TestMain.cpp" line="228"> - config.cutoff == 2 + config.abortAfter == 2 2 == 2 @@ -11092,7 +11092,7 @@ TestMain.cpp" line="236">
-
+
TestMain.cpp" line="240"> parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) @@ -11214,7 +11214,7 @@ TestMain.cpp" line="277"> TestMain.cpp" line="279"> - config.cutoff == 1 + config.abortAfter == 1 1 == 1 @@ -14189,9 +14189,9 @@ TestMain.cpp:59: totals.assertions.failed == 1 succeeded for: 1 == 1 [Started section: 'default'] TestMain.cpp:98: parseIntoConfig( argv, config ) succeeded TestMain.cpp:100: config.shouldDebugBreak == false succeeded for: false == false -TestMain.cpp:101: config.cutoff == -1 succeeded for: -1 == -1 +TestMain.cpp:101: config.abortAfter == -1 succeeded for: -1 == -1 TestMain.cpp:102: config.noThrow == false succeeded for: false == false -TestMain.cpp:103: config.reporter.empty() succeeded for: true +TestMain.cpp:103: config.reporterName.empty() succeeded for: true [End of section: 'default' All 5 assertions passed] [Started section: 'test lists'] @@ -14266,7 +14266,7 @@ TestMain.cpp:169: parseIntoConfigAndReturnError( argv, config ) Contains( "at le [Started section: 'reporter'] [Started section: '-r/console'] TestMain.cpp:176: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:178: config.reporter == "console" succeeded for: "console" == "console" +TestMain.cpp:178: config.reporterName == "console" succeeded for: "console" == "console" [End of section: '-r/console' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] @@ -14274,7 +14274,7 @@ TestMain.cpp:178: config.reporter == "console" succeeded for: "console" == "cons [Started section: 'reporter'] [Started section: '-r/xml'] TestMain.cpp:182: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:184: config.reporter == "xml" succeeded for: "xml" == "xml" +TestMain.cpp:184: config.reporterName == "xml" succeeded for: "xml" == "xml" [End of section: '-r/xml' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] @@ -14282,7 +14282,7 @@ TestMain.cpp:184: config.reporter == "xml" succeeded for: "xml" == "xml" [Started section: 'reporter'] [Started section: '--reporter/junit'] TestMain.cpp:188: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:190: config.reporter == "junit" succeeded for: "junit" == "junit" +TestMain.cpp:190: config.reporterName == "junit" succeeded for: "junit" == "junit" [End of section: '--reporter/junit' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] @@ -14322,7 +14322,7 @@ TestMain.cpp:213: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arg [Started section: 'abort'] [Started section: '-a'] TestMain.cpp:220: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:222: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:222: config.abortAfter == 1 succeeded for: 1 == 1 [End of section: '-a' All 2 assertions passed] [End of section: 'abort' All 2 assertions passed] @@ -14330,7 +14330,7 @@ TestMain.cpp:222: config.cutoff == 1 succeeded for: 1 == 1 [Started section: 'abort'] [Started section: '-a/2'] TestMain.cpp:226: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:228: config.cutoff == 2 succeeded for: 2 == 2 +TestMain.cpp:228: config.abortAfter == 2 succeeded for: 2 == 2 [End of section: '-a/2' All 2 assertions passed] [End of section: 'abort' All 2 assertions passed] @@ -14394,7 +14394,7 @@ TestMain.cpp:270: config.outputFilename == "filename.ext" succeeded for: "filena [Started section: 'combinations'] [Started section: '-a -b'] TestMain.cpp:277: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:279: config.cutoff == 1 succeeded for: 1 == 1 +TestMain.cpp:279: config.abortAfter == 1 succeeded for: 1 == 1 TestMain.cpp:280: config.shouldDebugBreak succeeded for: true TestMain.cpp:281: config.noThrow == true succeeded for: true == true [End of section: '-a -b' All 4 assertions passed] diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 415ad530..befe5a66 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -98,9 +98,9 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { CHECK_NOTHROW( parseIntoConfig( argv, config ) ); CHECK( config.shouldDebugBreak == false ); - CHECK( config.cutoff == -1 ); + CHECK( config.abortAfter == -1 ); CHECK( config.noThrow == false ); - CHECK( config.reporter.empty() ); + CHECK( config.reporterName.empty() ); } SECTION( "test lists", "" ) { @@ -175,19 +175,19 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { const char* argv[] = { "test", "-r", "console" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.reporter == "console" ); + REQUIRE( config.reporterName == "console" ); } SECTION( "-r/xml", "" ) { const char* argv[] = { "test", "-r", "xml" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.reporter == "xml" ); + REQUIRE( config.reporterName == "xml" ); } SECTION( "--reporter/junit", "" ) { const char* argv[] = { "test", "--reporter", "junit" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.reporter == "junit" ); + REQUIRE( config.reporterName == "junit" ); } SECTION( "-r/error", "reporter config only accepts one argument" ) { const char* argv[] = { "test", "-r", "one", "two" }; @@ -219,13 +219,13 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { const char* argv[] = { "test", "-a" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.cutoff == 1 ); + REQUIRE( config.abortAfter == 1 ); } SECTION( "-a/2", "" ) { const char* argv[] = { "test", "-a", "2" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - REQUIRE( config.cutoff == 2 ); + REQUIRE( config.abortAfter == 2 ); } SECTION( "-a/error/0", "" ) { const char* argv[] = { "test", "-a", "0" }; @@ -235,7 +235,7 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { const char* argv[] = { "test", "-a", "oops" }; REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "greater than zero" ) ); } - SECTION( "-a/error/two args", "cutoff only takes one argument" ) { + SECTION( "-a/error/two args", "abortAfter only takes one argument" ) { const char* argv[] = { "test", "-a", "1", "2" }; REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "0 and 1 argument" ) ); } @@ -276,7 +276,7 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { const char* argv[] = { "test", "-a", "-b", "-nt" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - CHECK( config.cutoff == 1 ); + CHECK( config.abortAfter == 1 ); CHECK( config.shouldDebugBreak ); CHECK( config.noThrow == true ); } From f330fe7ef922d3ac047755466274151c6101b51e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 31 May 2013 08:11:01 +0100 Subject: [PATCH 267/296] Made generated function name more obvious (for quickly finding in debugger's stack viewer) --- include/internal/catch_test_registry.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/internal/catch_test_registry.hpp b/include/internal/catch_test_registry.hpp index 269f48eb..51911a40 100644 --- a/include/internal/catch_test_registry.hpp +++ b/include/internal/catch_test_registry.hpp @@ -76,9 +76,9 @@ private: #ifdef CATCH_CONFIG_VARIADIC_MACROS /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TESTCASE( ... ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() + static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )() /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ @@ -87,19 +87,19 @@ private: /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... )\ namespace{ \ - struct INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ ) : ClassName{ \ + struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \ void test(); \ }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \ + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \ } \ - void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() + void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test() #else /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() + static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )() /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ @@ -108,12 +108,12 @@ private: /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\ namespace{ \ - struct INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ ) : ClassName{ \ + struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \ void test(); \ }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \ + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \ } \ - void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() + void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test() #endif From 0514fe4f38b9c464e380c74e1c62ff2d1d667554 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 31 May 2013 18:48:31 +0100 Subject: [PATCH 268/296] Got parseCommandLine ready to use new Clara (but not doing so yet) --- include/catch_runner.hpp | 6 +- include/internal/catch_commandline.hpp | 112 +++++++++++++++++++++++++ include/internal/clara.h | 4 +- projects/SelfTest/CmdLineTests.cpp | 4 +- 4 files changed, 118 insertions(+), 8 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index ea1389bb..bef75564 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -166,7 +166,7 @@ namespace Catch { showUsage( std::cout ); } } - + inline int Main( int argc, char* const argv[], ConfigData configData = ConfigData() ) { try { @@ -181,9 +181,7 @@ namespace Catch { return 0; } - AllOptions options; - - options.parseIntoConfig( parser, configData ); + parseCommandLine( argc, argv, configData ); } catch( std::exception& ex ) { std::cerr << ex.what() << "\n\nUsage: ...\n\n"; diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index af38bfa3..147b1495 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -10,6 +10,7 @@ #include "catch_config.hpp" #include "catch_common.h" +#include "clara.h" namespace Catch { @@ -341,6 +342,9 @@ namespace Catch { else cmd.raiseError( "Expected tests, reporters or tags" ); } + else { + config.listTests = true; + } } }; @@ -649,6 +653,114 @@ namespace Catch { Parsers m_parsers; }; + + inline void abortAfterFirst( ConfigData& config ) { config.abortAfter = 1; } + inline void abortAfterX( ConfigData& config, int x ) { config.abortAfter = x; } + inline void addTestOrTags( ConfigData& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); } + + inline void addWarning( ConfigData& config, std::string const& _warning ) { + if( _warning == "NoAssertions" ) + config.warnings = (ConfigData::WarnAbout::What)( config.warnings | ConfigData::WarnAbout::NoAssertions ); + else + throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" ); + + } + inline void setVerbosity( ConfigData& config, int level ) { + // !TBD: accept strings? + config.verbosity = (ConfigData::Verbosity::Level)level; + } + + inline void parseCommandLine( int argc, char* const argv[], ConfigData& config ) { + + Clara::CommandLine cli; + + cli.bind( &ConfigData::showHelp ) + .describe( "display usage information" ) + .shortOpt( "?") + .shortOpt( "h") + .longOpt( "help" ); + + cli.bind( &ConfigData::listTests ) + .describe( "list all (or matching) test cases" ) + .shortOpt( "l") + .longOpt( "list-tests" ); + + cli.bind( &ConfigData::listTags ) + .describe( "list all (or matching) tags" ) + .shortOpt( "t") + .longOpt( "list-tags" ); + + cli.bind( &ConfigData::listTags ) + .describe( "list all reporters" ) + .longOpt( "list-reporters" ); + + cli.bind( &ConfigData::showSuccessfulTests ) + .describe( "include successful tests in output" ) + .shortOpt( "s") + .longOpt( "success" ); + + cli.bind( &ConfigData::shouldDebugBreak ) + .describe( "break into debugger on failure" ) + .shortOpt( "b") + .longOpt( "break" ); + + cli.bind( &ConfigData::noThrow ) + .describe( "Skip exception tests" ) + .shortOpt( "e") + .longOpt( "nothrow" ); + + cli.bind( &ConfigData::outputFilename ) + .describe( "output filename" ) + .shortOpt( "o") + .longOpt( "out" ) + .argName( "filename" ); + + cli.bind( &ConfigData::reporterName ) + .describe( "reporter to use - defaults to console" ) + .shortOpt( "r") + .longOpt( "reporter" ) + .argName( "name[:filename]" ); + + cli.bind( &ConfigData::name ) + .describe( "suite name" ) + .shortOpt( "n") + .longOpt( "name" ) + .argName( "name" ); + + cli.bind( &abortAfterFirst ) + .describe( "abort at first failure" ) + .shortOpt( "a") + .longOpt( "abort" ); + + cli.bind( &abortAfterX ) + .describe( "abort after x failures" ) + .shortOpt( "x") + .longOpt( "abortx" ) + .argName( "number of failures" ); + + cli.bind( &addWarning ) + .describe( "enable warnings" ) + .shortOpt( "w") + .longOpt( "warn" ) + .argName( "warning name" ); + + cli.bind( &setVerbosity ) + .describe( "level of verbosity (0=no output)" ) + .shortOpt( "v") + .longOpt( "verbosity" ) + .argName( "level" ); + + cli.bind( &addTestOrTags ) + .describe( "which test or tests to use" ) + .argName( "test name, pattern or tags" ); + +// cli.parseInto( argc, argv, config ); + + // Legacy way + CommandParser parser( argc, argv ); + AllOptions options; + options.parseIntoConfig( parser, config ); + } } // end namespace Catch diff --git a/include/internal/clara.h b/include/internal/clara.h index 0fad01dd..7a4e4627 100644 --- a/include/internal/clara.h +++ b/include/internal/clara.h @@ -197,7 +197,7 @@ namespace Clara { std::string data; }; - void parseIntoTokens( int argc, char const* argv[], std::vector& tokens ) const { + void parseIntoTokens( int argc, char const * const * argv, std::vector& tokens ) const { for( int i = 1; i < argc; ++i ) parseIntoTokens( argv[i] , tokens); } @@ -434,7 +434,7 @@ namespace Clara { return oss.str(); } - std::vector parseInto( int argc, char const* argv[], ConfigT& config ) const { + std::vector parseInto( int argc, char const * const * argv, ConfigT& config ) const { std::vector tokens; Parser parser; parser.parseIntoTokens( argc, argv, tokens ); diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 5079dc71..82a40b18 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -16,7 +16,7 @@ // Helper to deduce size from array literals and pass on to parser template -std::vector parseInto( Clara::CommandLine& cli, char const* (&argv)[size], ConfigT& config ) { +std::vector parseInto( Clara::CommandLine& cli, char const * (&argv)[size], ConfigT& config ) { return cli.parseInto( size, argv, config ); } @@ -56,7 +56,7 @@ TEST_CASE( "cmdline" ) { .argName( "filename" ); SECTION( "arg separated by spaces" ) { - const char* argv[] = { "test", "-o filename.ext" }; + char const * argv[] = { "test", "-o filename.ext" }; parseInto( cli, argv, config ); CHECK( config.fileName == "filename.ext" ); From 4e88ccda568730bdeb4dd67da894c01f4e9c9acc Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 3 Jun 2013 20:03:07 +0100 Subject: [PATCH 269/296] Start of new docs --- docs/command-line.md | 1 + docs/own-main.md | 1 + docs/reference-index.md | 1 + docs/tutorial.md | 95 +++++++++++++++++++++++++++++++++++++++++ docs/why-catch.md | 1 + 5 files changed, 99 insertions(+) create mode 100644 docs/command-line.md create mode 100644 docs/own-main.md create mode 100644 docs/reference-index.md create mode 100644 docs/tutorial.md create mode 100644 docs/why-catch.md diff --git a/docs/command-line.md b/docs/command-line.md new file mode 100644 index 00000000..35906934 --- /dev/null +++ b/docs/command-line.md @@ -0,0 +1 @@ +placeholder for command line \ No newline at end of file diff --git a/docs/own-main.md b/docs/own-main.md new file mode 100644 index 00000000..44b5b60b --- /dev/null +++ b/docs/own-main.md @@ -0,0 +1 @@ +placeholder for using your own main \ No newline at end of file diff --git a/docs/reference-index.md b/docs/reference-index.md new file mode 100644 index 00000000..0f3837d0 --- /dev/null +++ b/docs/reference-index.md @@ -0,0 +1 @@ +placeholder for reference index \ No newline at end of file diff --git a/docs/tutorial.md b/docs/tutorial.md new file mode 100644 index 00000000..df91cf8d --- /dev/null +++ b/docs/tutorial.md @@ -0,0 +1,95 @@ +# Getting Catch + +The simplest way to get Catch is to download the single header version from [builds.catch-lib.net](builds.catch-lib.net). Don't be put off by the word "builds" there. The single header is generated by merging a set of individual headers but it is still just normal source code in a header file. + +The full source for Catch, including test projects, documentation, and other things, is hosted on GitHub. [catch-lib.net](catch-lib.net) will redirect you there. + + +## Where to put it? + +Catch is header only. All you need to do is drop the file(s) somewhere reachable from your project - either in some central location you can set your header search path to find, or directly into your project tree itself! This is a particularly good option for other Open-Source projects that want to use Catch for their test suite. See [this blog entry for more on that](http://www.levelofindirection.com/journal/2011/5/27/unit-testing-in-c-and-objective-c-just-got-ridiculously-easi-1.html). + +The rest of this tutorial will assume that the Catch single-include header (or the include folder) is available unqualified - but you may need to prefix it with a folder name if necessary. + +# Writing tests + +Let's start with a really simple example. Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now). + +```c++ +unsigned int Factorial( unsigned int number ) { + return number <= 1 ? number : Factorial(number-1)*number; +} +``` + +To keep things simple we'll put everything in a single file. + +```c++ +#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file +#include "catch.hpp" + +unsigned int Factorial( unsigned int number ) { + return number <= 1 ? number : Factorial(number-1)*number; +} + +TEST_CASE( "Factorials are computed", "[factorial]" ) { + REQUIRE( Factorial(1) == 1 ); + REQUIRE( Factorial(2) == 2 ); + REQUIRE( Factorial(3) == 6 ); + REQUIRE( Factorial(10) == 3628800 ); +} +``` + +This will compile to a complete executable which responds to [command line arguments](command-line.md). If you just run it with no arguments it will execute all test cases (in this case there is just one), report any failures, report a summary of how many tests passed and failed and return the number of failed tests (useful for if you just want a yes/ no answer to: "did it work"). + +If you run this as written it will pass. Everything is good. Right? +Well, there is still a bug here. In fact the first version of this tutorial I posted here genuinely had the bug in! So it's not completely contrived (thanks to Daryle Walker (```@CTMacUser```) for pointing this out). + +What is the bug? Well what is the factorial of zero? +[The factorial of zero is one](http://mathforum.org/library/drmath/view/57128.html) - which is just one of those things you have to know (and remember!). + +Let's add that to the test case: + +```c++ +TEST_CASE( "Factorials are computed", "[factorial]" ) { + REQUIRE( Factorial(0) == 1 ); + REQUIRE( Factorial(1) == 1 ); + REQUIRE( Factorial(2) == 2 ); + REQUIRE( Factorial(3) == 6 ); + REQUIRE( Factorial(10) == 3628800 ); +} +``` + +Now we get a failure - something like: + +``` +Example.cpp:9: FAILED: + REQUIRE( Factorial(0) == 1 ) +with expansion: + 0 == 1 +``` + +Note that we get the actual return value of Factorial(0) printed for us (0) - even though we used a natural expression with the == operator. That let's us immediately see what the problem is. + +Let's change the factorial function to: + +```c++ +unsigned int Factorial( unsigned int number ) { + return number > 1 ? Factorial(number-1)*number : 1; +} +``` + +Now all the tests pass. + +Of course there are still more issues to do deal with. For example we'll hit problems when the return value starts to exceed the range of an unsigned int. With factorials that can happen quite quickly. You might want to add tests for such cases and decide how to handle them. We'll stop short of doing that here. + +## What did we do here? + +Although this was a simple test it's been enough to demonstrate a few things about how Catch is used. Let's take moment to consider those before we move on. + +1. All we did was ```#define``` one identifier and ```#include``` one header and we got everything - even an implementation of ```main()``` that will [respond to command line arguments](command-line.md). You can only use that ```#define``` in one implementation file, for (hopefully) obvious reasons. Once you have more than one file with unit tests in you'll just ```#include "catch.hpp"``` and go. Usually it's a good idea to have a dedicated implementation file that just has ```#define CATCH_CONFIG_MAIN``` and ```#include "catch.hpp"```. You can also provide your own implementation of main and drive Catch yourself (see [Supplying-your-own-main()](own-main.md). +2. We introduce test cases with the TEST_CASE macro. This macro takes two arguments - a hierarchical test name (forward slash separated, by convention) and a free-form description. The test name should be unique - and ideally will logically group related tests together like folders in a file system. You can run sets of tests by specifying a wildcarded test name. +3. The name and description arguments are just strings. We haven't had to declare a function or method - or explicitly register the test case anywhere. Behind the scenes a function with a generated name is defined for you, and automatically registered using static registry classes. By abstracting the function name away we can name our tests without the constraints of identifier names. +4. We write our individual test assertions using the REQUIRE macro. Rather than a separate macro for each type of condition we express the condition naturally using C/C++ syntax. Behind the scenes a simple set of expression templates captures the left-hand-side and right-hand-side of the expression so we can display the values in our test report. As we'll see later there _are_ other assertion macros - but because of this technique the number of them is drastically reduced. + +## Next steps +For more specific information see the [Reference pages](reference-index.md) \ No newline at end of file diff --git a/docs/why-catch.md b/docs/why-catch.md new file mode 100644 index 00000000..c0707821 --- /dev/null +++ b/docs/why-catch.md @@ -0,0 +1 @@ +placeholder for "why do we need yet another C++ test framework?" \ No newline at end of file From 130ec986c74e534796d41415f519b6bf73047beb Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 3 Jun 2013 20:03:39 +0100 Subject: [PATCH 270/296] Start of new docs --- README.md | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a78f0c14..b8bcd832 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,24 @@ -![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) +![catch logo](catch-logo-small.png) -## CATCH v0.9 build 38 (integration branch) -An automated test framework for C, C++ and Objective-C. +*v0.9 build 38 (integration branch)* -This branch may contain code that is experimental or not yet fully tested. -The latest stable version can be found on the Master branch. +## What's the Catch? -* For documentation see the wiki at: https://github.com/philsquared/Catch/wiki -* Issues and bugs can be raised at: https://github.com/philsquared/Catch/issues -* For discussion or questions please use: https://groups.google.com/forum/?fromgroups#!forum/catch-forum +Catch stands for C++ Automated Test Cases in Headers and is a multi-paradigm automated test framework for C++ and Objective-C (and, maybe, C). It is implemented entirely in a set of header files, but is packaged up as a single header for extra convenience. + +## How to use it +This documentation comprises these three parts: + +* [Why do we need yet another C++ Unit Test System?](docs/why-catch.md) +* [Tutorial](docs/tutorial.md) - getting started +* [Reference section](docs/reference-index.md) - all the details + +## What state is Catch in - can I use it now? + +For now Catch is still classed as "in developer preview". However it has already been widely used for over two years. It has proven fairly stable and is in use in some demanding projects. Think of it in the same way that Google uses the term "beta". +At time of writing I'm working towards locking down the public facing interfaces so I can finally give it a 1.0 designation. + + +## More +* Issues and bugs can be raised on the [Issue tracker on GitHub](https://github.com/philsquared/Catch/issues) +* For discussion or questions please use [the dedicated Google Groups forum](https://groups.google.com/forum/?fromgroups#!forum/catch-forum) From aee9b75e37974388902609c62804880e4abbc430 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 4 Jun 2013 08:37:28 +0100 Subject: [PATCH 271/296] Now fully switched over to Clara-based command line with modified args --- include/catch_runner.hpp | 59 ++----- include/internal/catch_commandline.hpp | 19 +-- include/internal/catch_config.hpp | 1 + include/internal/clara.h | 58 +++++-- projects/SelfTest/CmdLineTests.cpp | 211 ++----------------------- projects/SelfTest/MiscTests.cpp | 3 +- projects/SelfTest/TestMain.cpp | 83 +++------- 7 files changed, 105 insertions(+), 329 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index bef75564..11266f7f 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -131,61 +131,36 @@ namespace Catch { return result; } - inline void showUsage( std::ostream& os ) { - AllOptions options; + inline void showHelp( Clara::CommandLine const& cli, std::string const& processName ) { - for( AllOptions::const_iterator it = options.begin(); it != options.end(); ++it ) { - OptionParser& opt = **it; - os << " " << opt.optionNames() << " " << opt.argsSynopsis() << "\n"; - } - os << "\nFor more detail usage please see: https://github.com/philsquared/Catch/wiki/Command-line\n" << std::endl; - } + std::cout << "\nCatch v" << libraryVersion.majorVersion << "." + << libraryVersion.minorVersion << " build " + << libraryVersion.buildNumber; + if( libraryVersion.branchName != "master" ) + std::cout << " (" << libraryVersion.branchName << " branch)"; + std::cout << "\n"; - inline void showHelp( const CommandParser& parser ) { - AllOptions options; - Options::HelpOptionParser helpOpt; - bool displayedSpecificOption = false; - for( AllOptions::const_iterator it = options.begin(); it != options.end(); ++it ) { - OptionParser& opt = **it; - if( opt.find( parser ) && opt.optionNames() != helpOpt.optionNames() ) { - displayedSpecificOption = true; - std::cout << "\n" << opt.optionNames() << " " << opt.argsSynopsis() << "\n\n" - << opt.optionSummary() << "\n\n" - << Text( opt.optionDescription(), TextAttributes().setIndent( 2 ) ) << "\n" << std::endl; - } - } - - if( !displayedSpecificOption ) { - std::cout << "\nCATCH v" << libraryVersion.majorVersion << "." - << libraryVersion.minorVersion << " build " - << libraryVersion.buildNumber; - if( libraryVersion.branchName != "master" ) - std::cout << " (" << libraryVersion.branchName << " branch)"; - - std::cout << "\n\n" << parser.exeName() << " is a CATCH host application. Options are as follows:\n\n"; - showUsage( std::cout ); - } + cli.usage( std::cout, processName ); + std::cout << "\nFor more detail usage please see: https://github.com/philsquared/Catch/wiki/Command-line\n" << std::endl; } inline int Main( int argc, char* const argv[], ConfigData configData = ConfigData() ) { + Clara::CommandLine cli = makeCommandLineParser(); + try { - CommandParser parser( argc, argv ); + cli.parseInto( argc, argv, configData ); - if( Command cmd = Options::HelpOptionParser().find( parser ) ) { - if( cmd.argsCount() != 0 ) - cmd.raiseError( "Does not accept arguments" ); - - showHelp( parser ); + if( configData.showHelp ) { + showHelp( cli, argv[0] ); Catch::cleanUp(); return 0; } - - parseCommandLine( argc, argv, configData ); } catch( std::exception& ex ) { - std::cerr << ex.what() << "\n\nUsage: ...\n\n"; - showUsage( std::cerr ); + std::cerr << "\nError in input:\n" + << " " << ex.what() << "\n\n"; + cli.usage( std::cout, argv[0] ); Catch::cleanUp(); return (std::numeric_limits::max)(); } diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 147b1495..d6d969ed 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -655,7 +655,11 @@ namespace Catch { }; inline void abortAfterFirst( ConfigData& config ) { config.abortAfter = 1; } - inline void abortAfterX( ConfigData& config, int x ) { config.abortAfter = x; } + inline void abortAfterX( ConfigData& config, int x ) { + if( x < 1 ) + throw std::runtime_error( "Value after -x or --abortAfter must be greater than zero" ); + config.abortAfter = x; + } inline void addTestOrTags( ConfigData& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); } inline void addWarning( ConfigData& config, std::string const& _warning ) { @@ -670,10 +674,12 @@ namespace Catch { config.verbosity = (ConfigData::Verbosity::Level)level; } - inline void parseCommandLine( int argc, char* const argv[], ConfigData& config ) { + inline Clara::CommandLine makeCommandLineParser() { Clara::CommandLine cli; + cli.bindProcessName( &ConfigData::processName ); + cli.bind( &ConfigData::showHelp ) .describe( "display usage information" ) .shortOpt( "?") @@ -690,7 +696,7 @@ namespace Catch { .shortOpt( "t") .longOpt( "list-tags" ); - cli.bind( &ConfigData::listTags ) + cli.bind( &ConfigData::listReporters ) .describe( "list all reporters" ) .longOpt( "list-reporters" ); @@ -754,12 +760,7 @@ namespace Catch { .describe( "which test or tests to use" ) .argName( "test name, pattern or tags" ); -// cli.parseInto( argc, argv, config ); - - // Legacy way - CommandParser parser( argc, argv ); - AllOptions options; - options.parseIntoConfig( parser, config ); + return cli; } } // end namespace Catch diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index c8b93b01..d294e48a 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -67,6 +67,7 @@ namespace Catch { std::string reporterName; std::string outputFilename; std::string name; + std::string processName; std::vector testsOrTags; }; diff --git a/include/internal/clara.h b/include/internal/clara.h index 7a4e4627..ada6d6ce 100644 --- a/include/internal/clara.h +++ b/include/internal/clara.h @@ -64,7 +64,7 @@ namespace Clara { BoundArgFunction( IArgFunction* _functionObj ) : functionObj( _functionObj ) {} BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj->clone() ) {} BoundArgFunction& operator = ( BoundArgFunction const& other ) { - IArgFunction newFunctionObj = other.clone(); + IArgFunction* newFunctionObj = other.functionObj->clone(); delete functionObj; functionObj = newFunctionObj; return *this; @@ -83,6 +83,14 @@ namespace Clara { }; + template + struct NullBinder : IArgFunction{ + virtual void set( C&, std::string const& ) const {} + virtual void setFlag( C& ) const {} + virtual bool takesArg() const { return true; } + virtual IArgFunction* clone() const { return new NullBinder( *this ); } + }; + template struct BoundDataMember : IArgFunction{ BoundDataMember( M C::* _member ) : member( _member ) {} @@ -354,13 +362,29 @@ namespace Clara { public: - CommandLine() : m_highestSpecifiedArgPosition( 0 ) {} + CommandLine() + : m_boundProcessName( new Detail::NullBinder() ), + m_highestSpecifiedArgPosition( 0 ) + {} + CommandLine( CommandLine const& other ) + : m_boundProcessName( other.m_boundProcessName ), + m_options ( other.m_options ), + m_positionalArgs( other.m_positionalArgs ), + m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition ) + { + if( other.m_arg.get() ) + m_arg = std::auto_ptr( new Arg( *other.m_arg ) ); + } template ArgBinder bind( F f ) { ArgBinder binder( this, f ); return binder; } + template + void bindProcessName( F f ) { + m_boundProcessName = Detail::makeBoundField( f ); + } void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = CATCH_CONFIG_CONSOLE_WIDTH ) const { typename std::vector::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it; @@ -418,7 +442,6 @@ namespace Clara { return oss.str(); } - void usage( std::ostream& os, std::string const& procName ) const { os << "usage:\n " << procName << " "; argSynopsis( os ); @@ -435,6 +458,7 @@ namespace Clara { } std::vector parseInto( int argc, char const * const * argv, ConfigT& config ) const { + m_boundProcessName.set( config, argv[0] ); std::vector tokens; Parser parser; parser.parseIntoTokens( argc, argv, tokens ); @@ -458,18 +482,23 @@ namespace Clara { typename std::vector::const_iterator it = m_options.begin(), itEnd = m_options.end(); for(; it != itEnd; ++it ) { Arg const& arg = *it; - - if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) || - ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) { - if( arg.takesArg() ) { - if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional ) - throw std::domain_error( "Expected argument to option " + token.data ); - arg.boundField.set( config, tokens[++i].data ); + + try { + if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) || + ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) { + if( arg.takesArg() ) { + if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional ) + throw std::domain_error( "Expected argument to option " + token.data ); + arg.boundField.set( config, tokens[++i].data ); + } + else { + arg.boundField.setFlag( config ); + } + break; } - else { - arg.boundField.setFlag( config ); - } - break; + } + catch( std::exception& ex ) { + throw std::runtime_error( std::string( ex.what() ) + " while parsing: (" + arg.commands() + ")" ); } } if( it == itEnd ) @@ -507,6 +536,7 @@ namespace Clara { } private: + Detail::BoundArgFunction m_boundProcessName; std::vector m_options; std::map m_positionalArgs; std::auto_ptr m_arg; diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 82a40b18..dba17f54 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -24,6 +24,7 @@ std::vector parseInto( Clara::CommandLine& cli, c struct TestOpt { TestOpt() : number( 0 ), index( 0 ), flag( false ) {} + std::string processName; std::string fileName; int number; int index; @@ -49,12 +50,19 @@ TEST_CASE( "cmdline" ) { TestOpt config; Clara::CommandLine cli; + cli.bindProcessName( &TestOpt::processName ); cli.bind( &TestOpt::fileName ) .describe( "specifies output file" ) .shortOpt( "o" ) .longOpt( "output" ) .argName( "filename" ); + SECTION( "process name" ) { + char const * argv[] = { "test", "-o filename.ext" }; + parseInto( cli, argv, config ); + + CHECK( config.processName == "test" ); + } SECTION( "arg separated by spaces" ) { char const * argv[] = { "test", "-o filename.ext" }; parseInto( cli, argv, config ); @@ -169,7 +177,7 @@ TEST_CASE( "cmdline" ) { .argName( "first arg" ) .position( 1 ); - std::cout << cli.usage( "testApp" ) << std::endl; +// std::cout << cli.usage( "testApp" ) << std::endl; const char* argv[] = { "test", "-f", "1st", "-o", "filename", "2nd", "3rd" }; parseInto( cli, argv, config ); @@ -180,205 +188,4 @@ TEST_CASE( "cmdline" ) { } } -struct Config { - - struct Verbosity { enum Level { NoOutput = 0, Quiet, Normal }; }; - struct Warning { enum Types { Nothing = 0x00, NoAssertions = 0x01 }; }; - - Config() - : listTests( false ), - listTags( false ), - listReporters( false ), - showSuccessfulTests( false ), - breakIntoDebugger( false ), - noThrow( false ), - showHelp( false ), - abortAfter( 0 ), - verbosity( Verbosity::Normal ), - warnings( Warning::Nothing ) - {} - - bool listTests; - bool listTags; - bool listReporters; - - bool showSuccessfulTests; - bool breakIntoDebugger; - bool noThrow; - bool showHelp; - - int abortAfter; - - Verbosity::Level verbosity; - Warning::Types warnings; - - std::string reporterName; - std::string fileName; - std::string suiteName; - - std::vector testsOrTags; -}; - -inline void abortAfterFirst( Config& config ) { config.abortAfter = 1; } -inline void abortAfterX( Config& config, int x ) { config.abortAfter = x; } -inline void addTestOrTags( Config& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); } - -inline void addWarning( Config& config, std::string const& _warning ) { - if( _warning == "NoAssertions" ) - config.warnings = (Config::Warning::Types)( config.warnings | Config::Warning::NoAssertions ); - else - throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" ); - -} -inline void setVerbosity( Config& config, int level ) { - // !TBD: accept strings? - config.verbosity = (Config::Verbosity::Level)level; -} - - -SCENARIO( "New Catch commandline interface", "[cli]" ) { - - GIVEN( "A built cli parser for Catch" ) { - Clara::CommandLine cli; - - cli.bind( &Config::showHelp ) - .describe( "display usage information" ) - .shortOpt( "?") - .shortOpt( "h") - .longOpt( "help" ); - - cli.bind( &Config::listTests ) - .describe( "list all (or matching) test cases" ) - .shortOpt( "l") - .longOpt( "list-tests" ); - - cli.bind( &Config::listTags ) - .describe( "list all (or matching) tags" ) - .shortOpt( "t") - .longOpt( "list-tags" ); - - cli.bind( &Config::listTags ) - .describe( "list all reporters" ) - .longOpt( "list-reporters" ); - - cli.bind( &Config::showSuccessfulTests ) - .describe( "include successful tests in output" ) - .shortOpt( "s") - .longOpt( "success" ); - - cli.bind( &Config::breakIntoDebugger ) - .describe( "break into debugger on failure" ) - .shortOpt( "b") - .longOpt( "break" ); - - cli.bind( &Config::noThrow ) - .describe( "Skip exception tests" ) - .shortOpt( "e") - .longOpt( "nothrow" ); - - cli.bind( &Config::fileName ) - .describe( "output filename" ) - .shortOpt( "o") - .longOpt( "out" ) - .argName( "filename" ); - - cli.bind( &Config::reporterName ) - .describe( "reporter to use - defaults to console" ) - .shortOpt( "r") - .longOpt( "reporter" ) - .argName( "name[:filename]" ); - - cli.bind( &Config::suiteName ) - .describe( "suite name" ) - .shortOpt( "n") - .longOpt( "name" ) - .argName( "name" ); - - cli.bind( &abortAfterFirst ) - .describe( "abort at first failure" ) - .shortOpt( "a") - .longOpt( "abort" ); - - cli.bind( &abortAfterX ) - .describe( "abort after x failures" ) - .shortOpt( "x") - .longOpt( "abortx" ) - .argName( "number of failures" ); - - cli.bind( &addWarning ) - .describe( "enable warnings" ) - .shortOpt( "w") - .longOpt( "warn" ) - .argName( "warning name" ); - - cli.bind( &setVerbosity ) - .describe( "level of verbosity (0=no output)" ) - .shortOpt( "v") - .longOpt( "verbosity" ) - .argName( "level" ); - - cli.bind( &addTestOrTags ) - .describe( "which test or tests to use" ) - .argName( "test name, pattern or tags" ); - - WHEN( "We ask for usage strings" ) - THEN( "It prints the usage strings" ) - std::cout << cli.usage( "CatchTestApp" ) << std::endl; - - Config config; - - WHEN( "Multiple flags are combined" ) { - - CHECK_FALSE( config.showSuccessfulTests ); - CHECK_FALSE( config.noThrow ); - CHECK_FALSE( config.breakIntoDebugger ); - - const char* argv[] = { "test", "-seb" }; - parseInto( cli, argv, config ); - - THEN( "All the flags are set" ) { - CHECK( config.showSuccessfulTests ); - CHECK( config.noThrow ); - CHECK( config.breakIntoDebugger ); - } - } - WHEN( "A flag is set via a nullary method" ) { - CHECK( config.abortAfter == 0 ); - - const char* argv[] = { "test", "-a" }; - parseInto( cli, argv, config ); - - THEN( "The flag is set" ) - REQUIRE( config.abortAfter == 1 ); - } - WHEN( "A flag is set via a unary method" ) { - CHECK( config.abortAfter == 0 ); - - const char* argv[] = { "test", "-x", "2" }; - parseInto( cli, argv, config ); - - THEN( "The flag is set" ) - REQUIRE( config.abortAfter == 2 ); - } - WHEN( "A positional argument is supplied" ) { - - const char* argv[] = { "test", "[hello]" }; - parseInto( cli, argv, config ); - - THEN( "The argument is in the testOrTags collection" ) { - REQUIRE( config.testsOrTags.size() == 1 ); - REQUIRE( config.testsOrTags[0] == "[hello]" ); - } - } - WHEN( "And enum opt is set by numeric value" ) { - CHECK( config.verbosity == Config::Verbosity::Normal ); - - const char* argv[] = { "test", "-v 0" }; - parseInto( cli, argv, config ); - - THEN( "The member is set to the enum value" ) - REQUIRE( config.verbosity == Config::Verbosity::NoOutput ); - } - } -} #endif diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index dc23bd58..f8bdcbc3 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -260,8 +260,7 @@ inline unsigned int Factorial( unsigned int number ) return number > 1 ? Factorial(number-1)*number : 1; } -TEST_CASE( "example/factorial", "The Factorial function should return the factorial of the number passed in" ) -{ +TEST_CASE( "Factorials are computed", "[factorial]" ) { REQUIRE( Factorial(0) == 1 ); REQUIRE( Factorial(1) == 1 ); REQUIRE( Factorial(2) == 2 ); diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index befe5a66..1272f597 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -71,8 +71,8 @@ TEST_CASE( "meta/Misc/Sections", "looped tests" ) { template void parseIntoConfig( const char * (&argv)[size], Catch::ConfigData& config ) { - static Catch::AllOptions options; - options.parseIntoConfig( Catch::CommandParser( size, argv ), config ); + Clara::CommandLine parser = Catch::makeCommandLineParser(); + parser.parseInto( size, argv, config ); } template @@ -89,11 +89,11 @@ std::string parseIntoConfigAndReturnError( const char * (&argv)[size], Catch::Co inline Catch::TestCase fakeTestCase( const char* name ){ return Catch::makeTestCase( NULL, "", name, "", CATCH_INTERNAL_LINEINFO ); } -TEST_CASE( "selftest/parser/2", "ConfigData" ) { +TEST_CASE( "Process can be configured on command line", "[config][command-line]" ) { Catch::ConfigData config; - SECTION( "default", "" ) { + SECTION( "default - no arguments", "" ) { const char* argv[] = { "test" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); @@ -104,8 +104,8 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { } SECTION( "test lists", "" ) { - SECTION( "-t/1", "Specify one test case using -t" ) { - const char* argv[] = { "test", "-t", "test1" }; + SECTION( "1 test", "Specify one test case using" ) { + const char* argv[] = { "test", "test1" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); Catch::Config cfg( config ); @@ -113,8 +113,8 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ); } - SECTION( "-t/exclude:1", "Specify one test case exclusion using -t exclude:" ) { - const char* argv[] = { "test", "-t", "exclude:test1" }; + SECTION( "Specify one test case exclusion using exclude:", "" ) { + const char* argv[] = { "test", "exclude:test1" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); Catch::Config cfg( config ); @@ -123,28 +123,8 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); } - SECTION( "--test/1", "Specify one test case using --test" ) { - const char* argv[] = { "test", "--test", "test1" }; - CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - - Catch::Config cfg( config ); - REQUIRE( cfg.filters().size() == 1 ); - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ); - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ); - } - - SECTION( "--test/exclude:1", "Specify one test case exclusion using --test exclude:" ) { - const char* argv[] = { "test", "--test", "exclude:test1" }; - CHECK_NOTHROW( parseIntoConfig( argv, config ) ); - - Catch::Config cfg( config ); - REQUIRE( cfg.filters().size() == 1 ); - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false ); - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); - } - - SECTION( "--test/exclude:2", "Specify one test case exclusion using --test ~" ) { - const char* argv[] = { "test", "--test", "~test1" }; + SECTION( "Specify one test case exclusion using ~", "" ) { + const char* argv[] = { "test", "~test1" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); Catch::Config cfg( config ); @@ -153,7 +133,7 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ); } - SECTION( "-t/2", "Specify two test cases using -t" ) { + SECTION( "Specify two test cases using -t", "" ) { const char* argv[] = { "test", "-t", "test1", "test2" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); @@ -163,11 +143,6 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ); REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test2" ) ) ); } - - SECTION( "-t/0", "When no test names are supplied it is an error" ) { - const char* argv[] = { "test", "-t" }; - REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "at least 1" ) ); - } } SECTION( "reporter", "" ) { @@ -189,10 +164,6 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { REQUIRE( config.reporterName == "junit" ); } - SECTION( "-r/error", "reporter config only accepts one argument" ) { - const char* argv[] = { "test", "-r", "one", "two" }; - REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "1 argument" ) ); - } } SECTION( "debugger", "" ) { @@ -208,42 +179,34 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { REQUIRE( config.shouldDebugBreak ); } - SECTION( "-b", "break option has no arguments" ) { - const char* argv[] = { "test", "-b", "unexpected" }; - REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "0 arguments" ) ); - } } SECTION( "abort", "" ) { - SECTION( "-a", "" ) { + SECTION( "-a aborts after first failure", "" ) { const char* argv[] = { "test", "-a" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); REQUIRE( config.abortAfter == 1 ); } - SECTION( "-a/2", "" ) { - const char* argv[] = { "test", "-a", "2" }; + SECTION( "-x 2 aborts after two failures", "" ) { + const char* argv[] = { "test", "-x", "2" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); REQUIRE( config.abortAfter == 2 ); } - SECTION( "-a/error/0", "" ) { - const char* argv[] = { "test", "-a", "0" }; + SECTION( "-x must be greater than zero", "" ) { + const char* argv[] = { "test", "-x", "0" }; REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "greater than zero" ) ); } - SECTION( "-a/error/non numeric", "" ) { - const char* argv[] = { "test", "-a", "oops" }; - REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "greater than zero" ) ); - } - SECTION( "-a/error/two args", "abortAfter only takes one argument" ) { - const char* argv[] = { "test", "-a", "1", "2" }; - REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "0 and 1 argument" ) ); + SECTION( "-x must be numeric", "" ) { + const char* argv[] = { "test", "-x", "oops" }; + REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "-x" ) ); } } SECTION( "nothrow", "" ) { - SECTION( "-nt", "" ) { - const char* argv[] = { "test", "-nt" }; + SECTION( "-e", "" ) { + const char* argv[] = { "test", "-e" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); REQUIRE( config.noThrow == true ); @@ -272,8 +235,8 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { } SECTION( "combinations", "" ) { - SECTION( "-a -b", "" ) { - const char* argv[] = { "test", "-a", "-b", "-nt" }; + SECTION( "Single character flags can be combined", "" ) { + const char* argv[] = { "test", "-abe" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); CHECK( config.abortAfter == 1 ); From 2ed56c47a6abea102c6f33dd7a45a03a501c1baa Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 4 Jun 2013 08:38:40 +0100 Subject: [PATCH 272/296] Removed legacy cli parser --- include/internal/catch_commandline.hpp | 640 ------------------------- projects/SelfTest/TestMain.cpp | 19 - 2 files changed, 659 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index d6d969ed..dbf45c07 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -13,646 +13,6 @@ #include "clara.h" namespace Catch { - - class Command { - public: - Command(){} - - explicit Command( std::string const& name ) : m_name( name ) { - } - - Command& operator += ( std::string const& arg ) { - m_args.push_back( arg ); - return *this; - } - Command& operator += ( Command const& other ) { - std::copy( other.m_args.begin(), other.m_args.end(), std::back_inserter( m_args ) ); - if( m_name.empty() ) - m_name = other.m_name; - return *this; - } - Command operator + ( Command const& other ) { - Command newCommand( *this ); - newCommand += other; - return newCommand; - } - - operator SafeBool::type() const { - return SafeBool::makeSafe( !m_name.empty() || !m_args.empty() ); - } - - std::string name() const { return m_name; } - std::string operator[]( std::size_t i ) const { return m_args[i]; } - std::size_t argsCount() const { return m_args.size(); } - - void raiseError( std::string const& message ) const { - std::ostringstream oss; - if( m_name.empty() ) - oss << "Error while parsing " << m_name << ". " << message << "."; - else - oss << "Error while parsing arguments. " << message << "."; - - if( m_args.size() > 0 ) - oss << " Arguments were:"; - for( std::size_t i = 0; i < m_args.size(); ++i ) - oss << " " << m_args[i]; - if( isTrue( true ) ) - throw std::domain_error( oss.str() ); - } - - private: - - std::string m_name; - std::vector m_args; - }; - - class CommandParser { - public: - CommandParser( int argc, char const * const * argv ) : m_argc( static_cast( argc ) ), m_argv( argv ) {} - - std::string exeName() const { - std::string exeName = m_argv[0]; - std::string::size_type pos = exeName.find_last_of( "/\\" ); - if( pos != std::string::npos ) - exeName = exeName.substr( pos+1 ); - return exeName; - } - Command find( std::string const& arg1, std::string const& arg2, std::string const& arg3 ) const { - return find( arg1 ) + find( arg2 ) + find( arg3 ); - } - - Command find( std::string const& shortArg, std::string const& longArg ) const { - return find( shortArg ) + find( longArg ); - } - Command find( std::string const& arg ) const { - if( arg.empty() ) - return getArgs( "", 1 ); - else - for( std::size_t i = 1; i < m_argc; ++i ) - if( m_argv[i] == arg ) - return getArgs( m_argv[i], i+1 ); - return Command(); - } - Command getDefaultArgs() const { - return getArgs( "", 1 ); - } - - private: - Command getArgs( std::string const& cmdName, std::size_t from ) const { - Command command( cmdName ); - for( std::size_t i = from; i < m_argc && m_argv[i][0] != '-'; ++i ) - command += m_argv[i]; - return command; - } - - std::size_t m_argc; - char const * const * m_argv; - }; - - class OptionParser : public SharedImpl { - public: - OptionParser( int minArgs = 0, int maxArgs = 0 ) - : m_minArgs( minArgs ), m_maxArgs( maxArgs ) - {} - - virtual ~OptionParser() {} - - Command find( CommandParser const& parser ) const { - Command cmd; - for( std::vector::const_iterator it = m_optionNames.begin(); - it != m_optionNames.end(); - ++it ) - cmd += parser.find( *it ); - return cmd; - } - - void validateArgs( Command const& args ) const { - if( tooFewArgs( args ) || tooManyArgs( args ) ) { - std::ostringstream oss; - if( m_maxArgs == -1 ) - oss <<"Expected at least " << pluralise( static_cast( m_minArgs ), "argument" ); - else if( m_minArgs == m_maxArgs ) - oss <<"Expected " << pluralise( static_cast( m_minArgs ), "argument" ); - else - oss <<"Expected between " << m_minArgs << " and " << m_maxArgs << " argument"; - args.raiseError( oss.str() ); - } - } - - void parseIntoConfig( CommandParser const& parser, ConfigData& config ) { - if( Command cmd = find( parser ) ) { - validateArgs( cmd ); - parseIntoConfig( cmd, config ); - } - } - - virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) = 0; - virtual std::string argsSynopsis() const = 0; - virtual std::string optionSummary() const = 0; - virtual std::string optionDescription() const { return ""; } - - std::string optionNames() const { - std::string names; - for( std::vector::const_iterator it = m_optionNames.begin(); - it != m_optionNames.end(); - ++it ) { - if( !it->empty() ) { - if( !names.empty() ) - names += ", "; - names += *it; - } - else { - names = "[" + names; - } - } - if( names[0] == '[' ) - names += "]"; - return names; - } - - protected: - - bool tooFewArgs( Command const& args ) const { - return args.argsCount() < static_cast( m_minArgs ); - } - bool tooManyArgs( Command const& args ) const { - return m_maxArgs >= 0 && args.argsCount() > static_cast( m_maxArgs ); - } - std::vector m_optionNames; - int m_minArgs; - int m_maxArgs; - }; - - namespace Options { - - class HelpOptionParser : public OptionParser { - public: - HelpOptionParser() { - m_optionNames.push_back( "-?" ); - m_optionNames.push_back( "-h" ); - m_optionNames.push_back( "--help" ); - } - virtual std::string argsSynopsis() const { - return "[ -MiscTests.cpp" line="266"> +MiscTests.cpp" line="265"> Factorial(1) == 1 @@ -10267,7 +9502,7 @@ MiscTests.cpp" line="266"> 1 == 1 -MiscTests.cpp" line="267"> +MiscTests.cpp" line="266"> Factorial(2) == 2 @@ -10275,7 +9510,7 @@ MiscTests.cpp" line="267"> 2 == 2 -MiscTests.cpp" line="268"> +MiscTests.cpp" line="267"> Factorial(3) == 6 @@ -10283,7 +9518,7 @@ MiscTests.cpp" line="268"> 6 == 6 -MiscTests.cpp" line="269"> +MiscTests.cpp" line="268"> Factorial(10) == 3628800 @@ -10309,7 +9544,7 @@ MiscTests.cpp" line="269"> -MiscTests.cpp" line="300"> +MiscTests.cpp" line="299"> v.size() == 5 @@ -10317,7 +9552,7 @@ MiscTests.cpp" line="300"> 5 == 5 -MiscTests.cpp" line="301"> +MiscTests.cpp" line="300"> v.capacity() >= 5 @@ -10326,7 +9561,7 @@ MiscTests.cpp" line="301">
-MiscTests.cpp" line="306"> +MiscTests.cpp" line="305"> v.size() == 10 @@ -10334,7 +9569,7 @@ MiscTests.cpp" line="306"> 10 == 10 -MiscTests.cpp" line="307"> +MiscTests.cpp" line="306"> v.capacity() >= 10 @@ -10344,7 +9579,7 @@ MiscTests.cpp" line="307">
-MiscTests.cpp" line="300"> +MiscTests.cpp" line="299"> v.size() == 5 @@ -10352,7 +9587,7 @@ MiscTests.cpp" line="300"> 5 == 5 -MiscTests.cpp" line="301"> +MiscTests.cpp" line="300"> v.capacity() >= 5 @@ -10361,7 +9596,7 @@ MiscTests.cpp" line="301">
-MiscTests.cpp" line="312"> +MiscTests.cpp" line="311"> v.size() == 0 @@ -10369,7 +9604,7 @@ MiscTests.cpp" line="312"> 0 == 0 -MiscTests.cpp" line="313"> +MiscTests.cpp" line="312"> v.capacity() >= 5 @@ -10378,7 +9613,7 @@ MiscTests.cpp" line="313">
-MiscTests.cpp" line="319"> +MiscTests.cpp" line="318"> v.capacity() == 0 @@ -10390,7 +9625,7 @@ MiscTests.cpp" line="319">
-MiscTests.cpp" line="300"> +MiscTests.cpp" line="299"> v.size() == 5 @@ -10398,7 +9633,7 @@ MiscTests.cpp" line="300"> 5 == 5 -MiscTests.cpp" line="301"> +MiscTests.cpp" line="300"> v.capacity() >= 5 @@ -10407,7 +9642,7 @@ MiscTests.cpp" line="301">
-MiscTests.cpp" line="312"> +MiscTests.cpp" line="311"> v.size() == 0 @@ -10415,7 +9650,7 @@ MiscTests.cpp" line="312"> 0 == 0 -MiscTests.cpp" line="313"> +MiscTests.cpp" line="312"> v.capacity() >= 5 @@ -10425,7 +9660,7 @@ MiscTests.cpp" line="313">
-MiscTests.cpp" line="300"> +MiscTests.cpp" line="299"> v.size() == 5 @@ -10433,7 +9668,7 @@ MiscTests.cpp" line="300"> 5 == 5 -MiscTests.cpp" line="301"> +MiscTests.cpp" line="300"> v.capacity() >= 5 @@ -10442,7 +9677,7 @@ MiscTests.cpp" line="301">
-MiscTests.cpp" line="325"> +MiscTests.cpp" line="324"> v.size() == 5 @@ -10450,7 +9685,7 @@ MiscTests.cpp" line="325"> 5 == 5 -MiscTests.cpp" line="326"> +MiscTests.cpp" line="325"> v.capacity() >= 10 @@ -10460,7 +9695,7 @@ MiscTests.cpp" line="326">
-MiscTests.cpp" line="300"> +MiscTests.cpp" line="299"> v.size() == 5 @@ -10468,7 +9703,7 @@ MiscTests.cpp" line="300"> 5 == 5 -MiscTests.cpp" line="301"> +MiscTests.cpp" line="300"> v.capacity() >= 5 @@ -10477,7 +9712,7 @@ MiscTests.cpp" line="301">
-MiscTests.cpp" line="331"> +MiscTests.cpp" line="330"> v.size() == 5 @@ -10485,7 +9720,7 @@ MiscTests.cpp" line="331"> 5 == 5 -MiscTests.cpp" line="332"> +MiscTests.cpp" line="331"> v.capacity() >= 5 @@ -10578,8 +9813,8 @@ TestMain.cpp" line="59"> - -
+ +
TestMain.cpp" line="98"> parseIntoConfig( argv, config ) @@ -10623,7 +9858,7 @@ TestMain.cpp" line="103">
-
+
TestMain.cpp" line="109"> parseIntoConfig( argv, config ) @@ -10661,7 +9896,7 @@ TestMain.cpp" line="114">
-
+
TestMain.cpp" line="118"> parseIntoConfig( argv, config ) @@ -10699,7 +9934,7 @@ TestMain.cpp" line="123">
-
+
TestMain.cpp" line="128"> parseIntoConfig( argv, config ) @@ -10718,7 +9953,7 @@ TestMain.cpp" line="131"> TestMain.cpp" line="132"> - cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false + cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false false == false @@ -10726,7 +9961,7 @@ TestMain.cpp" line="132"> TestMain.cpp" line="133"> - cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) + cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) true @@ -10737,7 +9972,7 @@ TestMain.cpp" line="133">
-
+
TestMain.cpp" line="138"> parseIntoConfig( argv, config ) @@ -10756,89 +9991,13 @@ TestMain.cpp" line="141"> TestMain.cpp" line="142"> - cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false + cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false false == false TestMain.cpp" line="143"> - - cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) - - - true - - - -
- -
-
-
-TestMain.cpp" line="148"> - - parseIntoConfig( argv, config ) - - - parseIntoConfig( argv, config ) - - -TestMain.cpp" line="151"> - - cfg.filters().size() == 1 - - - 1 == 1 - - -TestMain.cpp" line="152"> - - cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false - - - false == false - - -TestMain.cpp" line="153"> - - cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) - - - true - - - -
- -
-
-
-TestMain.cpp" line="158"> - - parseIntoConfig( argv, config ) - - - parseIntoConfig( argv, config ) - - -TestMain.cpp" line="161"> - - cfg.filters().size() == 1 - - - 1 == 1 - - -TestMain.cpp" line="162"> - - cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false - - - false == false - - -TestMain.cpp" line="163"> cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) @@ -10846,7 +10005,7 @@ TestMain.cpp" line="163"> true -TestMain.cpp" line="164"> +TestMain.cpp" line="144"> cfg.filters()[0].shouldInclude( fakeTestCase( "test2" ) ) @@ -10858,26 +10017,12 @@ TestMain.cpp" line="164">
-
-
-TestMain.cpp" line="169"> - - parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) - - - "Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" - - - -
- -
-TestMain.cpp" line="176"> +TestMain.cpp" line="151"> parseIntoConfig( argv, config ) @@ -10885,7 +10030,7 @@ TestMain.cpp" line="176"> parseIntoConfig( argv, config ) -TestMain.cpp" line="178"> +TestMain.cpp" line="153"> config.reporterName == "console" @@ -10899,7 +10044,7 @@ TestMain.cpp" line="178">
-TestMain.cpp" line="182"> +TestMain.cpp" line="157"> parseIntoConfig( argv, config ) @@ -10907,7 +10052,7 @@ TestMain.cpp" line="182"> parseIntoConfig( argv, config ) -TestMain.cpp" line="184"> +TestMain.cpp" line="159"> config.reporterName == "xml" @@ -10921,7 +10066,7 @@ TestMain.cpp" line="184">
-TestMain.cpp" line="188"> +TestMain.cpp" line="163"> parseIntoConfig( argv, config ) @@ -10929,7 +10074,7 @@ TestMain.cpp" line="188"> parseIntoConfig( argv, config ) -TestMain.cpp" line="190"> +TestMain.cpp" line="165"> config.reporterName == "junit" @@ -10941,26 +10086,12 @@ TestMain.cpp" line="190">
-
-
-TestMain.cpp" line="194"> - - parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) - - - "Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" - - - -
- -
-TestMain.cpp" line="201"> +TestMain.cpp" line="172"> parseIntoConfig( argv, config ) @@ -10968,7 +10099,7 @@ TestMain.cpp" line="201"> parseIntoConfig( argv, config ) -TestMain.cpp" line="203"> +TestMain.cpp" line="174"> config.shouldDebugBreak == true @@ -10982,7 +10113,7 @@ TestMain.cpp" line="203">
-TestMain.cpp" line="207"> +TestMain.cpp" line="178"> parseIntoConfig( argv, config ) @@ -10990,7 +10121,7 @@ TestMain.cpp" line="207"> parseIntoConfig( argv, config ) -TestMain.cpp" line="209"> +TestMain.cpp" line="180"> config.shouldDebugBreak @@ -11002,26 +10133,12 @@ TestMain.cpp" line="209">
-
-
-TestMain.cpp" line="213"> - - parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) - - - "Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" - - - -
- -
-
-TestMain.cpp" line="220"> +
+TestMain.cpp" line="187"> parseIntoConfig( argv, config ) @@ -11029,7 +10146,7 @@ TestMain.cpp" line="220"> parseIntoConfig( argv, config ) -TestMain.cpp" line="222"> +TestMain.cpp" line="189"> config.abortAfter == 1 @@ -11042,8 +10159,8 @@ TestMain.cpp" line="222">
-
-TestMain.cpp" line="226"> +
+TestMain.cpp" line="193"> parseIntoConfig( argv, config ) @@ -11051,7 +10168,7 @@ TestMain.cpp" line="226"> parseIntoConfig( argv, config ) -TestMain.cpp" line="228"> +TestMain.cpp" line="195"> config.abortAfter == 2 @@ -11064,13 +10181,13 @@ TestMain.cpp" line="228">
-
-TestMain.cpp" line="232"> +
+TestMain.cpp" line="199"> parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) - "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" + "Value after -x or --abortAfter must be greater than zero while parsing: (-x, --abortx <number of failures>)" contains: "greater than zero" @@ -11078,27 +10195,13 @@ TestMain.cpp" line="232">
-
-TestMain.cpp" line="236"> +
+TestMain.cpp" line="203"> - parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) + parseIntoConfigAndReturnError( argv, config ) Contains( "-x" ) - "Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" - - - -
- -
-
-
-TestMain.cpp" line="240"> - - parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) - - - "Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" + "Unable to convert oops to destination type while parsing: (-x, --abortx <number of failures>)" contains: "-x" @@ -11109,8 +10212,8 @@ TestMain.cpp" line="240">
-
-TestMain.cpp" line="247"> +
+TestMain.cpp" line="210"> parseIntoConfig( argv, config ) @@ -11118,7 +10221,7 @@ TestMain.cpp" line="247"> parseIntoConfig( argv, config ) -TestMain.cpp" line="249"> +TestMain.cpp" line="212"> config.noThrow == true @@ -11132,7 +10235,7 @@ TestMain.cpp" line="249">
-TestMain.cpp" line="253"> +TestMain.cpp" line="216"> parseIntoConfig( argv, config ) @@ -11140,7 +10243,7 @@ TestMain.cpp" line="253"> parseIntoConfig( argv, config ) -TestMain.cpp" line="255"> +TestMain.cpp" line="218"> config.noThrow == true @@ -11157,7 +10260,7 @@ TestMain.cpp" line="255">
-TestMain.cpp" line="262"> +TestMain.cpp" line="225"> parseIntoConfig( argv, config ) @@ -11165,7 +10268,7 @@ TestMain.cpp" line="262"> parseIntoConfig( argv, config ) -TestMain.cpp" line="264"> +TestMain.cpp" line="227"> config.outputFilename == "filename.ext" @@ -11179,7 +10282,7 @@ TestMain.cpp" line="264">
-TestMain.cpp" line="268"> +TestMain.cpp" line="231"> parseIntoConfig( argv, config ) @@ -11187,7 +10290,7 @@ TestMain.cpp" line="268"> parseIntoConfig( argv, config ) -TestMain.cpp" line="270"> +TestMain.cpp" line="233"> config.outputFilename == "filename.ext" @@ -11203,8 +10306,8 @@ TestMain.cpp" line="270">
-
-TestMain.cpp" line="277"> +
+TestMain.cpp" line="240"> parseIntoConfig( argv, config ) @@ -11212,7 +10315,7 @@ TestMain.cpp" line="277"> parseIntoConfig( argv, config ) -TestMain.cpp" line="279"> +TestMain.cpp" line="242"> config.abortAfter == 1 @@ -11220,7 +10323,7 @@ TestMain.cpp" line="279"> 1 == 1 -TestMain.cpp" line="280"> +TestMain.cpp" line="243"> config.shouldDebugBreak @@ -11228,7 +10331,7 @@ TestMain.cpp" line="280"> true -TestMain.cpp" line="281"> +TestMain.cpp" line="244"> config.noThrow == true @@ -11243,7 +10346,7 @@ TestMain.cpp" line="281"> -TestMain.cpp" line="290"> +TestMain.cpp" line="253"> matchAny.shouldInclude( fakeTestCase( "any" ) ) @@ -11251,7 +10354,7 @@ TestMain.cpp" line="290"> true -TestMain.cpp" line="291"> +TestMain.cpp" line="254"> matchNone.shouldInclude( fakeTestCase( "any" ) ) == false @@ -11259,7 +10362,7 @@ TestMain.cpp" line="291"> false == false -TestMain.cpp" line="296"> +TestMain.cpp" line="259"> matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false @@ -11267,7 +10370,7 @@ TestMain.cpp" line="296"> false == false -TestMain.cpp" line="297"> +TestMain.cpp" line="260"> matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) @@ -11275,7 +10378,7 @@ TestMain.cpp" line="297"> true -TestMain.cpp" line="299"> +TestMain.cpp" line="262"> matchHidden.shouldInclude( fakeTestCase( "./any" ) ) @@ -11283,7 +10386,7 @@ TestMain.cpp" line="299"> true -TestMain.cpp" line="300"> +TestMain.cpp" line="263"> matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false @@ -11294,7 +10397,7 @@ TestMain.cpp" line="300"> -TestMain.cpp" line="311"> +TestMain.cpp" line="274"> matchHidden.shouldInclude( fakeTestCase( "./something" ) ) @@ -11302,7 +10405,7 @@ TestMain.cpp" line="311"> true -TestMain.cpp" line="313"> +TestMain.cpp" line="276"> filters.shouldInclude( fakeTestCase( "any" ) ) == false @@ -11310,7 +10413,7 @@ TestMain.cpp" line="313"> false == false -TestMain.cpp" line="314"> +TestMain.cpp" line="277"> filters.shouldInclude( fakeTestCase( "./something" ) ) @@ -11318,7 +10421,7 @@ TestMain.cpp" line="314"> true -TestMain.cpp" line="315"> +TestMain.cpp" line="278"> filters.shouldInclude( fakeTestCase( "./anything" ) ) == false @@ -11329,7 +10432,7 @@ TestMain.cpp" line="315"> -TestMain.cpp" line="321"> +TestMain.cpp" line="284"> matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) @@ -11337,7 +10440,7 @@ TestMain.cpp" line="321"> true -TestMain.cpp" line="322"> +TestMain.cpp" line="285"> matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false @@ -11348,7 +10451,7 @@ TestMain.cpp" line="322"> -TestMain.cpp" line="327"> +TestMain.cpp" line="290"> matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) @@ -11356,7 +10459,7 @@ TestMain.cpp" line="327"> true -TestMain.cpp" line="328"> +TestMain.cpp" line="291"> matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) @@ -11364,7 +10467,7 @@ TestMain.cpp" line="328"> true -TestMain.cpp" line="329"> +TestMain.cpp" line="292"> matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) @@ -11372,7 +10475,7 @@ TestMain.cpp" line="329"> true -TestMain.cpp" line="330"> +TestMain.cpp" line="293"> matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false @@ -11382,44 +10485,9 @@ TestMain.cpp" line="330"> - -TestMain.cpp" line="350"> - - opt.parseIntoConfig( parser, config ) - - - opt.parseIntoConfig( parser, config ) - - -TestMain.cpp" line="353"> - - cfg.filters().size() == 1 - - - 1 == 1 - - -TestMain.cpp" line="354"> - - cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false - - - false == false - - -TestMain.cpp" line="355"> - - cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) - - - true - - - -
-TestMain.cpp" line="369"> +TestMain.cpp" line="313"> oneTag.getTestCaseInfo().description == "" @@ -11427,7 +10495,7 @@ TestMain.cpp" line="369"> "" == "" -TestMain.cpp" line="370"> +TestMain.cpp" line="314"> oneTag.hasTag( "one" ) @@ -11435,7 +10503,7 @@ TestMain.cpp" line="370"> true -TestMain.cpp" line="371"> +TestMain.cpp" line="315"> oneTag.getTags().size() == 1 @@ -11443,7 +10511,7 @@ TestMain.cpp" line="371"> 1 == 1 -TestMain.cpp" line="373"> +TestMain.cpp" line="317"> oneTag.matchesTags( p1 ) == true @@ -11451,7 +10519,7 @@ TestMain.cpp" line="373"> true == true -TestMain.cpp" line="374"> +TestMain.cpp" line="318"> oneTag.matchesTags( p2 ) == true @@ -11459,7 +10527,7 @@ TestMain.cpp" line="374"> true == true -TestMain.cpp" line="375"> +TestMain.cpp" line="319"> oneTag.matchesTags( p3 ) == false @@ -11467,7 +10535,7 @@ TestMain.cpp" line="375"> false == false -TestMain.cpp" line="376"> +TestMain.cpp" line="320"> oneTag.matchesTags( p4 ) == false @@ -11475,7 +10543,7 @@ TestMain.cpp" line="376"> false == false -TestMain.cpp" line="377"> +TestMain.cpp" line="321"> oneTag.matchesTags( p5 ) == false @@ -11486,7 +10554,7 @@ TestMain.cpp" line="377">
-TestMain.cpp" line="383"> +TestMain.cpp" line="327"> twoTags.getTestCaseInfo().description == "" @@ -11494,7 +10562,7 @@ TestMain.cpp" line="383"> "" == "" -TestMain.cpp" line="384"> +TestMain.cpp" line="328"> twoTags.hasTag( "one" ) @@ -11502,7 +10570,7 @@ TestMain.cpp" line="384"> true -TestMain.cpp" line="385"> +TestMain.cpp" line="329"> twoTags.hasTag( "two" ) @@ -11510,7 +10578,7 @@ TestMain.cpp" line="385"> true -TestMain.cpp" line="386"> +TestMain.cpp" line="330"> twoTags.hasTag( "Two" ) @@ -11518,7 +10586,7 @@ TestMain.cpp" line="386"> true -TestMain.cpp" line="387"> +TestMain.cpp" line="331"> twoTags.hasTag( "three" ) == false @@ -11526,7 +10594,7 @@ TestMain.cpp" line="387"> false == false -TestMain.cpp" line="388"> +TestMain.cpp" line="332"> twoTags.getTags().size() == 2 @@ -11534,7 +10602,7 @@ TestMain.cpp" line="388"> 2 == 2 -TestMain.cpp" line="390"> +TestMain.cpp" line="334"> twoTags.matchesTags( p1 ) == true @@ -11542,7 +10610,7 @@ TestMain.cpp" line="390"> true == true -TestMain.cpp" line="391"> +TestMain.cpp" line="335"> twoTags.matchesTags( p2 ) == true @@ -11550,7 +10618,7 @@ TestMain.cpp" line="391"> true == true -TestMain.cpp" line="392"> +TestMain.cpp" line="336"> twoTags.matchesTags( p3 ) == true @@ -11558,7 +10626,7 @@ TestMain.cpp" line="392"> true == true -TestMain.cpp" line="393"> +TestMain.cpp" line="337"> twoTags.matchesTags( p4 ) == true @@ -11566,7 +10634,7 @@ TestMain.cpp" line="393"> true == true -TestMain.cpp" line="394"> +TestMain.cpp" line="338"> twoTags.matchesTags( p5 ) == true @@ -11577,7 +10645,7 @@ TestMain.cpp" line="394">
-TestMain.cpp" line="400"> +TestMain.cpp" line="344"> oneTagWithExtras.getTestCaseInfo().description == "1234" @@ -11585,7 +10653,7 @@ TestMain.cpp" line="400"> "1234" == "1234" -TestMain.cpp" line="401"> +TestMain.cpp" line="345"> oneTagWithExtras.hasTag( "one" ) @@ -11593,7 +10661,7 @@ TestMain.cpp" line="401"> true -TestMain.cpp" line="402"> +TestMain.cpp" line="346"> oneTagWithExtras.hasTag( "two" ) == false @@ -11601,7 +10669,7 @@ TestMain.cpp" line="402"> false == false -TestMain.cpp" line="403"> +TestMain.cpp" line="347"> oneTagWithExtras.getTags().size() == 1 @@ -11612,7 +10680,7 @@ TestMain.cpp" line="403">
-TestMain.cpp" line="410"> +TestMain.cpp" line="354"> oneTagOpen.getTestCaseInfo().description == "[one" @@ -11620,7 +10688,7 @@ TestMain.cpp" line="410"> "[one" == "[one" -TestMain.cpp" line="411"> +TestMain.cpp" line="355"> oneTagOpen.hasTag( "one" ) == false @@ -11628,7 +10696,7 @@ TestMain.cpp" line="411"> false == false -TestMain.cpp" line="412"> +TestMain.cpp" line="356"> oneTagOpen.getTags().size() == 0 @@ -11639,7 +10707,7 @@ TestMain.cpp" line="412">
-TestMain.cpp" line="418"> +TestMain.cpp" line="362"> oneTag.getTestCaseInfo().description == "" @@ -11647,7 +10715,7 @@ TestMain.cpp" line="418"> "" == "" -TestMain.cpp" line="419"> +TestMain.cpp" line="363"> oneTag.hasTag( "hide" ) @@ -11655,7 +10723,7 @@ TestMain.cpp" line="419"> true -TestMain.cpp" line="420"> +TestMain.cpp" line="364"> oneTag.isHidden() @@ -11663,7 +10731,7 @@ TestMain.cpp" line="420"> true -TestMain.cpp" line="422"> +TestMain.cpp" line="366"> oneTag.matchesTags( "~[hide]" ) == false @@ -11678,7 +10746,7 @@ TestMain.cpp" line="422">
-TestMain.cpp" line="435"> +TestMain.cpp" line="379"> Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString @@ -11688,7 +10756,7 @@ TestMain.cpp" line="435"> "one two three four" -TestMain.cpp" line="436"> +TestMain.cpp" line="380"> Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString @@ -11704,7 +10772,7 @@ TestMain.cpp" line="436">
-TestMain.cpp" line="439"> +TestMain.cpp" line="383"> Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" @@ -11716,7 +10784,7 @@ four" four" -TestMain.cpp" line="440"> +TestMain.cpp" line="384"> Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" @@ -11728,7 +10796,7 @@ four" four" -TestMain.cpp" line="441"> +TestMain.cpp" line="385"> Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" @@ -11740,7 +10808,7 @@ four" four" -TestMain.cpp" line="442"> +TestMain.cpp" line="386"> Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" @@ -11752,7 +10820,7 @@ four" four" -TestMain.cpp" line="443"> +TestMain.cpp" line="387"> Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" @@ -11770,7 +10838,7 @@ three four"
-TestMain.cpp" line="446"> +TestMain.cpp" line="390"> Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" @@ -11784,7 +10852,7 @@ three four" -TestMain.cpp" line="447"> +TestMain.cpp" line="391"> Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" @@ -11798,7 +10866,7 @@ three four" -TestMain.cpp" line="448"> +TestMain.cpp" line="392"> Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" @@ -11818,7 +10886,7 @@ four"
-TestMain.cpp" line="451"> +TestMain.cpp" line="395"> Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" @@ -11834,7 +10902,7 @@ three four" -TestMain.cpp" line="452"> +TestMain.cpp" line="396"> Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" @@ -11856,7 +10924,7 @@ four"
-TestMain.cpp" line="455"> +TestMain.cpp" line="399"> Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" @@ -11868,7 +10936,7 @@ def" def" -TestMain.cpp" line="456"> +TestMain.cpp" line="400"> Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" @@ -11880,7 +10948,7 @@ defg" defg" -TestMain.cpp" line="457"> +TestMain.cpp" line="401"> Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" @@ -11894,7 +10962,7 @@ def- gh" -TestMain.cpp" line="459"> +TestMain.cpp" line="403"> Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" @@ -11912,7 +10980,7 @@ ee four" -TestMain.cpp" line="460"> +TestMain.cpp" line="404"> Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" @@ -11938,7 +11006,7 @@ ur"
-TestMain.cpp" line="464"> +TestMain.cpp" line="408"> text.size() == 4 @@ -11946,7 +11014,7 @@ TestMain.cpp" line="464"> 4 == 4 -TestMain.cpp" line="465"> +TestMain.cpp" line="409"> text[0] == "one" @@ -11954,7 +11022,7 @@ TestMain.cpp" line="465"> "one" == "one" -TestMain.cpp" line="466"> +TestMain.cpp" line="410"> text[1] == "two" @@ -11962,7 +11030,7 @@ TestMain.cpp" line="466"> "two" == "two" -TestMain.cpp" line="467"> +TestMain.cpp" line="411"> text[2] == "three" @@ -11970,7 +11038,7 @@ TestMain.cpp" line="467"> "three" == "three" -TestMain.cpp" line="468"> +TestMain.cpp" line="412"> text[3] == "four" @@ -11984,7 +11052,7 @@ TestMain.cpp" line="468">
-TestMain.cpp" line="475"> +TestMain.cpp" line="419"> text.toString() == " one two\n three\n four" @@ -12007,7 +11075,7 @@ TestMain.cpp" line="475">
-TestMain.cpp" line="486"> +TestMain.cpp" line="430"> Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString @@ -12019,7 +11087,7 @@ three four" three four" -TestMain.cpp" line="487"> +TestMain.cpp" line="431"> Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString @@ -12031,7 +11099,7 @@ three four" three four" -TestMain.cpp" line="488"> +TestMain.cpp" line="432"> Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString @@ -12049,7 +11117,7 @@ three four"
-TestMain.cpp" line="491"> +TestMain.cpp" line="435"> Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" @@ -12061,7 +11129,7 @@ TestMain.cpp" line="491"> " -TestMain.cpp" line="492"> +TestMain.cpp" line="436"> Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" @@ -12069,7 +11137,7 @@ TestMain.cpp" line="492"> "abcdef" == "abcdef" -TestMain.cpp" line="493"> +TestMain.cpp" line="437"> Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" @@ -12087,7 +11155,7 @@ TestMain.cpp" line="493">
-TestMain.cpp" line="496"> +TestMain.cpp" line="440"> Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" @@ -12101,7 +11169,7 @@ three four" -TestMain.cpp" line="497"> +TestMain.cpp" line="441"> Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" @@ -12115,7 +11183,7 @@ three four" -TestMain.cpp" line="498"> +TestMain.cpp" line="442"> Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" @@ -12135,7 +11203,7 @@ four"
-TestMain.cpp" line="501"> +TestMain.cpp" line="445"> Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" @@ -12159,7 +11227,7 @@ four"
-TestMain.cpp" line="511"> +TestMain.cpp" line="455"> Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" @@ -12183,7 +11251,7 @@ TestMain.cpp" line="511"> -TestMain.cpp" line="611"> +TestMain.cpp" line="555"> Text( "hi there" ).toString() == "hi there" @@ -12191,7 +11259,7 @@ TestMain.cpp" line="611"> "hi there" == "hi there" -TestMain.cpp" line="616"> +TestMain.cpp" line="560"> Text( "hi there", narrow ).toString() == "hi\nthere" @@ -12734,8 +11802,19 @@ BDDTests.cpp" line="54"> +
+CmdLineTests.cpp" line="64"> + + config.processName == "test" + + + "test" == "test" + + + +
-CmdLineTests.cpp" line="62"> +CmdLineTests.cpp" line="70"> config.fileName == "filename.ext" @@ -12746,7 +11825,7 @@ CmdLineTests.cpp" line="62">
-CmdLineTests.cpp" line="68"> +CmdLineTests.cpp" line="76"> config.fileName == "filename.ext" @@ -12757,7 +11836,7 @@ CmdLineTests.cpp" line="68">
-CmdLineTests.cpp" line="74"> +CmdLineTests.cpp" line="82"> config.fileName == "filename.ext" @@ -12768,7 +11847,7 @@ CmdLineTests.cpp" line="74">
-CmdLineTests.cpp" line="80"> +CmdLineTests.cpp" line="88"> config.fileName == "%stdout" @@ -12779,7 +11858,7 @@ CmdLineTests.cpp" line="80">
-CmdLineTests.cpp" line="91"> +CmdLineTests.cpp" line="99"> config.number == 42 @@ -12790,7 +11869,7 @@ CmdLineTests.cpp" line="91">
-CmdLineTests.cpp" line="95"> +CmdLineTests.cpp" line="103"> parseInto( cli, argv, config ) @@ -12798,7 +11877,7 @@ CmdLineTests.cpp" line="95"> parseInto( cli, argv, config ) -CmdLineTests.cpp" line="97"> +CmdLineTests.cpp" line="105"> config.number == 0 @@ -12809,7 +11888,7 @@ CmdLineTests.cpp" line="97">
-CmdLineTests.cpp" line="115"> +CmdLineTests.cpp" line="123"> config1.number == 42 @@ -12817,7 +11896,7 @@ CmdLineTests.cpp" line="115"> 42 == 42 -CmdLineTests.cpp" line="117"> +CmdLineTests.cpp" line="125"> !unusedTokens.empty() @@ -12825,7 +11904,7 @@ CmdLineTests.cpp" line="117"> !false -CmdLineTests.cpp" line="119"> +CmdLineTests.cpp" line="127"> config2.description == "some text" @@ -12837,7 +11916,7 @@ CmdLineTests.cpp" line="119">
-CmdLineTests.cpp" line="132"> +CmdLineTests.cpp" line="140"> config.index == 3 @@ -12851,7 +11930,7 @@ CmdLineTests.cpp" line="132">
-CmdLineTests.cpp" line="137"> +CmdLineTests.cpp" line="145"> parseInto( cli, argv, config ) @@ -12868,7 +11947,7 @@ CmdLineTests.cpp" line="137">
-CmdLineTests.cpp" line="150"> +CmdLineTests.cpp" line="158"> config.flag @@ -12882,7 +11961,7 @@ CmdLineTests.cpp" line="150">
-CmdLineTests.cpp" line="156"> +CmdLineTests.cpp" line="164"> config.flag == false @@ -12898,7 +11977,7 @@ CmdLineTests.cpp" line="156">
-CmdLineTests.cpp" line="177"> +CmdLineTests.cpp" line="185"> config.firstPos == "1st" @@ -12906,7 +11985,7 @@ CmdLineTests.cpp" line="177"> "1st" == "1st" -CmdLineTests.cpp" line="178"> +CmdLineTests.cpp" line="186"> config.secondPos == "2nd" @@ -12914,7 +11993,7 @@ CmdLineTests.cpp" line="178"> "2nd" == "2nd" -CmdLineTests.cpp" line="179"> +CmdLineTests.cpp" line="187"> config.unpositional == "3rd" @@ -12926,248 +12005,9 @@ CmdLineTests.cpp" line="179">
- -
-
-
- -
- -
- -
-
-
- -
- -
-
-
-CmdLineTests.cpp" line="332"> - - !config.showSuccessfulTests - - - !false - - -CmdLineTests.cpp" line="333"> - - !config.noThrow - - - !false - - -CmdLineTests.cpp" line="334"> - - !config.breakIntoDebugger - - - !false - - -
-CmdLineTests.cpp" line="340"> - - config.showSuccessfulTests - - - true - - -CmdLineTests.cpp" line="341"> - - config.noThrow - - - true - - -CmdLineTests.cpp" line="342"> - - config.breakIntoDebugger - - - true - - - -
- -
- -
-
-
-CmdLineTests.cpp" line="332"> - - !config.showSuccessfulTests - - - !false - - -CmdLineTests.cpp" line="333"> - - !config.noThrow - - - !false - - -CmdLineTests.cpp" line="334"> - - !config.breakIntoDebugger - - - !false - - - -
- -
-
-
-CmdLineTests.cpp" line="346"> - - config.abortAfter == 0 - - - 0 == 0 - - -
-CmdLineTests.cpp" line="352"> - - config.abortAfter == 1 - - - 1 == 1 - - - -
- -
- -
-
-
-CmdLineTests.cpp" line="346"> - - config.abortAfter == 0 - - - 0 == 0 - - - -
- -
-
-
-CmdLineTests.cpp" line="355"> - - config.abortAfter == 0 - - - 0 == 0 - - -
-CmdLineTests.cpp" line="361"> - - config.abortAfter == 2 - - - 2 == 2 - - - -
- -
- -
-
-
-CmdLineTests.cpp" line="355"> - - config.abortAfter == 0 - - - 0 == 0 - - - -
- -
-
-
-
-CmdLineTests.cpp" line="369"> - - config.testsOrTags.size() == 1 - - - 1 == 1 - - -CmdLineTests.cpp" line="370"> - - config.testsOrTags[0] == "[hello]" - - - "[hello]" == "[hello]" - - - -
- -
- -
-
-
- -
- -
-
-
-CmdLineTests.cpp" line="374"> - - config.verbosity == Config::Verbosity::Normal - - - 2 == 2 - - -
-CmdLineTests.cpp" line="380"> - - config.verbosity == Config::Verbosity::NoOutput - - - 0 == 0 - - - -
- -
- -
- -
- + - + [Started testing: CatchSelfTest] [Started group: '~dummy'] @@ -13920,13 +12760,13 @@ MiscTests.cpp:254: testStringForMatching() Equals( "this string contains 'abc' a "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: example/factorial] -MiscTests.cpp:265: Factorial(0) == 1 succeeded for: 1 == 1 -MiscTests.cpp:266: Factorial(1) == 1 succeeded for: 1 == 1 -MiscTests.cpp:267: Factorial(2) == 2 succeeded for: 2 == 2 -MiscTests.cpp:268: Factorial(3) == 6 succeeded for: 6 == 6 -MiscTests.cpp:269: Factorial(10) == 3628800 succeeded for: 0x == 3628800 -[Finished: 'example/factorial' All tests passed (5 assertions in 1 test case)] +[Running: Factorials are computed] +MiscTests.cpp:264: Factorial(0) == 1 succeeded for: 1 == 1 +MiscTests.cpp:265: Factorial(1) == 1 succeeded for: 1 == 1 +MiscTests.cpp:266: Factorial(2) == 2 succeeded for: 2 == 2 +MiscTests.cpp:267: Factorial(3) == 6 succeeded for: 6 == 6 +MiscTests.cpp:268: Factorial(10) == 3628800 succeeded for: 0x == 3628800 +[Finished: 'Factorials are computed' All tests passed (5 assertions in 1 test case)] [Running: empty] @@ -13935,7 +12775,7 @@ No assertions in test case, 'empty' [Finished: 'empty' 1 test case failed (1 assertion failed)] [Running: Nice descriptive name] -MiscTests.cpp:278: [warning: This one ran] +MiscTests.cpp:277: [warning: This one ran] No assertions in test case, 'Nice descriptive name' @@ -13954,43 +12794,43 @@ No assertions in test case, 'second tag' [Finished: 'second tag' 1 test case failed (1 assertion failed)] [Running: vectors can be sized and resized] -MiscTests.cpp:300: v.size() == 5 succeeded for: 5 == 5 -MiscTests.cpp:301: v.capacity() >= 5 succeeded for: 5 >= 5 +MiscTests.cpp:299: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:300: v.capacity() >= 5 succeeded for: 5 >= 5 [Started section: 'resizing bigger changes size and capacity'] -MiscTests.cpp:306: v.size() == 10 succeeded for: 10 == 10 -MiscTests.cpp:307: v.capacity() >= 10 succeeded for: 10 >= 10 +MiscTests.cpp:305: v.size() == 10 succeeded for: 10 == 10 +MiscTests.cpp:306: v.capacity() >= 10 succeeded for: 10 >= 10 [End of section: 'resizing bigger changes size and capacity' All 2 assertions passed] -MiscTests.cpp:300: v.size() == 5 succeeded for: 5 == 5 -MiscTests.cpp:301: v.capacity() >= 5 succeeded for: 5 >= 5 +MiscTests.cpp:299: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:300: v.capacity() >= 5 succeeded for: 5 >= 5 [Started section: 'resizing smaller changes size but not capacity'] -MiscTests.cpp:312: v.size() == 0 succeeded for: 0 == 0 -MiscTests.cpp:313: v.capacity() >= 5 succeeded for: 5 >= 5 +MiscTests.cpp:311: v.size() == 0 succeeded for: 0 == 0 +MiscTests.cpp:312: v.capacity() >= 5 succeeded for: 5 >= 5 [Started section: 'We can use the 'swap trick' to reset the capacity'] -MiscTests.cpp:319: v.capacity() == 0 succeeded for: 0 == 0 +MiscTests.cpp:318: v.capacity() == 0 succeeded for: 0 == 0 [End of section: 'We can use the 'swap trick' to reset the capacity' 1 assertion passed] [End of section: 'resizing smaller changes size but not capacity' All 3 assertions passed] -MiscTests.cpp:300: v.size() == 5 succeeded for: 5 == 5 -MiscTests.cpp:301: v.capacity() >= 5 succeeded for: 5 >= 5 +MiscTests.cpp:299: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:300: v.capacity() >= 5 succeeded for: 5 >= 5 [Started section: 'resizing smaller changes size but not capacity'] -MiscTests.cpp:312: v.size() == 0 succeeded for: 0 == 0 -MiscTests.cpp:313: v.capacity() >= 5 succeeded for: 5 >= 5 +MiscTests.cpp:311: v.size() == 0 succeeded for: 0 == 0 +MiscTests.cpp:312: v.capacity() >= 5 succeeded for: 5 >= 5 [End of section: 'resizing smaller changes size but not capacity' All 2 assertions passed] -MiscTests.cpp:300: v.size() == 5 succeeded for: 5 == 5 -MiscTests.cpp:301: v.capacity() >= 5 succeeded for: 5 >= 5 +MiscTests.cpp:299: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:300: v.capacity() >= 5 succeeded for: 5 >= 5 [Started section: 'reserving bigger changes capacity but not size'] -MiscTests.cpp:325: v.size() == 5 succeeded for: 5 == 5 -MiscTests.cpp:326: v.capacity() >= 10 succeeded for: 10 >= 10 +MiscTests.cpp:324: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:325: v.capacity() >= 10 succeeded for: 10 >= 10 [End of section: 'reserving bigger changes capacity but not size' All 2 assertions passed] -MiscTests.cpp:300: v.size() == 5 succeeded for: 5 == 5 -MiscTests.cpp:301: v.capacity() >= 5 succeeded for: 5 >= 5 +MiscTests.cpp:299: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:300: v.capacity() >= 5 succeeded for: 5 >= 5 [Started section: 'reserving smaller does not change size or capacity'] -MiscTests.cpp:331: v.size() == 5 succeeded for: 5 == 5 -MiscTests.cpp:332: v.capacity() >= 5 succeeded for: 5 >= 5 +MiscTests.cpp:330: v.size() == 5 succeeded for: 5 == 5 +MiscTests.cpp:331: v.capacity() >= 5 succeeded for: 5 >= 5 [End of section: 'reserving smaller does not change size or capacity' All 2 assertions passed] [Finished: 'vectors can be sized and resized' All tests passed (21 assertions in 1 test case)] @@ -14185,303 +13025,244 @@ TestMain.cpp:58: totals.assertions.passed == 2 succeeded for: 2 == 2 TestMain.cpp:59: totals.assertions.failed == 1 succeeded for: 1 == 1 [Finished: 'meta/Misc/Sections' All tests passed (2 assertions in 1 test case)] -[Running: selftest/parser/2] -[Started section: 'default'] +[Running: Process can be configured on command line] +[Started section: 'default - no arguments'] TestMain.cpp:98: parseIntoConfig( argv, config ) succeeded TestMain.cpp:100: config.shouldDebugBreak == false succeeded for: false == false TestMain.cpp:101: config.abortAfter == -1 succeeded for: -1 == -1 TestMain.cpp:102: config.noThrow == false succeeded for: false == false TestMain.cpp:103: config.reporterName.empty() succeeded for: true -[End of section: 'default' All 5 assertions passed] +[End of section: 'default - no arguments' All 5 assertions passed] [Started section: 'test lists'] -[Started section: '-t/1'] +[Started section: '1 test'] TestMain.cpp:109: parseIntoConfig( argv, config ) succeeded TestMain.cpp:112: cfg.filters().size() == 1 succeeded for: 1 == 1 TestMain.cpp:113: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false TestMain.cpp:114: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -[End of section: '-t/1' All 4 assertions passed] +[End of section: '1 test' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] -[Started section: '-t/exclude:1'] +[Started section: 'Specify one test case exclusion using exclude:'] TestMain.cpp:118: parseIntoConfig( argv, config ) succeeded TestMain.cpp:121: cfg.filters().size() == 1 succeeded for: 1 == 1 TestMain.cpp:122: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false TestMain.cpp:123: cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true -[End of section: '-t/exclude:1' All 4 assertions passed] +[End of section: 'Specify one test case exclusion using exclude:' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] -[Started section: '--test/1'] +[Started section: 'Specify one test case exclusion using ~'] TestMain.cpp:128: parseIntoConfig( argv, config ) succeeded TestMain.cpp:131: cfg.filters().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:132: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:133: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -[End of section: '--test/1' All 4 assertions passed] +TestMain.cpp:132: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false +TestMain.cpp:133: cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true +[End of section: 'Specify one test case exclusion using ~' All 4 assertions passed] [End of section: 'test lists' All 4 assertions passed] [Started section: 'test lists'] -[Started section: '--test/exclude:1'] +[Started section: 'Specify two test cases using -t'] TestMain.cpp:138: parseIntoConfig( argv, config ) succeeded TestMain.cpp:141: cfg.filters().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:142: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:143: cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true -[End of section: '--test/exclude:1' All 4 assertions passed] - -[End of section: 'test lists' All 4 assertions passed] - -[Started section: 'test lists'] -[Started section: '--test/exclude:2'] -TestMain.cpp:148: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:151: cfg.filters().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:152: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false succeeded for: false == false -TestMain.cpp:153: cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) succeeded for: true -[End of section: '--test/exclude:2' All 4 assertions passed] - -[End of section: 'test lists' All 4 assertions passed] - -[Started section: 'test lists'] -[Started section: '-t/2'] -TestMain.cpp:158: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:161: cfg.filters().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:162: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:163: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -TestMain.cpp:164: cfg.filters()[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true -[End of section: '-t/2' All 5 assertions passed] +TestMain.cpp:142: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false +TestMain.cpp:143: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true +TestMain.cpp:144: cfg.filters()[0].shouldInclude( fakeTestCase( "test2" ) ) succeeded for: true +[End of section: 'Specify two test cases using -t' All 5 assertions passed] [End of section: 'test lists' All 5 assertions passed] -[Started section: 'test lists'] -[Started section: '-t/0'] -TestMain.cpp:169: parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) succeeded for: -"Error while parsing arguments. Expected at least 1 argument." contains: "at least 1" -[End of section: '-t/0' 1 assertion passed] - -[End of section: 'test lists' 1 assertion passed] - [Started section: 'reporter'] [Started section: '-r/console'] -TestMain.cpp:176: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:178: config.reporterName == "console" succeeded for: "console" == "console" +TestMain.cpp:151: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:153: config.reporterName == "console" succeeded for: "console" == "console" [End of section: '-r/console' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '-r/xml'] -TestMain.cpp:182: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:184: config.reporterName == "xml" succeeded for: "xml" == "xml" +TestMain.cpp:157: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:159: config.reporterName == "xml" succeeded for: "xml" == "xml" [End of section: '-r/xml' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] [Started section: 'reporter'] [Started section: '--reporter/junit'] -TestMain.cpp:188: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:190: config.reporterName == "junit" succeeded for: "junit" == "junit" +TestMain.cpp:163: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:165: config.reporterName == "junit" succeeded for: "junit" == "junit" [End of section: '--reporter/junit' All 2 assertions passed] [End of section: 'reporter' All 2 assertions passed] -[Started section: 'reporter'] -[Started section: '-r/error'] -TestMain.cpp:194: parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) succeeded for: -"Error while parsing arguments. Expected 1 argument. Arguments were: one two" contains: "1 argument" -[End of section: '-r/error' 1 assertion passed] - -[End of section: 'reporter' 1 assertion passed] - [Started section: 'debugger'] [Started section: '-b'] -TestMain.cpp:201: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:203: config.shouldDebugBreak == true succeeded for: true == true +TestMain.cpp:172: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:174: config.shouldDebugBreak == true succeeded for: true == true [End of section: '-b' All 2 assertions passed] [End of section: 'debugger' All 2 assertions passed] [Started section: 'debugger'] [Started section: '--break'] -TestMain.cpp:207: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:209: config.shouldDebugBreak succeeded for: true +TestMain.cpp:178: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:180: config.shouldDebugBreak succeeded for: true [End of section: '--break' All 2 assertions passed] [End of section: 'debugger' All 2 assertions passed] -[Started section: 'debugger'] -[Started section: '-b'] -TestMain.cpp:213: parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) succeeded for: -"Error while parsing arguments. Expected 0 arguments. Arguments were: unexpected" contains: "0 arguments" -[End of section: '-b' 1 assertion passed] - -[End of section: 'debugger' 1 assertion passed] - [Started section: 'abort'] -[Started section: '-a'] -TestMain.cpp:220: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:222: config.abortAfter == 1 succeeded for: 1 == 1 -[End of section: '-a' All 2 assertions passed] +[Started section: '-a aborts after first failure'] +TestMain.cpp:187: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:189: config.abortAfter == 1 succeeded for: 1 == 1 +[End of section: '-a aborts after first failure' All 2 assertions passed] [End of section: 'abort' All 2 assertions passed] [Started section: 'abort'] -[Started section: '-a/2'] -TestMain.cpp:226: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:228: config.abortAfter == 2 succeeded for: 2 == 2 -[End of section: '-a/2' All 2 assertions passed] +[Started section: '-x 2 aborts after two failures'] +TestMain.cpp:193: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:195: config.abortAfter == 2 succeeded for: 2 == 2 +[End of section: '-x 2 aborts after two failures' All 2 assertions passed] [End of section: 'abort' All 2 assertions passed] [Started section: 'abort'] -[Started section: '-a/error/0'] -TestMain.cpp:232: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: -"Error while parsing arguments. threshold must be a number greater than zero. Arguments were: 0" contains: "greater than zero" -[End of section: '-a/error/0' 1 assertion passed] +[Started section: '-x must be greater than zero'] +TestMain.cpp:199: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: +"Value after -x or --abortAfter must be greater than zero while parsing: (-x, --abortx )" contains: "greater than zero" +[End of section: '-x must be greater than zero' 1 assertion passed] [End of section: 'abort' 1 assertion passed] [Started section: 'abort'] -[Started section: '-a/error/non numeric'] -TestMain.cpp:236: parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) succeeded for: -"Error while parsing arguments. threshold must be a number greater than zero. Arguments were: oops" contains: "greater than zero" -[End of section: '-a/error/non numeric' 1 assertion passed] - -[End of section: 'abort' 1 assertion passed] - -[Started section: 'abort'] -[Started section: '-a/error/two args'] -TestMain.cpp:240: parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) succeeded for: -"Error while parsing arguments. Expected between 0 and 1 argument. Arguments were: 1 2" contains: "0 and 1 argument" -[End of section: '-a/error/two args' 1 assertion passed] +[Started section: '-x must be numeric'] +TestMain.cpp:203: parseIntoConfigAndReturnError( argv, config ) Contains( "-x" ) succeeded for: +"Unable to convert oops to destination type while parsing: (-x, --abortx )" contains: "-x" +[End of section: '-x must be numeric' 1 assertion passed] [End of section: 'abort' 1 assertion passed] [Started section: 'nothrow'] -[Started section: '-nt'] -TestMain.cpp:247: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:249: config.noThrow == true succeeded for: true == true -[End of section: '-nt' All 2 assertions passed] +[Started section: '-e'] +TestMain.cpp:210: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:212: config.noThrow == true succeeded for: true == true +[End of section: '-e' All 2 assertions passed] [End of section: 'nothrow' All 2 assertions passed] [Started section: 'nothrow'] [Started section: '--nothrow'] -TestMain.cpp:253: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:255: config.noThrow == true succeeded for: true == true +TestMain.cpp:216: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:218: config.noThrow == true succeeded for: true == true [End of section: '--nothrow' All 2 assertions passed] [End of section: 'nothrow' All 2 assertions passed] [Started section: 'output filename'] [Started section: '-o filename'] -TestMain.cpp:262: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:264: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:225: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:227: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" [End of section: '-o filename' All 2 assertions passed] [End of section: 'output filename' All 2 assertions passed] [Started section: 'output filename'] [Started section: '--out'] -TestMain.cpp:268: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:270: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +TestMain.cpp:231: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:233: config.outputFilename == "filename.ext" succeeded for: "filename.ext" == "filename.ext" [End of section: '--out' All 2 assertions passed] [End of section: 'output filename' All 2 assertions passed] [Started section: 'combinations'] -[Started section: '-a -b'] -TestMain.cpp:277: parseIntoConfig( argv, config ) succeeded -TestMain.cpp:279: config.abortAfter == 1 succeeded for: 1 == 1 -TestMain.cpp:280: config.shouldDebugBreak succeeded for: true -TestMain.cpp:281: config.noThrow == true succeeded for: true == true -[End of section: '-a -b' All 4 assertions passed] +[Started section: 'Single character flags can be combined'] +TestMain.cpp:240: parseIntoConfig( argv, config ) succeeded +TestMain.cpp:242: config.abortAfter == 1 succeeded for: 1 == 1 +TestMain.cpp:243: config.shouldDebugBreak succeeded for: true +TestMain.cpp:244: config.noThrow == true succeeded for: true == true +[End of section: 'Single character flags can be combined' All 4 assertions passed] [End of section: 'combinations' All 4 assertions passed] -[Finished: 'selftest/parser/2' All tests passed (62 assertions in 1 test case)] +[Finished: 'Process can be configured on command line' All tests passed (50 assertions in 1 test case)] [Running: selftest/test filter] -TestMain.cpp:290: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -TestMain.cpp:291: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:296: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:297: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true -TestMain.cpp:299: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true -TestMain.cpp:300: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false +TestMain.cpp:253: matchAny.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:254: matchNone.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:259: matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:260: matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) succeeded for: true +TestMain.cpp:262: matchHidden.shouldInclude( fakeTestCase( "./any" ) ) succeeded for: true +TestMain.cpp:263: matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false succeeded for: false == false [Finished: 'selftest/test filter' All tests passed (6 assertions in 1 test case)] [Running: selftest/test filters] -TestMain.cpp:311: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -TestMain.cpp:313: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false -TestMain.cpp:314: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true -TestMain.cpp:315: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false +TestMain.cpp:274: matchHidden.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:276: filters.shouldInclude( fakeTestCase( "any" ) ) == false succeeded for: false == false +TestMain.cpp:277: filters.shouldInclude( fakeTestCase( "./something" ) ) succeeded for: true +TestMain.cpp:278: filters.shouldInclude( fakeTestCase( "./anything" ) ) == false succeeded for: false == false [Finished: 'selftest/test filters' All tests passed (4 assertions in 1 test case)] [Running: selftest/filter/prefix wildcard] -TestMain.cpp:321: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -TestMain.cpp:322: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false +TestMain.cpp:284: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:285: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/prefix wildcard' All tests passed (2 assertions in 1 test case)] [Running: selftest/filter/wildcard at both ends] -TestMain.cpp:327: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true -TestMain.cpp:328: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true -TestMain.cpp:329: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true -TestMain.cpp:330: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false +TestMain.cpp:290: matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) succeeded for: true +TestMain.cpp:291: matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) succeeded for: true +TestMain.cpp:292: matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) succeeded for: true +TestMain.cpp:293: matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false succeeded for: false == false [Finished: 'selftest/filter/wildcard at both ends' All tests passed (4 assertions in 1 test case)] -[Running: selftest/option parsers] -TestMain.cpp:350: opt.parseIntoConfig( parser, config ) succeeded -TestMain.cpp:353: cfg.filters().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:354: cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false succeeded for: false == false -TestMain.cpp:355: cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) succeeded for: true -[Finished: 'selftest/option parsers' All tests passed (4 assertions in 1 test case)] - [Running: selftest/tags] [Started section: 'one tag'] -TestMain.cpp:369: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:370: oneTag.hasTag( "one" ) succeeded for: true -TestMain.cpp:371: oneTag.getTags().size() == 1 succeeded for: 1 == 1 -TestMain.cpp:373: oneTag.matchesTags( p1 ) == true succeeded for: true == true -TestMain.cpp:374: oneTag.matchesTags( p2 ) == true succeeded for: true == true -TestMain.cpp:375: oneTag.matchesTags( p3 ) == false succeeded for: false == false -TestMain.cpp:376: oneTag.matchesTags( p4 ) == false succeeded for: false == false -TestMain.cpp:377: oneTag.matchesTags( p5 ) == false succeeded for: false == false +TestMain.cpp:313: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:314: oneTag.hasTag( "one" ) succeeded for: true +TestMain.cpp:315: oneTag.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:317: oneTag.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:318: oneTag.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:319: oneTag.matchesTags( p3 ) == false succeeded for: false == false +TestMain.cpp:320: oneTag.matchesTags( p4 ) == false succeeded for: false == false +TestMain.cpp:321: oneTag.matchesTags( p5 ) == false succeeded for: false == false [End of section: 'one tag' All 8 assertions passed] [Started section: 'two tags'] -TestMain.cpp:383: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:384: twoTags.hasTag( "one" ) succeeded for: true -TestMain.cpp:385: twoTags.hasTag( "two" ) succeeded for: true -TestMain.cpp:386: twoTags.hasTag( "Two" ) succeeded for: true -TestMain.cpp:387: twoTags.hasTag( "three" ) == false succeeded for: false == false -TestMain.cpp:388: twoTags.getTags().size() == 2 succeeded for: 2 == 2 -TestMain.cpp:390: twoTags.matchesTags( p1 ) == true succeeded for: true == true -TestMain.cpp:391: twoTags.matchesTags( p2 ) == true succeeded for: true == true -TestMain.cpp:392: twoTags.matchesTags( p3 ) == true succeeded for: true == true -TestMain.cpp:393: twoTags.matchesTags( p4 ) == true succeeded for: true == true -TestMain.cpp:394: twoTags.matchesTags( p5 ) == true succeeded for: true == true +TestMain.cpp:327: twoTags.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:328: twoTags.hasTag( "one" ) succeeded for: true +TestMain.cpp:329: twoTags.hasTag( "two" ) succeeded for: true +TestMain.cpp:330: twoTags.hasTag( "Two" ) succeeded for: true +TestMain.cpp:331: twoTags.hasTag( "three" ) == false succeeded for: false == false +TestMain.cpp:332: twoTags.getTags().size() == 2 succeeded for: 2 == 2 +TestMain.cpp:334: twoTags.matchesTags( p1 ) == true succeeded for: true == true +TestMain.cpp:335: twoTags.matchesTags( p2 ) == true succeeded for: true == true +TestMain.cpp:336: twoTags.matchesTags( p3 ) == true succeeded for: true == true +TestMain.cpp:337: twoTags.matchesTags( p4 ) == true succeeded for: true == true +TestMain.cpp:338: twoTags.matchesTags( p5 ) == true succeeded for: true == true [End of section: 'two tags' All 11 assertions passed] [Started section: 'one tag with characters either side'] -TestMain.cpp:400: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" -TestMain.cpp:401: oneTagWithExtras.hasTag( "one" ) succeeded for: true -TestMain.cpp:402: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false -TestMain.cpp:403: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 +TestMain.cpp:344: oneTagWithExtras.getTestCaseInfo().description == "1234" succeeded for: "1234" == "1234" +TestMain.cpp:345: oneTagWithExtras.hasTag( "one" ) succeeded for: true +TestMain.cpp:346: oneTagWithExtras.hasTag( "two" ) == false succeeded for: false == false +TestMain.cpp:347: oneTagWithExtras.getTags().size() == 1 succeeded for: 1 == 1 [End of section: 'one tag with characters either side' All 4 assertions passed] [Started section: 'start of a tag, but not closed'] -TestMain.cpp:410: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" -TestMain.cpp:411: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false -TestMain.cpp:412: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 +TestMain.cpp:354: oneTagOpen.getTestCaseInfo().description == "[one" succeeded for: "[one" == "[one" +TestMain.cpp:355: oneTagOpen.hasTag( "one" ) == false succeeded for: false == false +TestMain.cpp:356: oneTagOpen.getTags().size() == 0 succeeded for: 0 == 0 [End of section: 'start of a tag, but not closed' All 3 assertions passed] [Started section: 'hidden'] -TestMain.cpp:418: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" -TestMain.cpp:419: oneTag.hasTag( "hide" ) succeeded for: true -TestMain.cpp:420: oneTag.isHidden() succeeded for: true -TestMain.cpp:422: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false +TestMain.cpp:362: oneTag.getTestCaseInfo().description == "" succeeded for: "" == "" +TestMain.cpp:363: oneTag.hasTag( "hide" ) succeeded for: true +TestMain.cpp:364: oneTag.isHidden() succeeded for: true +TestMain.cpp:366: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false == false [End of section: 'hidden' All 4 assertions passed] [Finished: 'selftest/tags' All tests passed (30 assertions in 1 test case)] @@ -14489,11 +13270,11 @@ TestMain.cpp:422: oneTag.matchesTags( "~[hide]" ) == false succeeded for: false [Running: Long strings can be wrapped] [Started section: 'plain string'] [Started section: 'No wrapping'] -TestMain.cpp:435: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: +TestMain.cpp:379: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:436: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: +TestMain.cpp:380: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" @@ -14503,31 +13284,31 @@ TestMain.cpp:436: Text( testString, TextAttributes().setWidth( 18 ) ).toString() [Started section: 'plain string'] [Started section: 'Wrapped once'] -TestMain.cpp:439: Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:383: Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:440: Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:384: Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:441: Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:385: Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:442: Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" succeeded for: +TestMain.cpp:386: Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour" succeeded for: "one two three four" == "one two three four" -TestMain.cpp:443: Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" succeeded for: +TestMain.cpp:387: Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four" succeeded for: "one two three four" == @@ -14539,7 +13320,7 @@ three four" [Started section: 'plain string'] [Started section: 'Wrapped twice'] -TestMain.cpp:446: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:390: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14547,7 +13328,7 @@ four" "one two three four" -TestMain.cpp:447: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:391: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14555,7 +13336,7 @@ four" "one two three four" -TestMain.cpp:448: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:392: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14569,7 +13350,7 @@ four" [Started section: 'plain string'] [Started section: 'Wrapped three times'] -TestMain.cpp:451: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:395: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -14579,7 +13360,7 @@ four" two three four" -TestMain.cpp:452: Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:396: Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -14595,24 +13376,24 @@ four" [Started section: 'plain string'] [Started section: 'Short wrap'] -TestMain.cpp:455: Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" succeeded for: "abc- +TestMain.cpp:399: Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef" succeeded for: "abc- def" == "abc- def" -TestMain.cpp:456: Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" succeeded for: "abc- +TestMain.cpp:400: Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg" succeeded for: "abc- defg" == "abc- defg" -TestMain.cpp:457: Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- +TestMain.cpp:401: Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh" succeeded for: "abc- def- gh" == "abc- def- gh" -TestMain.cpp:459: Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: +TestMain.cpp:403: Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour" succeeded for: "one two thr- @@ -14624,7 +13405,7 @@ two thr- ee four" -TestMain.cpp:460: Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: +TestMain.cpp:404: Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur" succeeded for: "one two th- @@ -14644,18 +13425,18 @@ ur" [Started section: 'plain string'] [Started section: 'As container'] -TestMain.cpp:464: text.size() == 4 succeeded for: 4 == 4 -TestMain.cpp:465: text[0] == "one" succeeded for: "one" == "one" -TestMain.cpp:466: text[1] == "two" succeeded for: "two" == "two" -TestMain.cpp:467: text[2] == "three" succeeded for: "three" == "three" -TestMain.cpp:468: text[3] == "four" succeeded for: "four" == "four" +TestMain.cpp:408: text.size() == 4 succeeded for: 4 == 4 +TestMain.cpp:409: text[0] == "one" succeeded for: "one" == "one" +TestMain.cpp:410: text[1] == "two" succeeded for: "two" == "two" +TestMain.cpp:411: text[2] == "three" succeeded for: "three" == "three" +TestMain.cpp:412: text[3] == "four" succeeded for: "four" == "four" [End of section: 'As container' All 5 assertions passed] [End of section: 'plain string' All 5 assertions passed] [Started section: 'plain string'] [Started section: 'Indent first line differently'] -TestMain.cpp:475: text.toString() == " one two\n three\n four" succeeded for: +TestMain.cpp:419: text.toString() == " one two\n three\n four" succeeded for: " one two three four" @@ -14669,19 +13450,19 @@ TestMain.cpp:475: text.toString() == " one two\n three\n four" succeeded f [Started section: 'With newlines'] [Started section: 'No wrapping'] -TestMain.cpp:486: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: +TestMain.cpp:430: Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:487: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: +TestMain.cpp:431: Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString succeeded for: "one two three four" == "one two three four" -TestMain.cpp:488: Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString succeeded for: +TestMain.cpp:432: Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString succeeded for: "one two three four" == @@ -14693,13 +13474,13 @@ three four" [Started section: 'With newlines'] [Started section: 'Trailing newline'] -TestMain.cpp:491: Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:435: Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef " -TestMain.cpp:492: Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" -TestMain.cpp:493: Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" succeeded for: "abcdef +TestMain.cpp:436: Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef" succeeded for: "abcdef" == "abcdef" +TestMain.cpp:437: Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n" succeeded for: "abcdef " == "abcdef @@ -14710,7 +13491,7 @@ TestMain.cpp:493: Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() [Started section: 'With newlines'] [Started section: 'Wrapped once'] -TestMain.cpp:496: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:440: Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14718,7 +13499,7 @@ four" "one two three four" -TestMain.cpp:497: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:441: Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14726,7 +13507,7 @@ four" "one two three four" -TestMain.cpp:498: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: +TestMain.cpp:442: Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour" succeeded for: "one two three four" @@ -14740,7 +13521,7 @@ four" [Started section: 'With newlines'] [Started section: 'Wrapped twice'] -TestMain.cpp:501: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: +TestMain.cpp:445: Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour" succeeded for: "one two three @@ -14755,7 +13536,7 @@ four" [End of section: 'With newlines' 1 assertion passed] [Started section: 'With tabs'] -TestMain.cpp:511: Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" succeeded for: +TestMain.cpp:455: Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n four\n five\n six" succeeded for: "one two three four five @@ -14778,8 +13559,8 @@ No assertions in test case, 'Strings can be rendered with colour' [Finished: 'Strings can be rendered with colour' 1 test case failed (1 assertion failed)] [Running: Text can be formatted using the Text class] -TestMain.cpp:611: Text( "hi there" ).toString() == "hi there" succeeded for: "hi there" == "hi there" -TestMain.cpp:616: Text( "hi there", narrow ).toString() == "hi\nthere" succeeded for: "hi +TestMain.cpp:555: Text( "hi there" ).toString() == "hi there" succeeded for: "hi there" == "hi there" +TestMain.cpp:560: Text( "hi there", narrow ).toString() == "hi\nthere" succeeded for: "hi there" == "hi @@ -15004,285 +13785,81 @@ BDDTests.cpp:67: succeeded [Finished: 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' All tests passed (1 assertion in 1 test case)] [Running: cmdline] +[Started section: 'process name'] +CmdLineTests.cpp:64: config.processName == "test" succeeded for: "test" == "test" +[End of section: 'process name' 1 assertion passed] + [Started section: 'arg separated by spaces'] -CmdLineTests.cpp:62: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +CmdLineTests.cpp:70: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" [End of section: 'arg separated by spaces' 1 assertion passed] [Started section: 'arg separated by colon'] -CmdLineTests.cpp:68: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +CmdLineTests.cpp:76: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" [End of section: 'arg separated by colon' 1 assertion passed] [Started section: 'arg separated by ='] -CmdLineTests.cpp:74: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" +CmdLineTests.cpp:82: config.fileName == "filename.ext" succeeded for: "filename.ext" == "filename.ext" [End of section: 'arg separated by =' 1 assertion passed] [Started section: 'long opt'] -CmdLineTests.cpp:80: config.fileName == "%stdout" succeeded for: "%stdout" == "%stdout" +CmdLineTests.cpp:88: config.fileName == "%stdout" succeeded for: "%stdout" == "%stdout" [End of section: 'long opt' 1 assertion passed] [Started section: 'a number'] -CmdLineTests.cpp:91: config.number == 42 succeeded for: 42 == 42 +CmdLineTests.cpp:99: config.number == 42 succeeded for: 42 == 42 [End of section: 'a number' 1 assertion passed] [Started section: 'not a number'] -CmdLineTests.cpp:95: parseInto( cli, argv, config ) succeeded -CmdLineTests.cpp:97: config.number == 0 succeeded for: 0 == 0 +CmdLineTests.cpp:103: parseInto( cli, argv, config ) succeeded +CmdLineTests.cpp:105: config.number == 0 succeeded for: 0 == 0 [End of section: 'not a number' All 2 assertions passed] [Started section: 'two parsers'] -CmdLineTests.cpp:115: config1.number == 42 succeeded for: 42 == 42 -CmdLineTests.cpp:117: !unusedTokens.empty() succeeded for: !false -CmdLineTests.cpp:119: config2.description == "some text" succeeded for: "some text" == "some text" +CmdLineTests.cpp:123: config1.number == 42 succeeded for: 42 == 42 +CmdLineTests.cpp:125: !unusedTokens.empty() succeeded for: !false +CmdLineTests.cpp:127: config2.description == "some text" succeeded for: "some text" == "some text" [End of section: 'two parsers' All 3 assertions passed] [Started section: 'methods'] [Started section: 'in range'] -CmdLineTests.cpp:132: config.index == 3 succeeded for: 3 == 3 +CmdLineTests.cpp:140: config.index == 3 succeeded for: 3 == 3 [End of section: 'in range' 1 assertion passed] [End of section: 'methods' 1 assertion passed] [Started section: 'methods'] [Started section: 'out of range'] -CmdLineTests.cpp:137: parseInto( cli, argv, config ) succeeded +CmdLineTests.cpp:145: parseInto( cli, argv, config ) succeeded [End of section: 'out of range' 1 assertion passed] [End of section: 'methods' 1 assertion passed] [Started section: 'flags'] [Started section: 'set'] -CmdLineTests.cpp:150: config.flag succeeded for: true +CmdLineTests.cpp:158: config.flag succeeded for: true [End of section: 'set' 1 assertion passed] [End of section: 'flags' 1 assertion passed] [Started section: 'flags'] [Started section: 'not set'] -CmdLineTests.cpp:156: config.flag == false succeeded for: false == false +CmdLineTests.cpp:164: config.flag == false succeeded for: false == false [End of section: 'not set' 1 assertion passed] [End of section: 'flags' 1 assertion passed] -usage: - testApp [ ...] [options] - -where options are: - -o, --output specifies output file - -n - - [Started section: 'positional'] -CmdLineTests.cpp:177: config.firstPos == "1st" succeeded for: "1st" == "1st" -CmdLineTests.cpp:178: config.secondPos == "2nd" succeeded for: "2nd" == "2nd" -CmdLineTests.cpp:179: config.unpositional == "3rd" succeeded for: "3rd" == "3rd" +CmdLineTests.cpp:185: config.firstPos == "1st" succeeded for: "1st" == "1st" +CmdLineTests.cpp:186: config.secondPos == "2nd" succeeded for: "2nd" == "2nd" +CmdLineTests.cpp:187: config.unpositional == "3rd" succeeded for: "3rd" == "3rd" [End of section: 'positional' All 3 assertions passed] -[Finished: 'cmdline' All tests passed (17 assertions in 1 test case)] -usage: - CatchTestApp [ ...] [options] - -where options are: - -?, -h, --help display usage information - -l, --list-tests list all (or matching) test cases - -t, --list-tags list all (or matching) tags - --list-reporters list all reporters - -s, --success include successful tests in output - -b, --break break into debugger on failure - -e, --nothrow Skip exception tests - -o, --out output filename - -r, --reporter reporter to use - defaults to console - -n, --name suite name - -a, --abort abort at first failure - -x, --abortx abort after x failures - -w, --warn enable warnings - -v, --verbosity level of verbosity (0=no output) +[Finished: 'cmdline' All tests passed (18 assertions in 1 test case)] +[End of group: '~dummy'. 49 of 113 test cases failed (106 of 705 assertions failed)] - -[Running: Scenario: New Catch commandline interface] -[Started section: ' Given: A built cli parser for Catch'] -[Started section: ' When: We ask for usage strings'] -[Started section: ' Then: It prints the usage strings'] - -No assertions in section, ' Then: It prints the usage strings' - -[End of section: ' Then: It prints the usage strings' 1 assertion failed] - -[End of section: ' When: We ask for usage strings' 1 assertion failed] - -[End of section: ' Given: A built cli parser for Catch' 1 assertion failed] - -[Started section: ' Given: A built cli parser for Catch'] -[Started section: ' When: Multiple flags are combined'] -CmdLineTests.cpp:332: !config.showSuccessfulTests succeeded for: !false -CmdLineTests.cpp:333: !config.noThrow succeeded for: !false -CmdLineTests.cpp:334: !config.breakIntoDebugger succeeded for: !false -[Started section: ' Then: All the flags are set'] -CmdLineTests.cpp:340: config.showSuccessfulTests succeeded for: true -CmdLineTests.cpp:341: config.noThrow succeeded for: true -CmdLineTests.cpp:342: config.breakIntoDebugger succeeded for: true -[End of section: ' Then: All the flags are set' All 3 assertions passed] - -[End of section: ' When: Multiple flags are combined' All 6 assertions passed] - -[End of section: ' Given: A built cli parser for Catch' All 6 assertions passed] - -[Started section: ' Given: A built cli parser for Catch'] -[Started section: ' When: Multiple flags are combined'] -CmdLineTests.cpp:332: !config.showSuccessfulTests succeeded for: !false -CmdLineTests.cpp:333: !config.noThrow succeeded for: !false -CmdLineTests.cpp:334: !config.breakIntoDebugger succeeded for: !false -[End of section: ' When: Multiple flags are combined' All 3 assertions passed] - -[End of section: ' Given: A built cli parser for Catch' All 3 assertions passed] - -[Started section: ' Given: A built cli parser for Catch'] -[Started section: ' When: A flag is set via a nullary method'] -CmdLineTests.cpp:346: config.abortAfter == 0 succeeded for: 0 == 0 -[Started section: ' Then: The flag is set'] -CmdLineTests.cpp:352: config.abortAfter == 1 succeeded for: 1 == 1 -[End of section: ' Then: The flag is set' 1 assertion passed] - -[End of section: ' When: A flag is set via a nullary method' All 2 assertions passed] - -[End of section: ' Given: A built cli parser for Catch' All 2 assertions passed] - -[Started section: ' Given: A built cli parser for Catch'] -[Started section: ' When: A flag is set via a nullary method'] -CmdLineTests.cpp:346: config.abortAfter == 0 succeeded for: 0 == 0 -[End of section: ' When: A flag is set via a nullary method' 1 assertion passed] - -[End of section: ' Given: A built cli parser for Catch' 1 assertion passed] - -[Started section: ' Given: A built cli parser for Catch'] -[Started section: ' When: A flag is set via a unary method'] -CmdLineTests.cpp:355: config.abortAfter == 0 succeeded for: 0 == 0 -[Started section: ' Then: The flag is set'] -CmdLineTests.cpp:361: config.abortAfter == 2 succeeded for: 2 == 2 -[End of section: ' Then: The flag is set' 1 assertion passed] - -[End of section: ' When: A flag is set via a unary method' All 2 assertions passed] - -[End of section: ' Given: A built cli parser for Catch' All 2 assertions passed] - -[Started section: ' Given: A built cli parser for Catch'] -[Started section: ' When: A flag is set via a unary method'] -CmdLineTests.cpp:355: config.abortAfter == 0 succeeded for: 0 == 0 -[End of section: ' When: A flag is set via a unary method' 1 assertion passed] - -[End of section: ' Given: A built cli parser for Catch' 1 assertion passed] - -[Started section: ' Given: A built cli parser for Catch'] -[Started section: ' When: A positional argument is supplied'] -[Started section: ' Then: The argument is in the testOrTags collection'] -CmdLineTests.cpp:369: config.testsOrTags.size() == 1 succeeded for: 1 == 1 -CmdLineTests.cpp:370: config.testsOrTags[0] == "[hello]" succeeded for: "[hello]" == "[hello]" -[End of section: ' Then: The argument is in the testOrTags collection' All 2 assertions passed] - -[End of section: ' When: A positional argument is supplied' All 2 assertions passed] - -[End of section: ' Given: A built cli parser for Catch' All 2 assertions passed] - -[Started section: ' Given: A built cli parser for Catch'] -[Started section: ' When: And enum opt is set by numeric value'] -CmdLineTests.cpp:374: config.verbosity == Config::Verbosity::Normal succeeded for: 2 == 2 -[Started section: ' Then: The member is set to the enum value'] -CmdLineTests.cpp:380: config.verbosity == Config::Verbosity::NoOutput succeeded for: 0 == 0 -[End of section: ' Then: The member is set to the enum value' 1 assertion passed] - -[End of section: ' When: And enum opt is set by numeric value' All 2 assertions passed] - -[End of section: ' Given: A built cli parser for Catch' All 2 assertions passed] - -[Finished: 'Scenario: New Catch commandline interface' 1 test case failed (1 of 20 assertions failed)] -[End of group: '~dummy'. 50 of 115 test cases failed (107 of 740 assertions failed)] +[Testing completed. 49 of 113 test cases failed (106 of 705 assertions failed)] -[Testing completed. 50 of 115 test cases failed (107 of 740 assertions failed)] - -[Started testing: CatchSelfTest] -[Started group: '~dummy'] - -[Running: ./succeeding/Approx/simple] -ApproxTests.cpp:20: d == Approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:21: d != Approx( 1.22 ) succeeded for: 1.23 != Approx( 1.22 ) -ApproxTests.cpp:22: d != Approx( 1.24 ) succeeded for: 1.23 != Approx( 1.24 ) -ApproxTests.cpp:24: Approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:25: Approx( d ) != 1.22 succeeded for: Approx( 1.23 ) != 1.22 -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] -ApproxTests.cpp:38: d != Approx( 1.231 ) succeeded for: 1.23 != Approx( 1.231 ) -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] -ApproxTests.cpp:49: 1.23f == Approx( 1.23f ) succeeded for: 1.23 == Approx( 1.23 ) -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] -ApproxTests.cpp:60: 1 == Approx( 1 ) succeeded -ApproxTests.cpp:61: 0 == Approx( 0 ) succeeded -[Finished: './succeeding/Approx/int' All tests passed (2 assertions in 1 test case)] - -[Running: ./succeeding/Approx/mixed] -ApproxTests.cpp:75: 1.0f == Approx( 1 ) succeeded for: 1 == Approx( 1 ) -ApproxTests.cpp:76: 0 == Approx( dZero) succeeded for: 0 == Approx( 0 ) -ApproxTests.cpp:77: 0 == Approx( dSmall ).epsilon( 0.001 ) succeeded for: 0 == Approx( 1e-05 ) -ApproxTests.cpp:78: 1.234f == Approx( dMedium ) succeeded for: 1.234 == Approx( 1.234 ) -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] -ApproxTests.cpp:93: d == approx( 1.23 ) succeeded for: 1.23 == Approx( 1.23 ) -ApproxTests.cpp:94: d == approx( 1.22 ) succeeded for: 1.23 == Approx( 1.22 ) -ApproxTests.cpp:95: d == approx( 1.24 ) succeeded for: 1.23 == Approx( 1.24 ) -ApproxTests.cpp:96: d != approx( 1.25 ) succeeded for: 1.23 != Approx( 1.25 ) -ApproxTests.cpp:98: approx( d ) == 1.23 succeeded for: Approx( 1.23 ) == 1.23 -ApproxTests.cpp:99: approx( d ) == 1.22 succeeded for: Approx( 1.23 ) == 1.22 -ApproxTests.cpp:100: approx( d ) == 1.24 succeeded for: Approx( 1.23 ) == 1.24 -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: Approximate PI] -ApproxTests.cpp:110: divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) succeeded for: 3.142857142857143 == Approx( 3.141 ) -ApproxTests.cpp:111: divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) succeeded for: 3.142857142857143 != Approx( 3.141 ) -[Finished: 'Approximate PI' All tests passed (2 assertions in 1 test case)] - -[Running: ./succeeding/TestClass/succeedingCase] -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] -ClassTests.cpp:28: s == "world" failed for: "hello" == "world" -[Finished: './failing/TestClass/failingCase' 1 test case failed (1 assertion failed)] - -[Running: ./succeeding/Fixture/succeedingCase] -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] -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] -ConditionTests.cpp:55: data.int_seven == 7 succeeded for: 7 == 7 -ConditionTests.cpp:56: data.float_nine_point_one == Approx( 9.1f ) succeeded for: 9.1 == Approx( 9.1 ) -ConditionTests.cpp:57: data.double_pi == Approx( 3.1415926535 ) succeeded for: 3.1415926535 == Approx( 3.14159 ) -ConditionTests.cpp:58: data.str_hello == "hello" succeeded for: "hello" == "hello" -ConditionTests.cpp:59: "hello" == data.str_hello succeeded for: "hello" == "hello" -ConditionTests.cpp:60: data.str_hello.size() == 5 succeeded for: 5 == 5 -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] -ConditionTests.cpp:71: data.int_seven == 6 failed for: 7 == 6 -ConditionTests.cpp:72: data.int_seven == 8 failed for: 7 == 8 -[Finished: './failing/conditions/equality' 1 test case failed (All 2 assertions failed)] -[End of group: '~dummy'. 3 of 13 test cases failed (4 of 40 assertions failed)] - - -[Testing aborted. 3 of 13 test cases failed (4 of 40 assertions failed)] +[Testing completed. No tests ran] From c1196b6245f12237b441f6018562353e9c095977 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 5 Jun 2013 18:48:18 +0100 Subject: [PATCH 276/296] Moved all Catch::Main()s into new Session class - renamed them run() - moved cleanUp call into destructor --- include/catch_runner.hpp | 127 +++++++++++++----------- include/internal/catch_default_main.hpp | 6 +- 2 files changed, 71 insertions(+), 62 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index e431e50f..6d6c9f47 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -108,30 +108,6 @@ namespace Catch { std::set m_testsAlreadyRun; }; - inline int Main( Ptr const& config ) { - int result = 0; - try - { - Runner runner( config ); - - // Handle list request - if( list( config ) ) { - Catch::cleanUp(); - return 0; - } - - result = static_cast( runner.runTests().assertions.failed ); - - } - catch( std::exception& ex ) { - std::cerr << ex.what() << std::endl; - result = (std::numeric_limits::max)(); - } - - Catch::cleanUp(); - return result; - } - inline void showHelp( std::string const& processName ) { Clara::CommandLine cli = makeCommandLineParser(); @@ -145,47 +121,80 @@ namespace Catch { cli.usage( std::cout, processName ); std::cout << "\nFor more detail usage please see: https://github.com/philsquared/Catch/wiki/Command-line\n" << std::endl; } - inline Ptr processConfig( int argc, char* const argv[], ConfigData& configData ) { - Clara::CommandLine cli = makeCommandLineParser(); - std::vector unused = cli.parseInto( argc, argv, configData ); - if( !unused.empty() ) { - std::vector::const_iterator - it = unused.begin(), - itEnd = unused.end(); - std::string msg; - for(; it != itEnd; ++it ) - msg += " unrecognised option: " + it->data + "\n"; - throw std::runtime_error( msg.substr( 0, msg.size()-1 ) ); + + class Session { + static bool alreadyInstantiated; + + public: + Session() { + if( alreadyInstantiated ) { + std::string msg = "Only one instance of Catch::Session can ever be used"; + std::cerr << msg << std::endl; + throw std::logic_error( msg ); + } + alreadyInstantiated = true; } - Ptr config = new Config( configData ); - return config; - } - inline Ptr processConfig( int argc, char* const argv[] ) { - ConfigData configData; - return processConfig( argc, argv, configData ); - } + ~Session() { + Catch::cleanUp(); + } + + int run( Ptr const& config ) { + try + { + Runner runner( config ); - inline int Main( int argc, char* const argv[], ConfigData configData = ConfigData() ) { + // Handle list request + if( list( config ) ) + return 0; - Ptr config; - - try { - config = processConfig( argc, argv, configData ); - if( config->showHelp() ) { - showHelp( config->getProcessName() ); - Catch::cleanUp(); - return 0; + return static_cast( runner.runTests().assertions.failed ); + } + catch( std::exception& ex ) { + std::cerr << ex.what() << std::endl; + return (std::numeric_limits::max)(); } } - catch( std::exception& ex ) { - std::cerr << "\nError in input:\n" - << " " << ex.what() << "\n\n"; - makeCommandLineParser().usage( std::cout, configData.processName ); - Catch::cleanUp(); - return (std::numeric_limits::max)(); + + Ptr processConfig( int argc, char* const argv[], ConfigData& configData ) { + Clara::CommandLine cli = makeCommandLineParser(); + std::vector unused = cli.parseInto( argc, argv, configData ); + if( !unused.empty() ) { + std::vector::const_iterator + it = unused.begin(), + itEnd = unused.end(); + std::string msg; + for(; it != itEnd; ++it ) + msg += " unrecognised option: " + it->data + "\n"; + throw std::runtime_error( msg.substr( 0, msg.size()-1 ) ); + } + Ptr config = new Config( configData ); + return config; } - return Main( config ); - } + Ptr processConfig( int argc, char* const argv[] ) { + ConfigData configData; + return processConfig( argc, argv, configData ); + } + int run( int argc, char* const argv[], ConfigData configData = ConfigData() ) { + + Ptr config; + + try { + config = processConfig( argc, argv, configData ); + if( config->showHelp() ) { + showHelp( config->getProcessName() ); + return 0; + } + } + catch( std::exception& ex ) { + std::cerr << "\nError in input:\n" + << " " << ex.what() << "\n\n"; + makeCommandLineParser().usage( std::cout, configData.processName ); + return (std::numeric_limits::max)(); + } + return run( config ); + } + }; + bool Session::alreadyInstantiated = false; } // end namespace Catch diff --git a/include/internal/catch_default_main.hpp b/include/internal/catch_default_main.hpp index 3d7e423a..5844f350 100644 --- a/include/internal/catch_default_main.hpp +++ b/include/internal/catch_default_main.hpp @@ -11,8 +11,8 @@ #ifndef __OBJC__ // Standard C/C++ main entry point -int main (int argc, char * const argv[]) { - return Catch::Main( argc, argv ); +int main (int argc, char * const argv[]) { + return Catch::Session().run( argc, argv ); } #else // __OBJC__ @@ -24,7 +24,7 @@ int main (int argc, char * const argv[]) { #endif Catch::registerTestMethods(); - int result = Catch::Main( argc, (char* const*)argv ); + int result = Catch::Session().run( argc, (char* const*)argv ); #if !CATCH_ARC_ENABLED [pool drain]; From a7e657fd9b9f505212cb9a7f55d5794b127ac3eb Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 6 Jun 2013 18:51:24 +0100 Subject: [PATCH 277/296] Refactored new Session class to make it more friendly for custom client code --- include/catch_runner.hpp | 96 ++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 38 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 6d6c9f47..e856774e 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -126,7 +126,11 @@ namespace Catch { static bool alreadyInstantiated; public: - Session() { + + struct OnUnusedOptions { enum DoWhat { Ignore, Fail }; }; + + Session() + : cli( makeCommandLineParser() ) { if( alreadyInstantiated ) { std::string msg = "Only one instance of Catch::Session can ever be used"; std::cerr << msg << std::endl; @@ -137,10 +141,58 @@ namespace Catch { ~Session() { Catch::cleanUp(); } + + int applyCommandLine( int argc, char* const argv[], OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) { + try { + unusedTokens = cli.parseInto( argc, argv, configData ); + if( unusedOptionBehaviour == OnUnusedOptions::Fail ) + enforceNoUsedTokens(); + if( configData.showHelp ) + showHelp( configData.processName ); + config.reset(); + } + catch( std::exception& ex ) { + std::cerr << "\nError in input:\n" + << " " << ex.what() << "\n\n"; + cli.usage( std::cout, configData.processName ); + return (std::numeric_limits::max)(); + } + return 0; + } + + void useConfigData( ConfigData const& _configData ) { + configData = _configData; + config.reset(); + } + + void enforceNoUsedTokens() const { + if( !unusedTokens.empty() ) { + std::vector::const_iterator + it = unusedTokens.begin(), + itEnd = unusedTokens.end(); + std::string msg; + for(; it != itEnd; ++it ) + msg += " unrecognised option: " + it->data + "\n"; + throw std::runtime_error( msg.substr( 0, msg.size()-1 ) ); + } + } - int run( Ptr const& config ) { + int run( int argc, char* const argv[] ) { + + int returnCode = applyCommandLine( argc, argv ); + if( returnCode == 0 ) + returnCode = run(); + return returnCode; + } + + int run() { + if( configData.showHelp ) + return 0; + try { + if( !config ) + config = new Config( configData ); Runner runner( config ); // Handle list request @@ -155,45 +207,13 @@ namespace Catch { } } - Ptr processConfig( int argc, char* const argv[], ConfigData& configData ) { - Clara::CommandLine cli = makeCommandLineParser(); - std::vector unused = cli.parseInto( argc, argv, configData ); - if( !unused.empty() ) { - std::vector::const_iterator - it = unused.begin(), - itEnd = unused.end(); - std::string msg; - for(; it != itEnd; ++it ) - msg += " unrecognised option: " + it->data + "\n"; - throw std::runtime_error( msg.substr( 0, msg.size()-1 ) ); - } - Ptr config = new Config( configData ); - return config; - } - Ptr processConfig( int argc, char* const argv[] ) { + private: + Clara::CommandLine cli; + std::vector unusedTokens; ConfigData configData; - return processConfig( argc, argv, configData ); - } - int run( int argc, char* const argv[], ConfigData configData = ConfigData() ) { - Ptr config; - - try { - config = processConfig( argc, argv, configData ); - if( config->showHelp() ) { - showHelp( config->getProcessName() ); - return 0; - } - } - catch( std::exception& ex ) { - std::cerr << "\nError in input:\n" - << " " << ex.what() << "\n\n"; - makeCommandLineParser().usage( std::cout, configData.processName ); - return (std::numeric_limits::max)(); - } - return run( config ); - } }; + bool Session::alreadyInstantiated = false; } // end namespace Catch From e035e2835dd24c5bc679aa05b63fdf870c91ef15 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 6 Jun 2013 18:56:43 +0100 Subject: [PATCH 278/296] tweaks --- include/catch_runner.hpp | 26 ++++++++++++-------------- include/internal/catch_commandline.hpp | 10 +++++----- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index e856774e..37a8ed2e 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -108,20 +108,6 @@ namespace Catch { std::set m_testsAlreadyRun; }; - inline void showHelp( std::string const& processName ) { - Clara::CommandLine cli = makeCommandLineParser(); - - std::cout << "\nCatch v" << libraryVersion.majorVersion << "." - << libraryVersion.minorVersion << " build " - << libraryVersion.buildNumber; - if( libraryVersion.branchName != "master" ) - std::cout << " (" << libraryVersion.branchName << " branch)"; - std::cout << "\n"; - - cli.usage( std::cout, processName ); - std::cout << "\nFor more detail usage please see: https://github.com/philsquared/Catch/wiki/Command-line\n" << std::endl; - } - class Session { static bool alreadyInstantiated; @@ -141,7 +127,19 @@ namespace Catch { ~Session() { Catch::cleanUp(); } + + void showHelp( std::string const& processName ) { + std::cout << "\nCatch v" << libraryVersion.majorVersion << "." + << libraryVersion.minorVersion << " build " + << libraryVersion.buildNumber; + if( libraryVersion.branchName != "master" ) + std::cout << " (" << libraryVersion.branchName << " branch)"; + std::cout << "\n"; + cli.usage( std::cout, processName ); + std::cout << "For more detail usage please see the project docs\n" << std::endl; + } + int applyCommandLine( int argc, char* const argv[], OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) { try { unusedTokens = cli.parseInto( argc, argv, configData ); diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index dbf45c07..4b0e655b 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -110,11 +110,11 @@ namespace Catch { .longOpt( "warn" ) .argName( "warning name" ); - cli.bind( &setVerbosity ) - .describe( "level of verbosity (0=no output)" ) - .shortOpt( "v") - .longOpt( "verbosity" ) - .argName( "level" ); +// cli.bind( &setVerbosity ) +// .describe( "level of verbosity (0=no output)" ) +// .shortOpt( "v") +// .longOpt( "verbosity" ) +// .argName( "level" ); cli.bind( &addTestOrTags ) .describe( "which test or tests to use" ) From f438e04b5d434ba7ca26a18d68ca0f8756aa542d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 6 Jun 2013 22:54:42 +0100 Subject: [PATCH 279/296] list options return number listed --- include/catch_runner.hpp | 4 ++-- include/internal/catch_list.hpp | 37 +++++++++++++------------------ include/internal/catch_option.hpp | 7 ++++-- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 37a8ed2e..cd6d87e9 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -194,8 +194,8 @@ namespace Catch { Runner runner( config ); // Handle list request - if( list( config ) ) - return 0; + if( Option listed = list( config ) ) + return static_cast( *listed ); return static_cast( runner.runTests().assertions.failed ); } diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index e583bb87..263cd515 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -25,7 +25,7 @@ namespace Catch { return true; } - inline void listTests( Ptr const& config ) { + inline std::size_t listTests( Ptr const& config ) { if( config->filters().empty() ) std::cout << "All available test cases:\n"; else @@ -98,9 +98,10 @@ namespace Catch { std::cout << pluralise( matchedTests, "test case" ) << std::endl; else std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; + return matchedTests; } - inline void listTags( Ptr const& config ) { + inline std::size_t listTags( Ptr const& config ) { if( config->filters().empty() ) std::cout << "All available tags:\n"; else @@ -150,34 +151,28 @@ namespace Catch { << "\n"; } std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; + return tagCounts.size(); } - inline void listReporters( Ptr const& /*config*/ ) { + inline std::size_t listReporters( Ptr const& /*config*/ ) { std::cout << "Available reports:\n"; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); IReporterRegistry::FactoryMap::const_iterator it = factories.begin(), itEnd = factories.end(); - for(; it != itEnd; ++it ) { - // !TBD: consider listAs() + for(; it != itEnd; ++it ) std::cout << "\t" << it->first << "\n\t\t'" << it->second->getDescription() << "'\n"; - } std::cout << std::endl; + return factories.size(); } - inline bool list( Ptr const& config ) { - bool listed = false; - if( config->listTests() ) { - listTests( config ); - listed = true; - } - if( config->listTags() ) { - listTags( config ); - listed = true; - } - if( config->listReporters() ) { - listReporters( config ); - listed = true; - } - return listed; + inline Option list( Ptr const& config ) { + Option listedCount; + if( config->listTests() ) + listedCount = listedCount.valueOr(0) + listTests( config ); + if( config->listTags() ) + listedCount = listedCount.valueOr(0) + listTags( config ); + if( config->listReporters() ) + listedCount = listedCount.valueOr(0) + listReporters( config ); + return listedCount; } } // end namespace Catch diff --git a/include/internal/catch_option.hpp b/include/internal/catch_option.hpp index 9d6dec15..c56e1582 100644 --- a/include/internal/catch_option.hpp +++ b/include/internal/catch_option.hpp @@ -45,9 +45,13 @@ namespace Catch { T* operator->() { return nullableValue; } const T* operator->() const { return nullableValue; } + T valueOr( T const& defaultValue ) const { + return nullableValue ? *nullableValue : defaultValue; + } + bool some() const { return nullableValue != NULL; } bool none() const { return nullableValue == NULL; } - + bool operator !() const { return nullableValue == NULL; } operator SafeBool::type() const { return SafeBool::makeSafe( some() ); @@ -58,7 +62,6 @@ namespace Catch { char storage[sizeof(T)]; }; - } // end namespace Catch #endif // TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED From 8fde14313bbc7cdb4e3f4f60a5b23687ff03c234 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 7 Jun 2013 08:04:05 +0100 Subject: [PATCH 280/296] Session vars are public --- include/catch_runner.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index cd6d87e9..3e4a6e81 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -205,11 +205,10 @@ namespace Catch { } } - private: - Clara::CommandLine cli; - std::vector unusedTokens; - ConfigData configData; - Ptr config; + Clara::CommandLine cli; + std::vector unusedTokens; + ConfigData configData; + Ptr config; }; bool Session::alreadyInstantiated = false; From 80557647d6464284a0b211477aea08273e35ae1d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 7 Jun 2013 18:41:22 +0100 Subject: [PATCH 281/296] re-encapsulated session vars. - construct Config object lazily --- include/catch_runner.hpp | 57 +++++++++++++++++++++------------ include/internal/catch_list.hpp | 26 +++++++-------- 2 files changed, 49 insertions(+), 34 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 3e4a6e81..586a3823 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -116,7 +116,7 @@ namespace Catch { struct OnUnusedOptions { enum DoWhat { Ignore, Fail }; }; Session() - : cli( makeCommandLineParser() ) { + : m_cli( makeCommandLineParser() ) { if( alreadyInstantiated ) { std::string msg = "Only one instance of Catch::Session can ever be used"; std::cerr << msg << std::endl; @@ -136,38 +136,38 @@ namespace Catch { std::cout << " (" << libraryVersion.branchName << " branch)"; std::cout << "\n"; - cli.usage( std::cout, processName ); + m_cli.usage( std::cout, processName ); std::cout << "For more detail usage please see the project docs\n" << std::endl; } int applyCommandLine( int argc, char* const argv[], OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) { try { - unusedTokens = cli.parseInto( argc, argv, configData ); + m_unusedTokens = m_cli.parseInto( argc, argv, m_configData ); if( unusedOptionBehaviour == OnUnusedOptions::Fail ) enforceNoUsedTokens(); - if( configData.showHelp ) - showHelp( configData.processName ); - config.reset(); + if( m_configData.showHelp ) + showHelp( m_configData.processName ); + m_config.reset(); } catch( std::exception& ex ) { std::cerr << "\nError in input:\n" << " " << ex.what() << "\n\n"; - cli.usage( std::cout, configData.processName ); + m_cli.usage( std::cout, m_configData.processName ); return (std::numeric_limits::max)(); } return 0; } void useConfigData( ConfigData const& _configData ) { - configData = _configData; - config.reset(); + m_configData = _configData; + m_config.reset(); } void enforceNoUsedTokens() const { - if( !unusedTokens.empty() ) { + if( !m_unusedTokens.empty() ) { std::vector::const_iterator - it = unusedTokens.begin(), - itEnd = unusedTokens.end(); + it = m_unusedTokens.begin(), + itEnd = m_unusedTokens.end(); std::string msg; for(; it != itEnd; ++it ) msg += " unrecognised option: " + it->data + "\n"; @@ -184,17 +184,16 @@ namespace Catch { } int run() { - if( configData.showHelp ) + if( m_configData.showHelp ) return 0; try { - if( !config ) - config = new Config( configData ); - Runner runner( config ); + config(); // Force config to be constructed + Runner runner( m_config ); // Handle list request - if( Option listed = list( config ) ) + if( Option listed = list( config() ) ) return static_cast( *listed ); return static_cast( runner.runTests().assertions.failed ); @@ -205,10 +204,26 @@ namespace Catch { } } - Clara::CommandLine cli; - std::vector unusedTokens; - ConfigData configData; - Ptr config; + Clara::CommandLine const& cli() const { + return m_cli; + } + std::vector const& unusedTokens() const { + return m_unusedTokens; + } + ConfigData& configData() { + return m_configData; + } + Config& config() { + if( !m_config ) + m_config = new Config( m_configData ); + return *m_config; + } + + private: + Clara::CommandLine m_cli; + std::vector m_unusedTokens; + ConfigData m_configData; + Ptr m_config; }; bool Session::alreadyInstantiated = false; diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 263cd515..842beca9 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -25,8 +25,8 @@ namespace Catch { return true; } - inline std::size_t listTests( Ptr const& config ) { - if( config->filters().empty() ) + inline std::size_t listTests( Config const& config ) { + if( config.filters().empty() ) std::cout << "All available test cases:\n"; else std::cout << "Matching test cases:\n"; @@ -37,7 +37,7 @@ namespace Catch { std::size_t maxTagLen = 0; std::size_t maxNameLen = 0; for(; it != itEnd; ++it ) { - if( matchesFilters( config->filters(), *it ) ) { + if( matchesFilters( config.filters(), *it ) ) { maxTagLen = (std::max)( it->getTestCaseInfo().tagsAsString.size(), maxTagLen ); maxNameLen = (std::max)( it->getTestCaseInfo().name.size(), maxNameLen ); } @@ -54,7 +54,7 @@ namespace Catch { std::size_t matchedTests = 0; for( it = allTests.begin(); it != itEnd; ++it ) { - if( matchesFilters( config->filters(), *it ) ) { + if( matchesFilters( config.filters(), *it ) ) { matchedTests++; // !TBD: consider listAs() Text nameWrapper( it->getTestCaseInfo().name, @@ -94,15 +94,15 @@ namespace Catch { } } } - if( config->filters().empty() ) + if( config.filters().empty() ) std::cout << pluralise( matchedTests, "test case" ) << std::endl; else std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; return matchedTests; } - inline std::size_t listTags( Ptr const& config ) { - if( config->filters().empty() ) + inline std::size_t listTags( Config const& config ) { + if( config.filters().empty() ) std::cout << "All available tags:\n"; else std::cout << "Matching tags:\n"; @@ -114,7 +114,7 @@ namespace Catch { std::size_t maxTagLen = 0; for(; it != itEnd; ++it ) { - if( matchesFilters( config->filters(), *it ) ) { + if( matchesFilters( config.filters(), *it ) ) { for( std::set::const_iterator tagIt = it->getTestCaseInfo().tags.begin(), tagItEnd = it->getTestCaseInfo().tags.end(); tagIt != tagItEnd; @@ -154,7 +154,7 @@ namespace Catch { return tagCounts.size(); } - inline std::size_t listReporters( Ptr const& /*config*/ ) { + inline std::size_t listReporters( Config const& /*config*/ ) { std::cout << "Available reports:\n"; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); IReporterRegistry::FactoryMap::const_iterator it = factories.begin(), itEnd = factories.end(); @@ -164,13 +164,13 @@ namespace Catch { return factories.size(); } - inline Option list( Ptr const& config ) { + inline Option list( Config const& config ) { Option listedCount; - if( config->listTests() ) + if( config.listTests() ) listedCount = listedCount.valueOr(0) + listTests( config ); - if( config->listTags() ) + if( config.listTags() ) listedCount = listedCount.valueOr(0) + listTags( config ); - if( config->listReporters() ) + if( config.listReporters() ) listedCount = listedCount.valueOr(0) + listReporters( config ); return listedCount; } From 27cae858d0c03a2f9775a8b044a304866831b161 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 7 Jun 2013 18:56:43 +0100 Subject: [PATCH 282/296] Use Text formatter to list reporters --- include/internal/catch_list.hpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 842beca9..0be1c5ab 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -95,9 +95,9 @@ namespace Catch { } } if( config.filters().empty() ) - std::cout << pluralise( matchedTests, "test case" ) << std::endl; + std::cout << pluralise( matchedTests, "test case" ) << "\n" << std::endl; else - std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; + std::cout << pluralise( matchedTests, "matching test case" ) << "\n" << std::endl; return matchedTests; } @@ -150,16 +150,29 @@ namespace Catch { std::cout << countIt->second << "\n"; } - std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; + std::cout << pluralise( tagCounts.size(), "tag" ) << "\n" << std::endl; return tagCounts.size(); } inline std::size_t listReporters( Config const& /*config*/ ) { std::cout << "Available reports:\n"; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); - IReporterRegistry::FactoryMap::const_iterator it = factories.begin(), itEnd = factories.end(); - for(; it != itEnd; ++it ) - std::cout << "\t" << it->first << "\n\t\t'" << it->second->getDescription() << "'\n"; + IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it; + std::size_t maxNameLen = 0; + for(it = itBegin; it != itEnd; ++it ) + maxNameLen = (std::max)( maxNameLen, it->first.size() ); + + for(it = itBegin; it != itEnd; ++it ) { + Text wrapper( it->second->getDescription(), TextAttributes() + .setInitialIndent( 0 ) + .setIndent( 7+maxNameLen ) + .setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 ) ); + std::cout << " " + << it->first + << ":" + << std::string( maxNameLen - it->first.size() + 2, ' ' ) + << wrapper << "\n"; + } std::cout << std::endl; return factories.size(); } From 11381c146cce97465e52ee5ff959157fb1af658f Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 7 Jun 2013 19:06:30 +0100 Subject: [PATCH 283/296] Tweaked indentation of errors and test lists --- include/catch_runner.hpp | 5 ++++- include/internal/catch_config.hpp | 30 ++++++++++++++++-------------- include/internal/catch_list.hpp | 11 ++++++++--- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 586a3823..6127c36f 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -151,7 +151,10 @@ namespace Catch { } catch( std::exception& ex ) { std::cerr << "\nError in input:\n" - << " " << ex.what() << "\n\n"; + << Text( ex.what(), TextAttributes() + .setInitialIndent(2) + .setIndent(4) ) + << "\n\n"; m_cli.usage( std::cout, m_configData.processName ); return (std::numeric_limits::max)(); } diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 87e4d552..184649ef 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -88,21 +88,23 @@ namespace Catch { : m_data( data ), m_os( std::cout.rdbuf() ) { - std::string groupName; - for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) { - if( i != 0 ) - groupName += " "; - groupName += data.testsOrTags[i]; + if( !data.testsOrTags.empty() ) { + std::string groupName; + for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) { + if( i != 0 ) + groupName += " "; + groupName += data.testsOrTags[i]; + } + TestCaseFilters filters( groupName ); + for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) { + std::string filter = data.testsOrTags[i]; + if( startsWith( filter, "[" ) || startsWith( filter, "~[" ) ) + filters.addTags( filter ); + else + filters.addFilter( TestCaseFilter( filter ) ); + } + m_filterSets.push_back( filters ); } - TestCaseFilters filters( groupName ); - for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) { - std::string filter = data.testsOrTags[i]; - if( startsWith( filter, "[" ) || startsWith( filter, "~[" ) ) - filters.addTags( filter ); - else - filters.addFilter( TestCaseFilter( filter ) ); - } - m_filterSets.push_back( filters ); } virtual ~Config() { diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 0be1c5ab..6108f36d 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -56,12 +56,17 @@ namespace Catch { for( it = allTests.begin(); it != itEnd; ++it ) { if( matchesFilters( config.filters(), *it ) ) { matchedTests++; - // !TBD: consider listAs() Text nameWrapper( it->getTestCaseInfo().name, - TextAttributes().setWidth( maxNameLen ).setIndent(2) ); + TextAttributes() + .setWidth( maxNameLen ) + .setInitialIndent(2) + .setIndent(4) ); Text tagsWrapper( it->getTestCaseInfo().tagsAsString, - TextAttributes().setWidth( maxTagLen ) ); + TextAttributes() + .setWidth( maxTagLen ) + .setInitialIndent(0) + .setIndent( 2 ) ); for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) { Colour::Code colour = Colour::None; From 786959d535880c37556124b159b8c3872ded5a5f Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 7 Jun 2013 19:07:50 +0100 Subject: [PATCH 284/296] build 39 --- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 2036 ++++++++++++++-------------- 2 files changed, 1043 insertions(+), 995 deletions(-) diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index ae84eb5a..7caab555 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 38, "integration" ); + Version libraryVersion( 0, 9, 39, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 0de7b619..ee463915 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 38 (integration branch) - * Generated: 2013-04-24 19:08:42.283467 + * CATCH v0.9 build 39 (integration branch) + * Generated: 2013-06-07 19:06:43.206650 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -106,7 +106,11 @@ ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ ( defined __GNUC__ && __GNUC__ >= 3 ) || \ ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) - #define CATCH_CONFIG_VARIADIC_MACROS + +#ifndef CATCH_CONFIG_NO_VARIADIC_MACROS +#define CATCH_CONFIG_VARIADIC_MACROS +#endif + #endif namespace Catch { @@ -282,51 +286,6 @@ namespace Catch { } // end namespace Catch -#include -#include -#include - -namespace Catch { - - class TestCase; - class Stream; - struct IResultCapture; - struct IRunner; - struct IGeneratorsForTest; - struct IConfig; - - struct IContext - { - virtual ~IContext(); - - virtual IResultCapture& getResultCapture() = 0; - virtual IRunner& getRunner() = 0; - virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0; - virtual bool advanceGeneratorsForCurrentTest() = 0; - virtual const IConfig* getConfig() const = 0; - }; - - struct IMutableContext : IContext - { - virtual ~IMutableContext(); - virtual void setResultCapture( IResultCapture* resultCapture ) = 0; - virtual void setRunner( IRunner* runner ) = 0; - virtual void setConfig( const IConfig* config ) = 0; - }; - - IContext& getCurrentContext(); - IMutableContext& getCurrentMutableContext(); - void cleanUpContext(); - Stream createStream( std::string const& streamName ); - -} - -// #included from: internal/catch_test_registry.hpp -#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED - -// #included from: catch_interfaces_testcase.h -#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED - // #included from: catch_ptr.hpp #define TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED @@ -411,6 +370,51 @@ namespace Catch { #pragma clang diagnostic pop #endif +#include +#include +#include + +namespace Catch { + + class TestCase; + class Stream; + struct IResultCapture; + struct IRunner; + struct IGeneratorsForTest; + struct IConfig; + + struct IContext + { + virtual ~IContext(); + + virtual IResultCapture& getResultCapture() = 0; + virtual IRunner& getRunner() = 0; + virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0; + virtual bool advanceGeneratorsForCurrentTest() = 0; + virtual Ptr getConfig() const = 0; + }; + + struct IMutableContext : IContext + { + virtual ~IMutableContext(); + virtual void setResultCapture( IResultCapture* resultCapture ) = 0; + virtual void setRunner( IRunner* runner ) = 0; + virtual void setConfig( Ptr const& config ) = 0; + }; + + IContext& getCurrentContext(); + IMutableContext& getCurrentMutableContext(); + void cleanUpContext(); + Stream createStream( std::string const& streamName ); + +} + +// #included from: internal/catch_test_registry.hpp +#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED + +// #included from: catch_interfaces_testcase.h +#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED + #include namespace Catch { @@ -496,44 +500,44 @@ private: #ifdef CATCH_CONFIG_VARIADIC_MACROS /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TESTCASE( ... ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() + static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )() /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } /////////////////////////////////////////////////////////////////////////////// - #define TEST_CASE_METHOD( ClassName, ... )\ + #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... )\ namespace{ \ - struct INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ ) : ClassName{ \ + struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \ void test(); \ }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \ + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \ } \ - void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() + void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test() #else /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() + static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ + static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )() /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } /////////////////////////////////////////////////////////////////////////////// - #define TEST_CASE_METHOD( ClassName, TestName, Desc )\ + #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\ namespace{ \ - struct INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ ) : ClassName{ \ + struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \ void test(); \ }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \ + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \ } \ - void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test() + void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test() #endif @@ -937,6 +941,7 @@ namespace Catch { bool hasExpression() const; bool hasMessage() const; std::string getExpression() const; + std::string getExpressionInMacro() const; bool hasExpandedExpression() const; std::string getExpandedExpression() const; std::string getMessage() const; @@ -1937,13 +1942,22 @@ namespace Catch { // #included from: catch_interfaces_config.h #define TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED +#include +#include + namespace Catch { - struct IConfig { + struct IConfig : IShared { virtual ~IConfig(); virtual bool allowThrows() const = 0; + virtual std::ostream& stream() const = 0; + virtual std::string name() const = 0; + virtual bool includeSuccessfulResults() const = 0; + virtual bool shouldDebugBreak() const = 0; + virtual bool warnAboutMissingAssertions() const = 0; + virtual int abortAfter() const = 0; }; } @@ -2049,57 +2063,55 @@ namespace Catch { namespace Catch { - struct Include { enum WhichResults { - FailedOnly, - SuccessfulResults - }; }; - - struct List{ enum What { - None = 0, - - Reports = 1, - Tests = 2, - Tags = 4, - All = Reports | Tests | Tags, - - WhatMask = 0xf, - - AsText = 0x10, - AsXml = 0x20, - - AsMask = 0xf0 - }; }; - struct ConfigData { + struct Verbosity { enum Level { + NoOutput = 0, + Quiet, + Normal + }; }; + struct WarnAbout { enum What { Nothing = 0x00, NoAssertions = 0x01 }; }; ConfigData() - : listSpec( List::None ), + : listTests( false ), + listTags( false ), + listReporters( false ), + showSuccessfulTests( false ), shouldDebugBreak( false ), - includeWhichResults( Include::FailedOnly ), - cutoff( -1 ), - allowThrows( true ), + noThrow( false ), + showHelp( false ), + abortAfter( -1 ), + verbosity( Verbosity::Normal ), warnings( WarnAbout::Nothing ) {} - std::string reporter; - std::string outputFilename; - List::What listSpec; - std::vector filters; + bool listTests; + bool listTags; + bool listReporters; + + bool showSuccessfulTests; bool shouldDebugBreak; - std::string stream; - Include::WhichResults includeWhichResults; - std::string name; - int cutoff; - bool allowThrows; + bool noThrow; + bool showHelp; + + int abortAfter; + + Verbosity::Level verbosity; WarnAbout::What warnings; + + std::string reporterName; + std::string outputFilename; + std::string name; + std::string processName; + + std::vector testsOrTags; }; - class Config : public IConfig { + class Config : public SharedImpl { private: Config( Config const& other ); Config& operator = ( Config const& other ); @@ -2113,7 +2125,25 @@ namespace Catch { Config( ConfigData const& data ) : m_data( data ), m_os( std::cout.rdbuf() ) - {} + { + if( !data.testsOrTags.empty() ) { + std::string groupName; + for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) { + if( i != 0 ) + groupName += " "; + groupName += data.testsOrTags[i]; + } + TestCaseFilters filters( groupName ); + for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) { + std::string filter = data.testsOrTags[i]; + if( startsWith( filter, "[" ) || startsWith( filter, "~[" ) ) + filters.addTags( filter ); + else + filters.addFilter( TestCaseFilter( filter ) ); + } + m_filterSets.push_back( filters ); + } + } virtual ~Config() { m_os.rdbuf( std::cout.rdbuf() ); @@ -2124,34 +2154,22 @@ namespace Catch { m_data.outputFilename = filename; } - List::What getListSpec( void ) const { - return m_data.listSpec; - } - std::string const& getFilename() const { return m_data.outputFilename ; } - List::What listWhat() const { - return static_cast( m_data.listSpec & List::WhatMask ); - } + bool listTests() const { return m_data.listTests; } + bool listTags() const { return m_data.listTags; } + bool listReporters() const { return m_data.listReporters; } - List::What listAs() const { - return static_cast( m_data.listSpec & List::AsMask ); - } - - std::string getName() const { - return m_data.name; + std::string getProcessName() const { + return m_data.processName; } bool shouldDebugBreak() const { return m_data.shouldDebugBreak; } - virtual std::ostream& stream() const { - return m_os; - } - void setStreamBuf( std::streambuf* buf ) { m_os.rdbuf( buf ? buf : std::cout.rdbuf() ); } @@ -2163,37 +2181,37 @@ namespace Catch { m_stream = stream; } + std::string getReporterName() const { return m_data.reporterName; } + void addTestSpec( std::string const& testSpec ) { TestCaseFilters filters( testSpec ); filters.addFilter( TestCaseFilter( testSpec ) ); - m_data.filters.push_back( filters ); + m_filterSets.push_back( filters ); } - virtual bool includeSuccessfulResults() const { - return m_data.includeWhichResults == Include::SuccessfulResults; + int abortAfter() const { + return m_data.abortAfter; } - int getCutoff() const { - return m_data.cutoff; + std::vector const& filters() const { + return m_filterSets; } - virtual bool allowThrows() const { - return m_data.allowThrows; - } + bool showHelp() const { return m_data.showHelp; } - ConfigData const& data() const { - return m_data; - } - ConfigData& data() { - return m_data; - } + // IConfig interface + virtual bool allowThrows() const { return !m_data.noThrow; } + virtual std::ostream& stream() const { return m_os; } + virtual std::string name() const { return m_data.name.empty() ? m_data.processName : m_data.name; } + virtual bool includeSuccessfulResults() const { return m_data.showSuccessfulTests; } + virtual bool warnAboutMissingAssertions() const { return m_data.warnings & ConfigData::WarnAbout::NoAssertions; } private: ConfigData m_data; - // !TBD Move these out of here Stream m_stream; mutable std::ostream m_os; + std::vector m_filterSets; }; } // end namespace Catch @@ -2236,6 +2254,10 @@ namespace Catch { T* operator->() { return nullableValue; } const T* operator->() const { return nullableValue; } + T valueOr( T const& defaultValue ) const { + return nullableValue ? *nullableValue : defaultValue; + } + bool some() const { return nullableValue != NULL; } bool none() const { return nullableValue == NULL; } @@ -2258,17 +2280,18 @@ namespace Catch { namespace Catch { struct ReporterConfig { - ReporterConfig( std::ostream& _stream, ConfigData const& _fullConfig ) + explicit ReporterConfig( Ptr const& _fullConfig ) + : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {} + + ReporterConfig( Ptr const& _fullConfig, std::ostream& _stream ) : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} - std::ostream& stream() const { return *m_stream; } - std::string name() const { return m_fullConfig.name; } - bool includeSuccessfulResults() const { return m_fullConfig.includeWhichResults == Include::SuccessfulResults; } - bool warnAboutMissingAssertions() const { return m_fullConfig.warnings & ConfigData::WarnAbout::NoAssertions; } + std::ostream& stream() const { return *m_stream; } + Ptr fullConfig() const { return m_fullConfig; } private: std::ostream* m_stream; - ConfigData m_fullConfig; + Ptr m_fullConfig; }; struct ReporterPreferences { @@ -2451,7 +2474,7 @@ namespace Catch struct StreamingReporterBase : SharedImpl { StreamingReporterBase( ReporterConfig const& _config ) - : m_config( _config ), + : m_config( _config.fullConfig() ), stream( _config.stream() ) {} @@ -2498,7 +2521,7 @@ namespace Catch testRunInfo.reset(); } - ReporterConfig m_config; + Ptr m_config; Option testRunInfo; Option unusedGroupInfo; Option unusedTestCaseInfo; @@ -2554,7 +2577,7 @@ namespace Catch typedef std::map FactoryMap; virtual ~IReporterRegistry(); - virtual IStreamingReporter* create( std::string const& name, ReporterConfig const& config ) const = 0; + virtual IStreamingReporter* create( std::string const& name, Ptr const& config ) const = 0; virtual FactoryMap const& getFactories() const = 0; }; @@ -3572,676 +3595,8 @@ return @ desc; \ // #included from: internal/catch_commandline.hpp #define TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED -namespace Catch { - - class Command { - public: - Command(){} - - explicit Command( std::string const& name ) : m_name( name ) { - } - - Command& operator += ( std::string const& arg ) { - m_args.push_back( arg ); - return *this; - } - Command& operator += ( Command const& other ) { - std::copy( other.m_args.begin(), other.m_args.end(), std::back_inserter( m_args ) ); - if( m_name.empty() ) - m_name = other.m_name; - return *this; - } - Command operator + ( Command const& other ) { - Command newCommand( *this ); - newCommand += other; - return newCommand; - } - - operator SafeBool::type() const { - return SafeBool::makeSafe( !m_name.empty() || !m_args.empty() ); - } - - std::string name() const { return m_name; } - std::string operator[]( std::size_t i ) const { return m_args[i]; } - std::size_t argsCount() const { return m_args.size(); } - - void raiseError( std::string const& message ) const { - std::ostringstream oss; - if( m_name.empty() ) - oss << "Error while parsing " << m_name << ". " << message << "."; - else - oss << "Error while parsing arguments. " << message << "."; - - if( m_args.size() > 0 ) - oss << " Arguments were:"; - for( std::size_t i = 0; i < m_args.size(); ++i ) - oss << " " << m_args[i]; - if( isTrue( true ) ) - throw std::domain_error( oss.str() ); - } - - private: - - std::string m_name; - std::vector m_args; - }; - - class CommandParser { - public: - CommandParser( int argc, char const * const * argv ) : m_argc( static_cast( argc ) ), m_argv( argv ) {} - - std::string exeName() const { - std::string exeName = m_argv[0]; - std::string::size_type pos = exeName.find_last_of( "/\\" ); - if( pos != std::string::npos ) - exeName = exeName.substr( pos+1 ); - return exeName; - } - Command find( std::string const& arg1, std::string const& arg2, std::string const& arg3 ) const { - return find( arg1 ) + find( arg2 ) + find( arg3 ); - } - - Command find( std::string const& shortArg, std::string const& longArg ) const { - return find( shortArg ) + find( longArg ); - } - Command find( std::string const& arg ) const { - if( arg.empty() ) - return getArgs( "", 1 ); - else - for( std::size_t i = 1; i < m_argc; ++i ) - if( m_argv[i] == arg ) - return getArgs( m_argv[i], i+1 ); - return Command(); - } - Command getDefaultArgs() const { - return getArgs( "", 1 ); - } - - private: - Command getArgs( std::string const& cmdName, std::size_t from ) const { - Command command( cmdName ); - for( std::size_t i = from; i < m_argc && m_argv[i][0] != '-'; ++i ) - command += m_argv[i]; - return command; - } - - std::size_t m_argc; - char const * const * m_argv; - }; - - class OptionParser : public SharedImpl { - public: - OptionParser( int minArgs = 0, int maxArgs = 0 ) - : m_minArgs( minArgs ), m_maxArgs( maxArgs ) - {} - - virtual ~OptionParser() {} - - Command find( CommandParser const& parser ) const { - Command cmd; - for( std::vector::const_iterator it = m_optionNames.begin(); - it != m_optionNames.end(); - ++it ) - cmd += parser.find( *it ); - return cmd; - } - - void validateArgs( Command const& args ) const { - if( tooFewArgs( args ) || tooManyArgs( args ) ) { - std::ostringstream oss; - if( m_maxArgs == -1 ) - oss <<"Expected at least " << pluralise( static_cast( m_minArgs ), "argument" ); - else if( m_minArgs == m_maxArgs ) - oss <<"Expected " << pluralise( static_cast( m_minArgs ), "argument" ); - else - oss <<"Expected between " << m_minArgs << " and " << m_maxArgs << " argument"; - args.raiseError( oss.str() ); - } - } - - void parseIntoConfig( CommandParser const& parser, ConfigData& config ) { - if( Command cmd = find( parser ) ) { - validateArgs( cmd ); - parseIntoConfig( cmd, config ); - } - } - - virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) = 0; - virtual std::string argsSynopsis() const = 0; - virtual std::string optionSummary() const = 0; - virtual std::string optionDescription() const { return ""; } - - std::string optionNames() const { - std::string names; - for( std::vector::const_iterator it = m_optionNames.begin(); - it != m_optionNames.end(); - ++it ) { - if( !it->empty() ) { - if( !names.empty() ) - names += ", "; - names += *it; - } - else { - names = "[" + names; - } - } - if( names[0] == '[' ) - names += "]"; - return names; - } - - protected: - - bool tooFewArgs( Command const& args ) const { - return args.argsCount() < static_cast( m_minArgs ); - } - bool tooManyArgs( Command const& args ) const { - return m_maxArgs >= 0 && args.argsCount() > static_cast( m_maxArgs ); - } - std::vector m_optionNames; - int m_minArgs; - int m_maxArgs; - }; - - namespace Options { - - class HelpOptionParser : public OptionParser { - public: - HelpOptionParser() { - m_optionNames.push_back( "-?" ); - m_optionNames.push_back( "-h" ); - m_optionNames.push_back( "--help" ); - } - virtual std::string argsSynopsis() const { - return "[