Remove building with NOCRYPTO option
[minix.git] / external / bsd / tcpdump / dist / tests / TESTrun.sh
blob4cd04408ddd6ee83493b0a0a95a38e432cfaf9ea
1 #!/bin/sh
3 mkdir -p NEW
4 mkdir -p DIFF
5 passed=0
6 failed=0
7 cat /dev/null > failure-outputs.txt
9 runComplexTests()
11 for i in *.sh
13 case $i in TEST*.sh) continue;; esac
14 if sh ./$i
15 then
16 passed=`expr $passed + 1`
17 else
18 failed=`expr $failed + 1`
20 done
23 runSimpleTests()
25 only=$1
26 echo $passed >.passed
27 echo $failed >.failed
28 cat TESTLIST | while read name input output options
30 case $name in
31 \#*) continue;;
32 '') continue;;
33 esac
34 rm -f core
35 [ "$only" != "" -a "$name" != "$only" ] && continue
36 if ./TESTonce $name $input $output "$options"
37 then
38 passed=`expr $passed + 1`
39 echo $passed >.passed
40 else
41 failed=`expr $failed + 1`
42 echo $failed >.failed
44 [ "$only" != "" -a "$name" = "$only" ] && break
45 done
46 # I hate shells with their stupid, useless subshells.
47 passed=`cat .passed`
48 failed=`cat .failed`
51 if [ $# -eq 0 ]
52 then
53 runComplexTests
54 runSimpleTests
55 elif [ $# -eq 1 ]
56 then
57 runSimpleTests $1
58 else
59 echo "Usage: $0 [test_name]"
60 exit 30
63 # exit with number of failing tests.
64 echo '------------------------------------------------'
65 printf "%4u tests failed\n" $failed
66 printf "%4u tests passed\n" $passed
67 echo
68 echo
69 cat failure-outputs.txt
70 echo
71 echo
72 exit $failed