]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Restructure a bit
authorMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 5 Sep 2013 16:23:07 +0000 (16:23 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 5 Sep 2013 16:23:07 +0000 (16:23 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30611 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_deal_ii_add_test.cmake
deal.II/cmake/macros/macro_deal_ii_pickup_tests.cmake

index 0e947df9c0b5213ffc1fe5efa54443193601396f..714eb27d65f822b463d011135be302ece06a27d2 100644 (file)
 #
 # 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})
 
@@ -80,18 +83,6 @@ MACRO(DEAL_II_ADD_TEST _category _test_name)
         )
 
 
-      #
-      # 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:
       #
@@ -123,7 +114,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name)
         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
@@ -136,7 +127,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name)
           ${CMAKE_CURRENT_BINARY_DIR}/${_test}
         DEPENDS
           ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
-          ${_comparison}
+          ${_comparison_file}
         )
 
       ADD_CUSTOM_TARGET(${_full_test}.diff
index 43127882292b1539571988ca93c41078f21cc649..401b415a2b4ff892ef697ede4dcae8fbc6d8f522 100644 (file)
@@ -35,6 +35,10 @@ MACRO(DEAL_II_PICKUP_TESTS)
         _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)
@@ -43,8 +47,9 @@ MACRO(DEAL_II_PICKUP_TESTS)
         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()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.