From 716f8c88c9c94dc58f22ae770d613a4fec51c276 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 31 Mar 2017 13:56:49 -0400 Subject: Tests: Add option to customize LinkInterfaceLoop timeout This test has a timeout in case CMake gets into an infinite loop. The default of 90 seconds should be plenty of time for the test to run correctly since it does not actually do a build. However, busy machines that run lots of tests in parallel may need a longer timeout. Give them an option to extend it. --- Tests/CMakeOnly/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index c692cbd..d44c836 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -9,7 +9,14 @@ macro(add_CMakeOnly_test test) endmacro() add_CMakeOnly_test(LinkInterfaceLoop) -set_property(TEST CMakeOnly.LinkInterfaceLoop PROPERTY TIMEOUT 90) +# If a bug is introduced in CMake that causes an infinite loop while +# analyzing LinkInterfaceLoop then don't let the test run too long. +# Use an option to customize it so that the timeout can be extended +# on busy machines. +if(NOT DEFINED CMake_TEST_CMakeOnly.LinkInterfaceLoop_TIMEOUT) + set(CMake_TEST_CMakeOnly.LinkInterfaceLoop_TIMEOUT 90) +endif() +set_property(TEST CMakeOnly.LinkInterfaceLoop PROPERTY TIMEOUT ${CMake_TEST_CMakeOnly.LinkInterfaceLoop_TIMEOUT}) add_CMakeOnly_test(CheckSymbolExists) -- cgit v0.12