From: Adam Dickmeiss Date: Wed, 30 Apr 2014 08:22:27 +0000 (+0200) Subject: New, generic, test_xsl script X-Git-Tag: v1.7.0~16 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=54ff6d201b630b3af6211057e392417e40f3c3ea;p=pazpar2-moved-to-github.git New, generic, test_xsl script --- diff --git a/etc/xsl/Makefile.am b/etc/xsl/Makefile.am index 397ad2a..e2db1fb 100644 --- a/etc/xsl/Makefile.am +++ b/etc/xsl/Makefile.am @@ -1,8 +1,8 @@ TESTS = $(check_SCRIPTS) -check_SCRIPTS = test_tmarc.sh +check_SCRIPTS = test_xsl.sh dist-hook: cp ${srcdir}/*.xml $(distdir) cp ${srcdir}/*.xsl $(distdir) - + diff --git a/etc/xsl/test_tmarc.sh b/etc/xsl/test_tmarc.sh deleted file mode 100755 index e792cf1..0000000 --- a/etc/xsl/test_tmarc.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -res=0 -for m in tmarc?.xml; do - b=`basename $m .xml` - l=$b.log.xml - r=$b.res.xml - d=$b.dif - xsltproc tmarc.xsl $m >$l - if test -f $r; then - if diff $l $r >$d; then - rm $d - else - echo "$b: FAIL; check $d" - res=1 - fi - else - echo "$b: making $r for the first time" - mv $l $r - res=1 - fi -done -exit $res diff --git a/etc/xsl/test_xsl.sh b/etc/xsl/test_xsl.sh new file mode 100755 index 0000000..cd1a6ba --- /dev/null +++ b/etc/xsl/test_xsl.sh @@ -0,0 +1,29 @@ +#!/bin/sh +res=0 +for x in *.xsl; do + t=`basename $x .xsl` + if test ! -f ${t}1.xml; then + continue + fi + echo "$t" + for m in ${t}?.xml; do + b=`basename $m .xml` + l=$b.log.xml + r=$b.res.xml + d=$b.dif + xsltproc $x $m >$l + if test -f $r; then + if diff $l $r >$d; then + rm $d + else + echo "$b: FAIL; check $d" + res=1 + fi + else + echo "$b: making $r for the first time" + mv $l $r + res=1 + fi + done +done +exit $res