]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Implement TEST_OVERRIDE_LOCATION
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 20 Oct 2013 18:34:22 +0000 (18:34 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 20 Oct 2013 18:34:22 +0000 (18:34 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31346 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_add_test.cmake
deal.II/cmake/macros/macro_pickup_tests.cmake
deal.II/cmake/scripts/run_test.cmake
deal.II/cmake/setup_testsuite.cmake
deal.II/doc/developers/testsuite.html

index 67bc4fe0b92226b21c71f485e6f5e9f026a1e93d..0bda009a4c9cb2eaf281688c6a1e9695049e2df3 100644 (file)
 #
 #
 # Usage:
-#     DEAL_II_ADD_TEST(category test_name comparison_file)
+#     DEAL_II_ADD_TEST(category test_name comparison_file [ARGN])
 #
 # This macro assumes that a source file "./tests/category/<test_name>.cc"
 # as well as the comparison file "./tests/category/<comparison_file>" is
 # available in the testsuite. The output of compiled source file is
 # compared against the file comparison file.
 #
+# [ARGN] is an optional list of additional output lines passed down to the
+# run_test.cmake script and printed at the beginning of the test output.
+#
 # This macro gets the following options from the comparison file name (have
 # a look at the testsuite documentation for details):
 #  - usage of mpirun and number of simultaneous processes
@@ -213,6 +216,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
           -DTRGT=${_diff_target}
           -DTEST=${_test_full}
           -DEXPECT=${_expect}
+          -DADDITIONAL_OUTPUT=${ARGN}
           -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
           -P ${DEAL_II_SOURCE_DIR}/cmake/scripts/run_test.cmake
         WORKING_DIRECTORY ${_test_directory}
index 9226c5e2ac9f246b631b07c202068075d3837f82..bd27351144491436c922a98fe0b8cf04e1af3b98 100644 (file)
 # If TEST_PICKUP_REGEX is set, only tests matching the regex will be
 # processed.
 #
+# If TEST_OVERRIDE_LOCATION is set, a comparison file category/test.output
+# will be substituted by ${TEST_OVERRIDE_LOCATION}/category/test.output if
+# the latter exists.
+#
 # Usage:
 #     DEAL_II_PICKUP_TESTS()
 #
@@ -69,9 +73,22 @@ MACRO(DEAL_II_PICKUP_TESTS)
       ENDIF()
     ENDFOREACH()
 
+    #
+    # Respect TEST_OVERRIDE_LOCATION:
+    #
+
+    SET(_add_output)
+    IF(EXISTS ${TEST_OVERRIDE_LOCATION}/${_category}/${_test})
+      SET(_add_output
+        "Note: Default comparison file ${_comparison} overriden by"
+        "${TEST_OVERRIDE_LOCATION}/${_category}/${_test}"
+        )
+      SET(_comparison "${TEST_OVERRIDE_LOCATION}/${_category}/${_test}")
+    ENDIF()
+
     IF(_define_test)
       STRING(REGEX REPLACE "\\..*" "" _test ${_test})
-      DEAL_II_ADD_TEST(${_category} ${_test} ${_comparison})
+      DEAL_II_ADD_TEST(${_category} ${_test} ${_comparison} ${_add_output})
     ENDIF()
 
   ENDFOREACH()
index 89edef1be31bf1b83c01ffb53933883833d138c3..981c8508c71993c78b78aafcf3d2b8b3a47826fe 100644 (file)
@@ -28,6 +28,8 @@
 #            (return value 0)
 #            Possible values are CONFIGURE, BUILD, RUN, DIFF, PASSED
 #
+#   ADDITIONAL_OUTPUT - A list of additional output lines that should be printed
+#
 
 IF("${EXPECT}" STREQUAL "")
   SET(EXPECT "PASSED")
@@ -66,6 +68,10 @@ ENDIF()
 # Print out the test result:
 #
 
+FOREACH(_line ${ADDITIONAL_OUTPUT})
+  MESSAGE("Test ${TEST}: ${_line}")
+ENDFOREACH()
+
 MESSAGE("Test ${TEST}: ${_stage}")
 MESSAGE("===============================   OUTPUT BEGIN  ===============================")
 
index e9a250e0e404a5dd5f346fa8e106fac016afca0c..cd334b751ea5877f7daf67689e653a8a24ac1f47 100644 (file)
@@ -29,8 +29,9 @@
 # environment or command line:
 #
 #     TEST_DIFF
-#     TEST_TIME_LIMIT
+#     TEST_OVERRIDE_LOCATION
 #     TEST_PICKUP_REGEX
+#     TEST_TIME_LIMIT
 #
 
 #
@@ -50,6 +51,7 @@ SET_IF_EMPTY(DEAL_II_SOURCE_DIR $ENV{DEAL_II_SOURCE_DIR})
 SET_IF_EMPTY(TEST_DIFF $ENV{TEST_DIFF})
 SET_IF_EMPTY(TEST_TIME_LIMIT $ENV{TEST_TIME_LIMIT})
 SET_IF_EMPTY(TEST_PICKUP_REGEX $ENV{TEST_PICKUP_REGEX})
+SET_IF_EMPTY(TEST_OVERRIDE_LOCATION $ENV{TEST_OVERRIDE_LOCATION})
 
 #
 # We need deal.II and Perl as external packages:
index 31573f99e818699420ae8aaae65aed2491d67d44..9eb8dd343b78231ee47e6cdf376cd9ed86a51d72 100644 (file)
       calling <code>make setup_tests</code>:
       <pre>
 
-    TEST_PICKUP_REGEX
-      - A regular expression to select only a subset of tests during setup.
-        An empty string is interpreted as a catchall (this is the default).
-
     TEST_DIFF
       - The diff tool and command line to use for comparison. If numdiff is
         available it defaults to "numdiff -a 1e-6 -q", otherwise plain diff
     TEST_TIME_LIMIT
       - The time limit (in seconds) a single test is allowed to take. Defaults
         to 180 seconds
+
+    TEST_PICKUP_REGEX
+      - A regular expression to select only a subset of tests during setup.
+        An empty string is interpreted as a catchall (this is the default).
+
+    TEST_OVERRIDE_LOCATION
+      - If TEST_OVERRIDE_LOCATION is set, a comparison file category/test.output
+        will be substituted by ${TEST_OVERRIDE_LOCATION}/category/test.output if
+        the latter exists.
       </pre>
     </p>
 

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.