diff options
author | Brad King <brad.king@kitware.com> | 2015-06-24 13:53:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-06-30 14:21:34 (GMT) |
commit | dffc307c81220ffc243abc3b87ecfd694bd4cd35 (patch) | |
tree | c694b7b24003e9314ffb7c6eca4b4243e4689472 /Tests/RunCMake/RunCMake.cmake | |
parent | 93904772d7382ca46f2e73be9222c556c1ca79f2 (diff) | |
download | CMake-dffc307c81220ffc243abc3b87ecfd694bd4cd35.zip CMake-dffc307c81220ffc243abc3b87ecfd694bd4cd35.tar.gz CMake-dffc307c81220ffc243abc3b87ecfd694bd4cd35.tar.bz2 |
Tests: Teach RunCMake infrastructure to optionally timeout
Add a RunCMake_TEST_TIMEOUT option that tests can set to cause RunCMake
to limit the time it waits for the child process to finish.
Diffstat (limited to 'Tests/RunCMake/RunCMake.cmake')
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 70c0d6c..46bc494 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -66,6 +66,11 @@ function(run_cmake test) else() set(actual_stderr_var actual_stderr) endif() + if(DEFINED RunCMake_TEST_TIMEOUT) + set(maybe_timeout TIMEOUT ${RunCMake_TEST_TIMEOUT}) + else() + set(maybe_timeout "") + endif() if(RunCMake_TEST_COMMAND) execute_process( COMMAND ${RunCMake_TEST_COMMAND} @@ -73,6 +78,7 @@ function(run_cmake test) OUTPUT_VARIABLE actual_stdout ERROR_VARIABLE ${actual_stderr_var} RESULT_VARIABLE actual_result + ${maybe_timeout} ) else() execute_process( @@ -87,6 +93,7 @@ function(run_cmake test) OUTPUT_VARIABLE actual_stdout ERROR_VARIABLE ${actual_stderr_var} RESULT_VARIABLE actual_result + ${maybe_timeout} ) endif() set(msg "") |