Add first test files for solr-pz2 XSL
[pazpar2-moved-to-github.git] / etc / xsl / test_xsl.sh
1 #!/bin/sh
2 res=0
3 for x in *.xsl; do
4     t=`basename $x .xsl`
5     if test ! -f ${t}1.xml; then
6         continue
7     fi
8     echo "$t"
9     for m in ${t}?.xml; do
10         b=`basename $m .xml`
11         l=$b.log.xml
12         r=$b.res.xml
13         d=$b.dif
14         xsltproc $x $m >$l
15         if test -f $r; then
16             if diff $l $r >$d; then
17                 rm $d
18             else
19                 echo "$b: FAIL; check $d"
20                 res=1
21             fi
22         else
23             echo "$b: making $r for the first time"
24             mv $l $r
25             res=1
26         fi
27     done
28 done
29 exit $res