File size: 785 Bytes
6baed57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/sh

set -e

echo "## SGML 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)
    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_sgml.out
            log=$(diff result/catalogs/$name catalog_sgml.out)
            if [ -n "$log" ] ; then
                echo $name result
                echo "$log"
                exitcode=1
            fi
            rm catalog_sgml.out
        fi
    fi
done

exit $exitcode