MantisBT - CMake
View Issue Details
0015600CMakeCTestpublic2015-06-02 08:442016-01-04 11:51
Christophe Dumeunier 
Brad King 
normalminorhave not tried
closedfixed 
LinuxopenSUSE12.3
CMake 3.1 
CMake 3.4CMake 3.4 
0015600: CTest output redirection doesn't respect the order
The output redirection from the terminal (stdout and stderr) to the LastTest.log file doesn't respect the order of the output between stdout and stderr. When a long message is printed (and flushed) on stdout and followed by a message on stderr, the error message is printed inside the message from stdout, even if stdout is flushed. If I run the executable in the terminal or with "> output.log 2>&1", the error message is printed at the end, as expected.

You can see in attachement the result of executing the given C++ test with CTest.
Launch the tests on the project given in attachement and observe the problem in the generated file ./Testing/Temporary/LastTest.log
No tags attached.
zip bug_ctest_stdouterr.zip (139,493) 2015-06-02 08:44
https://public.kitware.com/Bug/file/5468/bug_ctest_stdouterr.zip
Issue History
2015-06-02 08:44Christophe DumeunierNew Issue
2015-06-02 08:44Christophe DumeunierFile Added: bug_ctest_stdouterr.zip
2015-06-04 08:46Brad KingNote Added: 0038882
2015-06-04 08:46Brad KingAssigned To => Brad King
2015-06-04 08:46Brad KingStatusnew => resolved
2015-06-04 08:46Brad KingResolutionopen => fixed
2015-06-04 08:46Brad KingFixed in Version => CMake 3.4
2015-06-04 08:46Brad KingTarget Version => CMake 3.4
2016-01-04 11:51Robert MaynardNote Added: 0040059
2016-01-04 11:51Robert MaynardStatusresolved => closed

Notes
(0038882)
Brad King   
2015-06-04 08:46   
Fixed and test case added:

 CTest: Capture test stdout/stderr through one pipe
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=721b7e3e [^]
(0040059)
Robert Maynard   
2016-01-04 11:51   
Closing resolved issues that have not been updated in more than 4 months.