浏览代码

CTest: correct misleading warning message for RUN_SERIAL tests

As reported in issue 17167, when only RUN_SERIAL tests remain, CTest can
display a misleading message that it is waiting for the load to come
down when in fact, it cannot start any new tests.

This commit fixes that by determining whether this circumstance is
what's happening and adds an additional warning message in this case.
Wouter Klouwen 8 年之前
父节点
当前提交
ec2f901202
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      Source/CTest/cmCTestMultiProcessHandler.cxx

+ 12 - 0
Source/CTest/cmCTestMultiProcessHandler.cxx

@@ -326,10 +326,22 @@ void cmCTestMultiProcessHandler::StartNextTests()
   }
 
   if (allTestsFailedTestLoadCheck) {
+    // Find out whether there are any non RUN_SERIAL tests left, so that the
+    // correct warning may be displayed.
+    bool onlyRunSerialTestsLeft = true;
+    for (auto const& test : copy) {
+      if (!this->Properties[test]->RunSerial) {
+        onlyRunSerialTestsLeft = false;
+      }
+    }
     cmCTestLog(this->CTest, HANDLER_OUTPUT, "***** WAITING, ");
+
     if (this->SerialTestRunning) {
       cmCTestLog(this->CTest, HANDLER_OUTPUT,
                  "Waiting for RUN_SERIAL test to finish.");
+    } else if (onlyRunSerialTestsLeft) {
+      cmCTestLog(this->CTest, HANDLER_OUTPUT,
+                 "Only RUN_SERIAL tests remain, awaiting available slot.");
     } else {
       /* clang-format off */
       cmCTestLog(this->CTest, HANDLER_OUTPUT,