CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
MESSAGE(STATUS "Proceed to test definitions now.")
-PROJECT(deal.II-testsuite NONE)
ENABLE_TESTING()
+IF(NOT "${CMAKE_PROJECT_NAME}" STREQUAL "deal.II")
+ MESSAGE(FATAL_ERROR
+ "The testsuite cannot be set up as an independent project. Please configure \"deal.II\" instead."
+ )
+ENDIF()
+
SET(_options)
IF("${CMAKE_PROJECT_NAME}" STREQUAL "deal.II")
#
SET(_category all-headers)
-SET(_count "0")
-
-IF(NOT "${DEAL_II_SOURCE_DIR}" STREQUAL "")
- # The testsuite was configured as part of a deal.II project, so pick up
- # the headers from the corresponding source directory:
- FILE(GLOB_RECURSE _header ${DEAL_II_SOURCE_DIR}/include/deal.II/*.h)
-ELSE()
- # The testsuite was configured as an independent project, so pick up
- # headers from an external deal.II build directory, or installation:
- IF(DEAL_II_BUILD_DIR)
- LIST(GET DEAL_II_INCLUDE_DIRS 2 _header_dir)
- ELSE()
- LIST(GET DEAL_II_INCLUDE_DIRS 0 _header_dir)
- ENDIF()
- FILE(GLOB_RECURSE _header ${_header_dir}/deal.II/*.h)
-ENDIF()
+FILE(GLOB_RECURSE _header ${DEAL_II_SOURCE_DIR}/include/deal.II/*.h)
FOREACH(_full_file ${_header})
GET_FILENAME_COMPONENT(_file ${_full_file} NAME)
LABEL "${_category}"
TIMEOUT ${TEST_TIME_LIMIT}
)
- MATH(EXPR _count "${_count}+1")
ENDIF()
ENDFOREACH()
ENDFOREACH()
-
-MESSAGE(STATUS
- "Testsuite: Set up ${_count} regression tests in category ${_category}."
- )
-MESSAGE(STATUS
- " (Timeout: ${TEST_TIME_LIMIT}, Diff: "${_test_diff}")"
- )
step-47 step-48 step-49
)
-IF(NOT "${DEAL_II_SOURCE_DIR}" STREQUAL "")
- # The testsuite was configured as part of a deal.II project, so pick up
- # the steps rom the corresponding source directory:
- FILE(GLOB _steps ${DEAL_II_SOURCE_DIR}/examples/step-*)
-ELSE()
- # The testsuite was configured as an independent project, so pick up
- # headers from an external deal.II build directory, or installation:
- FILE(GLOB _steps ${DEAL_II_PATH}/${DEAL_II_EXAMPLES_RELDIR}/step-*)
- # TODO: What do in case of a build dir?
-ENDIF()
-
-SET(_count "0")
+FILE(GLOB _steps ${DEAL_II_SOURCE_DIR}/examples/step-*)
+
FOREACH(_step_full ${_steps})
GET_FILENAME_COMPONENT(_step ${_step_full} NAME)
LABEL "${_category}"
TIMEOUT ${TEST_TIME_LIMIT}
)
- MATH(EXPR _count "${_count}+1")
ENDIF()
ENDFOREACH()
ENDFOREACH()
-
-MESSAGE(STATUS
- "Testsuite: Set up ${_count} regression tests in category ${_category}."
- )
-MESSAGE(STATUS
- " (Timeout: ${TEST_TIME_LIMIT}, Diff: "${_test_diff}")"
- )
&& cat ${_test_directory}/failing_output
&& exit 1)
COMMAND
- ${PERL_EXECUTABLE} -pi
- ${TEST_DIR}/cmake/scripts/normalize.pl
- ${_test_directory}/output
+ ${PERL_EXECUTABLE} -pi ${TEST_DIR}/cmake/scripts/normalize.pl
+ ${_test_directory}/output
WORKING_DIRECTORY
${_test_directory}
DEPENDS
# DEAL_II_PICKUP_TESTS()
#
-IF(NOT DEFINED SET_IF_EMPTY)
- MACRO(SET_IF_EMPTY _variable)
- IF("${${_variable}}" STREQUAL "")
- SET(${_variable} ${ARGN})
- ENDIF()
- ENDMACRO()
-ENDIF()
-
MACRO(DEAL_II_PICKUP_TESTS)
SET_IF_EMPTY(TEST_PICKUP_REGEX "$ENV{TEST_PICKUP_REGEX}")
GET_FILENAME_COMPONENT(_category ${CMAKE_CURRENT_SOURCE_DIR} NAME)
- #
- # Strip the quoting from TEST_DIFF:
- #
- SET(_test_diff ${TEST_DIFF})
-
SET(DEAL_II_SOURCE_DIR) # avoid a bogus warning
- SET(_count "0")
FILE(GLOB _tests "*.output")
FOREACH(_test ${_tests})
SET(_comparison ${_test})
#
- # Respect TEST_PICKUP_REGEX: Make sure we are allowed to pickup this
- # test:
+ # Respect TEST_PICKUP_REGEX:
#
IF( "${TEST_PICKUP_REGEX}" STREQUAL "" OR
_test MATCHES "${TEST_PICKUP_REGEX}" )
_feature ${_match}
)
STRING(TOUPPER ${_feature} _feature)
-
STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match})
IF( (DEAL_II_${_feature} AND NOT ${_boolean}) OR
IF(_test MATCHES debug)
SET(_configuration DEBUG)
- MATH(EXPR _count "${_count}+1")
ELSEIF(_test MATCHES release)
SET(_configuration RELEASE)
- MATH(EXPR _count "${_count}+1")
ELSE()
SET(_configuration)
- MATH(EXPR _count "${_count}+2")
ENDIF()
STRING(REGEX REPLACE "\\..*" "" _test ${_test})
DEAL_II_ADD_TEST(${_category} ${_test} ${_comparison} ${_n_cpu} ${_configuration})
ENDIF()
ENDFOREACH()
-
- MESSAGE(STATUS
- "Testsuite: Set up ${_count} regression tests in category ${_category}."
- )
- MESSAGE(STATUS
- " (Timeout: ${TEST_TIME_LIMIT}, Diff: "${_test_diff}")"
- )
ENDMACRO()