From cf0f46ed8557c1ac0abb58d6fc88e6ce22aa7836 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 23 Jun 2025 10:20:23 -0400 Subject: [PATCH] Tests/RunCMake/CommandLine: Simplify --toolchain cases --- Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 1 - Tests/RunCMake/CommandLine/Toolchain/CMakeLists.txt | 2 +- Tests/RunCMake/CommandLine/Toolchain/toolchain.cmake | 1 - Tests/RunCMake/CommandLine/toolchain-valid-abs-path-result.txt | 1 - Tests/RunCMake/CommandLine/toolchain-valid-abs-path-stderr.txt | 1 - Tests/RunCMake/CommandLine/toolchain-valid-abs-path-stdout.txt | 1 + .../CommandLine/toolchain-valid-rel-build-path-result.txt | 1 - .../CommandLine/toolchain-valid-rel-build-path-stderr.txt | 2 -- .../CommandLine/toolchain-valid-rel-build-path-stdout.txt | 1 + .../CommandLine/toolchain-valid-rel-src-path-result.txt | 1 - .../CommandLine/toolchain-valid-rel-src-path-stderr.txt | 1 - .../CommandLine/toolchain-valid-rel-src-path-stdout.txt | 1 + 12 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 Tests/RunCMake/CommandLine/toolchain-valid-abs-path-result.txt delete mode 100644 Tests/RunCMake/CommandLine/toolchain-valid-abs-path-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/toolchain-valid-abs-path-stdout.txt delete mode 100644 Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-result.txt delete mode 100644 Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stdout.txt delete mode 100644 Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-result.txt delete mode 100644 Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-stdout.txt diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 4f993585aa..efdf075a06 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -274,7 +274,6 @@ function(run_Toolchain) # precedence over source dir file(WRITE ${binary_dir}/toolchain.cmake [=[ set(CMAKE_SYSTEM_NAME Linux) -set(toolchain_file binary_dir) ]=]) run_cmake_with_options(toolchain-valid-rel-build-path -S ${source_dir} -B ${binary_dir} --toolchain toolchain.cmake) endfunction() diff --git a/Tests/RunCMake/CommandLine/Toolchain/CMakeLists.txt b/Tests/RunCMake/CommandLine/Toolchain/CMakeLists.txt index 80d42b828b..d49b6849a3 100644 --- a/Tests/RunCMake/CommandLine/Toolchain/CMakeLists.txt +++ b/Tests/RunCMake/CommandLine/Toolchain/CMakeLists.txt @@ -1,3 +1,3 @@ cmake_minimum_required(VERSION 3.20) project(Toolchain LANGUAGES NONE) -message(FATAL_ERROR "${toolchain_file}") +message(STATUS "CMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'") diff --git a/Tests/RunCMake/CommandLine/Toolchain/toolchain.cmake b/Tests/RunCMake/CommandLine/Toolchain/toolchain.cmake index 719556c0af..99c23014a7 100644 --- a/Tests/RunCMake/CommandLine/Toolchain/toolchain.cmake +++ b/Tests/RunCMake/CommandLine/Toolchain/toolchain.cmake @@ -1,2 +1 @@ set(CMAKE_SYSTEM_NAME Linux) -set(toolchain_file source_dir) diff --git a/Tests/RunCMake/CommandLine/toolchain-valid-abs-path-result.txt b/Tests/RunCMake/CommandLine/toolchain-valid-abs-path-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/CommandLine/toolchain-valid-abs-path-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CommandLine/toolchain-valid-abs-path-stderr.txt b/Tests/RunCMake/CommandLine/toolchain-valid-abs-path-stderr.txt deleted file mode 100644 index 21d5db6464..0000000000 --- a/Tests/RunCMake/CommandLine/toolchain-valid-abs-path-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CMake Error.*source_dir diff --git a/Tests/RunCMake/CommandLine/toolchain-valid-abs-path-stdout.txt b/Tests/RunCMake/CommandLine/toolchain-valid-abs-path-stdout.txt new file mode 100644 index 0000000000..753f00b5ad --- /dev/null +++ b/Tests/RunCMake/CommandLine/toolchain-valid-abs-path-stdout.txt @@ -0,0 +1 @@ +CMAKE_TOOLCHAIN_FILE='[^']*/Tests/RunCMake/CommandLine/Toolchain/toolchain\.cmake' diff --git a/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-result.txt b/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stderr.txt b/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stderr.txt deleted file mode 100644 index 047554673f..0000000000 --- a/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^CMake Error at CMakeLists.txt:[0-9] \(message\): - binary_dir$ diff --git a/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stdout.txt b/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stdout.txt new file mode 100644 index 0000000000..659cf5fdea --- /dev/null +++ b/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stdout.txt @@ -0,0 +1 @@ +CMAKE_TOOLCHAIN_FILE='[^']*/Tests/RunCMake/CommandLine/Toolchain-build/toolchain\.cmake' diff --git a/Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-result.txt b/Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-stderr.txt b/Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-stderr.txt deleted file mode 100644 index 21d5db6464..0000000000 --- a/Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CMake Error.*source_dir diff --git a/Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-stdout.txt b/Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-stdout.txt new file mode 100644 index 0000000000..753f00b5ad --- /dev/null +++ b/Tests/RunCMake/CommandLine/toolchain-valid-rel-src-path-stdout.txt @@ -0,0 +1 @@ +CMAKE_TOOLCHAIN_FILE='[^']*/Tests/RunCMake/CommandLine/Toolchain/toolchain\.cmake'