-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.sh
executable file
·75 lines (66 loc) · 1.34 KB
/
test.sh
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
71
72
73
74
75
#!/bin/sh
if [ $# -lt 4 ]; then
echo Usage: test.sh \$TYPE \$NAMESPACE \$BASE \$URI \$OUTPUT
exit 1
fi
. filenames.sh
TYPE=$1
NAMESPACE=$2
BASE=$3
URI=$4
if ! test -z $5; then
OUTPUT=$THISPWD/$BASE/$5
else
OUTPUT=
fi
export TYPE NAMESPACE BASE URI OUTPUT
XMLFILE=$(basename $BASE$URI)
XMLDIR=$(dirname $BASE$URI)
cd $XMLDIR
ln -sf $XMLFILE test.xml
echo "Checking $BASE$URI for $TYPE "
case $TYPE in
not-wf)
POSITIVE=no
TESTEXEC=$SAX_WELL_FORMED.ns.$NAMESPACE.exe
export POSITIVE TESTEXEC
$ACTUALTEST
;;
valid)
POSITIVE=yes
TESTEXEC=$SAX_VALID.ns.$NAMESPACE.exe
export POSITIVE TESTEXEC
$ACTUALTEST
if test $NAMESPACE = yes; then
TYPE=dom
TESTEXEC=$DOM.ns.$NAMESPACE.exe
export TESTEXEC
$ACTUALTEST
fi
;;
invalid)
POSITIVE=yes
TESTEXEC=$SAX_WELL_FORMED.ns.$NAMESPACE.exe
export POSITIVE TESTEXEC
$ACTUALTEST
POSITIVE=no
TESTEXEC=$SAX_VALID.ns.$NAMESPACE.exe
export POSITIVE TESTEXEC
$ACTUALTEST
if test $NAMESPACE = yes; then
TYPE=dom
TESTEXEC=$DOM.ns.$NAMESPACE.exe
export TESTEXEC
$ACTUALTEST
fi
;;
error)
POSITIVE=no
# FIXME should test only for error here
TESTEXEC=$SAX_WELL_FORMED.ns.$NAMESPACE.exe
export POSITIVE TESTEXEC
$ACTUALTEST
break
;;
esac
rm -f test.out out.xml test.xml