summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-25 13:09:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-25 13:09:56 (GMT)
commit96420a4afdd1467e05384dd8ba83e73154388fb7 (patch)
tree6f3623d7aae57421acb1f7495abd829f77f901cf /Tests/RunCMake/CommandLine/RunCMakeTest.cmake
parentb11d789ef7341ca717949a4e47f14e75fe41a4c2 (diff)
parent9f1471739d83c9e61b6700a0c369b7f7bbb19071 (diff)
downloadCMake-96420a4afdd1467e05384dd8ba83e73154388fb7.zip
CMake-96420a4afdd1467e05384dd8ba83e73154388fb7.tar.gz
CMake-96420a4afdd1467e05384dd8ba83e73154388fb7.tar.bz2
Merge topic 'cmake-fresh'
9f1471739d cmake: Add --fresh option to clear the cache and start from scratch Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !7099
Diffstat (limited to 'Tests/RunCMake/CommandLine/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake19
1 files changed, 18 insertions, 1 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 22a59f2..c8234ec 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -52,7 +52,8 @@ 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)
run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
-run_cmake_command(P_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -DFOO -S -B)
+run_cmake_command(P_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -DFOO -S -B --fresh)
+run_cmake_command(P_fresh ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_fresh.cmake" --fresh)
run_cmake_command(build-no-dir
${CMAKE_COMMAND} --build)
@@ -212,6 +213,22 @@ message(STATUS "CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}'")
endfunction()
run_ExplicitDirs()
+function(run_Fresh)
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/Fresh-build")
+
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-empty")
+ run_cmake_with_options(Fresh --fresh -DFIRST=ON)
+ set(RunCMake_TEST_NO_CLEAN 1)
+
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-reconfig")
+ run_cmake_with_options(Fresh --fresh)
+
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-src-from-cache")
+ set(RunCMake_TEST_NO_SOURCE_DIR 1)
+ run_cmake_with_options(Fresh --fresh "${RunCMake_TEST_BINARY_DIR}")
+endfunction()
+run_Fresh()
+
function(run_Toolchain)
set(RunCMake_TEST_NO_SOURCE_DIR 1)
set(source_dir ${RunCMake_SOURCE_DIR}/Toolchain)