diff options
Diffstat (limited to 'Tests/RunCMake/execute_process/AnyCommandTimeout.cmake')
-rw-r--r-- | Tests/RunCMake/execute_process/AnyCommandTimeout.cmake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/execute_process/AnyCommandTimeout.cmake b/Tests/RunCMake/execute_process/AnyCommandTimeout.cmake new file mode 100644 index 0000000..a5a53fd --- /dev/null +++ b/Tests/RunCMake/execute_process/AnyCommandTimeout.cmake @@ -0,0 +1,15 @@ +execute_process(COMMAND ${CMAKE_COMMAND} -E true + COMMAND ${CMAKE_COMMAND} -E sleep 10 + COMMAND ${CMAKE_COMMAND} -E true + TIMEOUT 1 + RESULT_VARIABLE result +) + +if(NOT result EQUAL "0") + execute_process(COMMAND ${CMAKE_COMMAND} -E true + COMMAND ${CMAKE_COMMAND} -E sleep 10 + COMMAND ${CMAKE_COMMAND} -E true + TIMEOUT 1 + COMMAND_ERROR_IS_FATAL ANY + ) +endif() |