2 # $Id: tstmarciso.sh,v 1.5 2007-01-18 11:44:50 adam Exp $
3 # Tests reading of ISO2709 and checks that we get identical MARCXML
5 # Reads marc?.marc files , Generates marc?.xml files
8 for f in ${srcdir}/marc?.marc; do
9 fb=`basename ${f} .marc`
10 CHR=${srcdir}/${fb}.chr
12 OLD=${srcdir}/${fb}.xml
13 DIFF=`basename ${f}`.diff
14 ../util/yaz-marcdump -f `cat $CHR` -t utf-8 -o marcxml $f > $NEW
15 if test $? != "0"; then
16 echo "$f: yaz-marcdump returned error"
18 elif test -f $OLD; then
19 if diff $OLD $NEW >$DIFF; then
23 echo "$f: $NEW and $OLD differ"
27 echo "$f: Making test result $OLD for the first time"
28 if test -x /usr/bin/xmllint; then
29 if xmllint --noout $NEW >out 2>stderr; then
30 echo "$f: $NEW is well-formed"
33 echo "$f: $NEW not well-formed"
37 echo "xmllint not found. install libxml2-utils"