Commit 020e1e20 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'test-macos-version' into release-3.19

55193c80 ci: Hard-code XCTest deployment target to 10.15
40877903 Tests: Remove outdated exclusion of tests on OS X 10.3
c404d7f2

 Tests: Add cache entry to control XCTest deployment target
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !5593
parents 9f66eb74 55193c80
Pipeline #204278 failed with stages
in 20 minutes and 43 seconds
......@@ -11,3 +11,8 @@ set(CMake_TEST_Java 0 CACHE FILEPATH "")
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF CACHE BOOL "")
set(BUILD_QtDialog ON CACHE BOOL "")
# The "XCTest" test uses an explicit deployment target chosen
# when CMake itself is configured. Use a version that is not
# newer than the macOS version running on any CI host.
set(CMake_TEST_XCTest_DEPLOYMENT_TARGET "10.15" CACHE STRING "")
......@@ -301,18 +301,7 @@ if(BUILD_TESTING)
set(CTEST_TEST_OSX_ARCH 0)
set(CMake_TEST_XCODE_VERSION 0)
if(APPLE)
execute_process(
COMMAND sw_vers -productVersion
OUTPUT_VARIABLE OSX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(OSX_VERSION VERSION_LESS 10.4)
message(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4")
message(STATUS "OSX_VERSION='${OSX_VERSION}'")
set(CTEST_TEST_CPACK OFF)
else()
set(CTEST_TEST_OSX_ARCH 1)
endif()
set(CTEST_TEST_OSX_ARCH 1)
if(XCODE_VERSION)
set(CMake_TEST_XCODE_VERSION "${XCODE_VERSION}")
else()
......@@ -1833,11 +1822,22 @@ if(BUILD_TESTING)
)
endif()
if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5
AND OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
set(XCTest_CTEST_OPTIONS --build-config $<CONFIGURATION>)
set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_MATCH_1} -DCMAKE_OSX_SYSROOT=macosx)
ADD_TEST_MACRO(XCTest ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> -V)
if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5)
if(NOT CMake_TEST_XCTest_DEPLOYMENT_TARGET)
execute_process(
COMMAND sw_vers -productVersion
OUTPUT_VARIABLE OSX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
set(CMake_TEST_XCTest_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}")
endif()
endif()
if(CMake_TEST_XCTest_DEPLOYMENT_TARGET)
set(XCTest_CTEST_OPTIONS --build-config $<CONFIGURATION>)
set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMake_TEST_XCTest_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=macosx)
ADD_TEST_MACRO(XCTest ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> -V)
endif()
endif()
add_test(linkorder1 ${CMAKE_CTEST_COMMAND}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment