catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Approved tag alias tests
- Commit
061861d940ebc957c493cde99ccb2d15554ef8f9- Author
- Phil Nash ·
- Parents
1d210ebd37b4
Changes
.../SelfTest/Baselines/console.std.approved.txt | 2 +- .../SelfTest/Baselines/console.sw.approved.txt | 68 ++++++++++++++++- projects/SelfTest/Baselines/junit.sw.approved.txt | 4 +- projects/SelfTest/Baselines/xml.sw.approved.txt | 85 +++++++++++++++++++++- 4 files changed, 154 insertions(+), 5 deletions(-) diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 3b33a28a..113b7fc5 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -786,5 +786,5 @@ with expansion: "first" == "second" =============================================================================== -124 test cases - 39 failed (695 assertions - 92 failed) +125 test cases - 39 failed (703 assertions - 92 failed) diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index c6a11ee0..9732c99d 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -6884,6 +6884,72 @@ PASSED: with expansion: true == true +------------------------------------------------------------------------------- +Tag alias can be registered against tag patterns + The same tag alias can only be registered once +------------------------------------------------------------------------------- +TagAliasTests.cpp:<line number> +............................................................................... + +TagAliasTests.cpp:<line number>: +PASSED: + CHECK_THAT( what Contains( "[@zzz]" ) ) +with expansion: + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: " + [@zzz]" + +TagAliasTests.cpp:<line number>: +PASSED: + CHECK_THAT( what Contains( "file" ) ) +with expansion: + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: + "file" + +TagAliasTests.cpp:<line number>: +PASSED: + CHECK_THAT( what Contains( "2" ) ) +with expansion: + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: + "2" + +TagAliasTests.cpp:<line number>: +PASSED: + CHECK_THAT( what Contains( "10" ) ) +with expansion: + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: + "10" + +------------------------------------------------------------------------------- +Tag alias can be registered against tag patterns + Tag aliases must be of the form [@name] +------------------------------------------------------------------------------- +TagAliasTests.cpp:<line number> +............................................................................... + +TagAliasTests.cpp:<line number>: +PASSED: + CHECK_THROWS( registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) ) + +TagAliasTests.cpp:<line number>: +PASSED: + CHECK_THROWS( registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) ) + +TagAliasTests.cpp:<line number>: +PASSED: + CHECK_THROWS( registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) ) + +TagAliasTests.cpp:<line number>: +PASSED: + CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) ) + ------------------------------------------------------------------------------- Anonymous test case 1 ------------------------------------------------------------------------------- @@ -7231,5 +7297,5 @@ with expansion: true =============================================================================== -124 test cases - 55 failed (715 assertions - 112 failed) +125 test cases - 55 failed (723 assertions - 112 failed) diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index fe7e7645..35ad75f5 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,5 +1,5 @@ <testsuites> - <testsuite errors="12" failures="100" tests="715" hostname="tbd" time="{duration}" timestamp="tbd"> + <testsuite errors="12" failures="100" tests="723" hostname="tbd" time="{duration}" timestamp="tbd"> <testcase classname="global" name="Some simple comparisons between doubles" time="{duration}"/> <testcase classname="global" name="Approximate comparisons with different epsilons" time="{duration}"/> <testcase classname="global" name="Approximate comparisons with floats" time="{duration}"/> @@ -556,6 +556,8 @@ TrickyTests.cpp:<line number> <testcase classname="Parse test names and tags" name="empty tag" time="{duration}"/> <testcase classname="Parse test names and tags" name="empty quoted name" time="{duration}"/> <testcase classname="Parse test names and tags" name="quoted string followed by tag exclusion" time="{duration}"/> + <testcase classname="Tag alias can be registered against tag patterns" name="The same tag alias can only be registered once" time="{duration}"/> + <testcase classname="Tag alias can be registered against tag patterns" name="Tag aliases must be of the form [@name]" time="{duration}"/> <testcase classname="global" name="Anonymous test case 1" time="{duration}"/> <testcase classname="global" name="Test case with one argument" time="{duration}"/> <testcase classname="Variadic macros" name="Section with one argument" time="{duration}"/> diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 5e4e2c4b..4b1e9269 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -7162,6 +7162,87 @@ there" </Section> <OverallResult success="true"/> </TestCase> + <TestCase name="Tag alias can be registered against tag patterns"> + <Section name="The same tag alias can only be registered once"> + <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" > + <Original> + what Contains( "[@zzz]" ) + </Original> + <Expanded> + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: "[@zzz]" + </Expanded> + </Expression> + <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" > + <Original> + what Contains( "file" ) + </Original> + <Expanded> + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: "file" + </Expanded> + </Expression> + <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" > + <Original> + what Contains( "2" ) + </Original> + <Expanded> + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: "2" + </Expanded> + </Expression> + <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" > + <Original> + what Contains( "10" ) + </Original> + <Expanded> + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: "10" + </Expanded> + </Expression> + <OverallResults successes="4" failures="0"/> + </Section> + <Section name="Tag aliases must be of the form [@name]"> + <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" > + <Original> + registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Original> + <Expanded> + registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Expanded> + </Expression> + <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" > + <Original> + registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Original> + <Expanded> + registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Expanded> + </Expression> + <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" > + <Original> + registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Original> + <Expanded> + registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Expanded> + </Expression> + <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" > + <Original> + registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) + </Original> + <Expanded> + registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) + </Expanded> + </Expression> + <OverallResults successes="4" failures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> <TestCase name="Anonymous test case 1"> <OverallResult success="true"/> </TestCase> @@ -7483,7 +7564,7 @@ there" </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="603" failures="112"/> + <OverallResults successes="611" failures="112"/> </Group> - <OverallResults successes="603" failures="112"/> + <OverallResults successes="611" failures="112"/> </Catch>