소스 검색

GoogleTest: gtest_add_tests() fails if any source file is empty

Fixes #18321
Alessandro 7 년 전
부모
커밋
31c82143bf
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Modules/GoogleTest.cmake

+ 1 - 1
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})