# Makefile,v 1.14 2002/09/19 13:53:47 wolf Exp
# Common Makefile for all test directories
-all: compare base lac fe deal.II multigrid bits
+all: base lac fe deal.II multigrid bits
-base: compare abort.o
+base: abort.o
cd base ; $(MAKE)
-lac: compare abort.o
+lac: abort.o
cd lac ; $(MAKE)
-fe: compare abort.o
+fe: abort.o
cd fe ; $(MAKE)
-bits: compare abort.o
+bits: abort.o
cd bits ; $(MAKE)
-deal.II: compare abort.o
+deal.II: abort.o
cd deal.II ; $(MAKE)
-multigrid: compare abort.o
+multigrid: abort.o
cd multigrid ; $(MAKE)
-report: compare abort.o
+report: abort.o
@for i in base lac fe deal.II multigrid bits all-headers ; do \
echo =======Report: $$i ======= ; \
cd $$i ; $(MAKE) report ; cd .. ; \
done
-report+mail: compare abort.o
+report+mail: abort.o
@for i in base lac fe deal.II multigrid bits all-headers ; do \
echo =======Report: $$i ======= ; \
cd $$i ; $(MAKE) report+mail ; cd .. ; \
-# generate a link to system specific test program output. we create
-# the name out of the system and compiler. unfortunately, for intel
-# compilers, the variable $(GXX-VERSION) reads intel_icc7.1 (with
-# proper version number), while for some historic reason we have named
-# the directories in the results/ tree with just icc7.1 (i.e. without
-# the preceding intel_). Thus, strip this part of the compiler name
-#
-# We declare this target as PHONY since we want it to re-run every time we
-# start the testsuite. Reason being that this way we can make sure that all
-# the proper links have been set for this run, even if some new tests have
-# been added.
-compare:
- cd results; $(MAKE)
- rm -f compare
- ln -s results/$(TARGET)+$(GXX-VERSION:intel_%=%) compare
-.PHONY: compare
-
resultname:
@echo $(TARGET)+$(GXX-VERSION)
verbose = off
+
+PLATFORM = $(TARGET)+$(GXX-VERSION:intel_%=%)
+PLATFORM-HIERARCHY = $(shell $(PERL) ../hierarchy.pl $(PLATFORM))
+
############################################################
# First how to create executables, including all necessary
# flags:
# 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
+# 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
# if, however, the flag `stop_on_error=on' was given, the
# check command fails whenever teh output differs from the
# precomputed file.
+#
+# as to finding which output file to compare with: we simply
+# walk the list of files created by the ./hierarchy.pl file
+# and take the first one.
############################################################
%/OK : %/output
@echo '=====Checking======' $<
- @perl -pi $(normalize) $<
- @if test "x$(verbose)" = "xon" ; then \
- cmd="diff -w $< ../compare/$(WORKDIR)/$(<:%/output=%).output" ; \
- else \
- cmd="diff -w $< ../compare/$(WORKDIR)/$(<:%/output=%).output > /dev/null" ; \
- fi ; \
- if eval $$cmd ; then \
- echo '=====OK============' $@ ; \
- touch $@ ; \
- else \
+ @$(PERL) -pi $(normalize) $<
+ @for i in $(PLATFORM-HIERARCHY) ; do \
+ testname=$(<:%/output=%) ; \
+ if test -f $$testname/cmp/$$i ; then \
+ cmpfile_found=yes ; \
if test "x$(verbose)" = "xon" ; then \
- echo '+++++Error+++++++++' $@ ; \
- else \
- echo '+++++Error+++++++++ $@. Use make verbose=on for the diffs' ; \
- fi ; \
- if test "x$(stop_on_error)" = "xon" ; then \
- false ; \
- fi ; \
- fi
+ cmd="diff -w $< $$testname/cmp/$$i" ; \
+ else \
+ cmd="diff -w $< $$testname/cmp/$$i > /dev/null" ; \
+ fi ; \
+ if eval $$cmd ; then \
+ echo '=====OK============' $@ ; \
+ touch $@ ; \
+ else \
+ if test "x$(verbose)" = "xon" ; then \
+ echo '+++++Error+++++++++' $@ ; \
+ else \
+ echo '+++++Error+++++++++ $@. Use make verbose=on for the diffs' ; \
+ fi ; \
+ if test "x$(stop_on_error)" = "xon" ; then \
+ false ; \
+ fi ; \
+ fi ; \
+ break ; \
+ fi ; \
+ done && \
+ if test "x$$cmpfile_found" != "xyes" ; then \
+ echo "*** No suitable file in $$testname/cmp found! ***" ; \
+ false ; \
+ fi
############################################################
.PHONY: report show-tests clean distclean
subdirs:
- for i in $(tests) ; do mkdir $$i ; cvs add $$i ; echo "obj.* exe OK output" > $$i/.cvsignore ; cvs add $$i/.cvsignore ; done
+ for i in $(tests) ; do \
+ mkdir $$i/cmp ; \
+ cp ../results/i686-pc-linux-gnu+gcc3.2/bits/$$i.output $$i/cmp/generic ; \
+ cp ../results/i686-pc-linux-gnu+gcc3.4/bits/$$i.output $$i/cmp/i686-pc-linux-gnu+gcc3.4 ; \
+ cp ../results/i686-pc-linux-gnu+gcc4.0/bits/$$i.output $$i/cmp/i686-pc-linux-gnu+gcc4.0 ; \
+ cp ../results/i686-pc-linux-gnu+gcc4.1/bits/$$i.output $$i/cmp/i686-pc-linux-gnu+gcc4.1 ; \
+ cp ../results/i686-pc-linux-gnu+icc7.1/bits/$$i.output $$i/cmp/i686-pc-linux-gnu+icc7.1 ; \
+ cp ../results/mips-sgi-irix6.5+MIPSpro7.4/bits/$$i.output $$i/cmp/mips-sgi-irix6.5+MIPSpro7.4 ; \
+ cp ../results/x86_64-unknown-linux-gnu+gcc3.3/bits/$$i.output $$i/cmp/x86_64-unknown-linux-gnu+gcc3.3 ; \
+ cd $$i/cmp ; \
+ for j in [imx]* ; do \
+ if diff -q $$j generic ; then rm $$j ; fi ; done ; \
+ cd ../.. ; \
+ done