summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-09 15:26:51 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-09 15:52:59 (GMT)
commit497f7d5c1af04f6c7120bcec40af9a1fee938883 (patch)
tree51c7c407507277bcc1c56dfa126e808d24cde06c
parentb6ffbffaf26006a361c1330d0edce9a6314f58bb (diff)
downloadCMake-497f7d5c1af04f6c7120bcec40af9a1fee938883.zip
CMake-497f7d5c1af04f6c7120bcec40af9a1fee938883.tar.gz
CMake-497f7d5c1af04f6c7120bcec40af9a1fee938883.tar.bz2
Tests: Simplify option passing to RunCMake.MaxRecursionDepth cases
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake22
1 files changed, 6 insertions, 16 deletions
diff --git a/Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake b/Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake
index c5a859d..f379eba 100644
--- a/Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake
+++ b/Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake
@@ -2,17 +2,11 @@ include(RunCMake)
include(RunCTest)
function(run_cmake_recursive name)
- set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
- run_cmake(${name}-default)
- unset(RunCMake_TEST_OPTIONS)
- set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
- run_cmake(${name}-var)
- unset(RunCMake_TEST_OPTIONS)
- set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a)
- run_cmake(${name}-invalid-var)
- unset(RunCMake_TEST_OPTIONS)
-
+ run_cmake_with_options(${name}-default "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
run_cmake_command(${name}-default-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
+
+ run_cmake_with_options(${name}-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
+ run_cmake_with_options(${name}-invalid-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a)
run_cmake_command(${name}-var-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10 -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
run_cmake_command(${name}-invalid-var-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
endfunction()
@@ -32,12 +26,8 @@ run_cmake_recursive(variable_watch)
# We run these tests separately and only with a small limit because they are
# taxing and slow. The "implicit" and "invalid" cases are already thoroughly
# covered by the other tests above.
-set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=add_subdirectory -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
-run_cmake(add_subdirectory-var)
-unset(RunCMake_TEST_OPTIONS)
-set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=try_compile -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
-run_cmake(try_compile-var)
-unset(RunCMake_TEST_OPTIONS)
+run_cmake_with_options(add_subdirectory-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=add_subdirectory -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
+run_cmake_with_options(try_compile-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=try_compile -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
run_ctest_recursive(ctest_read_custom_files)