1## Process this file with automake to produce Makefile.in 2 3tests: 4 @echo '## Running docbook tests' 5 $(MAKE) single 6 $(MAKE) xtchunk 7 8valgrind: 9 @echo '## Running the regression tests under Valgrind' 10 $(MAKE) CHECKER='valgrind -q' tests 11 12$(top_builddir)/xsltproc/xsltproc: 13 @(cd ../../xsltproc ; $(MAKE) xsltproc) 14 15EXTRA_DIST = README VERSION 16 17CLEANFILES = .memdump 18 19full: tests htmltests xhtmltests fotests 20 21# 22# a single tests to check that stuff ain't broken 23# 24single: 25 @$(MKDIR_P) result/html 26 @$(MKDIR_P) result/fo 27 @$(MKDIR_P) result/xhtml 28 @(echo > .memdump) 29 @(for i in $(srcdir)/test/gdp-handbook.xml ; do \ 30 echo -n "`basename $$i` : html " ; \ 31 out=result/html/`basename $$i .xml`.tst; \ 32 html=result/html/`basename $$i .xml`.html; \ 33 log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc --nonet \ 34 $(srcdir)/html/docbook.xsl $$i > $$out ; \ 35 if [ -f $(srcdir)/$$html ] ; then \ 36 grep -v id < $(srcdir)/$$html > $$html.noid ; \ 37 grep -v id < $$out > $$out.noid ; \ 38 diff $$html.noid $$out.noid ; \ 39 rm -f $$html.noid $$out.noid ; \ 40 else \ 41 mv $$out $(srcdir)/$$html ; \ 42 fi ; \ 43 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true` ; \ 44 if [ -n "$$log" ] ; then \ 45 echo ; \ 46 echo result ; \ 47 echo "$$log" ; \ 48 fi ; \ 49 rm -f $$out ; \ 50 echo -n "fo " ; \ 51 out=result/fo/`basename $$i .xml`.tst; \ 52 fo=result/fo/`basename $$i .xml`.fo; \ 53 msg=result/fo/`basename $$i .xml`.msg; \ 54 log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc --nonet \ 55 $(srcdir)/fo/docbook.xsl $$i > $$out 2> $$msg ; \ 56 if [ -f $(srcdir)/$$fo ] ; then \ 57 grep -v id < $(srcdir)/$$fo > $$fo.noid ; \ 58 grep -v id < $$out > $$out.noid ; \ 59 diff $$fo.noid $$out.noid ; \ 60 rm -f $$fo.noid $$out.noid ; \ 61 else \ 62 mv $$out $(srcdir)/$$fo ; \ 63 fi ; \ 64 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true` ; \ 65 if [ -n "$$log" ] ; then \ 66 echo ; \ 67 echo result ; \ 68 echo "$$log" ; \ 69 fi ; \ 70 rm -f $$out $$msg ; \ 71 echo -n "xhtml " ; \ 72 out=result/xhtml/`basename $$i .xml`.tst; \ 73 xhtml=result/xhtml/`basename $$i .xml`.xhtml; \ 74 log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc --nonet \ 75 $(srcdir)/xhtml/docbook.xsl $$i > $$out ; \ 76 if [ -f $(srcdir)/$$xhtml ] ; then \ 77 grep -v id < $(srcdir)/$$xhtml > $$xhtml.noid ; \ 78 grep -v id < $$out > $$out.noid ; \ 79 diff $$xhtml.noid $$out.noid ; \ 80 rm -f $$xhtml.noid $$out.noid ; \ 81 else \ 82 mv $$out $(srcdir)/$$xhtml ; \ 83 fi ; \ 84 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true` ; \ 85 if [ -n "$$log" ] ; then \ 86 echo ; \ 87 echo result ; \ 88 echo "$$log" ; \ 89 fi ; \ 90 rm -f $$out ; \ 91 done ) 92 @echo 93 94xtchunk: 95 @$(MKDIR_P) result/html 96 @$(MKDIR_P) result/xtchunk 97 @(echo > .memdump) 98 @echo -n html-chunking 99 @(for i in $(srcdir)/test/gdp-handbook.xml ; do \ 100 base=`basename $$i .xml` ; \ 101 html=result/html/$$base.html; \ 102 log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc \ 103 -o result/xtchunk/html/gdp-handbook \ 104 $(srcdir)/html/xtchunk.xsl $$i 2> $$base.err ; \ 105 if [ -f $(srcdir)/result/html/$$base.err ] ; then \ 106 diff $(srcdir)/result/html/$$base.err $$base.err ; \ 107 rm $$base.err ; \ 108 else \ 109 mv $$base.err $(srcdir)/result/html/$$base.err ; \ 110 fi ; \ 111 for html in result/xtchunk/html/*.html ; do \ 112 orig=result/xtchunk/html/\`basename $$html .html\`.orig ;\ 113 if [ -f $(srcdir)/$$orig ] ; then \ 114 grep -v id < $$html > $$html.noid ; \ 115 grep -v id < $(srcdir)/$$orig > $$orig.noid ; \ 116 diff $$orig.noid $$html.noid ; \ 117 rm -f $$html.noid $$orig.noid $$html; \ 118 else \ 119 mv $$html $(srcdir)/$$orig ; \ 120 fi ; \ 121 done ; \ 122 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true` ; \ 123 if [ -n "$$log" ] ; then \ 124 echo ; \ 125 echo result ; \ 126 echo "$$log" ; \ 127 fi ; \ 128 rm -f result/xtchunk/html/gdp-handbook ; \ 129 done ) 130 @echo 131 132# 133# The full set of tests 134# 135htmltests: $(top_builddir)/xsltproc/xsltproc 136 @$(MKDIR_P) result/html 137 @(echo > .memdump) 138 @echo "##" 139 @echo "## HTML stylesheets regression tests" 140 @echo "##" 141 @(for i in $(srcdir)/test/*.xml ; do \ 142 echo $$i ; \ 143 out=result/html/`basename $$i .xml`.tst; \ 144 html=result/html/`basename $$i .xml`.html; \ 145 $(CHECKER) $(top_builddir)/xsltproc/xsltproc --nonet $(srcdir)/html/docbook.xsl $$i > $$out ; \ 146 if [ -f $(srcdir)/$$html ] ; then \ 147 grep -v id < $(srcdir)/$$html > $$html.noid ; \ 148 grep -v id < $$out > $$out.noid ; \ 149 diff $$html.noid $$out.noid ; \ 150 rm -f $$html.noid $$out.noid ; \ 151 else mv $$out $(srcdir)/$$html ; fi ; \ 152 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\ 153 rm -f $$out ; done ) 154 155fotests: $(top_builddir)/xsltproc/xsltproc 156 @$(MKDIR_P) result/fo 157 @(echo > .memdump) 158 @echo "##" 159 @echo "## XSL FO stylesheets regression tests" 160 @echo "##" 161 @(for i in $(srcdir)/test/*.xml ; do \ 162 echo $$i ; \ 163 out=result/fo/`basename $$i .xml`.tst; \ 164 fo=result/fo/`basename $$i .xml`.fo; \ 165 msg=result/fo/`basename $$i .xml`.msg; \ 166 $(CHECKER) $(top_builddir)/xsltproc/xsltproc --nonet $(srcdir)/fo/docbook.xsl $$i > $$out 2> $$msg ; \ 167 if [ -f $(srcdir)/$$fo ] ; then \ 168 grep -v id < $(srcdir)/$$fo > $$fo.noid ; \ 169 grep -v id < $$out > $$out.noid ; \ 170 diff $$fo.noid $$out.noid ; \ 171 rm -f $$fo.noid $$out.noid ; \ 172 else mv $$out $(srcdir)/$$fo ; fi ; \ 173 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\ 174 rm -f $$out $$msg ; \ 175 done ) 176 177xhtmltests: $(top_builddir)/xsltproc/xsltproc 178 @$(MKDIR_P) result/xhtml 179 @(echo > .memdump) 180 @echo "##" 181 @echo "## XHTML stylesheets regression tests" 182 @echo "##" 183 @(for i in $(srcdir)/test/*.xml ; do \ 184 echo $$i ; \ 185 out=result/xhtml/`basename $$i .xml`.tst; \ 186 xhtml=result/xhtml/`basename $$i .xml`.xhtml; \ 187 $(CHECKER) $(top_builddir)/xsltproc/xsltproc --nonet $(srcdir)/xhtml/docbook.xsl $$i > $$out ; \ 188 if [ -f $(srcdir)/$$xhtml ] ; then \ 189 grep -v id < $(srcdir)/$$xhtml > $$xhtml.noid ; \ 190 grep -v id < $$out > $$out.noid ; \ 191 diff $$xhtml.noid $$out.noid ; \ 192 rm -f $$xhtml.noid $$out.noid ; \ 193 else mv $$out $(srcdir)/$$xhtml ; fi ; \ 194 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\ 195 rm -f $$out ; done ) 196 197dist-hook: 198 @(cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn common html dtd lib xhtml fo doc images template htmlhelp result test) | (cd $(distdir); tar xf -) 199