summaryrefslogtreecommitdiff
path: root/Modules/GoogleTest.cmake
diff options
context:
space:
mode:
authorOleksii Odynochenko <oleksii.odynochenko@gmail.com>2022-10-11 12:20:26 +0300
committerBrad King <brad.king@kitware.com>2022-10-11 10:20:23 -0400
commit1d340d7cb2183e129f193e9bdbea83347d9a370f (patch)
treee63ab673cc3f20fb17680aa6d244d968195e6f1f /Modules/GoogleTest.cmake
parente21071ec4b2b46add5416eb1abeb8b6fbd7fddc6 (diff)
downloadcmake-1d340d7cb2183e129f193e9bdbea83347d9a370f.tar.gz
GoogleTest: Add gtest-filter for TYPED_TEST_P
Diffstat (limited to 'Modules/GoogleTest.cmake')
-rw-r--r--Modules/GoogleTest.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index f5f4f0238c..b8dc482ee4 100644
--- a/Modules/GoogleTest.cmake
+++ b/Modules/GoogleTest.cmake
@@ -348,7 +348,7 @@ function(gtest_add_tests)
unset(testList)
set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
- set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
+ set(gtest_test_type_regex "(TYPED_TEST|TEST)_?[FP]?")
foreach(source IN LISTS ARGS_SOURCES)
if(NOT ARGS_SKIP_DEPENDENCY)
@@ -361,7 +361,9 @@ function(gtest_add_tests)
# Parameterized tests have a different signature for the filter
if("x${test_type}" STREQUAL "xTEST_P")
- string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" gtest_test_name ${hit})
+ string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" gtest_test_name ${hit})
+ elseif("x${test_type}" STREQUAL "xTYPED_TEST_P")
+ string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1/*.\\2" gtest_test_name ${hit})
elseif("x${test_type}" STREQUAL "xTEST_F" OR "x${test_type}" STREQUAL "xTEST")
string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" gtest_test_name ${hit})
elseif("x${test_type}" STREQUAL "xTYPED_TEST")