summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-04 13:13:00 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-02-04 13:13:06 (GMT)
commitc8a955584d5edeb426a0176da1847c84c3b99e89 (patch)
tree68c88b5ea511aa014c732a31ddbb30219a2e6c9f /Modules
parent3900a31f440a1111f07ea893b146a67778e918c2 (diff)
parentfd6b8fa40e4f80fc04c5c8db90d92cd13097d3cf (diff)
downloadCMake-c8a955584d5edeb426a0176da1847c84c3b99e89.zip
CMake-c8a955584d5edeb426a0176da1847c84c3b99e89.tar.gz
CMake-c8a955584d5edeb426a0176da1847c84c3b99e89.tar.bz2
Merge topic 'GoogleTest-discover-spaces-in-parameters' into release-3.23
fd6b8fa40e GoogleTest: Preserve spaces in test parameters Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6941
Diffstat (limited to 'Modules')
-rw-r--r--Modules/GoogleTestAddTests.cmake9
1 files changed, 4 insertions, 5 deletions
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index 7043b2b..a10b5d0 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -142,15 +142,14 @@ function(gtest_discover_tests_impl)
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_suite "${pretty_suite}")
else()
- # Test name; strip spaces and comments to get just the name...
- string(REGEX REPLACE " +" "" test "${line}")
+ string(STRIP "${line}" test)
if(test MATCHES "#" AND NOT _NO_PRETTY_VALUES)
- string(REGEX REPLACE "/[0-9]+#GetParam..=" "/" pretty_test "${test}")
+ string(REGEX REPLACE "/[0-9]+[ #]+GetParam\\(\\) = " "/" pretty_test "${test}")
else()
- string(REGEX REPLACE "#.*" "" pretty_test "${test}")
+ string(REGEX REPLACE " +#.*" "" pretty_test "${test}")
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_test "${pretty_test}")
- string(REGEX REPLACE "#.*" "" test "${test}")
+ string(REGEX REPLACE " +#.*" "" test "${test}")
if(NOT "${_TEST_XML_OUTPUT_DIR}" STREQUAL "")
set(TEST_XML_OUTPUT_PARAM "--gtest_output=xml:${_TEST_XML_OUTPUT_DIR}/${prefix}${suite}.${test}${suffix}.xml")
else()