From f06ed856d86ceb3457cb88b167570c01d6566cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 10 Aug 2017 21:38:07 +0200 Subject: [PATCH] Cherry picked 4f21bb72ff16f82b7fcf7362d683547f412641f4 (Add tests for #961) from master - had to redo the baselines --- .../Baselines/console.std.approved.txt | 4 +- .../Baselines/console.sw.approved.txt | 64 ++++++++++++++++++- .../Baselines/console.swa4.approved.txt | 64 ++++++++++++++++++- .../SelfTest/Baselines/junit.sw.approved.txt | 7 +- .../SelfTest/Baselines/xml.sw.approved.txt | 22 ++++++- projects/SelfTest/MiscTests.cpp | 8 +++ 6 files changed, 160 insertions(+), 9 deletions(-) diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 4bc5c454..42d62c9c 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -1020,6 +1020,6 @@ with expansion: "{?}" == "1" =============================================================================== -test cases: 181 | 130 passed | 47 failed | 4 failed as expected -assertions: 876 | 759 passed | 96 failed | 21 failed as expected +test cases: 182 | 131 passed | 47 failed | 4 failed as expected +assertions: 881 | 764 passed | 96 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index 17b876ea..1d228de6 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -137,6 +137,66 @@ with expansion: with message: dummy := 0 +------------------------------------------------------------------------------- +#961 -- Dynamically created sections should all be reported + Looped section 0 +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: +with message: + Everything is OK + +------------------------------------------------------------------------------- +#961 -- Dynamically created sections should all be reported + Looped section 1 +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: +with message: + Everything is OK + +------------------------------------------------------------------------------- +#961 -- Dynamically created sections should all be reported + Looped section 2 +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: +with message: + Everything is OK + +------------------------------------------------------------------------------- +#961 -- Dynamically created sections should all be reported + Looped section 3 +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: +with message: + Everything is OK + +------------------------------------------------------------------------------- +#961 -- Dynamically created sections should all be reported + Looped section 4 +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: +with message: + Everything is OK + ------------------------------------------------------------------------------- 'Not' checks that should fail ------------------------------------------------------------------------------- @@ -7463,6 +7523,6 @@ MiscTests.cpp:: PASSED: =============================================================================== -test cases: 181 | 127 passed | 50 failed | 4 failed as expected -assertions: 878 | 755 passed | 102 failed | 21 failed as expected +test cases: 182 | 128 passed | 50 failed | 4 failed as expected +assertions: 883 | 760 passed | 102 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.swa4.approved.txt b/projects/SelfTest/Baselines/console.swa4.approved.txt index fe22e2b3..bdacd9cb 100644 --- a/projects/SelfTest/Baselines/console.swa4.approved.txt +++ b/projects/SelfTest/Baselines/console.swa4.approved.txt @@ -137,6 +137,66 @@ with expansion: with message: dummy := 0 +------------------------------------------------------------------------------- +#961 -- Dynamically created sections should all be reported + Looped section 0 +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: +with message: + Everything is OK + +------------------------------------------------------------------------------- +#961 -- Dynamically created sections should all be reported + Looped section 1 +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: +with message: + Everything is OK + +------------------------------------------------------------------------------- +#961 -- Dynamically created sections should all be reported + Looped section 2 +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: +with message: + Everything is OK + +------------------------------------------------------------------------------- +#961 -- Dynamically created sections should all be reported + Looped section 3 +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: +with message: + Everything is OK + +------------------------------------------------------------------------------- +#961 -- Dynamically created sections should all be reported + Looped section 4 +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: +with message: + Everything is OK + ------------------------------------------------------------------------------- 'Not' checks that should fail ------------------------------------------------------------------------------- @@ -158,6 +218,6 @@ ConditionTests.cpp:: FAILED: CHECK_FALSE( true ) =============================================================================== -test cases: 7 | 4 passed | 1 failed | 2 failed as expected -assertions: 19 | 12 passed | 4 failed | 3 failed as expected +test cases: 8 | 5 passed | 1 failed | 2 failed as expected +assertions: 24 | 17 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 88b20529..6e3607a8 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + @@ -26,6 +26,11 @@ MiscTests.cpp: + + + + + ConditionTests.cpp: diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 21c9c9ca..f290b1de 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -150,6 +150,24 @@ + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
@@ -8258,7 +8276,7 @@ loose text artifact - + - + diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index 500e876a..e3a9318b 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -358,3 +358,11 @@ TEST_CASE( "#835 -- errno should not be touched by Catch", "[.][failing][!should CHECK(f() == 0); REQUIRE(errno == 1); // Check that f() doesn't touch errno. } + +TEST_CASE( "#961 -- Dynamically created sections should all be reported", "[.]" ) { + for (char i = '0'; i < '5'; ++i) { + SECTION(std::string("Looped section ") + i) { + SUCCEED( "Everything is OK" ); + } + } +}