diff options
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index af21ec1..ffc257a 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -1,19 +1,14 @@ -/*========================================================================= +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: CMake - Cross-Platform Makefile Generator - Module: $RCSfile$ - Language: C++ - Date: $Date$ - Version: $Revision$ + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ #include "cmCTestRunTest.h" #include "cmCTestMemCheckHandler.h" @@ -86,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; @@ -145,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 ) { @@ -188,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; @@ -430,6 +435,8 @@ bool cmCTestRunTest::CreateProcess(double testTimeOut, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index << ": " << "Test timeout computed to be: " << timeout << "\n"); + this->TestProcess->SetTimeout(timeout); + if (this->ModifyEnv) { this->OrigEnv = cmSystemTools::AppendEnv(environment); |