diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2022-09-23 14:07:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-09-26 13:40:58 (GMT) |
commit | 65260d6c1e09fbe2dd15e1b01a04c729c9d5bd6f (patch) | |
tree | b55a5a35d2e4caef83e85ca1d98f52d289d4a514 /Tests/RunCMake/ctest_build/RunCMakeTest.cmake | |
parent | e7fd69fa3660be2283ce53b2a9d050f6ba59efde (diff) | |
download | CMake-65260d6c1e09fbe2dd15e1b01a04c729c9d5bd6f.zip CMake-65260d6c1e09fbe2dd15e1b01a04c729c9d5bd6f.tar.gz CMake-65260d6c1e09fbe2dd15e1b01a04c729c9d5bd6f.tar.bz2 |
ctest: only report make-level errors when no others are found
In commit ab9ad2a6a0 (ctest: report make-level errors to CDash when
using launchers, 2020-09-24, v3.19.0-rc1~84^2~1) we taught CTest to
capture and report errors from the build command when using launchers.
This had the unintended side effect of reporting a separate build error containing
the full build output when the build command returns non-zero. To fix this problem,
we now only report build command errors from CTest launchers when no other
more specific build errors are found.
Fixes: #23991
Diffstat (limited to 'Tests/RunCMake/ctest_build/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/ctest_build/RunCMakeTest.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake index e94a55d..6f1b4b6 100644 --- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCTest) +set(LANG NONE) set(CASE_CTEST_BUILD_ARGS "") set(RunCMake_USE_LAUNCHERS TRUE) set(RunCMake_USE_CUSTOM_BUILD_COMMAND FALSE) @@ -70,3 +71,18 @@ set(RunCMake_USE_LAUNCHERS FALSE) set(RunCMake_BUILD_COMMAND "${COLOR_WARNING}") run_ctest(IgnoreColor) unset(RunCMake_BUILD_COMMAND) + +set(RunCMake_USE_CUSTOM_BUILD_COMMAND FALSE) +if(RunCMake_GENERATOR MATCHES "Ninja") + function(run_NinjaLauncherSingleBuildFailure) + set(LANG C) + set(RunCMake_USE_LAUNCHERS TRUE) + set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/NinjaLauncherSingleBuildFailure") + configure_file("${RunCMake_SOURCE_DIR}/error.c" "${RunCMake_TEST_SOURCE_DIR}/error.c" COPYONLY) + set(CASE_CMAKELISTS_SUFFIX_CODE [=[ + add_executable(error error.c) + ]=]) + run_ctest(NinjaLauncherSingleBuildFailure) + endfunction() + run_NinjaLauncherSingleBuildFailure() +endif() |