#
# A Macro to set up tests for thes testsuite
#
-# This macro assumes that a test
-#
-# ./tests/category/test_name.cc
-# ./tests/category/test_name.*.output
-#
-# is available in the testsuite.
-#
-# [configurations] is a list of configurations against this test should be
-# run. Possible values are an empty list, DEBUG, RELEASE or
-# "DEBUG;RELEASE".
-#
# The following variables must be set:
#
# TEST_DIFF
# - specifying the maximal wall clock time in seconds a test is allowed
# to run
#
+#
# Usage:
-# DEAL_II_ADD_TEST(category test_name [configurations])
+# DEAL_II_ADD_TEST(category test_name comparison_file [configurations])
+#
+# This macro assumes that a source file
+#
+# ./tests/category/<test_name>.cc
+#
+# is available in the testsuite.
+#
+# [configurations] is a list of configurations against this test should be
+# run. Possible values are an empty list, DEBUG, RELEASE or
+# "DEBUG;RELEASE".
+#
+# The output of <test_name>.cc is compared against the file
+# <comparison_file>.
#
-MACRO(DEAL_II_ADD_TEST _category _test_name)
+MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
FOREACH(_build ${DEAL_II_BUILD_TYPES})
)
- #
- # Determine correct file for comparison:
- #
-
- SET(_comparison ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name})
- IF(EXISTS ${_comparison}.${_build_lowercase}.output)
- SET(_comparison ${_comparison}.${_build_lowercase}.output)
- ELSE()
- SET(_comparison ${_comparison}.output)
- ENDIF()
-
-
#
# Add a top level target to run and compare the test:
#
COMMAND
${TEST_DIFF}
${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
- ${_comparison}
+ ${_comparison_file}
> ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff
|| (mv ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff
${CMAKE_CURRENT_BINARY_DIR}/${_test}/failing_diff
${CMAKE_CURRENT_BINARY_DIR}/${_test}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
- ${_comparison}
+ ${_comparison_file}
)
ADD_CUSTOM_TARGET(${_full_test}.diff
_test MATCHES "${TEST_PICKUP_REGEX}" )
GET_FILENAME_COMPONENT(_test ${_test} NAME)
+ #
+ # TODO: mpirun support
+ #
+
IF(_test MATCHES debug)
SET(_configuration DEBUG)
ELSEIF(_test MATCHES release)
SET(_configuration)
ENDIF()
+ SET(_comparison ${_test})
STRING(REGEX REPLACE "\\..*" "" _test ${_test})
- DEAL_II_ADD_TEST(${_category} ${_test} ${_configuration})
+ DEAL_II_ADD_TEST(${_category} ${_test} ${_comparison} ${_configuration})
ENDIF()
ENDFOREACH()