# Setup tests:
ADD_CUSTOM_TARGET(setup_tests)
+# Remove all tests:
+ADD_CUSTOM_TARGET(prune_tests)
+
# Regenerate tests (run "make rebuild_cache" in subprojects):
ADD_CUSTOM_TARGET(regen_tests
COMMAND ${CMAKE_COMMAND}
-- ${MAKEOPTS}
)
-# Remove all tests:
-ADD_CUSTOM_TARGET(prune_tests
- COMMAND ${CMAKE_COMMAND}
- --build ${CMAKE_BINARY_DIR}/tests --target prune_tests
- -- ${MAKEOPTS}
- )
-
MESSAGE(STATUS "Setup testsuite")
#
-# Setup the testsuite project: It is merely a wrapper around the individual
-# regen_tests_*, clean_tests_* and prune_tests_* targets.
-# down to it:
+# Provide custom targets to setup and prune the testsuite subproject:
#
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR}
- -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
-DTEST_DIR=${TEST_DIR}
${CMAKE_SOURCE_DIR}/tests
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests
LIST(APPEND _options -DDEAL_II_SOURCE_DIR=${CMAKE_SOURCE_DIR})
LIST(APPEND _options -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR})
FOREACH(_var
- DIFF_DIR
- NUMDIFF_DIR
- TEST_DIFF
- TEST_OVERRIDE_LOCATION
- TEST_PICKUP_REGEX
+ DIFF_DIR NUMDIFF_DIR TEST_DIFF TEST_OVERRIDE_LOCATION TEST_PICKUP_REGEX
TEST_TIME_LIMIT
)
# always undefine:
)
ADD_DEPENDENCIES(setup_tests setup_tests_${_category})
+ ADD_CUSTOM_TARGET(prune_tests_${_category}
+ COMMAND ${CMAKE_COMMAND} -E remove_directory
+ ${CMAKE_BINARY_DIR}/tests/${_category}
+ )
+ ADD_DEPENDENCIES(prune_tests prune_tests_${_category})
+
FILE(APPEND ${CMAKE_BINARY_DIR}/tests/CTestTestfile.cmake
"SUBDIRS(${_category})\n"
)
##
## ---------------------------------------------------------------------
-IF(NOT DEFINED DEAL_II_BINARY_DIR)
+#
+# This is a small project that provides some custom targets that need a
+# working, independent subproject because they are called back during
+# configure phase.
+#
+
+IF(NOT DEFINED TEST_DIR)
MESSAGE(FATAL_ERROR "\n
The testsuite cannot be set up as an independent project.
Please configure \"deal.II\" directly instead.\n\n"
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
PROJECT(testsuite NONE)
-#
-# This is a small project that provides some custom targets that need a
-# working, independent subproject because they are called back during
-# configure phase.
-#
-
-# Setup tests:
-ADD_CUSTOM_TARGET(setup_tests
- COMMAND ${CMAKE_COMMAND}
- --build ${DEAL_II_BINARY_DIR} --target setup_tests
- )
-
# Regenerate tests (run "make rebuild_cache" in subprojects):
ADD_CUSTOM_TARGET(regen_tests)
# Clean all tests
ADD_CUSTOM_TARGET(clean_tests)
-# Remove all tests:
-ADD_CUSTOM_TARGET(prune_tests)
-
-#
-# Glob together a list of all subfolders to set up:
-#
-
FILE(GLOB _categories RELATIVE ${TEST_DIR} ${TEST_DIR}/*)
SET(_categories all-headers build_tests mesh_converter ${_categories})
LIST(REMOVE_DUPLICATES _categories)
-#
-# Define a subproject for every enabled category:
-#
-
FOREACH(_category ${_categories})
IF( EXISTS ${CMAKE_SOURCE_DIR}/${_category}/CMakeLists.txt OR
EXISTS ${TEST_DIR}/${_category}/CMakeLists.txt )
)
ADD_DEPENDENCIES(clean_tests clean_tests_${_category})
- ADD_CUSTOM_TARGET(prune_tests_${_category}
- COMMAND ${CMAKE_COMMAND} -E remove_directory
- ${CMAKE_BINARY_DIR}/${_category}
- )
- ADD_DEPENDENCIES(prune_tests prune_tests_${_category})
-
ENDIF()
ENDFOREACH()