mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-20 12:53:55 +08:00
ctest: Don't treat skipped test as failed tests in progess report
Skipped tests should not stand out on their own lines Fixes #21143
This commit is contained in:
@@ -139,7 +139,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
|
|||||||
s << "SKIP_RETURN_CODE=" << this->TestProperties->SkipReturnCode;
|
s << "SKIP_RETURN_CODE=" << this->TestProperties->SkipReturnCode;
|
||||||
}
|
}
|
||||||
this->TestResult.CompletionStatus = s.str();
|
this->TestResult.CompletionStatus = s.str();
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Skipped ");
|
outputStream << "***Skipped ";
|
||||||
skipped = true;
|
skipped = true;
|
||||||
} else if (success != this->TestProperties->WillFail) {
|
} else if (success != this->TestProperties->WillFail) {
|
||||||
this->TestResult.Status = cmCTestTestHandler::COMPLETED;
|
this->TestResult.Status = cmCTestTestHandler::COMPLETED;
|
||||||
@@ -195,8 +195,9 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
|
|||||||
sprintf(buf, "%6.2f sec", this->TestProcess->GetTotalTime().count());
|
sprintf(buf, "%6.2f sec", this->TestProcess->GetTotalTime().count());
|
||||||
outputStream << buf << "\n";
|
outputStream << buf << "\n";
|
||||||
|
|
||||||
|
bool passedOrSkipped = passed || skipped;
|
||||||
if (this->CTest->GetTestProgressOutput()) {
|
if (this->CTest->GetTestProgressOutput()) {
|
||||||
if (!passed) {
|
if (!passedOrSkipped) {
|
||||||
// If the test did not pass, reprint test name and error
|
// If the test did not pass, reprint test name and error
|
||||||
std::string output = GetTestPrefix(completed, total);
|
std::string output = GetTestPrefix(completed, total);
|
||||||
std::string testName = this->TestProperties->Name;
|
std::string testName = this->TestProperties->Name;
|
||||||
@@ -216,7 +217,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
|
|||||||
cmCTestLog(this->CTest, HANDLER_TEST_PROGRESS_OUTPUT, testName);
|
cmCTestLog(this->CTest, HANDLER_TEST_PROGRESS_OUTPUT, testName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this->CTest->GetTestProgressOutput() || !passed) {
|
if (!this->CTest->GetTestProgressOutput() || !passedOrSkipped) {
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, outputStream.str());
|
cmCTestLog(this->CTest, HANDLER_OUTPUT, outputStream.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user