|
1 | 1 | /* |
2 | | - * Catch v1.3.6 |
3 | | - * Generated: 2016-03-11 18:30:42.852700 |
| 2 | + * Catch v1.4.0 |
| 3 | + * Generated: 2016-03-15 07:23:12.623111 |
4 | 4 | * ---------------------------------------------------------- |
5 | 5 | * This file has been merged from multiple headers. Please don't edit it directly |
6 | 6 | * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. |
|
62 | 62 |
|
63 | 63 | #define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line |
64 | 64 | #define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) |
65 | | -#define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) |
| 65 | +#ifdef CATCH_CONFIG_COUNTER |
| 66 | +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) |
| 67 | +#else |
| 68 | +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) |
| 69 | +#endif |
66 | 70 |
|
67 | 71 | #define INTERNAL_CATCH_STRINGIFY2( expr ) #expr |
68 | 72 | #define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr ) |
|
89 | 93 | // CATCH_CONFIG_CPP11_OR_GREATER : Is C++11 supported? |
90 | 94 |
|
91 | 95 | // CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported? |
92 | | - |
| 96 | +// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? |
93 | 97 | // **************** |
94 | 98 | // Note to maintainers: if new toggles are added please document them |
95 | 99 | // in configuration.md, too |
|
185 | 189 |
|
186 | 190 | #endif |
187 | 191 |
|
| 192 | +// Use __COUNTER__ if the compiler supports it |
| 193 | +#if ( defined _MSC_VER && _MSC_VER >= 1300 ) || \ |
| 194 | + ( defined __GNUC__ && __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 ) || \ |
| 195 | + ( defined __clang__ && __clang_major__ >= 3 ) |
| 196 | + |
| 197 | +#define CATCH_INTERNAL_CONFIG_COUNTER |
| 198 | + |
| 199 | +#endif |
| 200 | + |
188 | 201 | //////////////////////////////////////////////////////////////////////////////// |
189 | 202 | // C++ language feature support |
190 | 203 |
|
|
256 | 269 | #if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11) |
257 | 270 | # define CATCH_CONFIG_CPP11_UNIQUE_PTR |
258 | 271 | #endif |
| 272 | +#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) |
| 273 | +# define CATCH_CONFIG_COUNTER |
| 274 | +#endif |
259 | 275 |
|
260 | 276 | #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) |
261 | 277 | # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS |
@@ -686,49 +702,57 @@ void registerTestCaseFunction |
686 | 702 |
|
687 | 703 | #ifdef CATCH_CONFIG_VARIADIC_MACROS |
688 | 704 | /////////////////////////////////////////////////////////////////////////////// |
| 705 | + #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \ |
| 706 | + static void TestName(); \ |
| 707 | + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ |
| 708 | + static void TestName() |
689 | 709 | #define INTERNAL_CATCH_TESTCASE( ... ) \ |
690 | | - static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \ |
691 | | - 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__ ) ); }\ |
692 | | - static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )() |
| 710 | + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ ) |
693 | 711 |
|
694 | 712 | /////////////////////////////////////////////////////////////////////////////// |
695 | 713 | #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ |
696 | 714 | namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } |
697 | 715 |
|
698 | 716 | /////////////////////////////////////////////////////////////////////////////// |
699 | | - #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... )\ |
| 717 | + #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\ |
700 | 718 | namespace{ \ |
701 | | - struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \ |
| 719 | + struct TestName : ClassName{ \ |
702 | 720 | void test(); \ |
703 | 721 | }; \ |
704 | | - 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 ); \ |
| 722 | + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestName::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \ |
705 | 723 | } \ |
706 | | - void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test() |
| 724 | + void TestName::test() |
| 725 | + #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \ |
| 726 | + INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ ) |
707 | 727 |
|
708 | 728 | /////////////////////////////////////////////////////////////////////////////// |
709 | 729 | #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \ |
710 | 730 | Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); |
711 | 731 |
|
712 | 732 | #else |
713 | 733 | /////////////////////////////////////////////////////////////////////////////// |
| 734 | + #define INTERNAL_CATCH_TESTCASE2( TestName, Name, Desc ) \ |
| 735 | + static void TestName(); \ |
| 736 | + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ |
| 737 | + static void TestName() |
714 | 738 | #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \ |
715 | | - static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \ |
716 | | - 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 ) ); }\ |
717 | | - static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )() |
| 739 | + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), Name, Desc ) |
718 | 740 |
|
719 | 741 | /////////////////////////////////////////////////////////////////////////////// |
720 | 742 | #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ |
721 | 743 | namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } |
722 | 744 |
|
723 | 745 | /////////////////////////////////////////////////////////////////////////////// |
724 | | - #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\ |
| 746 | + #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestCaseName, ClassName, TestName, Desc )\ |
725 | 747 | namespace{ \ |
726 | | - struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \ |
| 748 | + struct TestCaseName : ClassName{ \ |
727 | 749 | void test(); \ |
728 | 750 | }; \ |
729 | | - 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 ); \ |
| 751 | + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestCaseName::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \ |
730 | 752 | } \ |
731 | | - void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test() |
| 753 | + void TestCaseName::test() |
| 754 | + #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\ |
| 755 | + INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, TestName, Desc ) |
732 | 756 |
|
733 | 757 | /////////////////////////////////////////////////////////////////////////////// |
734 | 758 | #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, Name, Desc ) \ |
@@ -2578,10 +2602,12 @@ namespace Catch { |
2578 | 2602 | } |
2579 | 2603 |
|
2580 | 2604 | /////////////////////////////////////////////////////////////////////////////// |
2581 | | -#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) \ |
2582 | | - static std::string INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator )( signature ); \ |
2583 | | - namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ) ); }\ |
2584 | | - static std::string INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator )( signature ) |
| 2605 | +#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \ |
| 2606 | + static std::string translatorName( signature ); \ |
| 2607 | + namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); }\ |
| 2608 | + static std::string translatorName( signature ) |
| 2609 | + |
| 2610 | +#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature ) |
2585 | 2611 |
|
2586 | 2612 | // #included from: internal/catch_approx.hpp |
2587 | 2613 | #define TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED |
@@ -5884,6 +5910,11 @@ namespace Catch { |
5884 | 5910 | while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() ); |
5885 | 5911 |
|
5886 | 5912 | Totals deltaTotals = m_totals.delta( prevTotals ); |
| 5913 | + if( testInfo.expectedToFail() && deltaTotals.testCases.passed > 0 ) { |
| 5914 | + deltaTotals.assertions.failed++; |
| 5915 | + deltaTotals.testCases.passed--; |
| 5916 | + deltaTotals.testCases.failed++; |
| 5917 | + } |
5887 | 5918 | m_totals.testCases += deltaTotals.testCases; |
5888 | 5919 | m_reporter->testCaseEnded( TestCaseStats( testInfo, |
5889 | 5920 | deltaTotals, |
@@ -7481,7 +7512,7 @@ namespace Catch { |
7481 | 7512 | return os; |
7482 | 7513 | } |
7483 | 7514 |
|
7484 | | - Version libraryVersion( 1, 3, 6, "", 0 ); |
| 7515 | + Version libraryVersion( 1, 4, 0, "", 0 ); |
7485 | 7516 |
|
7486 | 7517 | } |
7487 | 7518 |
|
@@ -9777,7 +9808,7 @@ namespace Catch { |
9777 | 9808 | if( totals.testCases.total() == 0 ) { |
9778 | 9809 | stream << Colour( Colour::Warning ) << "No tests ran\n"; |
9779 | 9810 | } |
9780 | | - else if( totals.assertions.total() > 0 && totals.assertions.allPassed() ) { |
| 9811 | + else if( totals.assertions.total() > 0 && totals.testCases.allPassed() ) { |
9781 | 9812 | stream << Colour( Colour::ResultSuccess ) << "All tests passed"; |
9782 | 9813 | stream << " (" |
9783 | 9814 | << pluralise( totals.assertions.passed, "assertion" ) << " in " |
|
0 commit comments