mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-19 21:50:39 -06:00
Merge topic 'skip-return-code'
3a0d164b allow to mark a test as "Not Run" with a specific return code (#8466)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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()))
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user