For ShowOnly mode
| 1434 | |
| 1435 | // For ShowOnly mode |
| 1436 | void cmCTestMultiProcessHandler::PrintTestList() |
| 1437 | { |
| 1438 | if (this->CTest->GetOutputAsJson()) { |
| 1439 | this->PrintOutputAsJson(); |
| 1440 | return; |
| 1441 | } |
| 1442 | |
| 1443 | this->TestHandler->SetMaxIndex(this->FindMaxIndex()); |
| 1444 | |
| 1445 | for (auto& it : this->Properties) { |
| 1446 | cmCTestTestHandler::cmCTestTestProperties& p = *it.second; |
| 1447 | |
| 1448 | // Don't worry if this fails, we are only showing the test list, not |
| 1449 | // running the tests |
| 1450 | cmWorkingDirectory workdir(p.Directory); |
| 1451 | |
| 1452 | cmCTestRunTest testRun(*this, p.Index); |
| 1453 | testRun.ComputeArguments(); // logs the command in verbose mode |
| 1454 | |
| 1455 | if (!p.Labels.empty()) // print the labels |
| 1456 | { |
| 1457 | cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, |
| 1458 | "Labels:", this->Quiet); |
| 1459 | } |
| 1460 | for (std::string const& label : p.Labels) { |
| 1461 | cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " " << label, |
| 1462 | this->Quiet); |
| 1463 | } |
| 1464 | if (!p.Labels.empty()) // print the labels |
| 1465 | { |
| 1466 | cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl, |
| 1467 | this->Quiet); |
| 1468 | } |
| 1469 | |
| 1470 | if (this->TestHandler->MemCheck) { |
| 1471 | cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Memory Check", |
| 1472 | this->Quiet); |
| 1473 | } else { |
| 1474 | cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Test", this->Quiet); |
| 1475 | } |
| 1476 | std::ostringstream indexStr; |
| 1477 | indexStr << " #" << p.Index << ":"; |
| 1478 | cmCTestOptionalLog( |
| 1479 | this->CTest, HANDLER_OUTPUT, |
| 1480 | std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) |
| 1481 | << indexStr.str(), |
| 1482 | this->Quiet); |
| 1483 | cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " " << p.Name, |
| 1484 | this->Quiet); |
| 1485 | if (p.Disabled) { |
| 1486 | cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " (Disabled)", |
| 1487 | this->Quiet); |
| 1488 | } |
| 1489 | cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, std::endl, this->Quiet); |
| 1490 | } |
| 1491 | |
| 1492 | cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, |
| 1493 | std::endl |
no test coverage detected