diff options
author | Zach Mullen <zach.mullen@kitware.com> | 2009-09-29 13:45:43 (GMT) |
---|---|---|
committer | Zach Mullen <zach.mullen@kitware.com> | 2009-09-29 13:45:43 (GMT) |
commit | 202bb45695a27574592b6d270987b15fbac03c3e (patch) | |
tree | 54b98676c6a1ea113587afc25681fa9db8f7f226 /Source/CTest/cmCTestRunTest.cxx | |
parent | aa8c003609dd57d47d7a45624185bc71134fe294 (diff) | |
download | CMake-202bb45695a27574592b6d270987b15fbac03c3e.zip CMake-202bb45695a27574592b6d270987b15fbac03c3e.tar.gz CMake-202bb45695a27574592b6d270987b15fbac03c3e.tar.bz2 |
BUG: 0009612: --output-on-failure option doesn't work with the new parallel CTest handler
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 88e846d..32c3ef8 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -81,6 +81,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 outputTestErrorsToConsole = false; if ( this->TestProperties->RequiredRegularExpressions.size() > 0 ) { bool found = false; @@ -140,15 +141,18 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) { this->TestResult.Status = cmCTestTestHandler::FAILED; cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Failed " << reason ); + outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure; } } else if ( res == cmsysProcess_State_Expired ) { cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Timeout"); this->TestResult.Status = cmCTestTestHandler::TIMEOUT; + outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure; } else if ( res == cmsysProcess_State_Exception ) { + outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure; cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Exception: "); switch ( retVal ) { @@ -183,6 +187,12 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) char buf[1024]; sprintf(buf, "%6.2f sec", this->TestProcess->GetTotalTime()); cmCTestLog(this->CTest, HANDLER_OUTPUT, buf << "\n" ); + + if ( outputTestErrorsToConsole ) + { + cmCTestLog(this->CTest, HANDLER_OUTPUT, this->ProcessOutput << std::endl ); + } + if ( this->TestHandler->LogFile ) { *this->TestHandler->LogFile << "Test time = " << buf << std::endl; |