summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestRunTest.cxx
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2009-09-04 17:50:06 (GMT)
committerZach Mullen <zach.mullen@kitware.com>2009-09-04 17:50:06 (GMT)
commit5517e17bf936ad243536e793dc792f4dfccf2497 (patch)
tree8b1a924324656d3bfa0151d64b71c1c3ac6c3d9f /Source/CTest/cmCTestRunTest.cxx
parent7d190a65ca3fb717e4889de7604ac8ef3484c593 (diff)
downloadCMake-5517e17bf936ad243536e793dc792f4dfccf2497.zip
CMake-5517e17bf936ad243536e793dc792f4dfccf2497.tar.gz
CMake-5517e17bf936ad243536e793dc792f4dfccf2497.tar.bz2
Fixed ctest output processing. Should now display output as it occurs, as well as be able to consume multiple lines if they exist within the timeout.
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r--Source/CTest/cmCTestRunTest.cxx40
1 files changed, 25 insertions, 15 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 85e8601..d471c6c 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -38,26 +38,36 @@ bool cmCTestRunTest::IsRunning()
void cmCTestRunTest::CheckOutput()
{
std::string out, err;
- int pipe = this->TestProcess->CheckOutput(.1);
+ this->TestProcess->CheckOutput(.1);
//start our timeout for reading the process output
double clock_start = cmSystemTools::GetTime();
- while(this->TestProcess->GetNextOutputLine(out, err))
+ int pipe;
+ bool gotStdOut = false;
+ bool gotStdErr = false;
+ while((pipe = this->TestProcess->
+ GetNextOutputLine(out, err, gotStdOut, gotStdErr) )
+ != cmsysProcess_Pipe_Timeout)
{
-
- if(pipe == cmsysProcess_Pipe_STDOUT)
- {
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- this->GetIndex() << ": " << out << std::endl);
- this->ProcessOutput += out;
- this->ProcessOutput += "\n";
- }
- else if(pipe == cmsysProcess_Pipe_STDERR)
+ if(pipe == cmsysProcess_Pipe_STDOUT ||
+ pipe == cmsysProcess_Pipe_STDERR)
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- this->GetIndex() << ": " << err << std::endl);
- this->ProcessOutput += err;
- this->ProcessOutput += "\n";
+ if(gotStdErr)
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ this->GetIndex() << ": " << err << std::endl);
+ this->ProcessOutput += err;
+ this->ProcessOutput += "\n";
+ }
+ if(gotStdOut)
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ this->GetIndex() << ": " << out << std::endl);
+ this->ProcessOutput += out;
+ this->ProcessOutput += "\n";
+ }
}
+ gotStdOut = false;
+ gotStdErr = false;
//timeout while reading process output (could denote infinite output)
if(cmSystemTools::GetTime() - clock_start > .1)
{