diff options
| author | Martin Hořeňovský | 2020-02-18 23:31:16 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-02-20 13:03:30 +0100 |
| commit | cf6575576f1c5b84b9148d47e96027e39915e132 (patch) | |
| tree | f756264c02c5915c6d276dfb8ccbf2fe2cd231d0 /tests/SelfTest | |
| parent | a1be19aa1bfcabcbd28e442c0878c1a9468e83e5 (diff) | |
| download | catch3-cf6575576f1c5b84b9148d47e96027e39915e132.tar.gz | |
Start fixing up Matchers: namespaces, composition ops
This commit also forbids composing lvalues of composed matchers, as
per previous deprecation notice. I do not expect this to be contentious
in practice, because there was a bug in that usage for years, and
nobody complained.
Diffstat (limited to 'tests/SelfTest')
| -rw-r--r-- | tests/SelfTest/Baselines/automake.sw.approved.txt | 1 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/compact.sw.approved.txt | 26 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/console.std.approved.txt | 4 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/console.sw.approved.txt | 52 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/console.swa4.approved.txt | 2 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/junit.sw.approved.txt | 3 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/sonarqube.sw.approved.txt | 1 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/tap.sw.approved.txt | 30 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/teamcity.sw.approved.txt | 2 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/xml.sw.approved.txt | 27 | ||||
| -rw-r--r-- | tests/SelfTest/IntrospectiveTests/Tag.tests.cpp | 3 | ||||
| -rw-r--r-- | tests/SelfTest/UsageTests/Compilation.tests.cpp | 2 | ||||
| -rw-r--r-- | tests/SelfTest/UsageTests/Matchers.tests.cpp | 52 |
13 files changed, 73 insertions, 132 deletions
diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt index 77e56433..db7f4006 100644 --- a/tests/SelfTest/Baselines/automake.sw.approved.txt +++ b/tests/SelfTest/Baselines/automake.sw.approved.txt @@ -99,7 +99,6 @@ Nor would this :test-result: PASS Comparisons between ints where one side is computed :test-result: PASS Comparisons between unsigned ints and negative signed ints match c++ standard behaviour :test-result: PASS Comparisons with int literals don't warn when mixing signed/ unsigned -:test-result: PASS Composed matchers are distinct :test-result: FAIL Contains string matcher :test-result: PASS Copy and then generate a range :test-result: FAIL Custom exceptions can be translated when testing for nothrow diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index 6524b8fd..eb8ccc42 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -33,7 +33,7 @@ Compilation.tests.cpp:<line number>: passed: a == t for: 3 == 3 Compilation.tests.cpp:<line number>: passed: throws_int(true) Compilation.tests.cpp:<line number>: passed: throws_int(true), int Compilation.tests.cpp:<line number>: passed: throws_int(false) -Compilation.tests.cpp:<line number>: passed: "aaa", Catch::EndsWith("aaa") for: "aaa" ends with: "aaa" +Compilation.tests.cpp:<line number>: passed: "aaa", Catch::Matchers::EndsWith("aaa") for: "aaa" ends with: "aaa" Compilation.tests.cpp:<line number>: passed: templated_tests<int>(3) for: true Misc.tests.cpp:<line number>: failed: f() == 0 for: 1 == 0 Misc.tests.cpp:<line number>: passed: errno == 1 for: 1 == 1 @@ -263,28 +263,28 @@ ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 2 == 2 ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 3 == 3 ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 4 == 4 ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 5 == 5 -Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB() && MatcherC()), Catch::Matchers::Impl::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC> >::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB() && MatcherC()), Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC> >::value' Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && MatcherB() && MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) -Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB() && MatcherC() && MatcherD()), Catch::Matchers::Impl::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> >::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB() && MatcherC() && MatcherD()), Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> >::value' Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && MatcherB() && MatcherC() && MatcherD() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 and equals: true ) -Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB() || MatcherC()), Catch::Matchers::Impl::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC> >::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB() || MatcherC()), Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC> >::value' Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || MatcherB() || MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) -Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB() || MatcherC() || MatcherD()), Catch::Matchers::Impl::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> >::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB() || MatcherC() || MatcherD()), Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> >::value' Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || MatcherB() || MatcherC() || MatcherD() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 or equals: true ) -Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(!MatcherA()), Catch::Matchers::Impl::MatchNotOfGeneric<MatcherA> >::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(!MatcherA()), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA> >::value' Matchers.tests.cpp:<line number>: passed: 0, !MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(!!MatcherA()), MatcherA const& >::value' Matchers.tests.cpp:<line number>: passed: 1, !!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f -Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(!!!MatcherA()), Catch::Matchers::Impl::MatchNotOfGeneric<MatcherA> >::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(!!!MatcherA()), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA> >::value' Matchers.tests.cpp:<line number>: passed: 0, !!!MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(!!!!MatcherA()), MatcherA const & >::value' Matchers.tests.cpp:<line number>: passed: 1, !!!!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f -Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(StartsWith("foo") || (StartsWith("bar") && EndsWith("bar") && !EndsWith("foo"))), Catch::Matchers::Impl::MatchAnyOf<std::string> >::value' -Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB()), Catch::Matchers::Impl::MatchAnyOfGeneric<MatcherA, MatcherB> >::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(StartsWith("foo") || (StartsWith("bar") && EndsWith("bar") && !EndsWith("foo"))), Catch::Matchers::Detail::MatchAnyOf<std::string> >::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB()), Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB> >::value' Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 ) -Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB()), Catch::Matchers::Impl::MatchAllOfGeneric<MatcherA, MatcherB> >::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB()), Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB> >::value' Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 ) -Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() || !MatcherB()), Catch::Matchers::Impl::MatchAnyOfGeneric<MatcherA, Catch::Matchers::Impl::MatchNotOfGeneric<MatcherB>> >::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype(MatcherA() || !MatcherB()), Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>> >::value' Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f or not equals: (long long) 1 ) Matchers.tests.cpp:<line number>: passed: vec, Predicate<std::vector<int>>([](auto const& vec) { return std::all_of(vec.begin(), vec.end(), [](int elem) { return elem % 2 == 1; }); }, "All elements are odd") && !EqualsRange(a) for: { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } ) Matchers.tests.cpp:<line number>: passed: str, StartsWith("foo") && EqualsRange(arr) && EndsWith("bar") for: "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" ) @@ -344,8 +344,6 @@ Condition.tests.cpp:<line number>: passed: 4 == ul for: 4 == 4 Condition.tests.cpp:<line number>: passed: 5 == c for: 5 == 5 Condition.tests.cpp:<line number>: passed: 6 == uc for: 6 == 6 Condition.tests.cpp:<line number>: passed: (std::numeric_limits<uint32_t>::max)() > ul for: 4294967295 (0x<hex digits>) > 4 -Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), !composed1 for: "some completely different text that contains one common word" not ( contains: "string" or contains: "random" ) -Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), composed2 for: "some completely different text that contains one common word" ( contains: "string" or contains: "random" or contains: "different" ) Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Contains("STRING") for: "this string contains 'abc' as a substring" contains: "STRING" Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1 @@ -1841,7 +1839,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: Timing.result == Timing.itera InternalBenchmark.tests.cpp:<line number>: passed: Timing.iterations >= time.count() for: 128 >= 100 Misc.tests.cpp:<line number>: failed: false with 1 message: '3' Message.tests.cpp:<line number>: failed: false with 2 messages: 'hi' and 'i := 7' -Tag.tests.cpp:<line number>: passed: tags, Catch::VectorContains("magic-tag"_catch_sr) && Catch::VectorContains("."_catch_sr) for: { ., magic-tag } ( Contains: magic-tag and Contains: . ) +Tag.tests.cpp:<line number>: passed: tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr) for: { ., magic-tag } ( Contains: magic-tag and Contains: . ) StringManip.tests.cpp:<line number>: passed: splitStringRef("", ','), Equals(std::vector<StringRef>()) for: { } Equals: { } StringManip.tests.cpp:<line number>: passed: splitStringRef("abc", ','), Equals(std::vector<StringRef>{"abc"}) for: { abc } Equals: { abc } StringManip.tests.cpp:<line number>: passed: splitStringRef("abc,def", ','), Equals(std::vector<StringRef>{"abc", "def"}) for: { abc, def } Equals: { abc, def } diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt index 36d6dd94..cc6328e8 100644 --- a/tests/SelfTest/Baselines/console.std.approved.txt +++ b/tests/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: 329 | 255 passed | 70 failed | 4 failed as expected -assertions: 1841 | 1689 passed | 131 failed | 21 failed as expected +test cases: 328 | 254 passed | 70 failed | 4 failed as expected +assertions: 1839 | 1687 passed | 131 failed | 21 failed as expected diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 0715ac7d..243ab6f9 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -271,7 +271,7 @@ Compilation.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( throws_int(false) ) Compilation.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( "aaa", Catch::EndsWith("aaa") ) + REQUIRE_THAT( "aaa", Catch::Matchers::EndsWith("aaa") ) with expansion: "aaa" ends with: "aaa" @@ -2125,7 +2125,7 @@ Matchers.tests.cpp:<line number> Matchers.tests.cpp:<line number>: PASSED: with message: std::is_same< decltype(MatcherA() && MatcherB() && MatcherC()), Catch:: - Matchers::Impl::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC> >::value + Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC> >::value Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, MatcherA() && MatcherB() && MatcherC() ) @@ -2136,7 +2136,7 @@ with expansion: Matchers.tests.cpp:<line number>: PASSED: with message: std::is_same< decltype(MatcherA() && MatcherB() && MatcherC() && MatcherD()), - Catch::Matchers::Impl::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, + Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> >::value Matchers.tests.cpp:<line number>: PASSED: @@ -2154,7 +2154,7 @@ Matchers.tests.cpp:<line number> Matchers.tests.cpp:<line number>: PASSED: with message: std::is_same< decltype(MatcherA() || MatcherB() || MatcherC()), Catch:: - Matchers::Impl::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC> >::value + Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC> >::value Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, MatcherA() || MatcherB() || MatcherC() ) @@ -2165,7 +2165,7 @@ with expansion: Matchers.tests.cpp:<line number>: PASSED: with message: std::is_same< decltype(MatcherA() || MatcherB() || MatcherC() || MatcherD()), - Catch::Matchers::Impl::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, + Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> >::value Matchers.tests.cpp:<line number>: PASSED: @@ -2182,8 +2182,8 @@ Matchers.tests.cpp:<line number> Matchers.tests.cpp:<line number>: PASSED: with message: - std::is_same< decltype(!MatcherA()), Catch::Matchers::Impl::MatchNotOfGeneric - <MatcherA> >::value + std::is_same< decltype(!MatcherA()), Catch::Matchers::Detail:: + MatchNotOfGeneric<MatcherA> >::value Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0, !MatcherA() ) @@ -2201,7 +2201,7 @@ with expansion: Matchers.tests.cpp:<line number>: PASSED: with message: - std::is_same< decltype(!!!MatcherA()), Catch::Matchers::Impl:: + std::is_same< decltype(!!!MatcherA()), Catch::Matchers::Detail:: MatchNotOfGeneric<MatcherA> >::value Matchers.tests.cpp:<line number>: PASSED: @@ -2227,8 +2227,8 @@ Matchers.tests.cpp:<line number> Matchers.tests.cpp:<line number>: PASSED: with message: std::is_same< decltype(StartsWith("foo") || (StartsWith("bar") && EndsWith - ("bar") && !EndsWith("foo"))), Catch::Matchers::Impl::MatchAnyOf<std::string> - >::value + ("bar") && !EndsWith("foo"))), Catch::Matchers::Detail::MatchAnyOf<std:: + string> >::value ------------------------------------------------------------------------------- Combining only templated matchers @@ -2238,7 +2238,7 @@ Matchers.tests.cpp:<line number> Matchers.tests.cpp:<line number>: PASSED: with message: - std::is_same< decltype(MatcherA() || MatcherB()), Catch::Matchers::Impl:: + std::is_same< decltype(MatcherA() || MatcherB()), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB> >::value Matchers.tests.cpp:<line number>: PASSED: @@ -2248,7 +2248,7 @@ with expansion: Matchers.tests.cpp:<line number>: PASSED: with message: - std::is_same< decltype(MatcherA() && MatcherB()), Catch::Matchers::Impl:: + std::is_same< decltype(MatcherA() && MatcherB()), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB> >::value Matchers.tests.cpp:<line number>: PASSED: @@ -2258,8 +2258,8 @@ with expansion: Matchers.tests.cpp:<line number>: PASSED: with message: - std::is_same< decltype(MatcherA() || !MatcherB()), Catch::Matchers::Impl:: - MatchAnyOfGeneric<MatcherA, Catch::Matchers::Impl::MatchNotOfGeneric + std::is_same< decltype(MatcherA() || !MatcherB()), Catch::Matchers::Detail:: + MatchAnyOfGeneric<MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric <MatcherB>> >::value Matchers.tests.cpp:<line number>: PASSED: @@ -2611,24 +2611,6 @@ with expansion: 4294967295 (0x<hex digits>) > 4 ------------------------------------------------------------------------------- -Composed matchers are distinct -------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> -............................................................................... - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( testStringForMatching2(), !composed1 ) -with expansion: - "some completely different text that contains one common word" not ( - contains: "string" or contains: "random" ) - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( testStringForMatching2(), composed2 ) -with expansion: - "some completely different text that contains one common word" ( contains: - "string" or contains: "random" or contains: "different" ) - -------------------------------------------------------------------------------- Contains string matcher ------------------------------------------------------------------------------- Matchers.tests.cpp:<line number> @@ -13485,7 +13467,7 @@ Tag.tests.cpp:<line number> ............................................................................... Tag.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( tags, Catch::VectorContains("magic-tag"_catch_sr) && Catch::VectorContains("."_catch_sr) ) + REQUIRE_THAT( tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr) ) with expansion: { ., magic-tag } ( Contains: magic-tag and Contains: . ) @@ -14414,6 +14396,6 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 329 | 239 passed | 86 failed | 4 failed as expected -assertions: 1858 | 1689 passed | 148 failed | 21 failed as expected +test cases: 328 | 238 passed | 86 failed | 4 failed as expected +assertions: 1856 | 1687 passed | 148 failed | 21 failed as expected diff --git a/tests/SelfTest/Baselines/console.swa4.approved.txt b/tests/SelfTest/Baselines/console.swa4.approved.txt index 72d87375..f8c59c90 100644 --- a/tests/SelfTest/Baselines/console.swa4.approved.txt +++ b/tests/SelfTest/Baselines/console.swa4.approved.txt @@ -271,7 +271,7 @@ Compilation.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( throws_int(false) ) Compilation.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( "aaa", Catch::EndsWith("aaa") ) + REQUIRE_THAT( "aaa", Catch::Matchers::EndsWith("aaa") ) with expansion: "aaa" ends with: "aaa" diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt index e5b297ef..f3d7ba04 100644 --- a/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuitesloose text artifact > - <testsuite name="<exe-name>" errors="17" failures="132" tests="1859" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="132" tests="1857" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> <property name="random-seed" value="1"/> @@ -364,7 +364,6 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Comparisons between ints where one side is computed" time="{duration}"/> <testcase classname="<exe-name>.global" name="Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" time="{duration}"/> <testcase classname="<exe-name>.global" name="Comparisons with int literals don't warn when mixing signed/ unsigned" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Composed matchers are distinct" time="{duration}"/> <testcase classname="<exe-name>.global" name="Contains string matcher" time="{duration}"> <failure message="testStringForMatching(), Contains("not there", Catch::CaseSensitive::No)" type="CHECK_THAT"> FAILED: diff --git a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt index ee917244..c554f8d9 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -925,7 +925,6 @@ Exception.tests.cpp:<line number> <testCase name="Combining only templated matchers" duration="{duration}"/> <testCase name="Combining templated and concrete matchers" duration="{duration}"/> <testCase name="Combining templated matchers" duration="{duration}"/> - <testCase name="Composed matchers are distinct" duration="{duration}"/> <testCase name="Contains string matcher" duration="{duration}"> <failure message="CHECK_THAT(testStringForMatching(), Contains("not there", Catch::CaseSensitive::No))"> FAILED: diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index 58869cfb..85a67157 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -65,7 +65,7 @@ ok {test-number} - throws_int(true), int # #833 ok {test-number} - throws_int(false) # #833 -ok {test-number} - "aaa", Catch::EndsWith("aaa") for: "aaa" ends with: "aaa" +ok {test-number} - "aaa", Catch::Matchers::EndsWith("aaa") for: "aaa" ends with: "aaa" # #833 ok {test-number} - templated_tests<int>(3) for: true # #835 -- errno should not be touched by Catch @@ -525,23 +525,23 @@ ok {test-number} - c == i for: 4 == 4 # Character pretty printing ok {test-number} - c == i for: 5 == 5 # Combining MatchAllOfGeneric does not nest -ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB() && MatcherC()), Catch::Matchers::Impl::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC> >::value' +ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB() && MatcherC()), Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC> >::value' # Combining MatchAllOfGeneric does not nest ok {test-number} - 1, MatcherA() && MatcherB() && MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) # Combining MatchAllOfGeneric does not nest -ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB() && MatcherC() && MatcherD()), Catch::Matchers::Impl::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> >::value' +ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB() && MatcherC() && MatcherD()), Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> >::value' # Combining MatchAllOfGeneric does not nest ok {test-number} - 1, MatcherA() && MatcherB() && MatcherC() && MatcherD() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 and equals: true ) # Combining MatchAnyOfGeneric does not nest -ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB() || MatcherC()), Catch::Matchers::Impl::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC> >::value' +ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB() || MatcherC()), Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC> >::value' # Combining MatchAnyOfGeneric does not nest ok {test-number} - 1, MatcherA() || MatcherB() || MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) # Combining MatchAnyOfGeneric does not nest -ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB() || MatcherC() || MatcherD()), Catch::Matchers::Impl::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> >::value' +ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB() || MatcherC() || MatcherD()), Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> >::value' # Combining MatchAnyOfGeneric does not nest ok {test-number} - 1, MatcherA() || MatcherB() || MatcherC() || MatcherD() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 or equals: true ) # Combining MatchNotOfGeneric does not nest -ok {test-number} - with 1 message: 'std::is_same< decltype(!MatcherA()), Catch::Matchers::Impl::MatchNotOfGeneric<MatcherA> >::value' +ok {test-number} - with 1 message: 'std::is_same< decltype(!MatcherA()), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA> >::value' # Combining MatchNotOfGeneric does not nest ok {test-number} - 0, !MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f # Combining MatchNotOfGeneric does not nest @@ -549,7 +549,7 @@ ok {test-number} - with 1 message: 'std::is_same< decltype(!!MatcherA()), Matche # Combining MatchNotOfGeneric does not nest ok {test-number} - 1, !!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f # Combining MatchNotOfGeneric does not nest -ok {test-number} - with 1 message: 'std::is_same< decltype(!!!MatcherA()), Catch::Matchers::Impl::MatchNotOfGeneric<MatcherA> >::value' +ok {test-number} - with 1 message: 'std::is_same< decltype(!!!MatcherA()), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA> >::value' # Combining MatchNotOfGeneric does not nest ok {test-number} - 0, !!!MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f # Combining MatchNotOfGeneric does not nest @@ -557,17 +557,17 @@ ok {test-number} - with 1 message: 'std::is_same< decltype(!!!!MatcherA()), Matc # Combining MatchNotOfGeneric does not nest ok {test-number} - 1, !!!!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f # Combining concrete matchers does not use templated matchers -ok {test-number} - with 1 message: 'std::is_same< decltype(StartsWith("foo") || (StartsWith("bar") && EndsWith("bar") && !EndsWith("foo"))), Catch::Matchers::Impl::MatchAnyOf<std::string> >::value' +ok {test-number} - with 1 message: 'std::is_same< decltype(StartsWith("foo") || (StartsWith("bar") && EndsWith("bar") && !EndsWith("foo"))), Catch::Matchers::Detail::MatchAnyOf<std::string> >::value' # Combining only templated matchers -ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB()), Catch::Matchers::Impl::MatchAnyOfGeneric<MatcherA, MatcherB> >::value' +ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() || MatcherB()), Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB> >::value' # Combining only templated matchers ok {test-number} - 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 ) # Combining only templated matchers -ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB()), Catch::Matchers::Impl::MatchAllOfGeneric<MatcherA, MatcherB> >::value' +ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() && MatcherB()), Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB> >::value' # Combining only templated matchers ok {test-number} - 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 ) # Combining only templated matchers -ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() || !MatcherB()), Catch::Matchers::Impl::MatchAnyOfGeneric<MatcherA, Catch::Matchers::Impl::MatchNotOfGeneric<MatcherB>> >::value' +ok {test-number} - with 1 message: 'std::is_same< decltype(MatcherA() || !MatcherB()), Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>> >::value' # Combining only templated matchers ok {test-number} - 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f or not equals: (long long) 1 ) # Combining templated and concrete matchers @@ -686,10 +686,6 @@ ok {test-number} - 5 == c for: 5 == 5 ok {test-number} - 6 == uc for: 6 == 6 # Comparisons with int literals don't warn when mixing signed/ unsigned ok {test-number} - (std::numeric_limits<uint32_t>::max)() > ul for: 4294967295 (0x<hex digits>) > 4 -# Composed matchers are distinct -ok {test-number} - testStringForMatching2(), !composed1 for: "some completely different text that contains one common word" not ( contains: "string" or contains: "random" ) -# Composed matchers are distinct -ok {test-number} - testStringForMatching2(), composed2 for: "some completely different text that contains one common word" ( contains: "string" or contains: "random" or contains: "different" ) # Contains string matcher not ok {test-number} - testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) # Contains string matcher @@ -3509,7 +3505,7 @@ not ok {test-number} - false with 1 message: '3' # sends information to INFO not ok {test-number} - false with 2 messages: 'hi' and 'i := 7' # shortened hide tags are split apart -ok {test-number} - tags, Catch::VectorContains("magic-tag"_catch_sr) && Catch::VectorContains("."_catch_sr) for: { ., magic-tag } ( Contains: magic-tag and Contains: . ) +ok {test-number} - tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr) for: { ., magic-tag } ( Contains: magic-tag and Contains: . ) # splitString ok {test-number} - splitStringRef("", ','), Equals(std::vector<StringRef>()) for: { } Equals: { } # splitString @@ -3708,5 +3704,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..1850 +1..1848 diff --git a/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.approved.txt index e3d1ead2..dbfb9835 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.approved.txt @@ -231,8 +231,6 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpe ##teamcity[testFinished name='Comparisons between unsigned ints and negative signed ints match c++ standard behaviour' duration="{duration}"] ##teamcity[testStarted name='Comparisons with int literals don|'t warn when mixing signed/ unsigned'] ##teamcity[testFinished name='Comparisons with int literals don|'t warn when mixing signed/ unsigned' duration="{duration}"] -##teamcity[testStarted name='Composed matchers are distinct'] -##teamcity[testFinished name='Composed matchers are distinct' duration="{duration}"] ##teamcity[testStarted name='Contains string matcher'] Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "not there" (case insensitive)|n'] Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Contains("STRING") )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "STRING"|n'] diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index 3caf2c19..bbd37d53 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -299,7 +299,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > <Original> - "aaa", Catch::EndsWith("aaa") + "aaa", Catch::Matchers::EndsWith("aaa") </Original> <Expanded> "aaa" ends with: "aaa" @@ -3011,25 +3011,6 @@ Nor would this </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="Composed matchers are distinct" tags="[composed][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching2(), !composed1 - </Original> - <Expanded> - "some completely different text that contains one common word" not ( contains: "string" or contains: "random" ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching2(), composed2 - </Original> - <Expanded> - "some completely different text that contains one common word" ( contains: "string" or contains: "random" or contains: "different" ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> <TestCase name="Contains string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> @@ -16273,7 +16254,7 @@ loose text artifact <TestCase name="shortened hide tags are split apart" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - tags, Catch::VectorContains("magic-tag"_catch_sr) && Catch::VectorContains("."_catch_sr) + tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr) </Original> <Expanded> { ., magic-tag } ( Contains: magic-tag and Contains: . ) @@ -17283,7 +17264,7 @@ loose text artifact </Section> <OverallResult success="true" |