New, generic, test_xsl script
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 30 Apr 2014 08:22:27 +0000 (10:22 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 30 Apr 2014 08:22:27 +0000 (10:22 +0200)
etc/xsl/Makefile.am
etc/xsl/test_tmarc.sh [deleted file]
etc/xsl/test_xsl.sh [new file with mode: 0755]

index 397ad2a..e2db1fb 100644 (file)
@@ -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 (executable)
index e792cf1..0000000
+++ /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 (executable)
index 0000000..cd1a6ba
--- /dev/null
@@ -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