summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestRunTest.cxx
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2009-09-08 14:16:16 (GMT)
committerZach Mullen <zach.mullen@kitware.com>2009-09-08 14:16:16 (GMT)
commita02ef564018be7e383992d52399279ea7cf48c91 (patch)
tree72261a3b4befbf6a644c3c3216f83420a9c634ba /Source/CTest/cmCTestRunTest.cxx
parent384f4d1f3f14e57a56a43b4f99233c9210041846 (diff)
downloadCMake-a02ef564018be7e383992d52399279ea7cf48c91.zip
CMake-a02ef564018be7e383992d52399279ea7cf48c91.tar.gz
CMake-a02ef564018be7e383992d52399279ea7cf48c91.tar.bz2
BUG: Fixed issue where ctest would hang if a process terminated with output in its buffers but no newline
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r--Source/CTest/cmCTestRunTest.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 0e8d404..2f20adf 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -38,18 +38,19 @@ bool cmCTestRunTest::IsRunning()
void cmCTestRunTest::CheckOutput()
{
std::string out, err;
- this->TestProcess->CheckOutput(.1);
+ bool running = this->TestProcess->CheckOutput(.1);
//start our timeout for reading the process output
double clock_start = cmSystemTools::GetTime();
int pipe;
bool gotStdOut = false;
bool gotStdErr = false;
while((pipe = this->TestProcess->
- GetNextOutputLine(out, err, gotStdOut, gotStdErr) )
+ GetNextOutputLine(out, err, gotStdOut, gotStdErr, running) )
!= cmsysProcess_Pipe_Timeout)
{
if(pipe == cmsysProcess_Pipe_STDOUT ||
- pipe == cmsysProcess_Pipe_STDERR)
+ pipe == cmsysProcess_Pipe_STDERR ||
+ pipe == cmsysProcess_Pipe_None)
{
if(gotStdErr)
{
@@ -65,6 +66,10 @@ void cmCTestRunTest::CheckOutput()
this->ProcessOutput += out;
this->ProcessOutput += "\n";
}
+ if(pipe == cmsysProcess_Pipe_None)
+ {
+ break;
+ }
}
gotStdOut = false;
gotStdErr = false;