Commit b5f3d4be authored by Brad King's avatar Brad King

ENH: Re-enable new 'testing' test mode

This fixes selection of a configuration when none is specified to find
an available configuration of the ctest test-command.
parent 2703d51b
......@@ -14,9 +14,11 @@ MACRO(ADD_TEST_MACRO NAME COMMAND)
ENDMACRO(ADD_TEST_MACRO)
# Make sure the 'testing' test gets a proper configuration.
#SET_DIRECTORY_PROPERTIES(PROPERTIES
# TEST_INCLUDE_FILE "${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake"
# )
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in
${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake @ONLY)
SET_DIRECTORY_PROPERTIES(PROPERTIES
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake"
)
# Testing
IF(BUILD_TESTING)
......@@ -542,16 +544,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
ENDFOREACH(STP)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial")
ADD_TEST(testing ${CMAKE_CTEST_COMMAND} # -C \${CTEST_CONFIGURATION_TYPE}
ADD_TEST(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Testing"
"${CMake_BINARY_DIR}/Tests/Testing"
--build-generator ${CMAKE_TEST_GENERATOR}
--build-project Testing
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
#--test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Testing/bin"
--test-command testing
--test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing")
......
......@@ -7,9 +7,23 @@ ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.6)
IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" STREQUAL 2.6)
IF("${CMAKE_PATCH_VERSION}" LESS 3)
SET(CONFIG_REQUIRED 1)
ENDIF("${CMAKE_PATCH_VERSION}" LESS 3)
ENDIF("${CMAKE_PATCH_VERSION}" LESS 3)
ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" STREQUAL 2.6)
ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.6)
IF(NOT CTEST_CONFIGURATION_TYPE AND CONFIG_REQUIRED)
SET(CTEST_CONFIGURATION_TYPE Debug)
SET(CTEST_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@")
GET_FILENAME_COMPONENT(CTEST_DIR "${CTEST_CMD}" PATH)
GET_FILENAME_COMPONENT(CTEST_EXE "${CTEST_CMD}" NAME)
FOREACH(cfg Release Debug MinSizeRel RelWithDebInfo)
IF(NOT CTEST_CONFIGURATION_TYPE)
IF(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
SET(CTEST_CONFIGURATION_TYPE ${cfg})
ENDIF(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
ENDIF(NOT CTEST_CONFIGURATION_TYPE)
ENDFOREACH(cfg)
IF(NOT CTEST_CONFIGURATION_TYPE)
SET(CTEST_CONFIGURATION_TYPE NoConfig)
ENDIF(NOT CTEST_CONFIGURATION_TYPE)
MESSAGE("Guessing configuration ${CTEST_CONFIGURATION_TYPE}")
ENDIF(NOT CTEST_CONFIGURATION_TYPE AND CONFIG_REQUIRED)
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