From 54ff6d201b630b3af6211057e392417e40f3c3ea Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 30 Apr 2014 10:22:27 +0200 Subject: [PATCH] New, generic, test_xsl script --- etc/xsl/Makefile.am | 4 ++-- etc/xsl/test_tmarc.sh | 22 ---------------------- etc/xsl/test_xsl.sh | 29 +++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 24 deletions(-) delete mode 100755 etc/xsl/test_tmarc.sh create mode 100755 etc/xsl/test_xsl.sh 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 -- 1.7.10.4