diff options
author | Evgeniy Shcherbina <ixsci@pm.me> | 2022-02-03 11:01:40 (GMT) |
---|---|---|
committer | Evgeniy Shcherbina <ixsci@pm.me> | 2022-02-03 11:12:53 (GMT) |
commit | fd6b8fa40e4f80fc04c5c8db90d92cd13097d3cf (patch) | |
tree | b6bd4310477e74492917e2a2a914e1c2c61541bc /Modules | |
parent | fb2658165303c29163e1d4f81a10df3dd427097c (diff) | |
download | CMake-fd6b8fa40e4f80fc04c5c8db90d92cd13097d3cf.zip CMake-fd6b8fa40e4f80fc04c5c8db90d92cd13097d3cf.tar.gz CMake-fd6b8fa40e4f80fc04c5c8db90d92cd13097d3cf.tar.bz2 |
GoogleTest: Preserve spaces in test parameters
Before the fix the gtest_discover_tests() function would strip the
user data in test parameters (everything to the right of GetParam())
of spaces. Now the parameters aren't altered in any way.
Fixes #23058
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() |