diff options
author | Brad King <brad.king@kitware.com> | 2017-04-27 12:53:34 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-04-27 12:55:40 (GMT) |
commit | ef205e04d4b06b4cc1456c2bca91d3859e5cb85c (patch) | |
tree | a9d3b28b2ed3b16c17be02ee012e48914111ed70 /Source/CTest | |
parent | 5081dfca8332957a4894bce0653c86ba1b7b2bfe (diff) | |
parent | 851b6c1595363c8916f24b7da8db991cf6fc3f25 (diff) | |
download | CMake-ef205e04d4b06b4cc1456c2bca91d3859e5cb85c.zip CMake-ef205e04d4b06b4cc1456c2bca91d3859e5cb85c.tar.gz CMake-ef205e04d4b06b4cc1456c2bca91d3859e5cb85c.tar.bz2 |
Merge topic 'ctest_test-ignore-skipped-tests'
851b6c15 cmCTestTestHandler: indicate why a test did not run
25a7f14f Help: add release notes
ab8bbef9 cmCTestTestHandler: count skipped tests as disabled
202a44a4 cmCTestRunTest: do not count skipped tests as failed
Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !741
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 16 |
2 files changed, 18 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index a4853b7..fe23075 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -167,6 +167,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) std::vector<std::pair<cmsys::RegularExpression, std::string> >::iterator passIt; bool forceFail = false; + bool skipped = false; bool outputTestErrorsToConsole = false; if (!this->TestProperties->RequiredRegularExpressions.empty() && this->FailedDependencies.empty()) { @@ -219,6 +220,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 "); + skipped = true; } else if ((success && !this->TestProperties->WillFail) || (!success && this->TestProperties->WillFail)) { this->TestResult.Status = cmCTestTestHandler::COMPLETED; @@ -338,7 +340,9 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) compress ? this->CompressedOutput : this->ProcessOutput; this->TestResult.CompressOutput = compress; this->TestResult.ReturnValue = this->TestProcess->GetExitValue(); - this->TestResult.CompletionStatus = "Completed"; + if (!skipped) { + this->TestResult.CompletionStatus = "Completed"; + } this->TestResult.ExecutionTime = this->TestProcess->GetTotalTime(); this->MemCheckPostProcess(); this->ComputeWeightedCost(); @@ -349,7 +353,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) this->TestHandler->TestResults.push_back(this->TestResult); } delete this->TestProcess; - return passed; + return passed || skipped; } bool cmCTestRunTest::StartAgain() diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 167fecf..c24aecb 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -17,6 +17,7 @@ #include <string.h> #include <time.h> +#include "cmAlgorithms.h" #include "cmCTest.h" #include "cmCTestBatchTestHandler.h" #include "cmCTestMultiProcessHandler.h" @@ -495,7 +496,8 @@ int cmCTestTestHandler::ProcessHandler() for (SetOfTests::iterator ftit = resultsSet.begin(); ftit != resultsSet.end(); ++ftit) { - if (ftit->CompletionStatus == "Disabled") { + if (cmHasLiteralPrefix(ftit->CompletionStatus, "SKIP_RETURN_CODE=") || + ftit->CompletionStatus == "Disabled") { disabledTests.push_back(*ftit); } } @@ -521,17 +523,22 @@ int cmCTestTestHandler::ProcessHandler() if (!disabledTests.empty()) { cmGeneratedFileStream ofs; cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl - << "The following tests are disabled and did not run:" - << std::endl); + << "The following tests did not run:" << std::endl); this->StartLogFile("TestsDisabled", ofs); + const char* disabled_reason; for (std::vector<cmCTestTestHandler::cmCTestTestResult>::iterator dtit = disabledTests.begin(); dtit != disabledTests.end(); ++dtit) { ofs << dtit->TestCount << ":" << dtit->Name << std::endl; + if (dtit->CompletionStatus == "Disabled") { + disabled_reason = "Disabled"; + } else { + disabled_reason = "Skipped"; + } cmCTestLog(this->CTest, HANDLER_OUTPUT, "\t" << std::setw(3) << dtit->TestCount << " - " << dtit->Name - << std::endl); + << " (" << disabled_reason << ")" << std::endl); } } @@ -544,6 +551,7 @@ int cmCTestTestHandler::ProcessHandler() for (SetOfTests::iterator ftit = resultsSet.begin(); ftit != resultsSet.end(); ++ftit) { if (ftit->Status != cmCTestTestHandler::COMPLETED && + !cmHasLiteralPrefix(ftit->CompletionStatus, "SKIP_RETURN_CODE=") && ftit->CompletionStatus != "Disabled") { ofs << ftit->TestCount << ":" << ftit->Name << std::endl; cmCTestLog( |