From 441db61ef6017bb23a16a7cdb2dc51b489910b53 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 30 Mar 2015 22:04:41 +0200 Subject: [PATCH] Testsuite: Cosmetic changes --- cmake/macros/macro_deal_ii_add_test.cmake | 28 +++++++++---------- cmake/macros/macro_deal_ii_pickup_tests.cmake | 22 ++++++--------- 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index dcaf5408b9..11134b6c8f 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -16,13 +16,14 @@ # # A Macro to set up tests for the testsuite # -# This macro assumes that a source file "./tests/category/.cc" -# as well as the 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} diff --git a/cmake/macros/macro_deal_ii_pickup_tests.cmake b/cmake/macros/macro_deal_ii_pickup_tests.cmake index 2ecbe1da75..b80d51eb06 100644 --- a/cmake/macros/macro_deal_ii_pickup_tests.cmake +++ b/cmake/macros/macro_deal_ii_pickup_tests.cmake @@ -33,6 +33,10 @@ # - 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() -- 2.39.5