From bd0b4ca867c297a42b3128e0193c6ab01f1b53ec Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 20 Oct 2023 15:20:41 -0400 Subject: cmCTestMultiProcessHandler: Invert spare load condition Switch then/else blocks to reduce indentation. --- Source/CTest/cmCTestMultiProcessHandler.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 0691008..d4cda42 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -560,14 +560,7 @@ void cmCTestMultiProcessHandler::StartNextTests() size_t processors = this->GetProcessorsUsed(test); 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 { + if (processors > spareLoad) { // Keep track of the smallest excluded test to report in message below. if (processors <= minProcessorsRequired) { minProcessorsRequired = processors; @@ -575,6 +568,13 @@ void cmCTestMultiProcessHandler::StartNextTests() } continue; } + + // We found a test that fits in the spare load. + allTestsFailedTestLoadCheck = false; + cmCTestLog(this->CTest, DEBUG, + "OK to run " + << this->GetName(test) << ", it requires " << processors + << " procs & system load is: " << systemLoad << std::endl); } // Exclude tests that are too big to fit in the concurrency limit. -- cgit v0.12