From 5baa29b6b9405913455ba5f628679575c7b915ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sat, 23 Apr 2022 23:34:27 +0200 Subject: [PATCH] Add test for %debug stream name --- tests/SelfTest/Baselines/automake.sw.approved.txt | 1 + .../Baselines/automake.sw.multi.approved.txt | 1 + tests/SelfTest/Baselines/compact.sw.approved.txt | 1 + .../Baselines/compact.sw.multi.approved.txt | 1 + tests/SelfTest/Baselines/console.std.approved.txt | 4 ++-- tests/SelfTest/Baselines/console.sw.approved.txt | 13 +++++++++++-- .../Baselines/console.sw.multi.approved.txt | 13 +++++++++++-- tests/SelfTest/Baselines/junit.sw.approved.txt | 3 ++- .../Baselines/junit.sw.multi.approved.txt | 3 ++- .../SelfTest/Baselines/sonarqube.sw.approved.txt | 1 + .../Baselines/sonarqube.sw.multi.approved.txt | 1 + tests/SelfTest/Baselines/tap.sw.approved.txt | 4 +++- .../SelfTest/Baselines/tap.sw.multi.approved.txt | 4 +++- tests/SelfTest/Baselines/teamcity.sw.approved.txt | 2 ++ .../Baselines/teamcity.sw.multi.approved.txt | 2 ++ tests/SelfTest/Baselines/xml.sw.approved.txt | 15 +++++++++++++-- .../SelfTest/Baselines/xml.sw.multi.approved.txt | 15 +++++++++++++-- .../SelfTest/IntrospectiveTests/Stream.tests.cpp | 4 ++++ 18 files changed, 74 insertions(+), 14 deletions(-) diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt index 8da193da..a0e83826 100644 --- a/tests/SelfTest/Baselines/automake.sw.approved.txt +++ b/tests/SelfTest/Baselines/automake.sw.approved.txt @@ -320,6 +320,7 @@ loose text artifact :test-result: PASS long long :test-result: FAIL looped SECTION tests :test-result: FAIL looped tests +:test-result: PASS makeStream recognizes %debug stream name :test-result: PASS make_unique reimplementation :test-result: PASS mean :test-result: PASS measure diff --git a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt index c95a970d..a1dd3ffc 100644 --- a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt @@ -312,6 +312,7 @@ :test-result: PASS long long :test-result: FAIL looped SECTION tests :test-result: FAIL looped tests +:test-result: PASS makeStream recognizes %debug stream name :test-result: PASS make_unique reimplementation :test-result: PASS mean :test-result: PASS measure diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index bf9482c6..0f5d6fb9 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -2269,6 +2269,7 @@ Misc.tests.cpp:: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 mes Misc.tests.cpp:: passed: ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if fib[5] (8) is even' Misc.tests.cpp:: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[6] (13) is even' Misc.tests.cpp:: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[7] (21) is even' +Stream.tests.cpp:: passed: Catch::makeStream( "%debug" ) UniquePtr.tests.cpp:: passed: !(lval.has_moved) for: !false UniquePtr.tests.cpp:: passed: rval.has_moved for: true UniquePtr.tests.cpp:: passed: *ptr == std::tuple{1, 2., 3} for: {?} == {?} diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt index a94192eb..f3655ea8 100644 --- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -2261,6 +2261,7 @@ Misc.tests.cpp:: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 mes Misc.tests.cpp:: passed: ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if fib[5] (8) is even' Misc.tests.cpp:: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[6] (13) is even' Misc.tests.cpp:: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[7] (21) is even' +Stream.tests.cpp:: passed: Catch::makeStream( "%debug" ) UniquePtr.tests.cpp:: passed: !(lval.has_moved) for: !false UniquePtr.tests.cpp:: passed: rval.has_moved for: true UniquePtr.tests.cpp:: passed: *ptr == std::tuple{1, 2., 3} for: {?} == {?} diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt index c85a9203..fd2bff6e 100644 --- a/tests/SelfTest/Baselines/console.std.approved.txt +++ b/tests/SelfTest/Baselines/console.std.approved.txt @@ -1394,6 +1394,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 390 | 314 passed | 69 failed | 7 failed as expected -assertions: 2225 | 2070 passed | 128 failed | 27 failed as expected +test cases: 391 | 315 passed | 69 failed | 7 failed as expected +assertions: 2226 | 2071 passed | 128 failed | 27 failed as expected diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 8bb1c3db..acfbe42e 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -15975,6 +15975,15 @@ with expansion: with message: Testing if fib[7] (21) is even +------------------------------------------------------------------------------- +makeStream recognizes %debug stream name +------------------------------------------------------------------------------- +Stream.tests.cpp: +............................................................................... + +Stream.tests.cpp:: PASSED: + REQUIRE_NOTHROW( Catch::makeStream( "%debug" ) ) + ------------------------------------------------------------------------------- make_unique reimplementation From lvalue copies @@ -17925,6 +17934,6 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== -test cases: 390 | 300 passed | 83 failed | 7 failed as expected -assertions: 2240 | 2070 passed | 143 failed | 27 failed as expected +test cases: 391 | 301 passed | 83 failed | 7 failed as expected +assertions: 2241 | 2071 passed | 143 failed | 27 failed as expected diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt index a64c56a5..1268daff 100644 --- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -15967,6 +15967,15 @@ with expansion: with message: Testing if fib[7] (21) is even +------------------------------------------------------------------------------- +makeStream recognizes %debug stream name +------------------------------------------------------------------------------- +Stream.tests.cpp: +............................................................................... + +Stream.tests.cpp:: PASSED: + REQUIRE_NOTHROW( Catch::makeStream( "%debug" ) ) + ------------------------------------------------------------------------------- make_unique reimplementation From lvalue copies @@ -17917,6 +17926,6 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== -test cases: 390 | 300 passed | 83 failed | 7 failed as expected -assertions: 2240 | 2070 passed | 143 failed | 27 failed as expected +test cases: 391 | 301 passed | 83 failed | 7 failed as expected +assertions: 2241 | 2071 passed | 143 failed | 27 failed as expected diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt index 1c2c3f93..fc059acd 100644 --- a/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + @@ -1727,6 +1727,7 @@ Testing if fib[7] (21) is even Misc.tests.cpp: + diff --git a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt index 6619466b..06ade42c 100644 --- a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt @@ -1,6 +1,6 @@ - + @@ -1726,6 +1726,7 @@ Testing if fib[7] (21) is even Misc.tests.cpp: + diff --git a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt index f2ec6f49..4cdab2d3 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -224,6 +224,7 @@ + diff --git a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt index 98cb8b7d..d5608195 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt @@ -223,6 +223,7 @@ + diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index a2e69782..b893dcdd 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -4019,6 +4019,8 @@ ok {test-number} - ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if f not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[6] (13) is even' # looped tests not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[7] (21) is even' +# makeStream recognizes %debug stream name +ok {test-number} - Catch::makeStream( "%debug" ) # make_unique reimplementation ok {test-number} - !(lval.has_moved) for: !false # make_unique reimplementation @@ -4483,5 +4485,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2240 +1..2241 diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt index 69d85c7a..3cbba8f6 100644 --- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -4011,6 +4011,8 @@ ok {test-number} - ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if f not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[6] (13) is even' # looped tests not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[7] (21) is even' +# makeStream recognizes %debug stream name +ok {test-number} - Catch::makeStream( "%debug" ) # make_unique reimplementation ok {test-number} - !(lval.has_moved) for: !false # make_unique reimplementation @@ -4475,5 +4477,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2240 +1..2241 diff --git a/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.approved.txt index 2ef7d121..c028b21a 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.approved.txt @@ -779,6 +779,8 @@ Misc.tests.cpp:|nexpression failed with message:|n "Testing if fib Misc.tests.cpp:|nexpression failed with message:|n "Testing if fib|[6|] (13) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] Misc.tests.cpp:|nexpression failed with message:|n "Testing if fib|[7|] (21) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] ##teamcity[testFinished name='looped tests' duration="{duration}"] +##teamcity[testStarted name='makeStream recognizes %debug stream name'] +##teamcity[testFinished name='makeStream recognizes %debug stream name' duration="{duration}"] ##teamcity[testStarted name='make_unique reimplementation'] ##teamcity[testFinished name='make_unique reimplementation' duration="{duration}"] ##teamcity[testStarted name='mean'] diff --git a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt index 4edcdab5..9f534639 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt @@ -778,6 +778,8 @@ Misc.tests.cpp:|nexpression failed with message:|n "Testing if fib Misc.tests.cpp:|nexpression failed with message:|n "Testing if fib|[6|] (13) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] Misc.tests.cpp:|nexpression failed with message:|n "Testing if fib|[7|] (21) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] ##teamcity[testFinished name='looped tests' duration="{duration}"] +##teamcity[testStarted name='makeStream recognizes %debug stream name'] +##teamcity[testFinished name='makeStream recognizes %debug stream name' duration="{duration}"] ##teamcity[testStarted name='make_unique reimplementation'] ##teamcity[testFinished name='make_unique reimplementation' duration="{duration}"] ##teamcity[testStarted name='mean'] diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index 95d1c51a..27dad165 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -18765,6 +18765,17 @@ loose text artifact + + + + Catch::makeStream( "%debug" ) + + + Catch::makeStream( "%debug" ) + + + +
@@ -21050,6 +21061,6 @@ loose text artifact
- - + + diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt index a222ab37..40cca5e3 100644 --- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -18764,6 +18764,17 @@ There is no extra whitespace here
+ + + + Catch::makeStream( "%debug" ) + + + Catch::makeStream( "%debug" ) + + + +
@@ -21049,6 +21060,6 @@ There is no extra whitespace here
- - + + diff --git a/tests/SelfTest/IntrospectiveTests/Stream.tests.cpp b/tests/SelfTest/IntrospectiveTests/Stream.tests.cpp index 5ad92e8c..6b1d377c 100644 --- a/tests/SelfTest/IntrospectiveTests/Stream.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/Stream.tests.cpp @@ -26,3 +26,7 @@ TEST_CASE( "stdout and stderr streams have %-starting name", "[streams]" ) { TEST_CASE( "request an unknown %-starting stream fails", "[streams]" ) { REQUIRE_THROWS( Catch::makeStream( "%somestream" ) ); } + +TEST_CASE( "makeStream recognizes %debug stream name", "[streams]" ) { + REQUIRE_NOTHROW( Catch::makeStream( "%debug" ) ); +}