1## Process this file with automake to produce Makefile.in
2
3$(top_builddir)/xsltproc/xsltproc:
4	@(cd ../../../xsltproc ; $(MAKE) xsltproc)
5
6EXTRA_DIST = 						\
7	highest.1.out  highest.1.xml  highest.1.xsl	\
8	highest.2.out  highest.2.xml  highest.2.xsl	\
9	highest.5.out  highest.5.xml  highest.5.xsl	\
10	lowest.1.out   lowest.1.xml   lowest.1.xsl	\
11	lowest.2.out   lowest.2.xml   lowest.2.xsl	\
12	max.1.out      max.1.xml      max.1.xsl		\
13	max.2.out      max.2.xml      max.2.xsl		\
14	max.3.out      max.3.xml      max.3.xsl		\
15	max.5.out      max.5.xml      max.5.xsl		\
16	power.1.out   power.1.xml    power.1.xsl	\
17	min.1.out      min.1.xml      min.1.xsl		\
18	min.2.out      min.2.xml      min.2.xsl
19
20CLEANFILES = .memdump
21
22valgrind:
23	@echo '## Running the regression tests under Valgrind'
24	$(MAKE) CHECKER='valgrind -q' tests
25
26test tests: $(top_builddir)/xsltproc/xsltproc
27	@echo '## Running exslt math tests'
28	@(echo > .memdump)
29	@(for i in $(srcdir)/*.xsl ; do \
30	  name=`basename $$i .xsl` ; \
31	  if [ ! -f $(srcdir)/$$name.xml ] ; then continue ; fi ; \
32	  log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc \
33		$(srcdir)/$$name.xsl $(srcdir)/$$name.xml > $$name.res 2>$$name.bad;\
34	  if [ ! -f $(srcdir)/$$name.out ] ; then \
35		cp $$name.res $(srcdir)/$$name.out ; \
36		if [ -s $$name.bad ] ; then \
37			mv $$name.bad $(srcdir)/$$name.err ; \
38		fi ; \
39	  else \
40		if  [ ! -s $$name.res ] ; then \
41			echo "Fatal error, no $$name.res\n" ; \
42	  	else \
43			diff $(srcdir)/$$name.out $$name.res ; \
44			if [ -s $(srcdir)/$$name.err ] ; then \
45	  			diff $(srcdir)/$$name.err $$name.bad; \
46			else \
47				diff /dev/null $$name.bad; \
48			fi ; \
49		fi ; \
50	  fi; \
51	  grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0" || true`;\
52	  if [ -n "$$log" ] ; then \
53	  	echo $$name result ; \
54		echo "$$log" ; \
55	  fi ; \
56	  rm -f $$name.res $$name.bad ; \
57	  done)
58