]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Testsuite: Cosmetic changes
authorMatthias Maier <tamiko@43-1.org>
Mon, 30 Mar 2015 20:04:41 +0000 (22:04 +0200)
committerMatthias Maier <tamiko@43-1.org>
Mon, 30 Mar 2015 20:40:06 +0000 (22:40 +0200)
cmake/macros/macro_deal_ii_add_test.cmake
cmake/macros/macro_deal_ii_pickup_tests.cmake

index dcaf5408b94fd38fd6af091df92c1e9294502236..11134b6c8f2a6b631f94d3d21d1709f220b7078f 100644 (file)
 #
 # A Macro to set up tests for the testsuite
 #
-# This macro assumes that a source file "./tests/category/<test_name>.cc"
-# as well as the comparison file "<comparison_file>" is available in the
-# testsuite. The output of compiled source file is compared against the
-# file comparison file.
+# This macro assumes that a source file "${test_name}.cc" as well as the
+# comparison file "${comparison_file}" is available in the testsuite. The
+# output of the compiled source file is compared against the file
+# comparison file.
 #
-# For every deal.II build type (given by the variable DEAL_II_BUILD_TYPES) that
-# is a (case insensitive) substring of CMAKE_BUILD_TYPE a test is defined.
+# For every deal.II build type (given by the variable DEAL_II_BUILD_TYPES)
+# that is a (case insensitive) substring of CMAKE_BUILD_TYPE a test is
+# defined.
 #
 # This macro gets the following options from the comparison file name (have
 # a look at the testsuite documentation for details):
@@ -32,8 +33,9 @@
 #
 # The following variables must be set:
 #
-#   TEST_DIFF
-#     - specifying the executable and command line of the diff command to use
+#   NUMDIFF_EXECUTABLE, DIFF_EXECUTABLE
+#     - pointing to valid diff executables. If NUMDIFF_EXECUTABLE is not
+#       "numdiff" it will be ignored and DIFF_EXECUTABLE is used instead.
 #
 #   TEST_TIME_LIMIT
 #     - specifying the maximal wall clock time in seconds a test is allowed
@@ -65,7 +67,6 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
   #
   # Determine valid build configurations for this test:
   #
-
   SET(_configuration)
   IF(_file MATCHES "\\.debug\\.")
     SET(_configuration DEBUG)
@@ -77,7 +78,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
   # A "binary" in the output file indicates binary output. In this case we
   # have to switch to plain diff instead of (possibly) numdiff, which can
   # only work on plain text files.
-
+  #
   IF(_file MATCHES "\\.binary\\.")
     SET(_test_diff ${DIFF_EXECUTABLE})
   ELSE()
@@ -87,7 +88,6 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
   #
   # Determine whether the test should be run with mpirun:
   #
-
   STRING(REGEX MATCH "mpirun=([0-9]*)" _n_cpu ${_file})
   IF("${_n_cpu}" STREQUAL "")
     SET(_n_cpu 0) # 0 indicates that no mpirun should be used
@@ -98,7 +98,6 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
   #
   # Determine the expected build stage of this test:
   #
-
   STRING(REGEX MATCH "expect=([a-z]*)" _expect ${_file})
   IF("${_expect}" STREQUAL "")
     SET(_expect "PASSED")
@@ -157,10 +156,9 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
 
       #
       # Add an executable for the current test and set up compile
-      # definitions and the full link interface:
+      # definitions and the full link interface. Only add the target once.
       #
       IF(NOT TARGET ${_target})
-        # only add the target once
 
         #
         # Add a "guard file" rule: The purpose of interrupt_guard.cc is to
@@ -232,7 +230,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
         )
 
       #
-      # And finally add the test:
+      # And finally define the test:
       #
 
       ADD_TEST(NAME ${_test_full}
index 2ecbe1da758260c31b681ecb9d51f3679adbbe63..b80d51eb0602f3d73650e2cc80e91032981c6f40 100644 (file)
 #       - specifying the maximal wall clock time in seconds a test is
 #         allowed to run
 #
+# Either numdiff (if available), or diff are used for the comparison of
+# test results. Their location can be specified with NUMDIFF_DIR and
+# DIFF_DIR.
+#
 # Usage:
 #     DEAL_II_PICKUP_TESTS()
 #
@@ -70,15 +74,11 @@ MACRO(DEAL_II_PICKUP_TESTS)
   ENDIF()
 
   #
-  # We need perl:
+  # Necessary external interpreters and programs:
   #
 
   FIND_PACKAGE(Perl REQUIRED)
 
-  #
-  # We need a diff tool, preferably numdiff:
-  #
-
   FIND_PROGRAM(DIFF_EXECUTABLE
     NAMES diff
     HINTS ${DIFF_DIR}
@@ -117,18 +117,12 @@ MACRO(DEAL_II_PICKUP_TESTS)
   SET_IF_EMPTY(TEST_TIME_LIMIT 600)
 
   #
-  # Enable testing...
+  # ... and finally pick up tests:
   #
 
   ENABLE_TESTING()
 
-  #
-  # ... and finally pick up tests:
-  #
-
   SET_IF_EMPTY(TEST_PICKUP_REGEX "$ENV{TEST_PICKUP_REGEX}")
-
-
   GET_FILENAME_COMPONENT(_category ${CMAKE_CURRENT_SOURCE_DIR} NAME)
 
   SET(DEAL_II_SOURCE_DIR) # avoid a bogus warning
@@ -150,7 +144,7 @@ MACRO(DEAL_II_PICKUP_TESTS)
     ENDIF()
 
     #
-    # Respect compiler constraint:
+    # Respect compiler constraints:
     #
 
     STRING(REGEX MATCHALL
@@ -225,7 +219,7 @@ The feature \"DEAL_II_${_feature}\" does not exist.\n"
 
     IF(_define_test)
       STRING(REGEX REPLACE "\\..*" "" _test ${_test})
-      DEAL_II_ADD_TEST(${_category} ${_test} ${_comparison} ${_add_output})
+      DEAL_II_ADD_TEST(${_category} ${_test} ${_comparison})
     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.