test_rpn2cql test_rpn2solr test_json test_xml_include test_file_glob \
test_shared_ptr test_libstemmer
-check_SCRIPTS = tstmarc.sh tstmarccol.sh tstcql2xcql.sh tstcql2pqf.sh tsticu.sh
+check_SCRIPTS = test_marc.sh test_marccol.sh test_cql2xcql.sh \
+ test_cql2pqf.sh test_icu.sh
TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
marccol3.u8.marc marccol3.u8.1.lst marccol3.u8.2.lst \
marccol4.u8.marc marccol4.u8.1.lst marccol4.u8.2.lst \
marccol5.u8.marc marccol5.u8.1.lst marccol5.u8.2.lst \
- tsticu-0.xml tsticu-0.input tsticu-0.output \
- tsticu-1.xml tsticu-1.input tsticu-1.output \
- tsticu-2.xml tsticu-2.input tsticu-2.output \
+ test_icu.0.xml test_icu.0.input test_icu.0.output \
+ test_icu.1.xml test_icu.1.input test_icu.1.output \
+ test_icu.2.xml test_icu.2.input test_icu.2.output \
+ test_icu.3.xml test_icu.3.input test_icu.3.output \
test_record_conv.xsl test_xml_include.xml
YAZCOMP = ../util/yaz-asncomp
--- /dev/null
+#!/bin/sh
+srcdir=${srcdir:-.}
+oIFS="$IFS"
+IFS='
+'
+secno=0
+testno=0
+comment=0
+ecode=0
+test -f ${srcdir}/cql2pqfsample || exit 1
+test -d cql2pqf || mkdir cql2pqf
+for f in `cat ${srcdir}/cql2pqfsample`; do
+ if echo $f | grep '^#' >/dev/null; then
+ comment=1
+ else
+ if test "$comment" = "1"; then
+ secno=`expr $secno + 1`
+ testno=0
+ fi
+ comment=0
+ testno=`expr $testno + 1`
+ OUT1=${srcdir}/cql2pqf/$secno.$testno.out
+ ERR1=${srcdir}/cql2pqf/$secno.$testno.err
+ OUT2=cql2pqf/$secno.$testno.out.tmp
+ ERR2=cql2pqf/$secno.$testno.err.tmp
+ DIFF=cql2pqf/$secno.$testno.diff
+ ../util/cql2pqf ${srcdir}/../etc/pqf.properties "$f" >$OUT2 2>$ERR2
+ if test -f $OUT1 -a -f $ERR1; then
+ if diff $OUT1 $OUT2 >$DIFF; then
+ rm $DIFF
+ rm $OUT2
+ else
+ echo "diff out $secno $testno $f"
+ cat $DIFF
+ ecode=1
+ fi
+ if diff $ERR1 $ERR2 >$DIFF; then
+ rm $DIFF
+ rm $ERR2
+ else
+ echo "diff err $secno $testno $f"
+ cat $DIFF
+ ecode=1
+ fi
+ else
+ echo "making test $secno $testno $f"
+ mv $OUT2 $OUT1
+ mv $ERR2 $ERR1
+ ecode=1
+ fi
+ fi
+done
+IFS="$oIFS"
+exit $ecode
--- /dev/null
+#!/bin/sh
+srcdir=${srcdir:-.}
+oIFS="$IFS"
+IFS='
+'
+secno=0
+testno=0
+comment=0
+ecode=0
+test -f ${srcdir}/cql2xcqlsample || exit 1
+test -d cql || mkdir cql
+for f in `cat ${srcdir}/cql2xcqlsample`; do
+ if echo $f | grep '^#' >/dev/null; then
+ comment=1
+ else
+ if test "$comment" = "1"; then
+ secno=`expr $secno + 1`
+ testno=0
+ fi
+ comment=0
+ testno=`expr $testno + 1`
+ OUT1=${srcdir}/cql/$secno.$testno.out
+ ERR1=${srcdir}/cql/$secno.$testno.err
+ OUT2=cql/$secno.$testno.out.tmp
+ ERR2=cql/$secno.$testno.err.tmp
+ DIFF=cql/$secno.$testno.diff
+ ../util/cql2xcql "$f" >$OUT2 2>$ERR2
+ if test -f $OUT1 -a -f $ERR1; then
+ if diff $OUT1 $OUT2 >$DIFF; then
+ rm $DIFF
+ rm $OUT2
+ else
+ echo "diff out $secno $testno $f"
+ cat $DIFF
+ ecode=1
+ fi
+ if diff $ERR1 $ERR2 >$DIFF; then
+ rm $DIFF
+ rm $ERR2
+ else
+ echo "diff err $secno $testno $f"
+ cat $DIFF
+ ecode=1
+ fi
+ else
+ echo "making test $secno $testno $f"
+ mv $OUT2 $OUT1
+ mv $ERR2 $ERR1
+ ecode=1
+ fi
+ fi
+done
+IFS="$oIFS"
+exit $ecode
--- /dev/null
+Børn
+Le Carré
+Le Carre
+Le Carré
--- /dev/null
+1 1 'børn' 'Børn'
+2 2 'le' 'Le'
+3 2 'carré' 'Carré'
+4 3 'le' 'Le'
+5 3 'carre' 'Carre'
+6 4 'le' 'Le'
+7 4 'carré' 'Carré'
--- /dev/null
+<icu_chain locale="en">
+ <transform rule="[:Control:] Any-Remove"/>
+ <tokenize rule="l"/>
+ <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
+ <display/>
+ <casemap rule="l"/>
+</icu_chain>
--- /dev/null
+Børn
+Le Carré
+Le Carre
+Le Carré
--- /dev/null
+1 1 'børn' 'Børn'
+2 2 'le' 'Le'
+3 2 'carre' 'Carre'
+4 3 'le' 'Le'
+5 3 'carre' 'Carre'
+6 4 'le' 'Le'
+7 4 'carre' 'Carre'
--- /dev/null
+<icu_chain locale="en">
+ <transform rule="[:Control:] Any-Remove"/>
+ <tokenize rule="l"/>
+ <transform rule="NFD; [[:WhiteSpace:][:Punctuation:][:Diacritic:]] Remove"/>
+ <display/>
+ <casemap rule="l"/>
+</icu_chain>
--- /dev/null
+`a'
+``a''
--- /dev/null
+1 1 '‘a'
+' ''
+2 2 '“a''
+' ''
--- /dev/null
+<icu_chain locale="en">
+ <transliterate>
+$back = \` ;
+$back $back > “ ; # generate right d.q.m. (double quotation mark)
+$back > ‘ ;
+ </transliterate>
+</icu_chain>
+
--- /dev/null
+men running
+he runs
--- /dev/null
+1 1 'men' ''
+2 1 'run' ''
+3 2 'he' ''
+4 2 'run' ''
--- /dev/null
+<icu_chain locale="en">
+ <transform rule="[:Control:] Any-Remove"/>
+ <tokenize rule="l"/>
+ <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
+ <casemap rule="l"/>
+ <stemming rule="english" />
+</icu_chain>
--- /dev/null
+#!/bin/sh
+# Tests a couple of yaz-icu conversions
+#
+# Reads tsticu-[0-9].input files
+# Writes tsticu-[0-9].output / output.tmp files
+# Config tsticu-[0-9].xml
+
+srcdir=${srcdir:-.}
+ecode=0
+
+../util/yaz-icu >/dev/null 2>&1
+if test $? = "3"; then
+ exit 0
+fi
+
+for f in ${srcdir}/test_icu.[0-9].input; do
+ fb=`basename ${f} .input`
+ CONFIG=${srcdir}/${fb}.xml
+ NEW=${fb}.output.tmp
+ OLD=${srcdir}/${fb}.output
+ DIFF=`basename ${fb}`.diff
+ ../util/yaz-icu -c $CONFIG <$f > $NEW
+ if test $? != "0"; then
+ echo "$f: yaz-icu returned error"
+ ecode=1
+ elif test -f $OLD; then
+ if diff $OLD $NEW >$DIFF; then
+ rm $DIFF
+ rm $NEW
+ else
+ echo "$f: $NEW and $OLD differ"
+ ecode=1
+ fi
+ else
+ echo "$f: Making test result $OLD for the first time"
+ mv $NEW $OLD
+ ecode=1
+ fi
+done
+exit $ecode
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 2
+# sh-basic-offset: 4
+# End:
--- /dev/null
+#!/bin/sh
+# Tests reading of ISO2709 and checks that we get identical MARCXML
+#
+# Reads marc?.marc files , Generates marc*.xml files
+# If Libxml2 is present, also turbomarc*xml.
+# as well as reverse transformation from *marc*.xml files are parsed again..
+#
+srcdir=${srcdir:-.}
+ecode=0
+
+../util/yaz-marcdump -i marcxml >/dev/null 2>&1
+if test $? = "3"; then
+ noxml=1
+fi
+
+../util/yaz-marcdump -o xml,marcxml >/dev/null 2>&1
+if test $? = "4"; then
+ noxmlwrite=1
+fi
+
+binmarc_convert() {
+ OUTPUT_FORMAT="$1"
+ REVERT_FORMAT="$2"
+ PREFIX="$3"
+ for f in ${srcdir}/marc[0-9].marc; do
+ fb=`basename ${f} .marc`
+ CHR=`cat ${srcdir}/${fb}.chr`
+ NEW=${PREFIX}${fb}.new.xml
+ OLD=${srcdir}/${PREFIX}${fb}.xml
+ DIFF=`basename ${f}`.diff
+ #echo "../util/yaz-marcdump -f $CHR -t utf-8 -i marc -o ${OUTPUT_FORMAT} $f > $NEW"
+ ../util/yaz-marcdump -f $CHR -t utf-8 -i marc -o ${OUTPUT_FORMAT} $f > $NEW
+ if test $? != "0"; then
+ echo "$f: yaz-marcdump returned error"
+ ecode=1
+ elif test -f $OLD; then
+ if diff $OLD $NEW >$DIFF; then
+ rm $DIFF
+ rm $NEW
+ else
+ echo "$f: $NEW and $OLD differ"
+ ecode=1
+ fi
+ else
+ echo "$f: Making test result $OLD for the first time"
+ if test -x /usr/bin/xmllint; then
+ if xmllint --noout $NEW >out 2>stderr; then
+ echo "$f: $NEW is well-formed"
+ mv $NEW $OLD
+ else
+ echo "$f: $NEW not well-formed"
+ ecode=1
+ fi
+ else
+ echo "xmllint not found. install libxml2-utils"
+ ecode=1
+ fi
+ fi
+
+ if test -z "$noxml"; then
+ ORIGINAL=${f}
+ f=$OLD
+ # compare with original (binary) marc record.
+ OLD=${f}.marc
+ NEW=`basename ${f}`.new.marc
+ DIFF=`basename ${f}`.diff
+ #echo "../util/yaz-marcdump -f utf-8 -t utf-8 -i ${REVERT_FORMAT} -o marc $f > $NEW"
+ ../util/yaz-marcdump -f utf-8 -t utf-8 -i ${REVERT_FORMAT} -o marc $f > $NEW
+ if test $? != "0"; then
+ echo "Failed decode of $f"
+ ecode=1
+ elif test -f $OLD; then
+ if diff $OLD $NEW >$DIFF; then
+ rm $DIFF
+ rm $NEW
+ else
+ echo "$f: $NEW and $OLD Differ"
+ ecode=1
+ fi
+ else
+ echo "$f: Making test result $OLD for the first time"
+ mv $NEW $OLD
+ fi
+ # check with original
+ REVERT=`basename ${f}`.marc.revert
+ #../util/yaz-marcdump -f utf-8 -t $CHR -i ${REVERT_FORMAT} -o marc $f > $REVERT
+ #hexdump -cx $REVERT > $REVERT.hex
+ #hexdump -cx $ORIGINAL > $ORIGINAL.hex
+ #diff $REVERT.hex $ORIGINAL.hex > $REVERT.diff
+ fi
+ done
+ return $ecode
+}
+
+binmarc_convert "marcxml" "marcxml" ""
+echo "binmarc -> marcxml: $?"
+
+
+if test -z "$noxmlwrite"; then
+binmarc_convert "xml,marcxml" "marcxml" "xml2"
+echo "binmarc -> marcxml(libxml2): $?"
+fi
+
+binmarc_convert "turbomarc" "turbomarc" "t"
+echo "binmarc -> turbomarc: $?"
+
+if test -z "$noxmlwrite"; then
+binmarc_convert "xml,turbomarc" "turbomarc" "xml2t"
+echo "binmarc -> turbomarc(libxml2): $?"
+fi
+
+exit $ecode
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 2
+# sh-basic-offset: 4
+# End:
--- /dev/null
+#!/bin/sh
+# Tests reading of a bunch of non-roman UTF-8 ISO2709 and see if
+# we can encode it in MARC-8
+#
+# Reads marccol?.u8.marc files , Generates marccol?.u8.{1,2}.lst
+srcdir=${srcdir:-.}
+ecode=0
+for f in ${srcdir}/marccol?.u8.marc; do
+
+ fb=`basename ${f} .marc`
+
+ DIFF=${fb}.1.lst.diff
+ NEW=${fb}.1.lst.new
+ OLD=${srcdir}/${fb}.1.lst
+ ../util/yaz-marcdump -f utf-8 -t utf-8 $f >$NEW
+ if test $? != "0"; then
+ echo "$f: yaz-marcdump returned error"
+ ecode=1
+ break
+ elif test -f $OLD; then
+ if diff $OLD $NEW >$DIFF; then
+ rm $DIFF
+ rm $NEW
+ else
+ echo "$f: $NEW and $OLD differ"
+ ecode=1
+ fi
+ else
+ echo "$f: Making test result $OLD for the first time"
+ mv $NEW $OLD
+ fi
+
+ filem=`echo $fb | sed 's/u8/m8/'`.marc
+ ../util/yaz-marcdump -o marc -f utf8 -t marc8lossless $f >$filem
+
+ DIFF=${fb}.2.lst.diff
+ NEW=${fb}.2.lst.new
+ OLD=${srcdir}/${fb}.2.lst
+ ../util/yaz-marcdump -f marc8 -t utf-8 $filem >$NEW
+ if test $? != "0"; then
+ echo "$f: yaz-marcdump returned error"
+ ecode=1
+ break
+ elif test -f $OLD; then
+ if diff $OLD $NEW >$DIFF; then
+ rm $DIFF
+ rm $NEW
+ rm $filem
+ else
+ echo "$f: $NEW and $OLD differ"
+ ecode=1
+ fi
+ else
+ echo "$f: Making test result $OLD for the first time"
+ mv $NEW $OLD
+ rm $filem
+ fi
+done
+exit $ecode
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 2
+# sh-basic-offset: 4
+# End:
+++ /dev/null
-#!/bin/sh
-srcdir=${srcdir:-.}
-oIFS="$IFS"
-IFS='
-'
-secno=0
-testno=0
-comment=0
-ecode=0
-test -f ${srcdir}/cql2pqfsample || exit 1
-test -d cql2pqf || mkdir cql2pqf
-for f in `cat ${srcdir}/cql2pqfsample`; do
- if echo $f | grep '^#' >/dev/null; then
- comment=1
- else
- if test "$comment" = "1"; then
- secno=`expr $secno + 1`
- testno=0
- fi
- comment=0
- testno=`expr $testno + 1`
- OUT1=${srcdir}/cql2pqf/$secno.$testno.out
- ERR1=${srcdir}/cql2pqf/$secno.$testno.err
- OUT2=cql2pqf/$secno.$testno.out.tmp
- ERR2=cql2pqf/$secno.$testno.err.tmp
- DIFF=cql2pqf/$secno.$testno.diff
- ../util/cql2pqf ${srcdir}/../etc/pqf.properties "$f" >$OUT2 2>$ERR2
- if test -f $OUT1 -a -f $ERR1; then
- if diff $OUT1 $OUT2 >$DIFF; then
- rm $DIFF
- rm $OUT2
- else
- echo "diff out $secno $testno $f"
- cat $DIFF
- ecode=1
- fi
- if diff $ERR1 $ERR2 >$DIFF; then
- rm $DIFF
- rm $ERR2
- else
- echo "diff err $secno $testno $f"
- cat $DIFF
- ecode=1
- fi
- else
- echo "making test $secno $testno $f"
- mv $OUT2 $OUT1
- mv $ERR2 $ERR1
- ecode=1
- fi
- fi
-done
-IFS="$oIFS"
-exit $ecode
+++ /dev/null
-#!/bin/sh
-srcdir=${srcdir:-.}
-oIFS="$IFS"
-IFS='
-'
-secno=0
-testno=0
-comment=0
-ecode=0
-test -f ${srcdir}/cql2xcqlsample || exit 1
-test -d cql || mkdir cql
-for f in `cat ${srcdir}/cql2xcqlsample`; do
- if echo $f | grep '^#' >/dev/null; then
- comment=1
- else
- if test "$comment" = "1"; then
- secno=`expr $secno + 1`
- testno=0
- fi
- comment=0
- testno=`expr $testno + 1`
- OUT1=${srcdir}/cql/$secno.$testno.out
- ERR1=${srcdir}/cql/$secno.$testno.err
- OUT2=cql/$secno.$testno.out.tmp
- ERR2=cql/$secno.$testno.err.tmp
- DIFF=cql/$secno.$testno.diff
- ../util/cql2xcql "$f" >$OUT2 2>$ERR2
- if test -f $OUT1 -a -f $ERR1; then
- if diff $OUT1 $OUT2 >$DIFF; then
- rm $DIFF
- rm $OUT2
- else
- echo "diff out $secno $testno $f"
- cat $DIFF
- ecode=1
- fi
- if diff $ERR1 $ERR2 >$DIFF; then
- rm $DIFF
- rm $ERR2
- else
- echo "diff err $secno $testno $f"
- cat $DIFF
- ecode=1
- fi
- else
- echo "making test $secno $testno $f"
- mv $OUT2 $OUT1
- mv $ERR2 $ERR1
- ecode=1
- fi
- fi
-done
-IFS="$oIFS"
-exit $ecode
+++ /dev/null
-Børn
-Le Carré
-Le Carre
-Le Carré
+++ /dev/null
-1 1 'børn' 'Børn'
-2 2 'le' 'Le'
-3 2 'carré' 'Carré'
-4 3 'le' 'Le'
-5 3 'carre' 'Carre'
-6 4 'le' 'Le'
-7 4 'carré' 'Carré'
+++ /dev/null
-<icu_chain locale="en">
- <transform rule="[:Control:] Any-Remove"/>
- <tokenize rule="l"/>
- <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
- <display/>
- <casemap rule="l"/>
-</icu_chain>
+++ /dev/null
-Børn
-Le Carré
-Le Carre
-Le Carré
+++ /dev/null
-1 1 'børn' 'Børn'
-2 2 'le' 'Le'
-3 2 'carre' 'Carre'
-4 3 'le' 'Le'
-5 3 'carre' 'Carre'
-6 4 'le' 'Le'
-7 4 'carre' 'Carre'
+++ /dev/null
-<icu_chain locale="en">
- <transform rule="[:Control:] Any-Remove"/>
- <tokenize rule="l"/>
- <transform rule="NFD; [[:WhiteSpace:][:Punctuation:][:Diacritic:]] Remove"/>
- <display/>
- <casemap rule="l"/>
-</icu_chain>
+++ /dev/null
-`a'
-``a''
+++ /dev/null
-1 1 '‘a'
-' ''
-2 2 '“a''
-' ''
+++ /dev/null
-<icu_chain locale="en">
- <transliterate>
-$back = \` ;
-$back $back > “ ; # generate right d.q.m. (double quotation mark)
-$back > ‘ ;
- </transliterate>
-</icu_chain>
-
+++ /dev/null
-men running
-he runs
+++ /dev/null
-1 1 'men' ''
-2 1 'run' ''
-3 2 'he' ''
-4 2 'run' ''
+++ /dev/null
-<icu_chain locale="en">
- <transform rule="[:Control:] Any-Remove"/>
- <tokenize rule="l"/>
- <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
- <casemap rule="l"/>
- <stemming rule="english" />
-</icu_chain>
+++ /dev/null
-#!/bin/sh
-# Tests a couple of yaz-icu conversions
-#
-# Reads tsticu-[0-9].input files
-# Writes tsticu-[0-9].output / output.tmp files
-# Config tsticu-[0-9].xml
-
-srcdir=${srcdir:-.}
-ecode=0
-
-../util/yaz-icu >/dev/null 2>&1
-if test $? = "3"; then
- exit 0
-fi
-
-for f in ${srcdir}/tsticu-[0-9].input; do
- fb=`basename ${f} .input`
- CONFIG=${srcdir}/${fb}.xml
- NEW=${fb}.output.tmp
- OLD=${srcdir}/${fb}.output
- DIFF=`basename ${fb}`.diff
- ../util/yaz-icu -c $CONFIG <$f > $NEW
- if test $? != "0"; then
- echo "$f: yaz-icu returned error"
- ecode=1
- elif test -f $OLD; then
- if diff $OLD $NEW >$DIFF; then
- rm $DIFF
- rm $NEW
- else
- echo "$f: $NEW and $OLD differ"
- ecode=1
- fi
- else
- echo "$f: Making test result $OLD for the first time"
- mv $NEW $OLD
- ecode=1
- fi
-done
-exit $ecode
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation: 2
-# sh-basic-offset: 4
-# End:
+++ /dev/null
-#!/bin/sh
-# Tests reading of ISO2709 and checks that we get identical MARCXML
-#
-# Reads marc?.marc files , Generates marc*.xml files
-# If Libxml2 is present, also turbomarc*xml.
-# as well as reverse transformation from *marc*.xml files are parsed again..
-#
-srcdir=${srcdir:-.}
-ecode=0
-
-../util/yaz-marcdump -i marcxml >/dev/null 2>&1
-if test $? = "3"; then
- noxml=1
-fi
-
-../util/yaz-marcdump -o xml,marcxml >/dev/null 2>&1
-if test $? = "4"; then
- noxmlwrite=1
-fi
-
-binmarc_convert() {
- OUTPUT_FORMAT="$1"
- REVERT_FORMAT="$2"
- PREFIX="$3"
- for f in ${srcdir}/marc[0-9].marc; do
- fb=`basename ${f} .marc`
- CHR=`cat ${srcdir}/${fb}.chr`
- NEW=${PREFIX}${fb}.new.xml
- OLD=${srcdir}/${PREFIX}${fb}.xml
- DIFF=`basename ${f}`.diff
- #echo "../util/yaz-marcdump -f $CHR -t utf-8 -i marc -o ${OUTPUT_FORMAT} $f > $NEW"
- ../util/yaz-marcdump -f $CHR -t utf-8 -i marc -o ${OUTPUT_FORMAT} $f > $NEW
- if test $? != "0"; then
- echo "$f: yaz-marcdump returned error"
- ecode=1
- elif test -f $OLD; then
- if diff $OLD $NEW >$DIFF; then
- rm $DIFF
- rm $NEW
- else
- echo "$f: $NEW and $OLD differ"
- ecode=1
- fi
- else
- echo "$f: Making test result $OLD for the first time"
- if test -x /usr/bin/xmllint; then
- if xmllint --noout $NEW >out 2>stderr; then
- echo "$f: $NEW is well-formed"
- mv $NEW $OLD
- else
- echo "$f: $NEW not well-formed"
- ecode=1
- fi
- else
- echo "xmllint not found. install libxml2-utils"
- ecode=1
- fi
- fi
-
- if test -z "$noxml"; then
- ORIGINAL=${f}
- f=$OLD
- # compare with original (binary) marc record.
- OLD=${f}.marc
- NEW=`basename ${f}`.new.marc
- DIFF=`basename ${f}`.diff
- #echo "../util/yaz-marcdump -f utf-8 -t utf-8 -i ${REVERT_FORMAT} -o marc $f > $NEW"
- ../util/yaz-marcdump -f utf-8 -t utf-8 -i ${REVERT_FORMAT} -o marc $f > $NEW
- if test $? != "0"; then
- echo "Failed decode of $f"
- ecode=1
- elif test -f $OLD; then
- if diff $OLD $NEW >$DIFF; then
- rm $DIFF
- rm $NEW
- else
- echo "$f: $NEW and $OLD Differ"
- ecode=1
- fi
- else
- echo "$f: Making test result $OLD for the first time"
- mv $NEW $OLD
- fi
- # check with original
- REVERT=`basename ${f}`.marc.revert
- #../util/yaz-marcdump -f utf-8 -t $CHR -i ${REVERT_FORMAT} -o marc $f > $REVERT
- #hexdump -cx $REVERT > $REVERT.hex
- #hexdump -cx $ORIGINAL > $ORIGINAL.hex
- #diff $REVERT.hex $ORIGINAL.hex > $REVERT.diff
- fi
- done
- return $ecode
-}
-
-binmarc_convert "marcxml" "marcxml" ""
-echo "binmarc -> marcxml: $?"
-
-
-if test -z "$noxmlwrite"; then
-binmarc_convert "xml,marcxml" "marcxml" "xml2"
-echo "binmarc -> marcxml(libxml2): $?"
-fi
-
-binmarc_convert "turbomarc" "turbomarc" "t"
-echo "binmarc -> turbomarc: $?"
-
-if test -z "$noxmlwrite"; then
-binmarc_convert "xml,turbomarc" "turbomarc" "xml2t"
-echo "binmarc -> turbomarc(libxml2): $?"
-fi
-
-exit $ecode
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation: 2
-# sh-basic-offset: 4
-# End:
+++ /dev/null
-#!/bin/sh
-# Tests reading of a bunch of non-roman UTF-8 ISO2709 and see if
-# we can encode it in MARC-8
-#
-# Reads marccol?.u8.marc files , Generates marccol?.u8.{1,2}.lst
-srcdir=${srcdir:-.}
-ecode=0
-for f in ${srcdir}/marccol?.u8.marc; do
-
- fb=`basename ${f} .marc`
-
- DIFF=${fb}.1.lst.diff
- NEW=${fb}.1.lst.new
- OLD=${srcdir}/${fb}.1.lst
- ../util/yaz-marcdump -f utf-8 -t utf-8 $f >$NEW
- if test $? != "0"; then
- echo "$f: yaz-marcdump returned error"
- ecode=1
- break
- elif test -f $OLD; then
- if diff $OLD $NEW >$DIFF; then
- rm $DIFF
- rm $NEW
- else
- echo "$f: $NEW and $OLD differ"
- ecode=1
- fi
- else
- echo "$f: Making test result $OLD for the first time"
- mv $NEW $OLD
- fi
-
- filem=`echo $fb | sed 's/u8/m8/'`.marc
- ../util/yaz-marcdump -o marc -f utf8 -t marc8lossless $f >$filem
-
- DIFF=${fb}.2.lst.diff
- NEW=${fb}.2.lst.new
- OLD=${srcdir}/${fb}.2.lst
- ../util/yaz-marcdump -f marc8 -t utf-8 $filem >$NEW
- if test $? != "0"; then
- echo "$f: yaz-marcdump returned error"
- ecode=1
- break
- elif test -f $OLD; then
- if diff $OLD $NEW >$DIFF; then
- rm $DIFF
- rm $NEW
- rm $filem
- else
- echo "$f: $NEW and $OLD differ"
- ecode=1
- fi
- else
- echo "$f: Making test result $OLD for the first time"
- mv $NEW $OLD
- rm $filem
- fi
-done
-exit $ecode
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation: 2
-# sh-basic-offset: 4
-# End: