2 # Tests reading of ISO2709 and checks that we get identical MARCXML
4 # Reads marc?.marc files , Generates marc*.xml files
5 # If Libxml2 is present, the marc*.xml files are parsed again..
9 ../util/yaz-marcdump -i marcxml >/dev/null 2>&1
10 if test $? = "3"; then
14 for f in ${srcdir}/marc[0-9].marc; do
15 fb=`basename ${f} .marc`
16 CHR=${srcdir}/${fb}.chr
18 OLD=${srcdir}/${fb}.xml
19 DIFF=`basename ${f}`.diff
20 ../util/yaz-marcdump -f `cat $CHR` -t utf-8 -o marcxml $f > $NEW
21 if test $? != "0"; then
22 echo "$f: yaz-marcdump returned error"
24 elif test -f $OLD; then
25 if diff $OLD $NEW >$DIFF; then
29 echo "$f: $NEW and $OLD differ"
33 echo "$f: Making test result $OLD for the first time"
34 if test -x /usr/bin/xmllint; then
35 if xmllint --noout $NEW >out 2>stderr; then
36 echo "$f: $NEW is well-formed"
39 echo "$f: $NEW not well-formed"
43 echo "xmllint not found. install libxml2-utils"
48 if test -z "$noxml"; then
51 NEW=`basename ${f}`.new.marc
52 DIFF=`basename ${f}`.diff
53 ../util/yaz-marcdump -f utf-8 -t utf-8 -i marcxml -o marc $f > $NEW
54 if test $? != "0"; then
55 echo "Failed decode of $f"
57 elif test -f $OLD; then
58 if diff $OLD $NEW >$DIFF; then
62 echo "$f: $NEW and $OLD Differ"
66 echo "$f: Making test result $OLD for the first time"