tst
914 Bytes
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
#!/bin/sh
# This is a short-cut to execute tests on the parser.
# ./conf/torture_msgs{,2} contain various kind of messages.
#echo "=="
#echo "== Testing the parser contained in libosip."
#echo "== You can use the verbose mode (-v) to see the full message."
#echo "=="
ok=0
nok=0
vok=0
vnok=0
total=0
i=0
while [ -e $1/sip$i ]
do
filename=$1/sip$i
./torture_test $filename $2
code=$?
if [ "$code" -eq 0 ]; then
ok=`expr $ok + 1`;
else
nok=`expr $nok + 1`
fi;
i=`expr $i + 1`
total=`expr $total + 1`
done
i=0
while [ -e $1/sip-malformed$i ]
do
filename=$1/sip-malformed$i
./torture_test $filename $2
code=$?
if [ "$code" -eq 0 ]; then
ok=`expr $ok + 1`;
else
nok=`expr $nok + 1`
fi;
i=`expr $i + 1`
total=`expr $total + 1`
done
#
echo "unit testing total : $total"
echo "unit testing passed: $ok"
echo "unit testing failed: $nok"