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