diff options
author | Brad King <brad.king@kitware.com> | 2015-06-03 12:47:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-06-03 12:47:49 (GMT) |
commit | 721b7e3e56f8a9e7f6daf1602dcc5cd85677fc84 (patch) | |
tree | 7fd3da24e72f4951b586e6515e9ae0e92155a9ca /Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake | |
parent | d3bb5da9294ddbfcc5fddf7ba3dafd2c3e0b32b2 (diff) | |
download | CMake-721b7e3e56f8a9e7f6daf1602dcc5cd85677fc84.zip CMake-721b7e3e56f8a9e7f6daf1602dcc5cd85677fc84.tar.gz CMake-721b7e3e56f8a9e7f6daf1602dcc5cd85677fc84.tar.bz2 |
CTest: Capture test stdout/stderr through one pipe (#15600)
Use the KWSys Process "MergeOutput" option to give each test child
process the same pipe for both stdout and stderr. This allows natural
merging of stdout and stderr together instead of merging on arbitrary
buffered read boundaries as before.
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 0cb11ac..a3ce139 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -39,3 +39,16 @@ subdirs() run_cmake_command(BadCTestTestfile ${CMAKE_CTEST_COMMAND}) endfunction() run_BadCTestTestfile() + +function(run_MergeOutput) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/MergeOutput) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" " +add_test(MergeOutput \"${CMAKE_COMMAND}\" -P \"${RunCMake_SOURCE_DIR}/MergeOutput.cmake\") +") + + run_cmake_command(MergeOutput ${CMAKE_CTEST_COMMAND} -V) +endfunction() +run_MergeOutput() |