Hash :
f06fc933
Author :
Date :
2024-06-22T03:28:27
tests: Move tests for executables to separate script Move tests for xmllint shell and xmlcatalog to separate scripts and enabled them in Autotools.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
#!/bin/sh
set -e
echo "## Catalog regression tests"
if [ -n "$1" ]; then
xmlcatalog=$1
else
xmlcatalog=./xmlcatalog
fi
exitcode=0
for i in test/catalogs/*.script ; do
name=$(basename $i .script)
xml="./test/catalogs/$name.xml"
if [ -f $xml ] ; then
if [ ! -f result/catalogs/$name ] ; then
echo New test file $name
$xmlcatalog --shell $xml < $i 2>&1 > result/catalogs/$name
else
$xmlcatalog --shell $xml < $i 2>&1 > catalog.out
log=$(diff result/catalogs/$name catalog.out)
if [ -n "$log" ] ; then
echo $name result
echo "$log"
exitcode=1
fi
rm catalog.out
fi
fi
done
for i in test/catalogs/*.script ; do
name=$(basename $i .script)
sgml="./test/catalogs/$name.sgml"
if [ -f $sgml ] ; then
if [ ! -f result/catalogs/$name ] ; then
echo New test file $name
$xmlcatalog --shell $sgml < $i > result/catalogs/$name
else
$xmlcatalog --shell $sgml < $i > catalog.out
log=$(diff result/catalogs/$name catalog.out)
if [ -n "$log" ] ; then
echo $name result
echo "$log"
exitcode=1
fi
rm catalog.out
fi
fi
done
# Add and del operations on XML Catalogs
$xmlcatalog --create --noout mycatalog
$xmlcatalog --noout --add public Pubid sysid mycatalog
$xmlcatalog --noout --add public Pubid2 sysid2 mycatalog
$xmlcatalog --noout --add public Pubid3 sysid3 mycatalog
diff result/catalogs/mycatalog.full mycatalog
$xmlcatalog --noout --del sysid mycatalog
$xmlcatalog --noout --del sysid3 mycatalog
$xmlcatalog --noout --del sysid2 mycatalog
diff result/catalogs/mycatalog.empty mycatalog
rm -f mycatalog
exit $exitcode