Updates to pz:authentication documentation
[pazpar2-moved-to-github.git] / etc / xsl / test_xsl.sh
1 #!/bin/sh
2 v=`xsltproc --version|head -1|awk '{print $5}'`
3 if test $v -lt 10124; then
4     echo "libxslt is version $v. Skipping test"
5     exit 0
6 fi
7 res=0
8 for x in *.xsl; do
9     t=`basename $x .xsl`
10     if test ! -f ${t}1.xml; then
11         continue
12     fi
13     echo "$t"
14     for m in ${t}?.xml; do
15         b=`basename $m .xml`
16         opt=`grep 'xsltproc:' $m|cut -d: -f2|cut -d- -f1|tr '#' '-'`
17         l=$b.log.xml
18         r=$b.res.xml
19         d=$b.dif
20         xsltproc $opt $x $m >$l
21         if test -f $r; then
22             if diff $l $r >$d; then
23                 rm $d
24             else
25                 echo "$b: FAIL; check $d"
26                 res=1
27             fi
28         else
29             echo "$b: making $r for the first time"
30             mv $l $r
31             res=1
32         fi
33     done
34 done
35 exit $res