diff --git a/CMakeLists.txt b/CMakeLists.txt index 2903ad9e..c6f4b900 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -317,6 +317,7 @@ if (NOT NO_SELFTEST) add_test(NAME ListTags COMMAND SelfTest --list-tags) set_tests_properties(ListTags PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags") + # AppVeyor has a Python 2.7 in path, but doesn't have .py files as autorunnable add_test(NAME ApprovalTests COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/approvalTests.py $) set_tests_properties(ApprovalTests PROPERTIES FAIL_REGULAR_EXPRESSION "Results differed") endif() # !NO_SELFTEST diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 42d62c9c..dfa2fa92 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -644,20 +644,6 @@ MessageTests.cpp:: FAILED: explicitly with message: Message from section two -------------------------------------------------------------------------------- -Pointers can be converted to strings -------------------------------------------------------------------------------- -MessageTests.cpp: -............................................................................... - -MessageTests.cpp:: -warning: - actual address of p: 0x - -MessageTests.cpp:: -warning: - toString(p): 0x - ------------------------------------------------------------------------------- Reconstruction should be based on stringification: #914 ------------------------------------------------------------------------------- @@ -1020,6 +1006,6 @@ with expansion: "{?}" == "1" =============================================================================== -test cases: 182 | 131 passed | 47 failed | 4 failed as expected -assertions: 881 | 764 passed | 96 failed | 21 failed as expected +test cases: 179 | 128 passed | 47 failed | 4 failed as expected +assertions: 879 | 762 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 02ec81d7..bcba36a1 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -955,20 +955,6 @@ PASSED: with expansion: 0x == 0x -------------------------------------------------------------------------------- -Comparing member function pointers -------------------------------------------------------------------------------- -TrickyTests.cpp: -............................................................................... - -TrickyTests.cpp:: -PASSED: - CHECK( m == &S::f ) -with expansion: - 0x - == - 0x - ------------------------------------------------------------------------------- Comparison with explicitly convertible types ------------------------------------------------------------------------------- @@ -1182,11 +1168,9 @@ with expansion: ConditionTests.cpp:: PASSED: - REQUIRE( (std::numeric_limits::max)() > ul ) + REQUIRE( (std::numeric_limits::max)() > ul ) with expansion: - 18446744073709551615 (0x) - > - 4 + 4294967295 (0x) > 4 ------------------------------------------------------------------------------- Contains string matcher @@ -2096,18 +2080,6 @@ PASSED: with expansion: !{?} -------------------------------------------------------------------------------- -Operators at different namespace levels not hijacked by Koenig lookup -------------------------------------------------------------------------------- -TrickyTests.cpp: -............................................................................... - -TrickyTests.cpp:: -PASSED: - REQUIRE( 0x == o ) -with expansion: - 3221225472 (0x) == {?} - ------------------------------------------------------------------------------- Ordering comparison checks that should fail ------------------------------------------------------------------------------- @@ -3432,20 +3404,6 @@ PASSED: with expansion: 0 != 0x -------------------------------------------------------------------------------- -Pointers can be converted to strings -------------------------------------------------------------------------------- -MessageTests.cpp: -............................................................................... - -MessageTests.cpp:: -warning: - actual address of p: 0x - -MessageTests.cpp:: -warning: - toString(p): 0x - ------------------------------------------------------------------------------- Process can be configured on command line empty args don't cause a crash @@ -7521,6 +7479,6 @@ MiscTests.cpp:: PASSED: =============================================================================== -test cases: 182 | 128 passed | 50 failed | 4 failed as expected -assertions: 883 | 760 passed | 102 failed | 21 failed as expected +test cases: 179 | 125 passed | 50 failed | 4 failed as expected +assertions: 881 | 758 passed | 102 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 9c693386..13c48c19 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + @@ -116,7 +116,6 @@ ExceptionTests.cpp: - @@ -335,7 +334,6 @@ ExceptionTests.cpp: - ConditionTests.cpp: @@ -441,7 +439,6 @@ MessageTests.cpp: - diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 1acc1d74..9ab6d491 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -1023,19 +1023,6 @@ - - - - m == &S::f - - - 0x -== -0x - - - - @@ -1296,12 +1283,10 @@ - (std::numeric_limits<unsigned long>::max)() > ul + (std::numeric_limits<uint32_t>::max)() > ul - 18446744073709551615 (0x) -> -4 + 4294967295 (0x) > 4 @@ -2388,17 +2373,6 @@ - - - - 0x == o - - - 3221225472 (0x) == {?} - - - - @@ -3962,15 +3936,6 @@ - - - actual address of p: 0x - - - toString(p): 0x - - -
@@ -4824,7 +4789,7 @@ A string sent directly to stderr - +
@@ -8276,7 +8241,7 @@ loose text artifact
- + - + diff --git a/projects/SelfTest/ConditionTests.cpp b/projects/SelfTest/ConditionTests.cpp index 565d9815..00ff6060 100644 --- a/projects/SelfTest/ConditionTests.cpp +++ b/projects/SelfTest/ConditionTests.cpp @@ -13,6 +13,7 @@ #include #include +#include struct TestData { int int_seven = 7; @@ -184,7 +185,7 @@ TEST_CASE( "Comparisons with int literals don't warn when mixing signed/ unsigne REQUIRE( 5 == c ); REQUIRE( 6 == uc ); - REQUIRE( (std::numeric_limits::max)() > ul ); + REQUIRE( (std::numeric_limits::max)() > ul ); } // Disable warnings about sign conversions for the next two tests diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index 437ba53d..6082a4e6 100644 --- a/projects/SelfTest/MessageTests.cpp +++ b/projects/SelfTest/MessageTests.cpp @@ -85,7 +85,7 @@ TEST_CASE( "Standard output from all sections is reported", "[messages][.]" ) { } } -TEST_CASE( "Standard error is reported and redirected", "[messages][.]" ) { +TEST_CASE( "Standard error is reported and redirected", "[messages][.][approvals]" ) { SECTION( "std::cerr" ) { std::cerr << "Write to std::cerr" << std::endl; } @@ -98,7 +98,7 @@ TEST_CASE( "Standard error is reported and redirected", "[messages][.]" ) { std::cerr << ' '; std::clog << "writes"; std::cerr << " to error"; - std::clog << " streams\n"; + std::clog << " streams" << std::endl; } } @@ -130,7 +130,7 @@ TEST_CASE( "sends information to INFO", "[.][failing]" ) { REQUIRE( false ); } -TEST_CASE( "Pointers can be converted to strings", "[messages][.]" ) { +TEST_CASE( "Pointers can be converted to strings", "[messages][.][approvals]" ) { int p; WARN( "actual address of p: " << &p ); WARN( "toString(p): " << ::Catch::Detail::stringify( &p ) ); diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index f551d3bf..90abb4a8 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -175,7 +175,7 @@ namespace ObjectWithConversions TEST_CASE ( "Operators at different namespace levels not hijacked by Koenig lookup", - "[Tricky]" + "[Tricky][approvals]" ) { Object o; @@ -211,9 +211,16 @@ namespace ObjectWithNonConstEqualityOperator namespace EnumBitFieldTests { - enum Bits {bit0 = 0x0001, bit1 = 0x0002, bit2 = 0x0004, bit3 = 0x0008, bit1and2 = 0x0006, - bit30 = 0x40000000, bit31 = 0x80000000, - bit30and31 = 0xc0000000}; + enum Bits : uint32_t { + bit0 = 0x0001, + bit1 = 0x0002, + bit2 = 0x0004, + bit3 = 0x0008, + bit1and2 = bit1 | bit2, + bit30 = 0x40000000, + bit31 = 0x80000000, + bit30and31 = bit30 | bit31 + }; TEST_CASE( "Test enum bit values", "[Tricky]" ) { @@ -365,7 +372,7 @@ struct S }; -TEST_CASE( "Comparing member function pointers", "[Tricky][member function pointer]" ) +TEST_CASE( "Comparing member function pointers", "[Tricky][member function pointer][approvals]" ) { typedef void (S::*MF)(); MF m = &S::f; diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py index 49553349..5c0c63ec 100755 --- a/scripts/approvalTests.py +++ b/scripts/approvalTests.py @@ -41,6 +41,8 @@ errnoParser = re.compile(r''' \(\*__errno_location\ \(\)\) | \(\*__error\(\)\) + | + \(\*_errno\(\)\) ''', re.VERBOSE) if len(sys.argv) == 2: @@ -145,15 +147,15 @@ print("Running approvals against executable:") print(" " + cmdPath) # Standard console reporter -approve("console.std", ["~[!nonportable]~[!benchmark]", "--order", "lex"]) +approve("console.std", ["~[!nonportable]~[!benchmark]~[approvals]", "--order", "lex"]) # console reporter, include passes, warn about No Assertions -approve("console.sw", ["~[!nonportable]~[!benchmark]", "-s", "-w", "NoAssertions", "--order", "lex"]) +approve("console.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "--order", "lex"]) # console reporter, include passes, warn about No Assertions, limit failures to first 4 -approve("console.swa4", ["~[!nonportable]~[!benchmark]", "-s", "-w", "NoAssertions", "-x", "4", "--order", "lex"]) +approve("console.swa4", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-x", "4", "--order", "lex"]) # junit reporter, include passes, warn about No Assertions -approve("junit.sw", ["~[!nonportable]~[!benchmark]", "-s", "-w", "NoAssertions", "-r", "junit", "--order", "lex"]) +approve("junit.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-r", "junit", "--order", "lex"]) # xml reporter, include passes, warn about No Assertions -approve("xml.sw", ["~[!nonportable]~[!benchmark]", "-s", "-w", "NoAssertions", "-r", "xml", "--order", "lex"]) +approve("xml.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-r", "xml", "--order", "lex"]) if overallResult != 0: print("If these differences are expected, run approve.py to approve new baselines.")