From 101ac06b2874b451e167f19d55fc0a8b684d7b44 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 8 Dec 2023 08:38:28 -0500 Subject: Tests: Update for changes to upstream ninja development version Account for: * commit `8f47d5aa33` (Remove `-w dupbuild` completely, always error on duplicate edges, 2023-11-29) * commit `4d98903d4c` (Improve misleading error message when an output is defined multiple times, 2023-12-06) --- Tests/RunCMake/Ninja/RunCMakeTest.cmake | 9 ++++++--- Tests/RunCMake/try_compile/ISPCDuplicateTargetNinja-stderr.txt | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index 69f2587..42ab1d8 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -347,6 +347,9 @@ if("${ninja_version}" VERSION_LESS 1.6) message(WARNING "Ninja is too old; skipping rest of test.") return() endif() +if("${ninja_version}" VERSION_LESS 1.12) + set(maybe_w_dupbuild_err -w dupbuild=err) +endif() set(ninja_output_path_prefixes "sub") if(NOT CMAKE_C_COMPILER_ID STREQUAL "OrangeC") @@ -364,14 +367,14 @@ endforeach(ninja_output_path_prefix) function (run_PreventTargetAliasesDupBuildRule) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/PreventTargetAliasesDupBuildRule-build) run_cmake(PreventTargetAliasesDupBuildRule) - run_ninja("${RunCMake_TEST_BINARY_DIR}" -w dupbuild=err) + run_ninja("${RunCMake_TEST_BINARY_DIR}" ${maybe_w_dupbuild_err}) endfunction () run_PreventTargetAliasesDupBuildRule() function (run_PreventConfigureFileDupBuildRule) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/PreventConfigureFileDupBuildRule-build) run_cmake(PreventConfigureFileDupBuildRule) - run_ninja("${RunCMake_TEST_BINARY_DIR}" -w dupbuild=err) + run_ninja("${RunCMake_TEST_BINARY_DIR}" ${maybe_w_dupbuild_err}) endfunction() run_PreventConfigureFileDupBuildRule() @@ -380,7 +383,7 @@ function (run_ChangeBuildType) set(RunCMake_TEST_OPTIONS "-DCMAKE_BUILD_TYPE:STRING=Debug") run_cmake(ChangeBuildType) unset(RunCMake_TEST_OPTIONS) - run_ninja("${RunCMake_TEST_BINARY_DIR}" -w dupbuild=err) + run_ninja("${RunCMake_TEST_BINARY_DIR}" ${maybe_w_dupbuild_err}) endfunction() run_ChangeBuildType() diff --git a/Tests/RunCMake/try_compile/ISPCDuplicateTargetNinja-stderr.txt b/Tests/RunCMake/try_compile/ISPCDuplicateTargetNinja-stderr.txt index 99248bf..155aff9 100644 --- a/Tests/RunCMake/try_compile/ISPCDuplicateTargetNinja-stderr.txt +++ b/Tests/RunCMake/try_compile/ISPCDuplicateTargetNinja-stderr.txt @@ -1 +1,5 @@ -.*ninja: error: .* multiple rules generate.*src.ispc_avx512skx.o.* +ninja: error:([^ +]+multiple rules generate[^ +]+src\.ispc_avx512skx\.o|[^ +]+src\.ispc_avx512skx\.o[^ +]+is defined as an output multiple times) -- cgit v0.12