diff options
author | Brad King <brad.king@kitware.com> | 2021-02-24 14:40:55 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-02-24 14:41:03 (GMT) |
commit | cf21ea2ce6b174a69316a39e83616c056fc530e2 (patch) | |
tree | 242be131760e3fe40adf602eeecd3a20d5efb430 /Tests/RunCMake | |
parent | 6714074cd4754e8d9734174cf47ceb10180f934e (diff) | |
parent | d33c2c93d8d006f1270c800d5f6a0b3c493e4404 (diff) | |
download | CMake-cf21ea2ce6b174a69316a39e83616c056fc530e2.zip CMake-cf21ea2ce6b174a69316a39e83616c056fc530e2.tar.gz CMake-cf21ea2ce6b174a69316a39e83616c056fc530e2.tar.bz2 |
Merge topic 'ninja-status-stderr' into release-3.20
d33c2c93d8 Tests: Update for upstream ninja change to write status on stderr
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5850
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/Ninja/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/try_compile/RunCMakeTest.cmake | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index b91ab00..1b252cd 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -34,6 +34,7 @@ function(run_NoWorkToDo) run_cmake(NoWorkToDo) set(RunCMake_TEST_NO_CLEAN 1) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/NoWorkToDo-build) + set(RunCMake_TEST_OUTPUT_MERGE 1) run_cmake_command(NoWorkToDo-build ${CMAKE_COMMAND} --build .) run_cmake_command(NoWorkToDo-nowork ${CMAKE_COMMAND} --build . -- -d explain) endfunction() @@ -43,6 +44,7 @@ function(run_VerboseBuild) run_cmake(VerboseBuild) set(RunCMake_TEST_NO_CLEAN 1) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/VerboseBuild-build) + set(RunCMake_TEST_OUTPUT_MERGE 1) run_cmake_command(VerboseBuild-build ${CMAKE_COMMAND} --build . -v --clean-first) run_cmake_command(VerboseBuild-nowork ${CMAKE_COMMAND} --build . --verbose) endfunction() diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index e8fbd6a..a26f632 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -139,6 +139,12 @@ function(run_cmake test) if(NOT "${actual_result}" MATCHES "${expect_result}") string(APPEND msg "Result is [${actual_result}], not [${expect_result}].\n") endif() + + # Special case: remove ninja no-op line from stderr, but not stdout. + # Test cases that look for it should use RunCMake_TEST_OUTPUT_MERGE. + string(REGEX REPLACE "(^|\r?\n)ninja: no work to do\\.\r?\n" "\\1" actual_stderr "${actual_stderr}") + + # Remove incidental content from both stdout and stderr. string(CONCAT ignore_line_regex "(^|\n)((==[0-9]+==" "|BullseyeCoverage" diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index 5b849bf..fffb038 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -93,7 +93,9 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja") message(STATUS "RerunCMake: first configuration...") run_cmake(RerunCMake) if(NOT CMake_TEST_FILESYSTEM_1S) + set(RunCMake_TEST_OUTPUT_MERGE 1) run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .) + unset(RunCMake_TEST_OUTPUT_MERGE) endif() execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution @@ -101,7 +103,9 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja") file(WRITE "${in_tc}" "does-not-compile\n") run_cmake_command(RerunCMake-rerun${ninja} ${CMAKE_COMMAND} --build .) if(NOT CMake_TEST_FILESYSTEM_1S) + set(RunCMake_TEST_OUTPUT_MERGE 1) run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .) + unset(RunCMake_TEST_OUTPUT_MERGE) endif() unset(RunCMake_TEST_BINARY_DIR) |