diff options
author | Brad King <brad.king@kitware.com> | 2022-04-22 13:38:37 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-04-22 13:38:43 (GMT) |
commit | bcd98b5f9846d7b9d2a6518501eb7ac56139665e (patch) | |
tree | 8104a1c66150559d58939ff6a1cfef729d406391 /Tests | |
parent | 4f15a57060c34900aaef5feb88edd2270fcd52e9 (diff) | |
parent | 313ea361b0435b18e89fb652bf59a8aef25a066b (diff) | |
download | CMake-bcd98b5f9846d7b9d2a6518501eb7ac56139665e.zip CMake-bcd98b5f9846d7b9d2a6518501eb7ac56139665e.tar.gz CMake-bcd98b5f9846d7b9d2a6518501eb7ac56139665e.tar.bz2 |
Merge topic 'cmake-use-findpython'
313ea361b0 CMake: Use FindPython instead of FindPythonInterp to build CMake itself
b6a6190877 string(): Support hash functions in bootstrap
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7197
Diffstat (limited to 'Tests')
11 files changed, 27 insertions, 27 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 024c388..c2677a0 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -76,7 +76,7 @@ function(add_RunCMake_test_group test types) endfunction() # Some tests use python for extra checks. -find_package(PythonInterp QUIET) +find_package(Python QUIET) if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 6.1) set(Swift_ARGS -DXCODE_BELOW_6_1=1) @@ -302,7 +302,7 @@ add_RunCMake_test(ExcludeFromAll) add_RunCMake_test(ExternalData) add_RunCMake_test(FeatureSummary) add_RunCMake_test(FPHSA) -add_RunCMake_test(FileAPI -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} +add_RunCMake_test(FileAPI -DPython_EXECUTABLE=${Python_EXECUTABLE} -DCMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID}) add_RunCMake_test(FindBoost) add_RunCMake_test(FindLua) @@ -400,7 +400,7 @@ add_RunCMake_test(build_command) add_executable(exit_code exit_code.c) set(execute_process_ARGS -DEXIT_CODE_EXE=$<TARGET_FILE:exit_code> - -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + -DPython_EXECUTABLE=${Python_EXECUTABLE} ) if(NOT CMake_TEST_EXTERNAL_CMAKE) list(APPEND execute_process_ARGS -DTEST_ENCODING_EXE=$<TARGET_FILE:testEncoding>) @@ -748,7 +748,7 @@ endif() add_executable(pseudo_llvm-rc pseudo_llvm-rc.c) add_RunCMake_test(CommandLine -DLLVM_RC=$<TARGET_FILE:pseudo_llvm-rc> -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} - -DCYGWIN=${CYGWIN} -DMSYS=${MSYS} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + -DCYGWIN=${CYGWIN} -DMSYS=${MSYS} -DPython_EXECUTABLE=${Python_EXECUTABLE} -DEXIT_CODE_EXE=$<TARGET_FILE:exit_code>) add_RunCMake_test(CommandLineTar) @@ -784,7 +784,7 @@ if(CMake_TEST_RunCMake_ExternalProject_DOWNLOAD_SERVER_TIMEOUT) endif() add_RunCMake_test(ExternalProject) add_RunCMake_test(FetchContent) -set(CTestCommandLine_ARGS -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}) +set(CTestCommandLine_ARGS -DPython_EXECUTABLE=${Python_EXECUTABLE}) if(NOT CMake_TEST_EXTERNAL_CMAKE) list(APPEND CTestCommandLine_ARGS -DTEST_AFFINITY=$<TARGET_FILE:testAffinity>) endif() @@ -968,16 +968,16 @@ add_RunCMake_test(PrecompileHeaders -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} add_RunCMake_test("UnityBuild") add_RunCMake_test(CMakePresets - -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + -DPython_EXECUTABLE=${Python_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} ) add_RunCMake_test(CMakePresetsBuild - -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + -DPython_EXECUTABLE=${Python_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} ) add_RunCMake_test(CMakePresetsTest - -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + -DPython_EXECUTABLE=${Python_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} ) diff --git a/Tests/RunCMake/CMakePresets/check.cmake b/Tests/RunCMake/CMakePresets/check.cmake index cef43f4..03f96a9 100644 --- a/Tests/RunCMake/CMakePresets/check.cmake +++ b/Tests/RunCMake/CMakePresets/check.cmake @@ -1,4 +1,4 @@ -if(PYTHON_EXECUTABLE AND CMake_TEST_JSON_SCHEMA) +if(Python_EXECUTABLE AND CMake_TEST_JSON_SCHEMA) if(NOT CMakePresets_SCHEMA_EXPECTED_RESULT) set(CMakePresets_SCHEMA_EXPECTED_RESULT 0) endif() diff --git a/Tests/RunCMake/CMakePresets/validate_schema.cmake b/Tests/RunCMake/CMakePresets/validate_schema.cmake index 68b638f..ed60760 100644 --- a/Tests/RunCMake/CMakePresets/validate_schema.cmake +++ b/Tests/RunCMake/CMakePresets/validate_schema.cmake @@ -4,7 +4,7 @@ function(validate_schema file expected_result) endif() execute_process( - COMMAND "${PYTHON_EXECUTABLE}" "${CMakePresets_VALIDATE_SCRIPT_PATH}" "${file}" + COMMAND "${Python_EXECUTABLE}" "${CMakePresets_VALIDATE_SCRIPT_PATH}" "${file}" RESULT_VARIABLE _result OUTPUT_VARIABLE _output ERROR_VARIABLE _error diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 6835834..8ac1747 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -342,14 +342,14 @@ endfunction() run_TestStdin() function(show_only_json_check_python v) - if(RunCMake_TEST_FAILED OR NOT PYTHON_EXECUTABLE) + if(RunCMake_TEST_FAILED OR NOT Python_EXECUTABLE) return() endif() set(json_file "${RunCMake_TEST_BINARY_DIR}/ctest.json") file(WRITE "${json_file}" "${actual_stdout}") set(actual_stdout "" PARENT_SCOPE) execute_process( - COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/show-only_json-v${v}_check.py" "${json_file}" + COMMAND ${Python_EXECUTABLE} "${RunCMake_SOURCE_DIR}/show-only_json-v${v}_check.py" "${json_file}" RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE output diff --git a/Tests/RunCMake/CommandLine/trace-json-v1-check.cmake b/Tests/RunCMake/CommandLine/trace-json-v1-check.cmake index 66af039..e9a4a59 100644 --- a/Tests/RunCMake/CommandLine/trace-json-v1-check.cmake +++ b/Tests/RunCMake/CommandLine/trace-json-v1-check.cmake @@ -1,6 +1,6 @@ -if(PYTHON_EXECUTABLE) +if(Python_EXECUTABLE) execute_process( - COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/trace-json-v1-check.py" "${RunCMake_BINARY_DIR}/json-v1.trace" + COMMAND ${Python_EXECUTABLE} "${RunCMake_SOURCE_DIR}/trace-json-v1-check.py" "${RunCMake_BINARY_DIR}/json-v1.trace" RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE output diff --git a/Tests/RunCMake/CommandLine/trace-json-v1-expand-check.cmake b/Tests/RunCMake/CommandLine/trace-json-v1-expand-check.cmake index 7916d2e..79079e1 100644 --- a/Tests/RunCMake/CommandLine/trace-json-v1-expand-check.cmake +++ b/Tests/RunCMake/CommandLine/trace-json-v1-expand-check.cmake @@ -1,6 +1,6 @@ -if(PYTHON_EXECUTABLE) +if(Python_EXECUTABLE) execute_process( - COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/trace-json-v1-check.py" --expand "${RunCMake_BINARY_DIR}/json-v1-expand.trace" + COMMAND ${Python_EXECUTABLE} "${RunCMake_SOURCE_DIR}/trace-json-v1-check.py" --expand "${RunCMake_BINARY_DIR}/json-v1-expand.trace" RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE output diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake index ae3d179..61dce17 100644 --- a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake +++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake @@ -18,12 +18,12 @@ in directory: endfunction() function(check_python case) - if(RunCMake_TEST_FAILED OR NOT PYTHON_EXECUTABLE) + if(RunCMake_TEST_FAILED OR NOT Python_EXECUTABLE) return() endif() file(GLOB index ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/index-*.json) execute_process( - COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/${case}-check.py" "${index}" "${CMAKE_CXX_COMPILER_ID}" + COMMAND ${Python_EXECUTABLE} "${RunCMake_SOURCE_DIR}/${case}-check.py" "${index}" "${CMAKE_CXX_COMPILER_ID}" "${RunCMake_TEST_BINARY_DIR}" RESULT_VARIABLE result OUTPUT_VARIABLE output diff --git a/Tests/RunCMake/execute_process/AnyCommandAbnormalExit.cmake b/Tests/RunCMake/execute_process/AnyCommandAbnormalExit.cmake index 5ac0c21..1017e0f 100644 --- a/Tests/RunCMake/execute_process/AnyCommandAbnormalExit.cmake +++ b/Tests/RunCMake/execute_process/AnyCommandAbnormalExit.cmake @@ -1,4 +1,4 @@ -execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c +execute_process(COMMAND "${Python_EXECUTABLE}" -c "import os; os.kill(os.getpid(),11)" COMMAND ${CMAKE_COMMAND} -E true COMMAND_ERROR_IS_FATAL ANY diff --git a/Tests/RunCMake/execute_process/LastCommandAbnormalExit-1.cmake b/Tests/RunCMake/execute_process/LastCommandAbnormalExit-1.cmake index 5a4574c..e4a125d 100644 --- a/Tests/RunCMake/execute_process/LastCommandAbnormalExit-1.cmake +++ b/Tests/RunCMake/execute_process/LastCommandAbnormalExit-1.cmake @@ -1,11 +1,11 @@ -execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c +execute_process(COMMAND "${Python_EXECUTABLE}" -c "import os; os.kill(os.getpid(),11)" COMMAND ${CMAKE_COMMAND} -E true RESULT_VARIABLE result ) if(result EQUAL "0") - execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c + execute_process(COMMAND "${Python_EXECUTABLE}" -c "import os; os.kill(os.getpid(),11)" COMMAND ${CMAKE_COMMAND} -E true COMMAND_ERROR_IS_FATAL LAST diff --git a/Tests/RunCMake/execute_process/LastCommandAbnormalExit-2.cmake b/Tests/RunCMake/execute_process/LastCommandAbnormalExit-2.cmake index b87e0f7..6c3fbf8 100644 --- a/Tests/RunCMake/execute_process/LastCommandAbnormalExit-2.cmake +++ b/Tests/RunCMake/execute_process/LastCommandAbnormalExit-2.cmake @@ -1,12 +1,12 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E true - COMMAND "${PYTHON_EXECUTABLE}" -c + COMMAND "${Python_EXECUTABLE}" -c "import os; os.kill(os.getpid(),11)" RESULT_VARIABLE result ) if(NOT result EQUAL "0") execute_process(COMMAND ${CMAKE_COMMAND} -E true - COMMAND "${PYTHON_EXECUTABLE}" -c + COMMAND "${Python_EXECUTABLE}" -c "import os; os.kill(os.getpid(),11)" COMMAND_ERROR_IS_FATAL LAST ) diff --git a/Tests/RunCMake/execute_process/RunCMakeTest.cmake b/Tests/RunCMake/execute_process/RunCMakeTest.cmake index 35712f6..c2f9144 100644 --- a/Tests/RunCMake/execute_process/RunCMakeTest.cmake +++ b/Tests/RunCMake/execute_process/RunCMakeTest.cmake @@ -35,8 +35,8 @@ run_cmake_command(LastCommandError ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/La run_cmake_command(LastCommandTimeout ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/LastCommandTimeout.cmake) run_cmake_command(LastCommandGood ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/LastCommandGood.cmake) -if(UNIX AND PYTHON_EXECUTABLE) - run_cmake_command(AnyCommandAbnormalExit ${CMAKE_COMMAND} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -P ${RunCMake_SOURCE_DIR}/AnyCommandAbnormalExit.cmake) - run_cmake_command(LastCommandAbnormalExit-1 ${CMAKE_COMMAND} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -P ${RunCMake_SOURCE_DIR}/LastCommandAbnormalExit-1.cmake) - run_cmake_command(LastCommandAbnormalExit-2 ${CMAKE_COMMAND} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -P ${RunCMake_SOURCE_DIR}/LastCommandAbnormalExit-2.cmake) +if(UNIX AND Python_EXECUTABLE) + run_cmake_command(AnyCommandAbnormalExit ${CMAKE_COMMAND} -DPython_EXECUTABLE=${Python_EXECUTABLE} -P ${RunCMake_SOURCE_DIR}/AnyCommandAbnormalExit.cmake) + run_cmake_command(LastCommandAbnormalExit-1 ${CMAKE_COMMAND} -DPython_EXECUTABLE=${Python_EXECUTABLE} -P ${RunCMake_SOURCE_DIR}/LastCommandAbnormalExit-1.cmake) + run_cmake_command(LastCommandAbnormalExit-2 ${CMAKE_COMMAND} -DPython_EXECUTABLE=${Python_EXECUTABLE} -P ${RunCMake_SOURCE_DIR}/LastCommandAbnormalExit-2.cmake) endif() |