]> The Tcpdump Group git mirrors - tcpdump/blob - tests/TESTrun.sh
Fix the pointer tests in the non-ndoified TTEST2() macro as well.
[tcpdump] / tests / TESTrun.sh
1 #!/bin/sh
2
3 mkdir -p NEW
4 mkdir -p DIFF
5 passed=0
6 failed=0
7
8 # first run any specific tests.
9 for i in *.sh
10 do
11 case $i in TEST*.sh) continue;; esac
12
13 if sh ./$i >DIFF/$i.result
14 then
15 echo $i: passed.
16 rm -f DIFF/$i.result
17 passed=$(($passed + 1))
18 else
19 echo $i: failed.
20 failed=$(($failed + 1))
21 fi
22 done
23
24 echo $passed >.passed
25 echo $failed >.failed
26
27 # now run typical tests
28 cat TESTLIST | while read name input output options
29 do
30 case $name in
31 \#*) continue;;
32 '') continue;;
33 esac
34
35 if ./TESTonce $name $input $output "$options"
36 then
37 echo $name: passed.
38 rm -f DIFF/$output.diff
39 passed=$(($passed + 1))
40 echo $passed >.passed
41 else
42 echo $name: failed.
43 failed=$(($failed + 1))
44 echo $failed >.failed
45 fi
46 done
47
48 # I hate shells with their stupid, useless subshells.
49 passed=`cat .passed`
50 failed=`cat .failed`
51
52 # exit with number of failing tests.
53 echo
54 echo
55 printf "%4u tests failed\n" $failed
56 printf "%4u tests passed\n" $passed
57 echo
58 echo
59 exit $failed
60
61
62
63