diff options
author | Brad King <brad.king@kitware.com> | 2023-10-20 19:17:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-11-17 23:41:42 (GMT) |
commit | ee321dc85fcc99389c372f7ba1453edf27b27663 (patch) | |
tree | bb3ca229967e5d760715f86d49bb1cbf34e97303 /Source | |
parent | afd185881f3b138389ab79024e397e52cfd945c3 (diff) | |
download | CMake-ee321dc85fcc99389c372f7ba1453edf27b27663.zip CMake-ee321dc85fcc99389c372f7ba1453edf27b27663.tar.gz CMake-ee321dc85fcc99389c372f7ba1453edf27b27663.tar.bz2 |
cmCTestMultiProcessHandler: Clarify search for tests <= spare load
Move code into conditions where it is needed and comment its purpose.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index e6466ad..02f1d83 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -558,25 +558,26 @@ void cmCTestMultiProcessHandler::StartNextTests() } size_t processors = this->GetProcessorsUsed(test); - bool testLoadOk = true; if (this->TestLoad > 0) { + // Exclude tests that are too big to fit in the spare load. if (processors <= spareLoad) { + // We found a test that fits in the spare load. cmCTestLog(this->CTest, DEBUG, "OK to run " << this->GetName(test) << ", it requires " << processors << " procs & system load is: " << systemLoad << std::endl); allTestsFailedTestLoadCheck = false; } else { - testLoadOk = false; + // Keep track of the smallest excluded test to report in message below. + if (processors <= minProcessorsRequired) { + minProcessorsRequired = processors; + testWithMinProcessors = this->GetName(test); + } + continue; } } - if (processors <= minProcessorsRequired) { - minProcessorsRequired = processors; - testWithMinProcessors = this->GetName(test); - } - - if (testLoadOk && processors <= numToStart && this->StartTest(test)) { + if (processors <= numToStart && this->StartTest(test)) { numToStart -= processors; } else if (numToStart == 0) { break; |