-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtestaccessone.sh
executable file
·82 lines (65 loc) · 1.2 KB
/
testaccessone.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
76
77
78
79
80
81
#! /bin/sh
#
# execute a single testcase
#
# (c) 2005 (W3C) MIT, ERCIM, Keio University
# See tidy.c for the copyright notice.
#
# <URL:http://tidy.sourceforge.net/>
#
# CVS Info:
#
# $Author: arnaud02 $
# $Date: 2007/02/04 17:35:31 $
# $Revision: 1.2 $
#
# set -x
VERSION='$Id'
echo Testing $1
set +f
TESTNO=$1
TESTEXPECTED=$2
ACCESSLEVEL=$3
TIDY=../bin/tidy
INFILES=./accessTest/$1.*ml
CFGFILE=./accessTest/cfg_$1.txt
TIDYFILE=./tmp/out_$1.html
MSGFILE=./tmp/msg_$1.txt
unset HTML_TIDY
shift
shift
shift
# Remove any pre-exising test outputs
for INFIL in $MSGFILE $TIDYFILE
do
if [ -f $INFIL ]
then
rm $INFIL
fi
done
for INFILE in $INFILES
do
if [ -r $INFILE ]
then
break
fi
done
# If no test specific config file, use default.
if [ ! -f $CFGFILE ]
then
CFGFILE=./accessTest/cfg_default.txt
fi
# Make sure output directory exists.
if [ ! -d ./tmp ]
then
mkdir ./tmp
fi
$TIDY -f $MSGFILE --accessibility-check $ACCESSLEVEL -config $CFGFILE "$@" --gnu-emacs yes --tidy-mark no -o $TIDYFILE $INFILE
STATUS=$?
if [ `grep -c -e ' \['$TESTEXPECTED'\]: ' $MSGFILE` = 0 ]
then
echo "--- test '$TESTEXPECTED' not detected in file '$INFILE'"
cat $MSGFILE
exit 1
fi
exit 0