diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 693584a1..6f8537ef 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -772,5 +772,5 @@ with expansion: "first" == "second" =============================================================================== -127 test cases - 39 failed (629 assertions - 92 failed) +123 test cases - 39 failed (677 assertions - 92 failed) diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index 6e80ffbf..22d22af5 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -3604,19 +3604,13 @@ PASSED: TestMain.cpp:: PASSED: - REQUIRE( cfg.filters().size() == 1 ) -with expansion: - 1 == 1 - -TestMain.cpp:: -PASSED: - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) + REQUIRE( cfg.testSpec().matches( fakeTestCase( "notIncluded" ) ) == false ) with expansion: false == false TestMain.cpp:: PASSED: - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ) + REQUIRE( cfg.testSpec().matches( fakeTestCase( "test1" ) ) ) with expansion: true @@ -3634,19 +3628,13 @@ PASSED: TestMain.cpp:: PASSED: - REQUIRE( cfg.filters().size() == 1 ) -with expansion: - 1 == 1 - -TestMain.cpp:: -PASSED: - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) + REQUIRE( cfg.testSpec().matches( fakeTestCase( "test1" ) ) == false ) with expansion: false == false TestMain.cpp:: PASSED: - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) + REQUIRE( cfg.testSpec().matches( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true @@ -3664,55 +3652,13 @@ PASSED: TestMain.cpp:: PASSED: - REQUIRE( cfg.filters().size() == 1 ) -with expansion: - 1 == 1 - -TestMain.cpp:: -PASSED: - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) + REQUIRE( cfg.testSpec().matches( fakeTestCase( "test1" ) ) == false ) with expansion: false == false TestMain.cpp:: PASSED: - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) -with expansion: - true - -------------------------------------------------------------------------------- -Process can be configured on command line - test lists - Specify two test cases using -t -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) - -TestMain.cpp:: -PASSED: - REQUIRE( cfg.filters().size() == 1 ) -with expansion: - 1 == 1 - -TestMain.cpp:: -PASSED: - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - REQUIRE( cfg.filters()[0].shouldInclude( fakeTestCase( "test2" ) ) ) + REQUIRE( cfg.testSpec().matches( fakeTestCase( "alwaysIncluded" ) ) ) with expansion: true @@ -3974,445 +3920,6 @@ PASSED: with expansion: true == true -------------------------------------------------------------------------------- -selftest/test filter -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( matchNone.shouldInclude( fakeTestCase( "any" ) ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( matchHidden.shouldInclude( fakeTestCase( "./any" ) ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -selftest/test filters -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( filters.shouldInclude( fakeTestCase( "any" ) ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( filters.shouldInclude( fakeTestCase( "./something" ) ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( filters.shouldInclude( fakeTestCase( "./anything" ) ) == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -selftest/filter/prefix wildcard -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -selftest/filter/wildcard at both ends -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -selftest/tags - single [one] tag -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( oneTag.getTestCaseInfo().description == "" ) -with expansion: - "" == "" - -TestMain.cpp:: -PASSED: - CHECK( oneTag.hasTag( "one" ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( oneTag.getTags().size() == 1 ) -with expansion: - 1 == 1 - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( p1 ) == true ) -with expansion: - true == true - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( p2 ) == true ) -with expansion: - true == true - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( p3 ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( p4 ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( p5 ) == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -selftest/tags - single [two] tag -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( oneTag.getTestCaseInfo().description == "" ) -with expansion: - "" == "" - -TestMain.cpp:: -PASSED: - CHECK( oneTag.hasTag( "two" ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( oneTag.getTags().size() == 1 ) -with expansion: - 1 == 1 - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( p1 ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( p2 ) == true ) -with expansion: - true == true - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( p3 ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( p4 ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( p5 ) == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -selftest/tags - two tags -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( twoTags.getTestCaseInfo().description == "" ) -with expansion: - "" == "" - -TestMain.cpp:: -PASSED: - CHECK( twoTags.hasTag( "one" ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( twoTags.hasTag( "two" ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( twoTags.hasTag( "Two" ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( twoTags.hasTag( "three" ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( twoTags.getTags().size() == 2 ) -with expansion: - 2 == 2 - -TestMain.cpp:: -PASSED: - CHECK( twoTags.matchesTags( p1 ) == true ) -with expansion: - true == true - -TestMain.cpp:: -PASSED: - CHECK( twoTags.matchesTags( p2 ) == true ) -with expansion: - true == true - -TestMain.cpp:: -PASSED: - CHECK( twoTags.matchesTags( p3 ) == true ) -with expansion: - true == true - -TestMain.cpp:: -PASSED: - CHECK( twoTags.matchesTags( p4 ) == true ) -with expansion: - true == true - -TestMain.cpp:: -PASSED: - CHECK( twoTags.matchesTags( p5 ) == true ) -with expansion: - true == true - -------------------------------------------------------------------------------- -selftest/tags - complex -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( fakeTestCase( "test", "[one][.]" ).matchesTags( p1 ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK_FALSE( fakeTestCase( "test", "[one][.]" ).matchesTags( p5 ) ) -with expansion: - !false - -TestMain.cpp:: -PASSED: - CHECK( fakeTestCase( "test", "[three]" ).matchesTags( p4 ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( fakeTestCase( "test", "[three]" ).matchesTags( p5 ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( fakeTestCase( "test", "[three]" ).matchesTags( "[three]~[one]" ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( fakeTestCase( "test", "[unit][not_apple]" ).matchesTags( "[unit]" ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK_FALSE( fakeTestCase( "test", "[unit][not_apple]" ).matchesTags( "[unit]~[not_apple]" ) ) -with expansion: - !false - -------------------------------------------------------------------------------- -selftest/tags - one tag with characters either side -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) -with expansion: - "1234" == "1234" - -TestMain.cpp:: -PASSED: - CHECK( oneTagWithExtras.hasTag( "one" ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( oneTagWithExtras.hasTag( "two" ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( oneTagWithExtras.getTags().size() == 1 ) -with expansion: - 1 == 1 - -------------------------------------------------------------------------------- -selftest/tags - start of a tag, but not closed -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) -with expansion: - "[one" == "[one" - -TestMain.cpp:: -PASSED: - CHECK( oneTagOpen.hasTag( "one" ) == false ) -with expansion: - false == false - -TestMain.cpp:: -PASSED: - CHECK( oneTagOpen.getTags().size() == 0 ) -with expansion: - 0 == 0 - -------------------------------------------------------------------------------- -selftest/tags - hidden -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - CHECK( oneTag.getTestCaseInfo().description == "" ) -with expansion: - "" == "" - -TestMain.cpp:: -PASSED: - CHECK( oneTag.hasTag( "." ) ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( oneTag.isHidden() ) -with expansion: - true - -TestMain.cpp:: -PASSED: - CHECK( oneTag.matchesTags( "~[.]" ) == false ) -with expansion: - false == false - ------------------------------------------------------------------------------- Long strings can be wrapped plain string @@ -6333,6 +5840,890 @@ TrickyTests.cpp: TrickyTests.cpp:: PASSED: +------------------------------------------------------------------------------- +Parse test names and tags + Empty test spec should have no filters +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + Test spec from empty string should have no filters +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches(tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + Test spec from just a comma should have no filters +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + Test spec from name should have one filter +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + Test spec from quoted name should have one filter +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + Test spec from name should have one filter +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + Wildcard at the start +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( parseTestSpec( "*a" ).matches( tcA ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + Wildcard at the end +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( parseTestSpec( "a*" ).matches( tcA ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + Wildcard at both ends +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( parseTestSpec( "*a*" ).matches( tcA ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + Just wildcard +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + Single tag +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + Single tag, two matches +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + Two tags +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + Wildcarded name and tag +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + Single tag exclusion +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + One tag exclusion and one tag inclusion +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + One tag exclusion and one wldcarded name inclusion +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + One tag exclusion, using exclude:, and one wldcarded name inclusion +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + name exclusion +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Parse test names and tags + wildcarded name exclusion +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + wildcarded name exclusion with tag inclusion +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + wildcarded name exclusion, using exclude:, with tag inclusion +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + two wildcarded names +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + empty tag +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + empty quoted name +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Parse test names and tags + quoted string followed by tag exclusion +------------------------------------------------------------------------------- +CmdLineTests.cpp: +............................................................................... + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.hasFilters() == true ) +with expansion: + true == true + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcA ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcB ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcC ) == false ) +with expansion: + false == false + +CmdLineTests.cpp:: +PASSED: + CHECK( spec.matches( tcD ) == true ) +with expansion: + true == true + ------------------------------------------------------------------------------- Anonymous test case 1 ------------------------------------------------------------------------------- @@ -6680,5 +7071,5 @@ with expansion: true =============================================================================== -127 test cases - 54 failed (648 assertions - 111 failed) +123 test cases - 54 failed (696 assertions - 111 failed) diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 5e7969b8..40ecb7ce 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,5 +1,5 @@ - + @@ -450,7 +450,6 @@ MiscTests.cpp: - @@ -465,17 +464,6 @@ MiscTests.cpp: - - - - - - - - - - - @@ -536,6 +524,32 @@ TrickyTests.cpp: + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index b80c7094..1d6579d8 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -1,5 +1,5 @@ - + @@ -3687,15 +3687,7 @@ - cfg.filters().size() == 1 - - - 1 == 1 - - - - - cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false + cfg.testSpec().matches( fakeTestCase( "notIncluded" ) ) == false false == false @@ -3703,15 +3695,15 @@ - cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) + cfg.testSpec().matches( fakeTestCase( "test1" ) ) true - + - +
@@ -3725,15 +3717,7 @@ - cfg.filters().size() == 1 - - - 1 == 1 - - - - - cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false + cfg.testSpec().matches( fakeTestCase( "test1" ) ) == false false == false @@ -3741,15 +3725,15 @@ - cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) + cfg.testSpec().matches( fakeTestCase( "alwaysIncluded" ) ) true - +
- +
@@ -3763,15 +3747,7 @@ - cfg.filters().size() == 1 - - - 1 == 1 - - - - - cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) == false + cfg.testSpec().matches( fakeTestCase( "test1" ) ) == false false == false @@ -3779,61 +3755,15 @@ - cfg.filters()[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) + cfg.testSpec().matches( fakeTestCase( "alwaysIncluded" ) ) true - +
- -
-
-
- - - parseIntoConfig( argv, config ) - - - parseIntoConfig( argv, config ) - - - - - cfg.filters().size() == 1 - - - 1 == 1 - - - - - cfg.filters()[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false - - - false == false - - - - - cfg.filters()[0].shouldInclude( fakeTestCase( "test1" ) ) - - - true - - - - - cfg.filters()[0].shouldInclude( fakeTestCase( "test2" ) ) - - - true - - - -
- +
@@ -4147,530 +4077,6 @@
- - - - matchAny.shouldInclude( fakeTestCase( "any" ) ) - - - true - - - - - matchNone.shouldInclude( fakeTestCase( "any" ) ) == false - - - false == false - - - - - matchHidden.shouldInclude( fakeTestCase( "any" ) ) == false - - - false == false - - - - - matchNonHidden.shouldInclude( fakeTestCase( "any" ) ) - - - true - - - - - matchHidden.shouldInclude( fakeTestCase( "./any" ) ) - - - true - - - - - matchNonHidden.shouldInclude( fakeTestCase( "./any" ) ) == false - - - false == false - - - - - - - - matchHidden.shouldInclude( fakeTestCase( "./something" ) ) - - - true - - - - - filters.shouldInclude( fakeTestCase( "any" ) ) == false - - - false == false - - - - - filters.shouldInclude( fakeTestCase( "./something" ) ) - - - true - - - - - filters.shouldInclude( fakeTestCase( "./anything" ) ) == false - - - false == false - - - - - - - - matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) - - - true - - - - - matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) == false - - - false == false - - - - - - - - matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) - - - true - - - - - matchBadgers.shouldInclude( fakeTestCase( "little badgers" ) ) - - - true - - - - - matchBadgers.shouldInclude( fakeTestCase( "badgers are big" ) ) - - - true - - - - - matchBadgers.shouldInclude( fakeTestCase( "hedgehogs" ) ) == false - - - false == false - - - - - -
- - - oneTag.getTestCaseInfo().description == "" - - - "" == "" - - - - - oneTag.hasTag( "one" ) - - - true - - - - - oneTag.getTags().size() == 1 - - - 1 == 1 - - - - - oneTag.matchesTags( p1 ) == true - - - true == true - - - - - oneTag.matchesTags( p2 ) == true - - - true == true - - - - - oneTag.matchesTags( p3 ) == false - - - false == false - - - - - oneTag.matchesTags( p4 ) == false - - - false == false - - - - - oneTag.matchesTags( p5 ) == false - - - false == false - - - -
-
- - - oneTag.getTestCaseInfo().description == "" - - - "" == "" - - - - - oneTag.hasTag( "two" ) - - - true - - - - - oneTag.getTags().size() == 1 - - - 1 == 1 - - - - - oneTag.matchesTags( p1 ) == false - - - false == false - - - - - oneTag.matchesTags( p2 ) == true - - - true == true - - - - - oneTag.matchesTags( p3 ) == false - - - false == false - - - - - oneTag.matchesTags( p4 ) == false - - - false == false - - - - - oneTag.matchesTags( p5 ) == false - - - false == false - - - -
-
- - - twoTags.getTestCaseInfo().description == "" - - - "" == "" - - - - - twoTags.hasTag( "one" ) - - - true - - - - - twoTags.hasTag( "two" ) - - - true - - - - - twoTags.hasTag( "Two" ) - - - true - - - - - twoTags.hasTag( "three" ) == false - - - false == false - - - - - twoTags.getTags().size() == 2 - - - 2 == 2 - - - - - twoTags.matchesTags( p1 ) == true - - - true == true - - - - - twoTags.matchesTags( p2 ) == true - - - true == true - - - - - twoTags.matchesTags( p3 ) == true - - - true == true - - - - - twoTags.matchesTags( p4 ) == true - - - true == true - - - - - twoTags.matchesTags( p5 ) == true - - - true == true - - - -
-
- - - fakeTestCase( "test", "[one][.]" ).matchesTags( p1 ) - - - true - - - - - !fakeTestCase( "test", "[one][.]" ).matchesTags( p5 ) - - - !false - - - - - fakeTestCase( "test", "[three]" ).matchesTags( p4 ) - - - true - - - - - fakeTestCase( "test", "[three]" ).matchesTags( p5 ) - - - true - - - - - fakeTestCase( "test", "[three]" ).matchesTags( "[three]~[one]" ) - - - true - - - - - fakeTestCase( "test", "[unit][not_apple]" ).matchesTags( "[unit]" ) - - - true - - - - - !fakeTestCase( "test", "[unit][not_apple]" ).matchesTags( "[unit]~[not_apple]" ) - - - !false - - - -
-
- - - oneTagWithExtras.getTestCaseInfo().description == "1234" - - - "1234" == "1234" - - - - - oneTagWithExtras.hasTag( "one" ) - - - true - - - - - oneTagWithExtras.hasTag( "two" ) == false - - - false == false - - - - - oneTagWithExtras.getTags().size() == 1 - - - 1 == 1 - - - -
-
- - - oneTagOpen.getTestCaseInfo().description == "[one" - - - "[one" == "[one" - - - - - oneTagOpen.hasTag( "one" ) == false - - - false == false - - - - - oneTagOpen.getTags().size() == 0 - - - 0 == 0 - - - -
-
- - - oneTag.getTestCaseInfo().description == "" - - - "" == "" - - - - - oneTag.hasTag( "." ) - - - true - - - - - oneTag.isHidden() - - - true - - - - - oneTag.matchesTags( "~[.]" ) == false - - - false == false - - - -
- -
@@ -6571,6 +5977,1023 @@ there" + +
+ + + spec.hasFilters() == false + + + false == false + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == false + + + false == false + + + + + spec.matches(tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == false + + + false == false + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == true + + + true == true + + + + + spec.matches( tcC ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == true + + + true == true + + + + + spec.matches( tcD ) == false + + + false == false + + + + + parseTestSpec( "*a" ).matches( tcA ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == true + + + true == true + + + + + spec.matches( tcD ) == false + + + false == false + + + + + parseTestSpec( "a*" ).matches( tcA ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == true + + + true == true + + + + + spec.matches( tcD ) == true + + + true == true + + + + + parseTestSpec( "*a*" ).matches( tcA ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == true + + + true == true + + + + + spec.matches( tcB ) == true + + + true == true + + + + + spec.matches( tcC ) == true + + + true == true + + + + + spec.matches( tcD ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == true + + + true == true + + + + + spec.matches( tcC ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == true + + + true == true + + + + + spec.matches( tcC ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == true + + + true == true + + + + + spec.matches( tcD ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == true + + + true == true + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == true + + + true == true + + + + + spec.matches( tcC ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == false + + + false == false + + + + + spec.matches( tcD ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == false + + + false == false + + + + + spec.matches( tcD ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == true + + + true == true + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == true + + + true == true + + + + + spec.matches( tcD ) == true + + + true == true + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == true + + + true == true + + + + + spec.matches( tcB ) == true + + + true == true + + + + + spec.matches( tcC ) == false + + + false == false + + + + + spec.matches( tcD ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == true + + + true == true + + + + + spec.matches( tcB ) == true + + + true == true + + + + + spec.matches( tcC ) == true + + + true == true + + + + + spec.matches( tcD ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == true + + + true == true + + + + + spec.matches( tcB ) == true + + + true == true + + + + + spec.matches( tcC ) == true + + + true == true + + + + + spec.matches( tcD ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == true + + + true == true + + + + + spec.matches( tcD ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == false + + + false == false + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == false + + + false == false + + + + + spec.matches( tcD ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == false + + + false == false + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == false + + + false == false + + + + + spec.matches( tcD ) == false + + + false == false + + + +
+
+ + + spec.hasFilters() == true + + + true == true + + + + + spec.matches( tcA ) == false + + + false == false + + + + + spec.matches( tcB ) == false + + + false == false + + + + + spec.matches( tcC ) == false + + + false == false + + + + + spec.matches( tcD ) == true + + + true == true + + + +
+ +
@@ -6892,7 +7315,7 @@ there"
- + - +