diff options
author | Zach Mullen <zach.mullen@kitware.com> | 2009-09-08 18:48:23 (GMT) |
---|---|---|
committer | Zach Mullen <zach.mullen@kitware.com> | 2009-09-08 18:48:23 (GMT) |
commit | 6727834a8cfe8621e456ead9221ea09c69e53d8c (patch) | |
tree | ee080649fed8c3cdd1437f5afd5109995261b187 /Source/CTest | |
parent | 39e5f9d963c6580f95316f9b5f76a3a8f660d6cc (diff) | |
download | CMake-6727834a8cfe8621e456ead9221ea09c69e53d8c.zip CMake-6727834a8cfe8621e456ead9221ea09c69e53d8c.tar.gz CMake-6727834a8cfe8621e456ead9221ea09c69e53d8c.tar.bz2 |
BUG: Fixed extraneous newlines from ctest process output
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmProcess.cxx | 45 |
2 files changed, 26 insertions, 21 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 41b764d..8002c05 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -90,7 +90,7 @@ void cmCTestMultiProcessHandler::SubmitBatchTests() //--------------------------------------------------------- void cmCTestMultiProcessHandler::StartTestProcess(int test) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " test " << test << "\n"); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "test " << test << "\n"); this->TestRunningMap[test] = true; // mark the test as running // now remove the test itself this->EraseTest(test); diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 458c77a..de0fc9a 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -93,26 +93,6 @@ int cmProcess::GetNextOutputLine(std::string& stdOutLine, std::vector<char>::iterator erriter = this->StdErrorBuffer.begin(); - //If process terminated, flush the buffer - if(!running) - { - if(!this->StdErrorBuffer.empty()) - { - gotStdErr = true; - stdErrLine.append(&this->StdErrorBuffer[0], this->StdErrorBuffer.size()); - this->StdErrorBuffer.erase(this->StdErrorBuffer.begin(), - this->StdErrorBuffer.end()); - } - if(!this->StdOutBuffer.empty()) - { - gotStdOut = true; - stdOutLine.append(&this->StdOutBuffer[0], this->StdOutBuffer.size()); - this->StdOutBuffer.erase(this->StdOutBuffer.begin(), - this->StdOutBuffer.end()); - } - return cmsysProcess_Pipe_None; - } - // Check for a newline in stdout. for(;outiter != this->StdOutBuffer.end(); ++outiter) { @@ -162,6 +142,31 @@ int cmProcess::GetNextOutputLine(std::string& stdOutLine, break; } } + + if(!running && !gotStdErr && !gotStdOut) + { + //If process terminated with no newline, flush the buffer + if(!running) + { + if(!this->StdErrorBuffer.empty()) + { + gotStdErr = true; + stdErrLine.append(&this->StdErrorBuffer[0], + this->StdErrorBuffer.size()); + this->StdErrorBuffer.erase(this->StdErrorBuffer.begin(), + this->StdErrorBuffer.end()); + } + if(!this->StdOutBuffer.empty()) + { + gotStdOut = true; + stdOutLine.append(&this->StdOutBuffer[0], + this->StdOutBuffer.size()); + this->StdOutBuffer.erase(this->StdOutBuffer.begin(), + this->StdOutBuffer.end()); + } + return cmsysProcess_Pipe_None; + } + } //If we get here, we have stuff waiting in the buffers, but no newline return this->LastOutputPipe; } |