From bb5e6207617bf7d7b81f3701a72111aa39e69827 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. --- .../SelfTest/Baselines/compact.sw.approved.txt | 3 ++- .../SelfTest/Baselines/console.std.approved.txt | 2 +- .../SelfTest/Baselines/console.sw.approved.txt | 7 +++++-- .../SelfTest/Baselines/junit.sw.approved.txt | 2 +- projects/SelfTest/Baselines/xml.sw.approved.txt | 16 ++++++++++++---- .../IntrospectiveTests/Details.tests.cpp | 2 +- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt index 14fba5d74d..55a6a4ca4b 100644 --- a/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -265,10 +265,11 @@ 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_logic_error((Catch::ReusableStringStream() << ::Catch::SourceLineInfo( "projects//IntrospectiveTests/Details.tests.cpp", static_cast( 14 ) ) << ": 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 +Details.tests.cpp:: passed: [](){do{ if( !(true) ) Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()); } while(false);}() 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 d627e4e8ed..fd86c972c4 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -1381,5 +1381,5 @@ due to unexpected exception with message: =============================================================================== test cases: 299 | 225 passed | 70 failed | 4 failed as expected -assertions: 1557 | 1405 passed | 131 failed | 21 failed as expected +assertions: 1558 | 1406 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 2bfd558010..e274212be7 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -2135,7 +2135,7 @@ 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 ) + REQUIRE_THROWS_AS( Catch::throw_logic_error((Catch::ReusableStringStream() << ::Catch::SourceLineInfo( "projects//IntrospectiveTests/Details.tests.cpp", static_cast( 14 ) ) << ": Internal Catch2 error: " << "").str()), std::logic_error ) Details.tests.cpp:: PASSED: REQUIRE_THROWS_AS( Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()), std::domain_error ) @@ -2146,6 +2146,9 @@ Details.tests.cpp:: PASSED: Details.tests.cpp:: PASSED: REQUIRE_THROWS_AS( [](){do{ if( !(false) ) Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()); } while(false);}(), std::domain_error ) +Details.tests.cpp:: PASSED: + REQUIRE_NOTHROW( [](){do{ if( !(true) ) Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()); } while(false);}() ) + ------------------------------------------------------------------------------- Commas in various macros are allowed ------------------------------------------------------------------------------- @@ -12428,5 +12431,5 @@ 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 +assertions: 1575 | 1406 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 c512748cc0..b993716f4b 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 8e9f45b3b4..9a8f118187 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -2441,10 +2441,10 @@ 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>( 14 ) ) << ": 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_logic_error((Catch::ReusableStringStream() << ::Catch::SourceLineInfo( "projects//IntrospectiveTests/Details.tests.cpp", static_cast<std::size_t>( 14 ) ) << ": Internal Catch2 error: " << "").str()), std::logic_error @@ -2471,6 +2471,14 @@ Nor would this [](){do{ if( !(false) ) Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()); } while(false);}(), std::domain_error + + + [](){do{ if( !(true) ) Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()); } while(false);}() + + + [](){do{ if( !(true) ) Catch::throw_domain_error((Catch::ReusableStringStream() << "").str()); } while(false);}() + + @@ -14802,7 +14810,7 @@ loose text artifact - + - + diff --git a/projects/SelfTest/IntrospectiveTests/Details.tests.cpp b/projects/SelfTest/IntrospectiveTests/Details.tests.cpp index 289e5bb6d5..75054fb3b7 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);