Commit dffc307c authored by Brad King's avatar Brad King
Browse files

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.
parent 93904772
...@@ -66,6 +66,11 @@ function(run_cmake test) ...@@ -66,6 +66,11 @@ function(run_cmake test)
else() else()
set(actual_stderr_var actual_stderr) set(actual_stderr_var actual_stderr)
endif() endif()
if(DEFINED RunCMake_TEST_TIMEOUT)
set(maybe_timeout TIMEOUT ${RunCMake_TEST_TIMEOUT})
else()
set(maybe_timeout "")
endif()
if(RunCMake_TEST_COMMAND) if(RunCMake_TEST_COMMAND)
execute_process( execute_process(
COMMAND ${RunCMake_TEST_COMMAND} COMMAND ${RunCMake_TEST_COMMAND}
...@@ -73,6 +78,7 @@ function(run_cmake test) ...@@ -73,6 +78,7 @@ function(run_cmake test)
OUTPUT_VARIABLE actual_stdout OUTPUT_VARIABLE actual_stdout
ERROR_VARIABLE ${actual_stderr_var} ERROR_VARIABLE ${actual_stderr_var}
RESULT_VARIABLE actual_result RESULT_VARIABLE actual_result
${maybe_timeout}
) )
else() else()
execute_process( execute_process(
...@@ -87,6 +93,7 @@ function(run_cmake test) ...@@ -87,6 +93,7 @@ function(run_cmake test)
OUTPUT_VARIABLE actual_stdout OUTPUT_VARIABLE actual_stdout
ERROR_VARIABLE ${actual_stderr_var} ERROR_VARIABLE ${actual_stderr_var}
RESULT_VARIABLE actual_result RESULT_VARIABLE actual_result
${maybe_timeout}
) )
endif() endif()
set(msg "") set(msg "")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment