6 echo RUNNING from
${srcdir}
9 srcdir
=$
(cd $srcdir && pwd)
11 # this should be run from the compiled build directory,
12 # with srcdir= set to wherever the source code is.
13 # not from the tests directory.
14 echo RUNNING from
${srcdir}
16 passedfile
=$
(pwd)/tests
/.passed
17 failedfile
=$
(pwd)/tests
/.failed
20 cat /dev
/null
> failure-outputs.txt
24 for i
in ${srcdir}/tests
/*.sh
27 ${srcdir}/tests
/TEST
*.sh
) continue;;
28 ${srcdir}/tests
/\
*.sh
) continue;;
31 (cd tests
&& sh
$i ${srcdir})
33 passed
=`cat ${passedfile}`
34 failed
=`cat ${failedfile}`
40 cat ${srcdir}/tests
/TESTLIST |
while read name input output options
47 [ "$only" != "" -a "$name" != "$only" ] && continue
48 export SRCDIR
=${srcdir}
49 # I hate shells with their stupid, useless subshells.
50 passed
=`cat ${passedfile}`
51 failed
=`cat ${failedfile}`
52 (cd tests
# run TESTonce in tests directory
53 if ${srcdir}/tests/TESTonce $name ${srcdir}/tests/$input ${srcdir}/tests
/$output "$options"
55 passed
=`expr $passed + 1`
56 echo $passed >${passedfile}
58 failed
=`expr $failed + 1`
59 echo $failed >${failedfile}
61 [ "$only" != "" -a "$name" = "$only" ] && break
63 # I hate shells with their stupid, useless subshells.
64 passed
=`cat ${passedfile}`
65 failed
=`cat ${failedfile}`
70 echo $passed >${passedfile}
71 echo $failed >${failedfile}
80 echo "Usage: $0 [test_name]"
84 # exit with number of failing tests.
85 echo '------------------------------------------------'
86 printf "%4u tests failed\n" $failed
87 printf "%4u tests passed\n" $passed
89 cat tests
/failure-outputs.txt