]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Modify check rule such that it a/ becomes simpler, b/ is extendible for automatic...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 10 Apr 2001 22:54:52 +0000 (22:54 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 10 Apr 2001 22:54:52 +0000 (22:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@4424 0785d39b-7218-0410-832d-ea1e28bc413d

tests/Makefile.rules

index ec539e37f6e19aa5d3d6579ab9868e479cfa2607..e3569bd10884b262b48676bbd38fe02c4f825a70 100644 (file)
@@ -1,9 +1,10 @@
 ######################################################################
 # $Id$
 #
-# Copyright (C) 201, the deal.II authors
+# Copyright (C) 2001, the deal.II authors
 #
-# Common make rules for test files
+# Common make rules for test files. To be included by the Makefiles
+# in the subdirectories.
 ######################################################################
 
 
@@ -12,33 +13,54 @@ normalize = $D/common/scripts/normalize.pl
 verbose = off
 
 ############################################################
-# Postprocessing
+# First how to create output: by simply running a program.
+# Note that we normalize output to a few digits after
+# the decimal punct, in order to be able to check across
+# different platforms where we might differ in round-off etc.
 ############################################################
 
-%.output:%.testcase
+%.output : %.testcase
        @echo =====Running======= $<
        @./$<
        @perl -pi $(normalize)  $@
 
-ifeq ($(verbose),on)
-%.check:%.output
-       @echo '=====Checking======' $< ;
-       @if diff $< $(patsubst %.output,%.checked, $<); then \
-                 echo '=====OK============' $@ ; \
-                 touch $@ ; \
-               else \
-                 echo '+++++Error+++++++++' $@ ; \
-               fi
-else
-%.check:%.output
+
+
+############################################################
+# Postprocessing the output: compare with precomputed
+# files. In default mode, do not show diffs as they are 
+# usually overly verbose. Only if user calls `make' with
+# flag `verbose=on' show the diffs. Also note that we
+# usually let the call to `make# continue even if we
+# find a difference, since the output is clearly marked
+# as a failing test and we normally want to see the results
+# of all tests at once, including those that come after
+# the failed one.
+#
+# if, however, the flag `stop_on_error=on' was given, the
+# check command fails whenever teh output differs from the
+# precomputed file.
+############################################################
+
+
+%.check : %.output
        @echo '=====Checking======' $< ;
-       @if diff $< $(patsubst %.output,%.checked, $<) > /dev/null ; then \
-                 echo '=====OK============' $@ ; \
-                 touch $@ ; \
-               else \
-                 echo '+++++Error+++++++++' $@ '   details with "make verbose=on"'; \
-               fi
-endif
+       @if test "x$verbose" = "xon" then \
+               cmd="diff $< $(patsubst %.output,%.checked, $<)" ; \
+        else \
+               cmd="diff $< $(patsubst %.output,%.checked, $<) > /dev/null" ; \
+        fi ; \
+        if eval $$cmd ; then \
+               echo '=====OK============' $@ ; \
+               touch $@ ; \
+        else \
+               echo '+++++Error+++++++++' $@ ; \
+               if test "x$stop_on_error" = "xon" ; then \
+                       false ; \
+               fi ; \
+        fi
+
+
 
 ############################################################
 # Cleanup targets

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.