Apply CMake test-time config to all tests
We configure an EnforceConfig.cmake script to load at CTest time. Previously we loaded it from Tests/CTestTestfile.cmake, but now we load it from the top level so it applies to all tests.
This commit is contained in:
parent
08ac33fe6a
commit
9d823f7847
|
@ -342,6 +342,10 @@ SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
|
||||||
ENABLE_TESTING()
|
ENABLE_TESTING()
|
||||||
INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
|
INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
|
||||||
|
|
||||||
|
# Set up test-time configuration.
|
||||||
|
SET_DIRECTORY_PROPERTIES(PROPERTIES
|
||||||
|
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
|
||||||
|
|
||||||
# where to write the resulting executables and libraries
|
# where to write the resulting executables and libraries
|
||||||
SET(BUILD_SHARED_LIBS OFF)
|
SET(BUILD_SHARED_LIBS OFF)
|
||||||
SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
|
SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
|
||||||
|
|
|
@ -28,12 +28,8 @@ IF(NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE)
|
||||||
SET(CTestTest_CONFIG ${CMAKE_BUILD_TYPE})
|
SET(CTestTest_CONFIG ${CMAKE_BUILD_TYPE})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Make sure the 'testing' test gets a proper configuration.
|
|
||||||
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in
|
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in
|
||||||
${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake @ONLY)
|
${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake @ONLY)
|
||||||
SET_DIRECTORY_PROPERTIES(PROPERTIES
|
|
||||||
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
IF(BUILD_TESTING)
|
IF(BUILD_TESTING)
|
||||||
|
|
Loading…
Reference in New Issue