test.sh
713 Bytes
#!/bin/sh
FILES=${@:-"odt"}
GLOBIGNORE="*-orig.*"
# ./odt2tei.py -d test odt/{2_066_000005112.odt,2_077_000005200.odt,8_23-KomOswiaty.odt,118_Kom_Polityki_Gosp.odt}
./odt2tei.py -d test -v "$VERBOSE" test/md/{2_066_000005112.md,2_077_000005200.md,8_23-KomOswiaty.md,118_Kom_Polityki_Gosp.md} > test.log
cat test.log
if [ ! -s "test.log" ]; then
rm -f test.log
fi
if [ "$1" == "-a" ]; then
shift
ACCEPT=1
fi
cd test/clean
if [ "$1" ]; then FILES=$(find . -name "$1*"); else FILES=*.md; fi
mkdir -p ../orig
if [ "$ACCEPT" ]; then
for md in $FILES; do
cp $md ../orig
done
else
rm -f ../../test.diff
for md in $FILES; do
echo "### Check $md..."
diff ../orig/$md $md
done | tee -a ../../test.diff
fi