catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Enabled SFINAE stream test
- Commit
61ac34045c07705b13d14d84ca416cc5c28ebb79- Author
- Phil Nash ·
- Parents
569d355b3676
Changes
projects/SelfTest/Baselines/console.std.approved.txt | 4 ++-- projects/SelfTest/Baselines/console.sw.approved.txt | 18 ++++++++++++++++-- projects/SelfTest/Baselines/console.swa4.approved.txt | 18 ++++++++++++++++-- projects/SelfTest/Baselines/junit.sw.approved.txt | 3 ++- projects/SelfTest/Baselines/xml.sw.approved.txt | 18 ++++++++++++++++-- projects/SelfTest/CompilationTests.cpp | 12 ++++++++++-- 6 files changed, 62 insertions(+), 11 deletions(-) diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index e6bcf41e..2e76ce75 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -940,6 +940,6 @@ with expansion: "first" == "second" =============================================================================== -test cases: 167 | 119 passed | 44 failed | 4 failed as expected -assertions: 967 | 859 passed | 87 failed | 21 failed as expected +test cases: 168 | 120 passed | 44 failed | 4 failed as expected +assertions: 968 | 860 passed | 87 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index ac178f80..41693f3a 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -123,6 +123,20 @@ PASSED: with expansion: 1 == 1 +------------------------------------------------------------------------------- +#872 +------------------------------------------------------------------------------- +CompilationTests.cpp:<line number> +............................................................................... + +CompilationTests.cpp:<line number>: +PASSED: + REQUIRE( x == 4 ) +with expansion: + {?} == 4 +with message: + dummy := 0 + ------------------------------------------------------------------------------- 'Not' checks that should fail ------------------------------------------------------------------------------- @@ -9466,6 +9480,6 @@ MiscTests.cpp:<line number>: PASSED: =============================================================================== -test cases: 167 | 118 passed | 45 failed | 4 failed as expected -assertions: 969 | 859 passed | 89 failed | 21 failed as expected +test cases: 168 | 119 passed | 45 failed | 4 failed as expected +assertions: 970 | 860 passed | 89 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.swa4.approved.txt b/projects/SelfTest/Baselines/console.swa4.approved.txt index dcabf4e0..6ce6850a 100644 --- a/projects/SelfTest/Baselines/console.swa4.approved.txt +++ b/projects/SelfTest/Baselines/console.swa4.approved.txt @@ -123,6 +123,20 @@ PASSED: with expansion: 1 == 1 +------------------------------------------------------------------------------- +#872 +------------------------------------------------------------------------------- +CompilationTests.cpp:<line number> +............................................................................... + +CompilationTests.cpp:<line number>: +PASSED: + REQUIRE( x == 4 ) +with expansion: + {?} == 4 +with message: + dummy := 0 + ------------------------------------------------------------------------------- 'Not' checks that should fail ------------------------------------------------------------------------------- @@ -144,6 +158,6 @@ ConditionTests.cpp:<line number>: FAILED: CHECK_FALSE( true ) =============================================================================== -test cases: 6 | 3 passed | 1 failed | 2 failed as expected -assertions: 18 | 11 passed | 4 failed | 3 failed as expected +test cases: 7 | 4 passed | 1 failed | 2 failed as expected +assertions: 19 | 12 passed | 4 failed | 3 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 49df947e..ee691ce0 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuitesspanner> - <testsuite name="<exe-name>" errors="13" failures="77" tests="970" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="13" failures="77" tests="971" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <testcase classname="global" name="# A test name that starts with a #" time="{duration}"/> <testcase classname="#748 - captures with unexpected exceptions" name="outside assertions" time="{duration}"> <error type="TEST_CASE"> @@ -24,6 +24,7 @@ ExceptionTests.cpp:<line number> MiscTests.cpp:<line number> </failure> </testcase> + <testcase classname="global" name="#872" time="{duration}"/> <testcase classname="global" name="'Not' checks that should fail" time="{duration}"> <failure message="false != false" type="CHECK"> ConditionTests.cpp:<line number> diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index fed55cd0..1373c6d3 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -136,6 +136,20 @@ </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="#872" filename="projects/<exe-name>/CompilationTests.cpp" > + <Info> + dummy := 0 + </Info> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/CompilationTests.cpp" > + <Original> + x == 4 + </Original> + <Expanded> + {?} == 4 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="'Not' checks that should fail" tags="[.][failing][hide]" filename="projects/<exe-name>/ConditionTests.cpp" > <Expression success="false" type="CHECK" filename="projects/<exe-name>/ConditionTests.cpp" > <Original> @@ -10114,7 +10128,7 @@ spanner <OverallResult success="true"/> </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="859" failures="90" expectedFailures="21"/> + <OverallResults successes="860" failures="90" expectedFailures="21"/> </Group> - <OverallResults successes="859" failures="89" expectedFailures="21"/> + <OverallResults successes="860" failures="89" expectedFailures="21"/> </Catch> diff --git a/projects/SelfTest/CompilationTests.cpp b/projects/SelfTest/CompilationTests.cpp index ed1978f3..06d361fb 100644 --- a/projects/SelfTest/CompilationTests.cpp +++ b/projects/SelfTest/CompilationTests.cpp @@ -51,8 +51,12 @@ TEST_CASE("#833") { REQUIRE(templated_tests<int>(3)); } +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-function" +#endif + // Test containing example where original stream insertable check breaks compilation -#if defined (CATCH_CONFIG_CPP11_STREAM_INSERTABLE_CHECK) namespace { struct A {}; std::ostream& operator<< (std::ostream &o, const A &) { return o << 0; } @@ -64,9 +68,13 @@ namespace { B f (); std::ostream g (); } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif TEST_CASE( "#872" ) { + A dummy; + CAPTURE( dummy ); B x; REQUIRE (x == 4); } -#endif