]> The Tcpdump Group git mirrors - tcpdump/blob - tests/TESTrun.sh
IPoIB: Add the output with -e for a capture test
[tcpdump] / tests / TESTrun.sh
1 #!/bin/sh
2
3 TZ=GMT0; export TZ
4
5 mkdir -p NEW
6 mkdir -p DIFF
7 cat /dev/null > failure-outputs.txt
8
9 runComplexTests()
10 {
11 for i in *.sh
12 do
13 case $i in TEST*.sh) continue;; esac
14 sh ./$i
15 done
16 passed=`cat .passed`
17 failed=`cat .failed`
18 }
19
20 runSimpleTests()
21 {
22 only=$1
23 cat TESTLIST | while read name input output options
24 do
25 case $name in
26 \#*) continue;;
27 '') continue;;
28 esac
29 rm -f core
30 [ "$only" != "" -a "$name" != "$only" ] && continue
31 if ./TESTonce $name $input $output "$options"
32 then
33 passed=`expr $passed + 1`
34 echo $passed >.passed
35 else
36 failed=`expr $failed + 1`
37 echo $failed >.failed
38 fi
39 [ "$only" != "" -a "$name" = "$only" ] && break
40 done
41 # I hate shells with their stupid, useless subshells.
42 passed=`cat .passed`
43 failed=`cat .failed`
44 }
45
46 passed=0
47 failed=0
48 echo $passed >.passed
49 echo $failed >.failed
50 if [ $# -eq 0 ]
51 then
52 runComplexTests
53 runSimpleTests
54 elif [ $# -eq 1 ]
55 then
56 runSimpleTests $1
57 else
58 echo "Usage: $0 [test_name]"
59 exit 30
60 fi
61
62 # exit with number of failing tests.
63 echo '------------------------------------------------'
64 printf "%4u tests failed\n" $failed
65 printf "%4u tests passed\n" $passed
66 echo
67 cat failure-outputs.txt
68 echo
69 echo
70 exit $failed