Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
6727834a
Commit
6727834a
authored
Sep 08, 2009
by
Zach
Browse files
BUG: Fixed extraneous newlines from ctest process output
parent
39e5f9d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Source/CTest/cmCTestMultiProcessHandler.cxx
View file @
6727834a
...
...
@@ -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
);
...
...
Source/CTest/cmProcess.cxx
View file @
6727834a
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment