Split [.foo] into [.][foo] when parsing test specs

b77cec05c0 fixed this problem for tagging tests, so that a test
case tagged with `[.foo]` would be parsed as tagged with `[.][foo]`.
This does the same for the test spec parsing.

Fixes #1798
This commit is contained in:
Martin Hořeňovský
2019-11-05 23:28:47 +01:00
parent c165bd15c5
commit c50ba09cde
10 changed files with 209 additions and 37 deletions

View File

@@ -7370,6 +7370,50 @@ CmdLine.tests.cpp:<line number>: PASSED:
with expansion:
true
-------------------------------------------------------------------------------
Parse test names and tags
Shortened hide tags are split apart when parsing
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
CHECK( spec.matches(*fakeTestCase("hidden and foo", "[.][foo]")) )
with expansion:
true
CmdLine.tests.cpp:<line number>: PASSED:
CHECK_FALSE( spec.matches(*fakeTestCase("only foo", "[foo]")) )
with expansion:
!false
-------------------------------------------------------------------------------
Parse test names and tags
Shortened hide tags also properly handle exclusion
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
CHECK_FALSE( spec.matches(*fakeTestCase("hidden and foo", "[.][foo]")) )
with expansion:
!false
CmdLine.tests.cpp:<line number>: PASSED:
CHECK_FALSE( spec.matches(*fakeTestCase("only foo", "[foo]")) )
with expansion:
!false
CmdLine.tests.cpp:<line number>: PASSED:
CHECK_FALSE( spec.matches(*fakeTestCase("only hidden", "[.]")) )
with expansion:
!false
CmdLine.tests.cpp:<line number>: PASSED:
CHECK( spec.matches(*fakeTestCase("neither foo nor hidden", "[bar]")) )
with expansion:
true
-------------------------------------------------------------------------------
Pointers can be compared to null
-------------------------------------------------------------------------------
@@ -13961,5 +14005,5 @@ Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 320 | 230 passed | 86 failed | 4 failed as expected
assertions: 1793 | 1624 passed | 148 failed | 21 failed as expected
assertions: 1799 | 1630 passed | 148 failed | 21 failed as expected