summaryrefslogtreecommitdiffstats
path: root/Modules/GoogleTestAddTests.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/GoogleTestAddTests.cmake')
-rw-r--r--Modules/GoogleTestAddTests.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index a10b5d0..cef2e8a 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -135,10 +135,17 @@ function(gtest_discover_tests_impl)
if(NOT line MATCHES "^ ")
# 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}")
+ if(line MATCHES "#")
+ string(REGEX REPLACE "/.*" "" pretty_suite "${line}")
+ if(NOT _NO_PRETTY_TYPES)
+ string(REGEX REPLACE ".*/[0-9]+[ .#]+TypeParam = (.*)" "\\1" type_parameter "${line}")
+ else()
+ string(REGEX REPLACE ".*/([0-9]+)[ .#]+TypeParam = .*" "\\1" type_parameter "${line}")
+ endif()
+ set(test_name_template "@prefix@@pretty_suite@.@pretty_test@<@type_parameter@>@suffix@")
else()
set(pretty_suite "${suite}")
+ set(test_name_template "@prefix@@pretty_suite@.@pretty_test@@suffix@")
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_suite "${pretty_suite}")
else()
@@ -156,7 +163,7 @@ function(gtest_discover_tests_impl)
unset(TEST_XML_OUTPUT_PARAM)
endif()
- set(testname "${prefix}${pretty_suite}.${pretty_test}${suffix}")
+ string(CONFIGURE "${test_name_template}" testname)
# sanitize test name for further processing downstream
# unescape []
if(open_sb)