Commit a0e5998b authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'ctest-wait-verbosity'

82e40607 ctest: Display test "WAITING" messages only in extra-verbose mode
80da23f2

 Tests: Add RunCTest helper option to control CTest verbose flag
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !5990
parents ce97e2bd 82e40607
......@@ -587,24 +587,24 @@ void cmCTestMultiProcessHandler::StartNextTests()
onlyRunSerialTestsLeft = false;
}
}
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***** WAITING, ");
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "***** WAITING, ");
if (this->SerialTestRunning) {
cmCTestLog(this->CTest, HANDLER_OUTPUT,
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Waiting for RUN_SERIAL test to finish.");
} else if (onlyRunSerialTestsLeft) {
cmCTestLog(this->CTest, HANDLER_OUTPUT,
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Only RUN_SERIAL tests remain, awaiting available slot.");
} else {
/* clang-format off */
cmCTestLog(this->CTest, HANDLER_OUTPUT,
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"System Load: " << systemLoad << ", "
"Max Allowed Load: " << this->TestLoad << ", "
"Smallest test " << testWithMinProcessors <<
" requires " << minProcessorsRequired);
/* clang-format on */
}
cmCTestLog(this->CTest, HANDLER_OUTPUT, "*****" << std::endl);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "*****" << std::endl);
// Wait between 1 and 5 seconds before trying again.
unsigned int milliseconds = (cmSystemTools::RandomSeed() % 5 + 1) * 1000;
......
......@@ -202,7 +202,7 @@ function(run_TestLoad name load)
add_test(TestLoad1 \"${CMAKE_COMMAND}\" -E echo \"test of --test-load\")
add_test(TestLoad2 \"${CMAKE_COMMAND}\" -E echo \"test of --test-load\")
")
run_cmake_command(${name} ${CMAKE_CTEST_COMMAND} -j2 --test-load ${load})
run_cmake_command(${name} ${CMAKE_CTEST_COMMAND} -VV -j2 --test-load ${load})
endfunction()
# Tests for the --test-load feature of ctest
......
^Test project .*/Tests/RunCMake/CTestCommandLine/TestLoad
Test project [^
]*/Tests/RunCMake/CTestCommandLine/TestLoad(
[^*][^
]*)*
test 1
Start 1: TestLoad1
+(
[^*][^
]*)*
test 2
Start 2: TestLoad2
1/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
+(
[^*][^
]*)*
1/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec(
[^*][^
]*)*
2/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 2
^Test project .*/Tests/RunCMake/CTestCommandLine/TestLoad
Test project [^
]*/Tests/RunCMake/CTestCommandLine/TestLoad(
[^*][^
]*)*
test 1
Start 1: TestLoad1
+(
[^*][^
]*)*
test 2
Start 2: TestLoad2
1/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
+(
[^*][^
]*)*
1/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec(
[^*][^
]*)*
2/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 2
^Test project .*/Tests/RunCMake/CTestCommandLine/TestLoad
Test project [^
]*/Tests/RunCMake/CTestCommandLine/TestLoad(
[^*][^
]*)*
\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 3, Smallest test TestLoad[1-2] requires 1\*\*\*\*\*
test 1
Start 1: TestLoad1
+(
[^*][^
]*)*
test 2
Start 2: TestLoad2
1/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
+(
[^*][^
]*)*
1/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec(
[^*][^
]*)*
2/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 2
......@@ -11,10 +11,13 @@ function(run_ctest CASE_NAME)
endif()
configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in
${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY)
if(NOT DEFINED RunCTest_VERBOSE_FLAG)
set(RunCTest_VERBOSE_FLAG "-V")
endif()
run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND}
-C Debug
-S ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake
-V
${RunCTest_VERBOSE_FLAG}
--output-log ${RunCMake_BINARY_DIR}/${CASE_NAME}-build/testOutput.log
--no-compress-output
${ARGN}
......
Test project .*/Tests/RunCMake/ctest_test/CTestTestLoadInvalid-build
Test project [^
]*/Tests/RunCMake/ctest_test/CTestTestLoadInvalid-build(
[^*][^
]*)*
test 1
Start 1: RunCMakeVersion
+(
[^*][^
]*)*
1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 1
......
Test project .*/Tests/RunCMake/ctest_test/CTestTestLoadPass-build
Test project [^
]*/Tests/RunCMake/ctest_test/CTestTestLoadPass-build(
[^*][^
]*)*
test 1
Start 1: RunCMakeVersion
+(
[^*][^
]*)*
1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 1
......
Test project .*/Tests/RunCMake/ctest_test/CTestTestLoadWait-build
Test project [^
]*/Tests/RunCMake/ctest_test/CTestTestLoadWait-build(
[^*][^
]*)*
\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 4, Smallest test RunCMakeVersion requires 1\*\*\*\*\*
test 1
Start 1: RunCMakeVersion
+(
[^*][^
]*)*
1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 1
......
......@@ -18,6 +18,7 @@ run_ctest_test(TestQuiet QUIET)
#
# Spoof a load average value to make these tests more reliable.
set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 5)
set(RunCTest_VERBOSE_FLAG -VV)
# Verify that new tests are started when the load average falls below
# our threshold.
......@@ -53,6 +54,7 @@ run_ctest_test(TestLoadOrder TEST_LOAD "ERR4")
unset(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING})
unset(CASE_CTEST_TEST_LOAD)
unset(RunCTest_VERBOSE_FLAG)
function(run_TestChangeId)
set(CASE_TEST_PREFIX_CODE [[
......
Test project .*/Tests/RunCMake/ctest_test/TestLoadInvalid-build
Test project [^
]*/Tests/RunCMake/ctest_test/TestLoadInvalid-build(
[^*][^
]*)*
test 1
Start 1: RunCMakeVersion
+(
[^*][^
]*)*
1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 1
......
Test project .*/Tests/RunCMake/ctest_test/TestLoadOrder-build
Test project [^
]*/Tests/RunCMake/ctest_test/TestLoadOrder-build(
[^*][^
]*)*
test 1
Start 1: RunCMakeVersion
+(
[^*][^
]*)*
1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 1
......
Test project .*/Tests/RunCMake/ctest_test/TestLoadPass-build
Test project [^
]*/Tests/RunCMake/ctest_test/TestLoadPass-build(
[^*][^
]*)*
test 1
Start 1: RunCMakeVersion
+(
[^*][^
]*)*
1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 1
......
Test project .*/Tests/RunCMake/ctest_test/TestLoadWait-build
Test project [^
]*/Tests/RunCMake/ctest_test/TestLoadWait-build(
[^*][^
]*)*
\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 2, Smallest test RunCMakeVersion requires 1\*\*\*\*\*
test 1
Start 1: RunCMakeVersion
+(
[^*][^
]*)*
1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 1
......
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