summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-04 15:23:30 (GMT)
committerBrad King <brad.king@kitware.com>2015-05-04 15:28:50 (GMT)
commit0f927b440adbe3ecca1b8987ed8c5e442a324ff0 (patch)
tree02224e57b5b715ac04fd46728dabea76cbdc8cf9 /Modules
parentd3b36a90b661543f937daffafdf386c91a9592f5 (diff)
downloadCMake-0f927b440adbe3ecca1b8987ed8c5e442a324ff0.zip
CMake-0f927b440adbe3ecca1b8987ed8c5e442a324ff0.tar.gz
CMake-0f927b440adbe3ecca1b8987ed8c5e442a324ff0.tar.bz2
FindGTest: Fix parsing of test macro calls with spaces (#15553)
Tolerate spaces before the open paren and after the test name before the comma.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindGTest.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index e6b5b0a..fccf877 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -115,11 +115,11 @@ function(GTEST_ADD_TESTS executable extra_args)
# obtain sources used for building that executable
get_property(ARGN TARGET ${executable} PROPERTY SOURCES)
endif()
- set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*")
+ set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
foreach(source ${ARGN})
file(READ "${source}" contents)
- string(REGEX MATCHALL "${gtest_test_type_regex}\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
+ string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
foreach(hit ${found_tests})
string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})