From ebe6a07c23305b50ec4fd15f1ab190f42d82aee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Fri, 9 Aug 2019 11:08:23 +0200 Subject: [PATCH] Remove the new tests from approvals They lead to stringification of file (which is ok) and file line (not ok) to the approvals, which makes them exceedingly brittle and not worth approval testing. Instead we just run them as part of the base test run. --- .../Baselines/compact.sw.approved.txt | 4 -- .../Baselines/console.std.approved.txt | 4 +- .../Baselines/console.sw.approved.txt | 22 +---------- .../SelfTest/Baselines/junit.sw.approved.txt | 3 +- .../SelfTest/Baselines/xml.sw.approved.txt | 39 +------------------ .../IntrospectiveTests/Details.tests.cpp | 2 +- 6 files changed, 8 insertions(+), 66 deletions(-) diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt index 14fba5d7..45a37c57 100644 --- a/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -265,10 +265,6 @@ ToStringGeneral.tests.cpp:: passed: c == i for: 2 == 2 ToStringGeneral.tests.cpp:: passed: c == i for: 3 == 3 ToStringGeneral.tests.cpp:: passed: c == i for: 4 == 4 ToStringGeneral.tests.cpp:: passed: c == i for: 5 == 5 -Details.tests.cpp:: passed: Catch::throw_logic_error((Catch::ReusableStringStream() << ::Catch::SourceLineInfo( "projects//IntrospectiveTests/Details.tests.cpp", static_cast( 9 ) ) << ": Internal Catch2 error: " << "").str()), std::logic_error -Details.tests.cpp:: passed: Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()), std::domain_error -Details.tests.cpp:: passed: Catch::throw_runtime_error((Catch::ReusableStringStream() << "").str()), std::runtime_error -Details.tests.cpp:: passed: [](){do{ if( !(false) ) Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()); } while(false);}(), std::domain_error Tricky.tests.cpp:: passed: std::vector{constructor_throws{}, constructor_throws{}} Tricky.tests.cpp:: passed: std::vector{constructor_throws{}, constructor_throws{}} Tricky.tests.cpp:: passed: std::vector{1, 2, 3} == std::vector{1, 2, 3} diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index d627e4e8..917ff6ff 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -1380,6 +1380,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 299 | 225 passed | 70 failed | 4 failed as expected -assertions: 1557 | 1405 passed | 131 failed | 21 failed as expected +test cases: 298 | 224 passed | 70 failed | 4 failed as expected +assertions: 1553 | 1401 passed | 131 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index 2bfd5580..73c23901 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -2128,24 +2128,6 @@ ToStringGeneral.tests.cpp:: PASSED: with expansion: 5 == 5 -------------------------------------------------------------------------------- -Check that our error handling macros throw the right exceptions -------------------------------------------------------------------------------- -Details.tests.cpp: -............................................................................... - -Details.tests.cpp:: PASSED: - REQUIRE_THROWS_AS( Catch::throw_logic_error((Catch::ReusableStringStream() << ::Catch::SourceLineInfo( "projects//IntrospectiveTests/Details.tests.cpp", static_cast( 9 ) ) << ": Internal Catch2 error: " << "").str()), std::logic_error ) - -Details.tests.cpp:: PASSED: - REQUIRE_THROWS_AS( Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()), std::domain_error ) - -Details.tests.cpp:: PASSED: - REQUIRE_THROWS_AS( Catch::throw_runtime_error((Catch::ReusableStringStream() << "").str()), std::runtime_error ) - -Details.tests.cpp:: PASSED: - REQUIRE_THROWS_AS( [](){do{ if( !(false) ) Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()); } while(false);}(), std::domain_error ) - ------------------------------------------------------------------------------- Commas in various macros are allowed ------------------------------------------------------------------------------- @@ -12427,6 +12409,6 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== -test cases: 299 | 209 passed | 86 failed | 4 failed as expected -assertions: 1574 | 1405 passed | 148 failed | 21 failed as expected +test cases: 298 | 208 passed | 86 failed | 4 failed as expected +assertions: 1570 | 1401 passed | 148 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index c512748c..2cd6081e 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + @@ -241,7 +241,6 @@ Exception.tests.cpp: - diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 8e9f45b3..05875d0a 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -2438,41 +2438,6 @@ Nor would this - - - - Catch::throw_logic_error((Catch::ReusableStringStream() << ::Catch::SourceLineInfo( "projects//IntrospectiveTests/Details.tests.cpp", static_cast<std::size_t>( 9 ) ) << ": Internal Catch2 error: " << "").str()), std::logic_error - - - Catch::throw_logic_error((Catch::ReusableStringStream() << ::Catch::SourceLineInfo( "projects//IntrospectiveTests/Details.tests.cpp", static_cast<std::size_t>( 9 ) ) << ": Internal Catch2 error: " << "").str()), std::logic_error - - - - - Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()), std::domain_error - - - Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()), std::domain_error - - - - - Catch::throw_runtime_error((Catch::ReusableStringStream() << "").str()), std::runtime_error - - - Catch::throw_runtime_error((Catch::ReusableStringStream() << "").str()), std::runtime_error - - - - - [](){do{ if( !(false) ) Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()); } while(false);}(), std::domain_error - - - [](){do{ if( !(false) ) Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()); } while(false);}(), std::domain_error - - - - @@ -14802,7 +14767,7 @@ loose text artifact - + - + diff --git a/projects/SelfTest/IntrospectiveTests/Details.tests.cpp b/projects/SelfTest/IntrospectiveTests/Details.tests.cpp index 289e5bb6..75054fb3 100644 --- a/projects/SelfTest/IntrospectiveTests/Details.tests.cpp +++ b/projects/SelfTest/IntrospectiveTests/Details.tests.cpp @@ -10,7 +10,7 @@ #pragma warning(disable:4702) // unreachable code in the macro expansions #endif -TEST_CASE("Check that our error handling macros throw the right exceptions", "[!throws][internals]") { +TEST_CASE("Check that our error handling macros throw the right exceptions", "[!throws][internals][approvals]") { REQUIRE_THROWS_AS(CATCH_INTERNAL_ERROR(""), std::logic_error); REQUIRE_THROWS_AS(CATCH_ERROR(""), std::domain_error); REQUIRE_THROWS_AS(CATCH_RUNTIME_ERROR(""), std::runtime_error);