ENH: Reports "Passed" for WILL_FAIL tests
Previously tests marked with WILL_FAIL have been reported by CTest as ...............***Failed - supposed to fail when they correctly failed. Now we just report ".....Passed" because there is no reason to draw attention to something that works as expected.
This commit is contained in:
parent
2247153110
commit
5b51ad580b
|
@ -768,7 +768,6 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
|
||||||
std::string reason;
|
std::string reason;
|
||||||
if ( !this->CTest->GetShowOnly() )
|
if ( !this->CTest->GetShowOnly() )
|
||||||
{
|
{
|
||||||
bool testFailed = false;
|
|
||||||
std::vector<std::pair<cmsys::RegularExpression,
|
std::vector<std::pair<cmsys::RegularExpression,
|
||||||
std::string> >::iterator passIt;
|
std::string> >::iterator passIt;
|
||||||
bool forceFail = false;
|
bool forceFail = false;
|
||||||
|
@ -817,29 +816,23 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res == cmsysProcess_State_Exited &&
|
if (res == cmsysProcess_State_Exited)
|
||||||
(retVal == 0 || it->RequiredRegularExpressions.size()) &&
|
|
||||||
!forceFail)
|
|
||||||
{
|
{
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Passed");
|
bool success =
|
||||||
if ( it->WillFail )
|
!forceFail && (retVal == 0 || it->RequiredRegularExpressions.size());
|
||||||
{
|
if((success && !it->WillFail) || (!success && it->WillFail))
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, " - But it should fail!");
|
|
||||||
cres.Status = cmCTestTestHandler::FAILED;
|
|
||||||
testFailed = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
cres.Status = cmCTestTestHandler::COMPLETED;
|
cres.Status = cmCTestTestHandler::COMPLETED;
|
||||||
}
|
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Passed" << std::endl);
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
testFailed = true;
|
|
||||||
|
|
||||||
cres.Status = cmCTestTestHandler::FAILED;
|
cres.Status = cmCTestTestHandler::FAILED;
|
||||||
if ( res == cmsysProcess_State_Expired )
|
cmCTestLog(this->CTest, HANDLER_OUTPUT,
|
||||||
|
"***Failed " << reason << std::endl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( res == cmsysProcess_State_Expired )
|
||||||
{
|
{
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Timeout" << std::endl);
|
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Timeout" << std::endl);
|
||||||
cres.Status = cmCTestTestHandler::TIMEOUT;
|
cres.Status = cmCTestTestHandler::TIMEOUT;
|
||||||
|
@ -871,33 +864,21 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
|
||||||
}
|
}
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl);
|
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl);
|
||||||
}
|
}
|
||||||
else if ( res == cmsysProcess_State_Error )
|
else // if ( res == cmsysProcess_State_Error )
|
||||||
{
|
{
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Bad command " << res
|
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Bad command " << res
|
||||||
<< std::endl);
|
<< std::endl);
|
||||||
cres.Status = cmCTestTestHandler::BAD_COMMAND;
|
cres.Status = cmCTestTestHandler::BAD_COMMAND;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if(cres.Status == cmCTestTestHandler::COMPLETED)
|
||||||
// Force fail will also be here?
|
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Failed " << reason);
|
|
||||||
if ( it->WillFail )
|
|
||||||
{
|
|
||||||
cres.Status = cmCTestTestHandler::COMPLETED;
|
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, " - supposed to fail");
|
|
||||||
testFailed = false;
|
|
||||||
}
|
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( testFailed )
|
|
||||||
{
|
|
||||||
failed.push_back(testname);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
passed.push_back(testname);
|
passed.push_back(testname);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
failed.push_back(testname);
|
||||||
|
}
|
||||||
if (!output.empty() && output.find("<DartMeasurement") != output.npos)
|
if (!output.empty() && output.find("<DartMeasurement") != output.npos)
|
||||||
{
|
{
|
||||||
if (this->DartStuff.find(output.c_str()))
|
if (this->DartStuff.find(output.c_str()))
|
||||||
|
|
Loading…
Reference in New Issue