Commit 833c5e14 authored by jcfr's avatar jcfr

COMP: CTest module need to be included at Superbuild level for CTEST_USE_LAUNCHER to works

See http://www.kitware.com/blog/home/post/11

git-svn-id: http://svn.slicer.org/Slicer4/trunk@18495 3bd1e089-480b-0410-8dfb-8563597acbee
parent 03909c9c
......@@ -326,6 +326,25 @@ if(BUILD_TESTING)
list(APPEND Slicer_REQUIRED_QT_MODULES TEST)
endif()
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if(BUILD_TESTING)
# NOTE: For CTEST_USE_LAUNCHER to work, it's required to include CTest at the superbuild level.
# See http://www.kitware.com/blog/home/post/11
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1) # Do not add CTest default targets
include(CTest)
# Add Experimental target - Adapted from CTestTargets.cmake
set(__conf_types "")
if(CMAKE_CONFIGURATION_TYPES)
# We need to pass the configuration type on the test command line.
set(__conf_types -C "${CMAKE_CFG_INTDIR}")
endif()
add_custom_target(Experimental ${CMAKE_CTEST_COMMAND} ${__conf_types} -D Experimental)
endif()
#-----------------------------------------------------------------------------
# Superbuild script
#-----------------------------------------------------------------------------
......@@ -393,27 +412,16 @@ if(BUILD_TESTING)
set(Slicer_LAUNCHER_EXECUTABLE ${Slicer_BINARY_DIR}/Slicer)
set(Slicer_LAUNCH_COMMAND ${Slicer_LAUNCHER_EXECUTABLE} --launcher-no-splash --launch)
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1) # Do not add CTest default targets
include(CTest)
include(SlicerMacroPythonTesting)
include(SlicerMacroConfigureGenericCxxModuleTests)
include(SlicerMacroConfigureGenericPythonModuleTests)
# Add Experimental target - Adapted from CTestTargets.cmake
set(__conf_types "")
if(CMAKE_CONFIGURATION_TYPES)
# We need to pass the configuration type on the test command line.
set(__conf_types -C "${CMAKE_CFG_INTDIR}")
endif()
add_custom_target(Experimental ${CMAKE_CTEST_COMMAND} ${__conf_types} -D Experimental)
include(MIDAS)
set(MIDAS_REST_URL "http://midas.kitware.com/api/rest" CACHE STRING "The MIDAS server where testing data resides")
set(MIDAS_KEY_DIR "${Slicer_SOURCE_DIR}/Testing/Data")
set(MIDAS_DATA_DIR "${Slicer_BINARY_DIR}/MIDAS_Data")
set(CXX_TEST_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
mark_as_advanced(TCL_TCLSH DART_ROOT)
configure_file(
${Slicer_SOURCE_DIR}/CTestConfig.cmake
......
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