diff options
author | Brad King <brad.king@kitware.com> | 2015-07-02 14:00:51 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-07-02 14:00:51 (GMT) |
commit | d59ab785858d8028eb9452a61571ffa688d90136 (patch) | |
tree | 7cfd577bbbe87c753028185c20f1b2f7a6e997db /Tests/RunCMake/ctest_test/RunCMakeTest.cmake | |
parent | 3ae8e84ef5c94e5fa250b4e2466aa6632a233bb2 (diff) | |
parent | f62d301b9257542f5460902c400af3f947f10a66 (diff) | |
download | CMake-d59ab785858d8028eb9452a61571ffa688d90136.zip CMake-d59ab785858d8028eb9452a61571ffa688d90136.tar.gz CMake-d59ab785858d8028eb9452a61571ffa688d90136.tar.bz2 |
Merge topic 'ctest-test-load'
f62d301b ctest: Optionally avoid starting tests that may exceed a given CPU load
07c550ca cmCTestMultiProcessHandler: Refactor RUN_SERIAL implementation
8bf5a80b cmSystemTools: Add StringToULong helper
dffc307c Tests: Teach RunCMake infrastructure to optionally timeout
Diffstat (limited to 'Tests/RunCMake/ctest_test/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/ctest_test/RunCMakeTest.cmake | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake index d906290..21d0447 100644 --- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake @@ -1,6 +1,8 @@ include(RunCTest) +set(RunCMake_TEST_TIMEOUT 60) set(CASE_CTEST_TEST_ARGS "") +set(CASE_CTEST_TEST_LOAD "") function(run_ctest_test CASE_NAME) set(CASE_CTEST_TEST_ARGS "${ARGN}") @@ -8,3 +10,42 @@ function(run_ctest_test CASE_NAME) endfunction() run_ctest_test(TestQuiet QUIET) + +# Tests for the 'Test Load' feature of ctest +# +# Spoof a load average value to make these tests more reliable. +set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 5) + +# Verify that new tests are started when the load average falls below +# our threshold. +run_ctest_test(TestLoadPass TEST_LOAD 6) + +# Verify that new tests are not started when the load average exceeds +# our threshold. +run_ctest_test(TestLoadFail TEST_LOAD 2) + +# Verify that when an invalid "TEST_LOAD" value is given, a warning +# message is displayed and the value is ignored. +run_ctest_test(TestLoadInvalid TEST_LOAD "ERR1") + +# Verify that new tests are started when the load average falls below +# our threshold. +set(CASE_CTEST_TEST_LOAD 7) +run_ctest_test(CTestTestLoadPass) + +# Verify that new tests are not started when the load average exceeds +# our threshold. +set(CASE_CTEST_TEST_LOAD 4) +run_ctest_test(CTestTestLoadFail) + +# Verify that when an invalid "CTEST_TEST_LOAD" value is given, +# a warning message is displayed and the value is ignored. +set(CASE_CTEST_TEST_LOAD "ERR2") +run_ctest_test(CTestTestLoadInvalid) + +# Verify that the "TEST_LOAD" value has higher precedence than +# the "CTEST_TEST_LOAD" value +set(CASE_CTEST_TEST_LOAD "ERR3") +run_ctest_test(TestLoadOrder TEST_LOAD "ERR4") + +unset(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING}) |