summaryrefslogtreecommitdiff
path: root/Modules/GoogleTestAddTests.cmake
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2017-11-28 10:52:18 -0500
committerBrad King <brad.king@kitware.com>2017-12-06 07:37:48 -0500
commit29731d89192681cbc4bf87d7947a877aa0fb27aa (patch)
tree7da7ff6db386d5ff54382af3b106c8a50e1b86fa /Modules/GoogleTestAddTests.cmake
parente99e39829ba36dbfad189a94062363343d7d3d8b (diff)
downloadcmake-29731d89192681cbc4bf87d7947a877aa0fb27aa.tar.gz
GoogleTest: Add timeout to discovery
Add a TIMEOUT option to gtest_discover_tests. This provides a work-around in case a test goes out to lunch, rather than causing the build to simply hang. (Although this is still a problem with the user's project, hanging the build is not cool, especially in the case of automatically running CI builds. It is much preferred that the build should actively fail in this case, and it is trivially easy for us to implement that.)
Diffstat (limited to 'Modules/GoogleTestAddTests.cmake')
-rw-r--r--Modules/GoogleTestAddTests.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index 6424d569e3..5a4bdcad39 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -30,6 +30,7 @@ if(NOT EXISTS "${TEST_EXECUTABLE}")
endif()
execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" --gtest_list_tests
+ TIMEOUT ${TEST_DISCOVERY_TIMEOUT}
OUTPUT_VARIABLE output
RESULT_VARIABLE result
)