diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 9 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.h | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 0e2fa41..cdf90b9 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -206,7 +206,13 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) bool success = !forceFail && (retVal == 0 || this->TestProperties->RequiredRegularExpressions.size()); - if((success && !this->TestProperties->WillFail) + if(this->TestProperties->SkipReturnCode >= 0 + && this->TestProperties->SkipReturnCode == retVal) + { + this->TestResult.Status = cmCTestTestHandler::NOT_RUN; + cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Skipped "); + } + else if((success && !this->TestProperties->WillFail) || (!success && this->TestProperties->WillFail)) { this->TestResult.Status = cmCTestTestHandler::COMPLETED; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 26f8014..3a04b33 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2229,6 +2229,14 @@ bool cmCTestTestHandler::SetTestsProperties( rtit->Processors = 1; } } + if ( key == "SKIP_RETURN_CODE" ) + { + rtit->SkipReturnCode = atoi(val.c_str()); + if(rtit->SkipReturnCode < 0 || rtit->SkipReturnCode > 255) + { + rtit->SkipReturnCode = -1; + } + } if ( key == "DEPENDS" ) { std::vector<std::string> lval; @@ -2364,6 +2372,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) test.ExplicitTimeout = false; test.Cost = 0; test.Processors = 1; + test.SkipReturnCode = -1; test.PreviousRuns = 0; if (this->UseIncludeRegExpFlag && !this->IncludeTestsRegularExpression.find(testname.c_str())) diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 6dda300..63f9c93 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -109,6 +109,8 @@ public: int Index; //Requested number of process slots int Processors; + // return code of test which will mark test as "not run" + int SkipReturnCode; std::vector<std::string> Environment; std::vector<std::string> Labels; std::set<std::string> LockedResources; |