zoom: cache hit count
[yaz-moved-to-github.git] / test / test_icu.sh
1 #!/bin/sh
2 # Tests a couple of yaz-icu conversions
3
4 # Reads tsticu-[0-9].input files
5 # Writes tsticu-[0-9].output / output.tmp files
6 # Config tsticu-[0-9].xml
7
8 srcdir=${srcdir:-.}
9 ecode=0
10
11 ../util/yaz-icu >/dev/null 2>&1
12 if test $? = "3"; then
13     exit 0
14 fi
15
16 for f in ${srcdir}/test_icu.[0-9].input; do
17     fb=`basename ${f} .input`
18     CONFIG=${srcdir}/${fb}.xml
19     NEW=${fb}.output.tmp
20     OLD=${srcdir}/${fb}.output
21     DIFF=`basename ${fb}`.diff
22     ../util/yaz-icu -c $CONFIG <$f > $NEW
23     if test $? != "0"; then
24         echo "$f: yaz-icu returned error"
25         ecode=1
26     elif test -f $OLD; then
27         if diff $OLD $NEW >$DIFF; then
28             rm $DIFF
29             rm $NEW
30         else
31             echo "$f: $NEW and $OLD differ"
32             ecode=1
33         fi
34     else
35         echo "$f: Making test result $OLD for the first time"
36         mv $NEW $OLD
37         ecode=1
38     fi
39 done
40 exit $ecode
41
42 # Local Variables:
43 # mode:shell-script
44 # sh-indentation: 2
45 # sh-basic-offset: 4
46 # End: