diff --git a/README.md b/README.md index 79dd804e..4b321812 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](catch-logo-small.png) -*v1.0 build 17 (master branch)* +*v1.0 build 19 (master branch)* Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch) diff --git a/include/catch.hpp b/include/catch.hpp index 55623f85..bc4a15de 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -12,7 +12,7 @@ #ifdef __clang__ #pragma clang diagnostic ignored "-Wglobal-constructors" #pragma clang diagnostic ignored "-Wvariadic-macros" - +#pragma clang diagnostic ignored "-Wc99-extensions" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif @@ -102,9 +102,7 @@ #define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" ) #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_WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "CATCH_WARN", msg ) #define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "CATCH_INFO" ) #define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" ) #define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" ) @@ -114,11 +112,15 @@ #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__ ) + #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", __VA_ARGS__ ) + #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", __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 ) + #define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", msg ) + #define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", msg ) #endif #define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) @@ -163,9 +165,7 @@ #define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" ) #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 WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "WARN", msg ) #define SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "INFO" ) #define CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) #define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) @@ -175,11 +175,15 @@ #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__ ) + #define FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", __VA_ARGS__ ) + #define SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", __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 ) + #define FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", msg ) + #define SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", msg ) #endif #define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index e0bc098d..7117e091 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -193,11 +193,19 @@ namespace Catch { /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_MSG( log, messageType, resultDisposition, macroName ) \ - do { \ - INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \ - INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << log, resultDisposition, true ) \ - } while( Catch::isTrue( false ) ) +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, ... ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << __VA_ARGS__ +::Catch::StreamEndStop(), resultDisposition, true ) \ + } while( Catch::isTrue( false ) ) +#else + #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, log ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << log, resultDisposition, true ) \ + } while( Catch::isTrue( false ) ) +#endif /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_INFO( log, macroName ) \ diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 5b091b0a..a823bd64 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -91,6 +91,20 @@ namespace Catch { inline bool isTrue( bool value ){ return value; } void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ); + + // Use this in variadic streaming macros to allow + // >> +StreamEndStop + // as well as + // >> stuff +StreamEndStop + struct StreamEndStop { + std::string operator+() { + return std::string(); + } + }; + template + T const& operator + ( T const& value, StreamEndStop ) { + return value; + } } #define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h index 8191e967..6b8b89be 100644 --- a/include/internal/catch_compiler_capabilities.h +++ b/include/internal/catch_compiler_capabilities.h @@ -10,6 +10,16 @@ // Much of the following code is based on Boost (1.53) +#ifdef __clang__ + +#if __has_feature(cxx_nullptr) + +#define CATCH_CONFIG_CPP11_NULLPTR + +#endif + +#endif // __clang__ + //////////////////////////////////////////////////////////////////////////////// // Borland #ifdef __BORLANDC__ @@ -56,6 +66,11 @@ #endif // __GNUC__ < 3 +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) ) + +#define CATCH_CONFIG_CPP11_NULLPTR +#endif + #endif // __GNUC__ diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index e7ac6ca8..5748fe99 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -14,7 +14,7 @@ namespace Catch { // These numbers are maintained by a script template - const T LibraryVersionInfo::value( 1, 0, 17, "master" ); + const T LibraryVersionInfo::value( 1, 0, 19, "master" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 54bee3e5..54d3ee6f 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -428,6 +428,14 @@ MessageTests.cpp:: FAILED: explicitly with message: This is a failure +------------------------------------------------------------------------------- +FAIL does not require an argument +------------------------------------------------------------------------------- +MessageTests.cpp: +............................................................................... + +MessageTests.cpp:: FAILED: + ------------------------------------------------------------------------------- Output from all sections is reported one @@ -742,5 +750,5 @@ with expansion: "first" == "second" =============================================================================== -120 test cases - 35 failed (673 assertions - 90 failed) +122 test cases - 36 failed (675 assertions - 91 failed) diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index 7c39bd07..e0c15c68 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -2572,6 +2572,23 @@ MessageTests.cpp:: FAILED: explicitly with message: This is a failure +------------------------------------------------------------------------------- +FAIL does not require an argument +------------------------------------------------------------------------------- +MessageTests.cpp: +............................................................................... + +MessageTests.cpp:: FAILED: + +------------------------------------------------------------------------------- +SUCCESS does not require an argument +------------------------------------------------------------------------------- +MessageTests.cpp: +............................................................................... + +MessageTests.cpp:: +PASSED: + ------------------------------------------------------------------------------- Output from all sections is reported one @@ -7123,5 +7140,5 @@ with expansion: true =============================================================================== -120 test cases - 50 failed (692 assertions - 109 failed) +122 test cases - 51 failed (694 assertions - 110 failed) diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 0bb7c778..b105e986 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,5 +1,5 @@ - + @@ -262,6 +262,12 @@ This is a failure MessageTests.cpp: + + +MessageTests.cpp: + + + Message from section one diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 8b90d872..dda010b1 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -2730,6 +2730,13 @@ + + + + + + +
@@ -7398,7 +7405,7 @@ there"
- + - + diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index 7435b867..257e343e 100644 --- a/projects/SelfTest/MessageTests.cpp +++ b/projects/SelfTest/MessageTests.cpp @@ -50,10 +50,20 @@ namespace MessageTests TEST_CASE( "FAIL aborts the test", "[failing][messages][.]" ) { - if( Catch::isTrue( true ) ) - FAIL( "This is a " << "failure" ); // This should output the message and abort + FAIL( "This is a " << "failure" ); // This should output the message and abort } + #ifdef CATCH_CONFIG_VARIADIC_MACROS + TEST_CASE( "FAIL does not require an argument", "[failing][messages][.]" ) + { + FAIL(); + } + TEST_CASE( "SUCCESS does not require an argument", "[messages][.]" ) + { + SUCCEED(); + } + #endif + TEST_CASE( "Output from all sections is reported", "[failing][messages][.]" ) { SECTION( "one", "" ) diff --git a/scripts/catch_test_case.py b/scripts/catch_test_case.py index b685c9e8..e19640de 100644 --- a/scripts/catch_test_case.py +++ b/scripts/catch_test_case.py @@ -214,13 +214,17 @@ class TestCaseData: l = " " + prefix + "" lines.append(l) elif tmp[0] == "F": - l = " " + prefix + "" - lines.append(l) - for li in tmp[1]: - if len(li.strip()) > 0: - lines.append(li) - l = " " + prefix + "" - lines.append(l) + if len(tmp[1]) > 0: + l = " " + prefix + "" + lines.append(l) + for li in tmp[1]: + if len(li.strip()) > 0: + lines.append(li) + l = " " + prefix + "" + lines.append(l) + else: + l = " " + prefix + "" + lines.append(l) elif tmp[0] == "S": lines += self.generateRecursiveSection(prefix + " ", tmp) else: @@ -306,13 +310,17 @@ class TestCaseData: l = " " + prefix + "" lines.append(l) elif section[0] == "F": - l = " " + prefix + "" - lines.append(l) - for li in section[1]: - if len(li.strip()) > 0: - lines.append(li) - l = " " + prefix + "" - lines.append(l) + if len(section[1]) > 0: + l = " " + prefix + "" + lines.append(l) + for li in section[1]: + if len(li.strip()) > 0: + lines.append(li) + l = " " + prefix + "" + lines.append(l) + else: + l = " " + prefix + "" + lines.append(l) return lines def generateUnapprovedXml(self): diff --git a/scripts/validateVSTests.py b/scripts/validateVSTests.py index fa17c6c4..8938d063 100644 --- a/scripts/validateVSTests.py +++ b/scripts/validateVSTests.py @@ -23,8 +23,8 @@ else: if sys.platform == 'win32': cmdPath = os.path.join( catchPath, 'projects\\VS2010\\TestCatch\\Release\\TestCatch.exe' ) # VS2010 - #dllPath = os.path.join( catchPath, 'projects\\VS2010\\ManagedTestCatch\\Release\\ManagedTestCatch.dll' ) - dllPath = os.path.join( catchPath, 'projects\\VS2010\\ManagedTestCatch\\Debug\\ManagedTestCatch.dll' ) + dllPath = os.path.join( catchPath, 'projects\\VS2010\\ManagedTestCatch\\Release\\ManagedTestCatch.dll' ) + #dllPath = os.path.join( catchPath, 'projects\\VS2010\\ManagedTestCatch\\Debug\\ManagedTestCatch.dll' ) # VS2012 managed #dllPath = os.path.join( catchPath, 'projects\\VS2012\\ManagedTestCatch\\Debug\\ManagedTestCatch.dll' ) # VS2012 native @@ -461,8 +461,10 @@ def approveXml( baseName, args ): ls = text.splitlines() section = testcase.addWarning(ls) elif exp.tag == "Failure": - text = exp.text - ls = text.splitlines() + ls = [] + if exp.text != None: + text = exp.text + ls = text.splitlines() section = testcase.addSimpleFailure(ls) elif exp.tag == "OverallResult": testcase.addOverallResult(exp.get("success")) @@ -578,8 +580,10 @@ def approveXml( baseName, args ): ls = text.splitlines() section = testcase.addWarning(ls) elif exp.tag == "Failure": - text = exp.text - ls = text.splitlines() + ls = [] + if exp.text != None: + text = exp.text + ls = text.splitlines() section = testcase.addSimpleFailure(ls) elif exp.tag == "OverallResult": testcase.addOverallResult(exp.get("success")) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index ff06ee2c..bc2644b4 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v1.0 build 17 (master branch) - * Generated: 2013-12-11 08:27:45.976816 + * CATCH v1.0 build 19 (master branch) + * Generated: 2013-12-14 23:16:21.805565 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -16,7 +16,7 @@ #ifdef __clang__ #pragma clang diagnostic ignored "-Wglobal-constructors" #pragma clang diagnostic ignored "-Wvariadic-macros" - +#pragma clang diagnostic ignored "-Wc99-extensions" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif @@ -43,6 +43,16 @@ // Much of the following code is based on Boost (1.53) +#ifdef __clang__ + +#if __has_feature(cxx_nullptr) + +#define CATCH_CONFIG_CPP11_NULLPTR + +#endif + +#endif // __clang__ + //////////////////////////////////////////////////////////////////////////////// // Borland #ifdef __BORLANDC__ @@ -89,6 +99,11 @@ #endif // __GNUC__ < 3 +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) ) + +#define CATCH_CONFIG_CPP11_NULLPTR +#endif + #endif // __GNUC__ //////////////////////////////////////////////////////////////////////////////// @@ -183,6 +198,20 @@ namespace Catch { inline bool isTrue( bool value ){ return value; } void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ); + + // Use this in variadic streaming macros to allow + // >> +StreamEndStop + // as well as + // >> stuff +StreamEndStop + struct StreamEndStop { + std::string operator+() { + return std::string(); + } + }; + template + T const& operator + ( T const& value, StreamEndStop ) { + return value; + } } #define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) @@ -1593,11 +1622,19 @@ struct TestFailureException{}; } 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( messageType ) << log, resultDisposition, true ) \ - } while( Catch::isTrue( false ) ) +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, ... ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << __VA_ARGS__ +::Catch::StreamEndStop(), resultDisposition, true ) \ + } while( Catch::isTrue( false ) ) +#else + #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, log ) \ + do { \ + INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \ + INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << log, resultDisposition, true ) \ + } while( Catch::isTrue( false ) ) +#endif /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_INFO( log, macroName ) \ @@ -6129,7 +6166,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 17, "master" ); + Version libraryVersion( 1, 0, 19, "master" ); } // #included from: catch_text.hpp @@ -7920,9 +7957,7 @@ int main (int argc, char * const argv[]) { #define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" ) #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_WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "CATCH_WARN", msg ) #define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "CATCH_INFO" ) #define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" ) #define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" ) @@ -7932,11 +7967,15 @@ int main (int argc, char * const argv[]) { #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__ ) + #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", __VA_ARGS__ ) + #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", __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 ) + #define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", msg ) + #define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", msg ) #endif #define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) @@ -7981,9 +8020,7 @@ int main (int argc, char * const argv[]) { #define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" ) #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 WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "WARN", msg ) #define SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "INFO" ) #define CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) #define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) @@ -7993,11 +8030,15 @@ int main (int argc, char * const argv[]) { #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__ ) + #define FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", __VA_ARGS__ ) + #define SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", __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 ) + #define FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", msg ) + #define SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", msg ) #endif #define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" )