summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-04 21:11:30 (GMT)
committerBrad King <brad.king@kitware.com>2022-02-07 16:53:29 (GMT)
commitc8b29dc5b93d541052537b3e7b19069f4c2370d0 (patch)
tree4711534f7371e16c431adbdfe8e8e1cfbd276479 /Tests
parenta70864e30072167c8aae65910a653f9d2f32fb16 (diff)
downloadCMake-c8b29dc5b93d541052537b3e7b19069f4c2370d0.zip
CMake-c8b29dc5b93d541052537b3e7b19069f4c2370d0.tar.gz
CMake-c8b29dc5b93d541052537b3e7b19069f4c2370d0.tar.bz2
Tests: Add cache entries to control existence of CTest.Update* tests
Add undocumented `CMake_TEST_CTestUpdate_*` cache entries to explicitly enable or disable these tests. If not set, compute defaults as before.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt127
1 files changed, 75 insertions, 52 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index a479d16..6d39456 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2543,19 +2543,27 @@ if(BUILD_TESTING)
# )
# Test CTest Update with Subversion
- find_package(Subversion QUIET)
- if(Subversion_FOUND)
- get_filename_component(_Subversion_BIN_DIR
- ${Subversion_SVN_EXECUTABLE} PATH)
- find_program(Subversion_SVNADMIN_EXECUTABLE svnadmin
- HINTS ${_Subversion_BIN_DIR}
- )
- mark_as_advanced(Subversion_SVNADMIN_EXECUTABLE)
- if(NOT Subversion_SVNADMIN_EXECUTABLE)
- set(Subversion_FOUND FALSE)
+ if(NOT DEFINED CMake_TEST_CTestUpdate_SVN OR CMake_TEST_CTestUpdate_SVN)
+ find_package(Subversion QUIET)
+ if(Subversion_FOUND)
+ get_filename_component(_Subversion_BIN_DIR
+ ${Subversion_SVN_EXECUTABLE} PATH)
+ find_program(Subversion_SVNADMIN_EXECUTABLE svnadmin
+ HINTS ${_Subversion_BIN_DIR}
+ )
+ mark_as_advanced(Subversion_SVNADMIN_EXECUTABLE)
+ if(NOT Subversion_SVNADMIN_EXECUTABLE)
+ set(Subversion_FOUND FALSE)
+ endif()
endif()
endif()
- if(Subversion_FOUND)
+ if(NOT DEFINED CMake_TEST_CTestUpdate_SVN AND Subversion_FOUND)
+ set(CMake_TEST_CTestUpdate_SVN 1)
+ endif()
+ if(CMake_TEST_CTestUpdate_SVN)
+ if(NOT Subversion_FOUND)
+ message(FATAL_ERROR "CMake_TEST_CTestUpdate_SVN enabled but Subversion is not found.")
+ endif()
set(CTestUpdateSVN_DIR "CTest UpdateSVN")
configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestUpdateSVN.cmake" @ONLY)
@@ -2566,15 +2574,18 @@ if(BUILD_TESTING)
endif()
# Test CTest Update with CVS
- find_program(CVS_EXECUTABLE NAMES cvs)
- mark_as_advanced(CVS_EXECUTABLE)
- set(CTEST_TEST_UPDATE_CVS 0)
- if(CVS_EXECUTABLE)
- if(NOT "${CVS_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
- set(CTEST_TEST_UPDATE_CVS 1)
- endif()
+ if(NOT DEFINED CMake_TEST_CTestUpdate_CVS OR CMake_TEST_CTestUpdate_CVS)
+ find_program(CVS_EXECUTABLE NAMES cvs)
+ mark_as_advanced(CVS_EXECUTABLE)
+ endif()
+ if(NOT DEFINED CMake_TEST_CTestUpdate_CVS AND CVS_EXECUTABLE
+ AND (UNIX OR NOT "${CVS_EXECUTABLE}" MATCHES "cygwin"))
+ set(CMake_TEST_CTestUpdate_CVS 1)
endif()
- if(CTEST_TEST_UPDATE_CVS)
+ if(CMake_TEST_CTestUpdate_CVS)
+ if(NOT CVS_EXECUTABLE)
+ message(FATAL_ERROR "CMake_TEST_CTestUpdate_CVS enabled but CVS_EXECUTABLE is not found.")
+ endif()
set(CTestUpdateCVS_DIR "CTest UpdateCVS")
configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake" @ONLY)
@@ -2585,15 +2596,18 @@ if(BUILD_TESTING)
endif()
# Test CTest Update with BZR
- find_program(BZR_EXECUTABLE NAMES bzr)
- mark_as_advanced(BZR_EXECUTABLE)
- set(CTEST_TEST_UPDATE_BZR 0)
- if(BZR_EXECUTABLE)
- if(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
- set(CTEST_TEST_UPDATE_BZR 1)
- endif()
+ if(NOT DEFINED CMake_TEST_CTestUpdate_BZR OR CMake_TEST_CTestUpdate_BZR)
+ find_program(BZR_EXECUTABLE NAMES bzr)
+ mark_as_advanced(BZR_EXECUTABLE)
+ endif()
+ if(NOT DEFINED CMake_TEST_CTestUpdate_BZR AND BZR_EXECUTABLE
+ AND (UNIX OR NOT "${BZR_EXECUTABLE}" MATCHES "cygwin"))
+ set(CMake_TEST_CTestUpdate_BZR 1)
endif()
- if(CTEST_TEST_UPDATE_BZR)
+ if(CMake_TEST_CTestUpdate_BZR)
+ if(NOT BZR_EXECUTABLE)
+ message(FATAL_ERROR "CMake_TEST_CTestUpdate_BZR enabled but BZR_EXECUTABLE is not found.")
+ endif()
set(CTestUpdateBZR_DIR "CTest UpdateBZR")
configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestUpdateBZR.cmake" @ONLY)
@@ -2612,15 +2626,18 @@ if(BUILD_TESTING)
endif()
# Test CTest Update with GIT
- find_program(GIT_EXECUTABLE NAMES git)
- mark_as_advanced(GIT_EXECUTABLE)
- set(CTEST_TEST_UPDATE_GIT 0)
- if(GIT_EXECUTABLE)
- if(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
- set(CTEST_TEST_UPDATE_GIT 1)
- endif()
+ if(NOT DEFINED CMake_TEST_CTestUpdate_GIT OR CMake_TEST_CTestUpdate_GIT)
+ find_program(GIT_EXECUTABLE NAMES git)
+ mark_as_advanced(GIT_EXECUTABLE)
+ endif()
+ if(NOT DEFINED CMake_TEST_CTestUpdate_GIT AND GIT_EXECUTABLE
+ AND (UNIX OR NOT "${GIT_EXECUTABLE}" MATCHES "cygwin"))
+ set(CMake_TEST_CTestUpdate_GIT 1)
endif()
- if(CTEST_TEST_UPDATE_GIT)
+ if(CMake_TEST_CTestUpdate_GIT)
+ if(NOT GIT_EXECUTABLE)
+ message(FATAL_ERROR "CMake_TEST_CTestUpdate_GIT enabled but GIT_EXECUTABLE is not found.")
+ endif()
set(CTestUpdateGIT_DIR "CTest UpdateGIT")
configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake" @ONLY)
@@ -2631,15 +2648,18 @@ if(BUILD_TESTING)
endif()
# Test CTest Update with HG
- find_program(HG_EXECUTABLE NAMES hg)
- mark_as_advanced(HG_EXECUTABLE)
- set(CTEST_TEST_UPDATE_HG 0)
- if(HG_EXECUTABLE)
- if(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
- set(CTEST_TEST_UPDATE_HG 1)
- endif()
+ if(NOT DEFINED CMake_TEST_CTestUpdate_HG OR CMake_TEST_CTestUpdate_HG)
+ find_program(HG_EXECUTABLE NAMES hg)
+ mark_as_advanced(HG_EXECUTABLE)
endif()
- if(CTEST_TEST_UPDATE_HG)
+ if(NOT DEFINED CMake_TEST_CTestUpdate_HG AND HG_EXECUTABLE
+ AND (UNIX OR NOT "${HG_EXECUTABLE}" MATCHES "cygwin"))
+ set(CMake_TEST_CTestUpdate_HG 1)
+ endif()
+ if(CMake_TEST_CTestUpdate_HG)
+ if(NOT HG_EXECUTABLE)
+ message(FATAL_ERROR "CMake_TEST_CTestUpdate_HG enabled but HG_EXECUTABLE is not found.")
+ endif()
set(CTestUpdateHG_DIR "CTest UpdateHG")
configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestUpdateHG.cmake" @ONLY)
@@ -2650,16 +2670,19 @@ if(BUILD_TESTING)
endif()
# Test CTest Update with P4
- find_program(P4_EXECUTABLE NAMES p4)
- find_program(P4D_EXECUTABLE NAMES p4d)
- mark_as_advanced(P4_EXECUTABLE P4D_EXECUTABLE)
- set(CTEST_TEST_UPDATE_P4 0)
- if(P4_EXECUTABLE AND P4D_EXECUTABLE)
- if(NOT "${P4_EXECUTABLE};${P4D_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
- set(CTEST_TEST_UPDATE_P4 1)
- endif()
+ if(NOT DEFINED CMake_TEST_CTestUpdate_P4 OR CMake_TEST_CTestUpdate_P4)
+ find_program(P4_EXECUTABLE NAMES p4)
+ find_program(P4D_EXECUTABLE NAMES p4d)
+ mark_as_advanced(P4_EXECUTABLE P4D_EXECUTABLE)
endif()
- if(CTEST_TEST_UPDATE_P4)
+ if(NOT DEFINED CMake_TEST_CTestUpdate_P4 AND P4_EXECUTABLE AND P4D_EXECUTABLE
+ AND (UNIX OR NOT "${P4_EXECUTABLE};${P4D_EXECUTABLE}" MATCHES "cygwin"))
+ set(CMake_TEST_CTestUpdate_P4 1)
+ endif()
+ if(CMake_TEST_CTestUpdate_P4)
+ if(NOT P4_EXECUTABLE OR NOT P4D_EXECUTABLE)
+ message(FATAL_ERROR "CMake_TEST_CTestUpdate_HG enabled but P4_EXECUTABLE and P4D_EXECUTABLE are not both not found.")
+ endif()
set(CTestUpdateP4_DIR "CTest UpdateP4")
configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateP4.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestUpdateP4.cmake" @ONLY)