summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CTestCommandLine
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-17 23:31:26 (GMT)
committerBrad King <brad.king@kitware.com>2023-11-17 23:40:44 (GMT)
commitc896dc78f970aa154a722e65dc099d2c6d3b3bcd (patch)
tree15706c0e9c467b254875818d240728f950ccea94 /Tests/RunCMake/CTestCommandLine
parent6f8532fbfac3912fcb0e8729d549f2bfb045c64e (diff)
downloadCMake-c896dc78f970aa154a722e65dc099d2c6d3b3bcd.zip
CMake-c896dc78f970aa154a722e65dc099d2c6d3b3bcd.tar.gz
CMake-c896dc78f970aa154a722e65dc099d2c6d3b3bcd.tar.bz2
Tests: Cover ctest waiting on insufficient non-zero spare test-load
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine')
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-load-wait1-stdout.txt (renamed from Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt)2
2 files changed, 7 insertions, 5 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 223a61c..8a9cc8c 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -229,19 +229,21 @@ function(run_TestLoad name load)
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
add_test(TestLoad1 \"${CMAKE_COMMAND}\" -E echo \"test of --test-load\")
+ set_tests_properties(TestLoad1 PROPERTIES PROCESSORS 2)
add_test(TestLoad2 \"${CMAKE_COMMAND}\" -E echo \"test of --test-load\")
+ set_tests_properties(TestLoad2 PROPERTIES PROCESSORS 2)
")
- run_cmake_command(${name} ${CMAKE_CTEST_COMMAND} -VV -j2 --test-load ${load})
+ run_cmake_command(${name} ${CMAKE_CTEST_COMMAND} -VV -j8 --test-load ${load})
endfunction()
# 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)
+set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 7)
# Verify that new tests are not started when the load average exceeds
# our threshold and that they then run once the load average drops.
-run_TestLoad(test-load-wait 3)
+run_TestLoad(test-load-wait1 8)
# Verify that warning message is displayed but tests still start when
# an invalid argument is given.
@@ -249,7 +251,7 @@ run_TestLoad(test-load-invalid 'two')
# Verify that new tests are started when the load average falls below
# our threshold.
-run_TestLoad(test-load-pass 10)
+run_TestLoad(test-load-pass 12)
unset(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING})
diff --git a/Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt b/Tests/RunCMake/CTestCommandLine/test-load-wait1-stdout.txt
index db7d7f3..aa91950 100644
--- a/Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt
+++ b/Tests/RunCMake/CTestCommandLine/test-load-wait1-stdout.txt
@@ -2,7 +2,7 @@ Test project [^
]*/Tests/RunCMake/CTestCommandLine/TestLoad(
[^*][^
]*)*
-\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 3, Smallest test TestLoad[1-2] requires 1\*\*\*\*\*
+\*\*\*\*\* WAITING, System Load: 7, Max Allowed Load: 8, Smallest test TestLoad[1-2] requires 2\*\*\*\*\*
test 1
Start 1: TestLoad1
+(