| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# This is a short-cut to execute tests on the parser. |
| 4 |
# ./conf/torture_msgs{,2} contain various kind of messages. |
| 5 |
|
| 6 |
#echo "==" |
| 7 |
#echo "== Testing the parser contained in libosip." |
| 8 |
#echo "== You can use the verbose mode (-v) to see the full message." |
| 9 |
#echo "==" |
| 10 |
|
| 11 |
ok=0 |
| 12 |
nok=0 |
| 13 |
vok=0 |
| 14 |
vnok=0 |
| 15 |
total=0 |
| 16 |
|
| 17 |
|
| 18 |
i=0 |
| 19 |
while [ -e $1/sip$i ] |
| 20 |
do |
| 21 |
filename=$1/sip$i |
| 22 |
./torture_test $filename $2 |
| 23 |
|
| 24 |
code=$? |
| 25 |
if [ "$code" -eq 0 ]; then |
| 26 |
ok=`expr $ok + 1`; |
| 27 |
else |
| 28 |
nok=`expr $nok + 1` |
| 29 |
fi; |
| 30 |
|
| 31 |
i=`expr $i + 1` |
| 32 |
total=`expr $total + 1` |
| 33 |
done |
| 34 |
|
| 35 |
i=0 |
| 36 |
while [ -e $1/sip-malformed$i ] |
| 37 |
do |
| 38 |
filename=$1/sip-malformed$i |
| 39 |
./torture_test $filename $2 |
| 40 |
|
| 41 |
code=$? |
| 42 |
if [ "$code" -eq 0 ]; then |
| 43 |
ok=`expr $ok + 1`; |
| 44 |
else |
| 45 |
nok=`expr $nok + 1` |
| 46 |
fi; |
| 47 |
|
| 48 |
i=`expr $i + 1` |
| 49 |
total=`expr $total + 1` |
| 50 |
done |
| 51 |
# |
| 52 |
|
| 53 |
echo "unit testing total : $total" |
| 54 |
echo "unit testing passed: $ok" |
| 55 |
echo "unit testing failed: $nok" |
| 56 |
|