diff options
author | Evgeniy Shcherbina <ixsci@pm.me> | 2022-02-04 10:03:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-07 17:53:16 (GMT) |
commit | f28f738bd2be2ed790bb5b4c794773b7a627d3f2 (patch) | |
tree | f340702240d59653a59cfec97fe0873a4cc6c12c /Modules/GoogleTestAddTests.cmake | |
parent | c8a955584d5edeb426a0176da1847c84c3b99e89 (diff) | |
download | CMake-f28f738bd2be2ed790bb5b4c794773b7a627d3f2.zip CMake-f28f738bd2be2ed790bb5b4c794773b7a627d3f2.tar.gz CMake-f28f738bd2be2ed790bb5b4c794773b7a627d3f2.tar.bz2 |
GoogleTest: Fix type param tests for suites with many cases
When there were many cases (two digits or more) the "prettier" would
fail to recognize the pretty part leaving the test name unprocessed.
The fix made sure the processing would work correctly, irrespective
of the case number.
Before the fix, for the following input:
TypedSuite/1. # TypeParam = int
case
TypedSuite/10. # TypeParam = char
case
The output would be:
TypedSuite/int.case
TypedSuite/10. # TypeParam = char.case
Now the output will be:
TypedSuite/int.case
TypedSuite/char.case
Diffstat (limited to 'Modules/GoogleTestAddTests.cmake')
-rw-r--r-- | Modules/GoogleTestAddTests.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake index a10b5d0..671127a 100644 --- a/Modules/GoogleTestAddTests.cmake +++ b/Modules/GoogleTestAddTests.cmake @@ -136,7 +136,7 @@ function(gtest_discover_tests_impl) # Module; remove trailing '.' to get just the name... string(REGEX REPLACE "\\.( *#.*)?$" "" suite "${line}") if(line MATCHES "#" AND NOT _NO_PRETTY_TYPES) - string(REGEX REPLACE "/[0-9]\\.+ +#.*= +" "/" pretty_suite "${line}") + string(REGEX REPLACE "/[0-9]+\\.+ +#.*= +" "/" pretty_suite "${line}") else() set(pretty_suite "${suite}") endif() |