diff options
author | Brad King <brad.king@kitware.com> | 2024-07-24 14:00:22 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-07-24 14:00:30 (GMT) |
commit | 077691942a778516e6d88051d8f5d691ee037b33 (patch) | |
tree | ee2968fd216b2fd9624771fded936d07e11d1d4f /Tests | |
parent | 70b4966c01ced74455cd38015fe2294fd762d6c0 (diff) | |
parent | c55239e2861151eb16c1fb90258b50c07952fb4f (diff) | |
download | CMake-077691942a778516e6d88051d8f5d691ee037b33.zip CMake-077691942a778516e6d88051d8f5d691ee037b33.tar.gz CMake-077691942a778516e6d88051d8f5d691ee037b33.tar.bz2 |
Merge topic 'cmake-list-cached-variables'
c55239e286 cmake: Add flag to list cache entries matching a regex
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9644
Diffstat (limited to 'Tests')
6 files changed, 38 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 7f9b14b..8e5bffe 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -49,6 +49,16 @@ run_cmake_command(E___run_co_compile-no--- ${CMAKE_COMMAND} -E __run_co_compile run_cmake_command(E___run_co_compile-no-cc ${CMAKE_COMMAND} -E __run_co_compile --iwyu=iwyu-does-not-exist --) run_cmake_command(E___run_co_compile-tidy-remove-fixes ${CMAKE_COMMAND} -E __run_co_compile "--tidy=${CMAKE_COMMAND}\\;-E\\;true\\;--export-fixes=${RunCMake_BINARY_DIR}/tidy-fixes.yaml" -- ${CMAKE_COMMAND} -E true) +block() + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/list-cache-build) + run_cmake(list-cache) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(list-cache-LR ${CMAKE_COMMAND} . -LR MIDDLE) + run_cmake_command(list-cache-LRA ${CMAKE_COMMAND} . -LRA MIDDLE) + run_cmake_command(list-cache-LRH ${CMAKE_COMMAND} . -LRH MIDDLE) + run_cmake_command(list-cache-LRAH ${CMAKE_COMMAND} . -LRAH MIDDLE) +endblock() + run_cmake_command(G_no-arg ${CMAKE_COMMAND} -B DummyBuildDir -G) run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -B DummyBuildDir -G NoSuchGenerator) run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P) diff --git a/Tests/RunCMake/CommandLine/list-cache-LR-stdout.txt b/Tests/RunCMake/CommandLine/list-cache-LR-stdout.txt new file mode 100644 index 0000000..9a4e0db --- /dev/null +++ b/Tests/RunCMake/CommandLine/list-cache-LR-stdout.txt @@ -0,0 +1,3 @@ +-- Cache values +MIDDLE_ENTRY_1:STRING=1 +MIDDLE_ENTRY_2:STRING=2$ diff --git a/Tests/RunCMake/CommandLine/list-cache-LRA-stdout.txt b/Tests/RunCMake/CommandLine/list-cache-LRA-stdout.txt new file mode 100644 index 0000000..a452355 --- /dev/null +++ b/Tests/RunCMake/CommandLine/list-cache-LRA-stdout.txt @@ -0,0 +1,4 @@ +-- Cache values +MIDDLE_ENTRY_1:STRING=1 +MIDDLE_ENTRY_2:STRING=2 +MIDDLE_ENTRY_3:STRING=3$ diff --git a/Tests/RunCMake/CommandLine/list-cache-LRAH-stdout.txt b/Tests/RunCMake/CommandLine/list-cache-LRAH-stdout.txt new file mode 100644 index 0000000..cf502c1 --- /dev/null +++ b/Tests/RunCMake/CommandLine/list-cache-LRAH-stdout.txt @@ -0,0 +1,9 @@ +-- Cache values +// mid 1 +MIDDLE_ENTRY_1:STRING=1 + +// mid 2 +MIDDLE_ENTRY_2:STRING=2 + +// mid 3 +MIDDLE_ENTRY_3:STRING=3$ diff --git a/Tests/RunCMake/CommandLine/list-cache-LRH-stdout.txt b/Tests/RunCMake/CommandLine/list-cache-LRH-stdout.txt new file mode 100644 index 0000000..0f6b3a0d --- /dev/null +++ b/Tests/RunCMake/CommandLine/list-cache-LRH-stdout.txt @@ -0,0 +1,6 @@ +-- Cache values +// mid 1 +MIDDLE_ENTRY_1:STRING=1 + +// mid 2 +MIDDLE_ENTRY_2:STRING=2$ diff --git a/Tests/RunCMake/CommandLine/list-cache.cmake b/Tests/RunCMake/CommandLine/list-cache.cmake new file mode 100644 index 0000000..5617054 --- /dev/null +++ b/Tests/RunCMake/CommandLine/list-cache.cmake @@ -0,0 +1,6 @@ +set(EARLY_ENTRY_1 "1" CACHE STRING "early") +set(MIDDLE_ENTRY_1 "1" CACHE STRING "mid 1") +set(MIDDLE_ENTRY_2 "2" CACHE STRING "mid 2") +set(MIDDLE_ENTRY_3 "3" CACHE STRING "mid 3") +mark_as_advanced(MIDDLE_ENTRY_3) +set(LATER_ENTRY_1 "1" CACHE STRING "later") |