diff options
author | Brad King <brad.king@kitware.com> | 2022-02-04 13:13:00 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-02-04 13:13:07 (GMT) |
commit | 56aac8cf50f19d4c2449254adf83da3a7a1c74f1 (patch) | |
tree | 2a574d68dbb267553b3906e59caad741d5bf94c7 /Modules | |
parent | 30977c467b15bea67c2eb8e7aaba3cea14ab0d55 (diff) | |
parent | fd6b8fa40e4f80fc04c5c8db90d92cd13097d3cf (diff) | |
download | CMake-56aac8cf50f19d4c2449254adf83da3a7a1c74f1.zip CMake-56aac8cf50f19d4c2449254adf83da3a7a1c74f1.tar.gz CMake-56aac8cf50f19d4c2449254adf83da3a7a1c74f1.tar.bz2 |
Merge topic 'GoogleTest-discover-spaces-in-parameters'
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.cmake | 9 |
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() |