From 1bcd9b06b920eeadf0a574490dbd82bc78a46719 Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Tue, 5 Jan 2021 10:11:29 +0100 Subject: ctest: Don't treat skipped test as failed tests in progess report Skipped tests should not stand out on their own lines Fixes #21143 --- Source/CTest/cmCTestRunTest.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 4d65c9b..a4b0e22 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -139,7 +139,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) s << "SKIP_RETURN_CODE=" << this->TestProperties->SkipReturnCode; } this->TestResult.CompletionStatus = s.str(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Skipped "); + outputStream << "***Skipped "; skipped = true; } else if (success != this->TestProperties->WillFail) { 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()); outputStream << buf << "\n"; + bool passedOrSkipped = passed || skipped; if (this->CTest->GetTestProgressOutput()) { - if (!passed) { + if (!passedOrSkipped) { // If the test did not pass, reprint test name and error std::string output = GetTestPrefix(completed, total); 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); } } - if (!this->CTest->GetTestProgressOutput() || !passed) { + if (!this->CTest->GetTestProgressOutput() || !passedOrSkipped) { cmCTestLog(this->CTest, HANDLER_OUTPUT, outputStream.str()); } -- cgit v0.12 From 39cdc8afb93724de6145297b1a8e3335b2f40605 Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Tue, 5 Jan 2021 10:13:47 +0100 Subject: ctest: Make verbose mode override progress behavior Start and results should now be back in verbose mode even with progress mode enabled. --- Source/cmCTest.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 014ce4e..1860e0d 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2901,7 +2901,7 @@ bool cmCTest::GetFailover() const bool cmCTest::GetTestProgressOutput() const { - return this->Impl->TestProgressOutput; + return this->Impl->TestProgressOutput && !GetExtraVerbose(); } bool cmCTest::GetVerbose() const -- cgit v0.12