diff options
author | Brad King <brad.king@kitware.com> | 2022-02-08 13:35:12 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-02-08 13:35:18 (GMT) |
commit | 5bf6e57a127ad74caae50b947b1c6c6431bc4101 (patch) | |
tree | cacf35f6964d5bc4b68bffc197e0d48cb5c4fe86 /Modules | |
parent | 860dbece00bb246aeab2d4b687fc89c8fc846527 (diff) | |
parent | 073dd1bd8131a337d3022a6bdc75af0114588093 (diff) | |
download | CMake-5bf6e57a127ad74caae50b947b1c6c6431bc4101.zip CMake-5bf6e57a127ad74caae50b947b1c6c6431bc4101.tar.gz CMake-5bf6e57a127ad74caae50b947b1c6c6431bc4101.tar.bz2 |
Merge topic 'GoogleTest-discover-type-params' into release-3.23
073dd1bd81 GoogleTest: Change format for typed tests
f28f738bd2 GoogleTest: Fix type param tests for suites with many cases
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6958
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/GoogleTestAddTests.cmake | 13 |
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) |