diff options
author | Brad King <brad.king@kitware.com> | 2009-07-02 20:13:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-07-02 20:13:55 (GMT) |
commit | 5b51ad580bd716a21bda73898f4421e0fdbb3b83 (patch) | |
tree | ec0308745daf77aef831822ec7f8cbf766bce30a /Source/CTest/cmCTestTestHandler.cxx | |
parent | 2247153110406ce2a6a9baea39394167fa1f75c7 (diff) | |
download | CMake-5b51ad580bd716a21bda73898f4421e0fdbb3b83.zip CMake-5b51ad580bd716a21bda73898f4421e0fdbb3b83.tar.gz CMake-5b51ad580bd716a21bda73898f4421e0fdbb3b83.tar.bz2 |
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.
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 115 |
1 files changed, 48 insertions, 67 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index a7a4c6f..4b94567 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -768,7 +768,6 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it, std::string reason; if ( !this->CTest->GetShowOnly() ) { - bool testFailed = false; std::vector<std::pair<cmsys::RegularExpression, std::string> >::iterator passIt; bool forceFail = false; @@ -816,88 +815,70 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it, } } } - - if (res == cmsysProcess_State_Exited && - (retVal == 0 || it->RequiredRegularExpressions.size()) && - !forceFail) + + if (res == cmsysProcess_State_Exited) { - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Passed"); - if ( it->WillFail ) + bool success = + !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; + cres.Status = cmCTestTestHandler::COMPLETED; + cmCTestLog(this->CTest, HANDLER_OUTPUT, " Passed" << std::endl); } else { - cres.Status = cmCTestTestHandler::COMPLETED; + cres.Status = cmCTestTestHandler::FAILED; + cmCTestLog(this->CTest, HANDLER_OUTPUT, + "***Failed " << reason << std::endl); } - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl); } - else + else if ( res == cmsysProcess_State_Expired ) { - testFailed = true; - - cres.Status = cmCTestTestHandler::FAILED; - if ( res == cmsysProcess_State_Expired ) - { - cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Timeout" << std::endl); - cres.Status = cmCTestTestHandler::TIMEOUT; - } - else if ( res == cmsysProcess_State_Exception ) - { - cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Exception: "); - switch ( retVal ) - { - case cmsysProcess_Exception_Fault: - cmCTestLog(this->CTest, HANDLER_OUTPUT, "SegFault"); - cres.Status = cmCTestTestHandler::SEGFAULT; - break; - case cmsysProcess_Exception_Illegal: - cmCTestLog(this->CTest, HANDLER_OUTPUT, "Illegal"); - cres.Status = cmCTestTestHandler::ILLEGAL; - break; - case cmsysProcess_Exception_Interrupt: - cmCTestLog(this->CTest, HANDLER_OUTPUT, "Interrupt"); - cres.Status = cmCTestTestHandler::INTERRUPT; - break; - case cmsysProcess_Exception_Numerical: - cmCTestLog(this->CTest, HANDLER_OUTPUT, "Numerical"); - cres.Status = cmCTestTestHandler::NUMERICAL; - break; - default: - cmCTestLog(this->CTest, HANDLER_OUTPUT, "Other"); - cres.Status = cmCTestTestHandler::OTHER_FAULT; - } - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl); - } - else if ( res == cmsysProcess_State_Error ) - { - cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Bad command " << res - << std::endl); - cres.Status = cmCTestTestHandler::BAD_COMMAND; - } - else + cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Timeout" << std::endl); + cres.Status = cmCTestTestHandler::TIMEOUT; + } + else if ( res == cmsysProcess_State_Exception ) + { + cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Exception: "); + switch ( retVal ) { - // 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); + case cmsysProcess_Exception_Fault: + cmCTestLog(this->CTest, HANDLER_OUTPUT, "SegFault"); + cres.Status = cmCTestTestHandler::SEGFAULT; + break; + case cmsysProcess_Exception_Illegal: + cmCTestLog(this->CTest, HANDLER_OUTPUT, "Illegal"); + cres.Status = cmCTestTestHandler::ILLEGAL; + break; + case cmsysProcess_Exception_Interrupt: + cmCTestLog(this->CTest, HANDLER_OUTPUT, "Interrupt"); + cres.Status = cmCTestTestHandler::INTERRUPT; + break; + case cmsysProcess_Exception_Numerical: + cmCTestLog(this->CTest, HANDLER_OUTPUT, "Numerical"); + cres.Status = cmCTestTestHandler::NUMERICAL; + break; + default: + cmCTestLog(this->CTest, HANDLER_OUTPUT, "Other"); + cres.Status = cmCTestTestHandler::OTHER_FAULT; } + cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl); } - if ( testFailed ) + else // if ( res == cmsysProcess_State_Error ) { - failed.push_back(testname); + cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Bad command " << res + << std::endl); + cres.Status = cmCTestTestHandler::BAD_COMMAND; } - else + + if(cres.Status == cmCTestTestHandler::COMPLETED) { passed.push_back(testname); } + else + { + failed.push_back(testname); + } if (!output.empty() && output.find("<DartMeasurement") != output.npos) { if (this->DartStuff.find(output.c_str())) |