summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/GoogleTest.cmake2
-rw-r--r--Tests/GoogleTest/Test/CMakeLists.txt7
-rw-r--r--Tests/GoogleTest/Test/empty.cxx0
3 files changed, 5 insertions, 4 deletions
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index 2c9ee11..a5bb863 100644
--- a/Modules/GoogleTest.cmake
+++ b/Modules/GoogleTest.cmake
@@ -308,7 +308,7 @@ function(gtest_add_tests)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source})
endif()
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})
diff --git a/Tests/GoogleTest/Test/CMakeLists.txt b/Tests/GoogleTest/Test/CMakeLists.txt
index f798d31..baf00d5 100644
--- a/Tests/GoogleTest/Test/CMakeLists.txt
+++ b/Tests/GoogleTest/Test/CMakeLists.txt
@@ -44,12 +44,13 @@ endif()
set_tests_properties(set2.GoogleTest.ConditionalFail.foo PROPERTIES WILL_FAIL YES)
-# Search specific sources to get the test list
-add_executable(test_gtest2 main2.cxx)
+# Search specific sources to get the test list. Include an empty file
+# to ensure they are handled correctly too.
+add_executable(test_gtest2 main2.cxx empty.cxx)
target_link_libraries(test_gtest2 GTest::Main)
gtest_add_tests(TARGET test_gtest2
TEST_LIST testList
- SOURCES main2.h
+ SOURCES main2.h empty.cxx
)
set(expectedTests
GoogleTest.SomethingElse
diff --git a/Tests/GoogleTest/Test/empty.cxx b/Tests/GoogleTest/Test/empty.cxx
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/GoogleTest/Test/empty.cxx