svlogd: fix compat problem: svlogd -tt should timestanp stderr too
[busybox.git] / shell / ash_test / run-all
blob02f6d2a9dbf5ed1301195e216a6c7ecb1ffc7592
1 #!/bin/sh
3 test -x ash || { echo "No ./ash?!"; exit; }
4 test -x printenv || gcc -O2 -o printenv printenv.c || exit $?
5 test -x recho || gcc -O2 -o recho recho.c || exit $?
6 test -x zecho || gcc -O2 -o zecho zecho.c || exit $?
8 PATH="$PWD:$PATH" # for ash and recho/zecho/printenv
9 export PATH
11 THIS_SH="$PWD/ash"
12 export THIS_SH
14 do_test()
16 test -d "$1" || return 0
18 cd "$1" || { echo "cannot cd $1!"; exit 1; }
19 for x in run-*; do
20 test -f "$x" || continue
21 case "$x" in
22 "$0"|run-minimal|run-gprof) ;;
23 *.orig|*~) ;;
24 #*) echo $x ; sh $x ;;
26 sh "$x" >"../$1-$x.fail" 2>&1 && \
27 { echo "$1/$x: ok"; rm "../$1-$x.fail"; } || echo "$1/$x: fail";
29 esac
30 done
31 # Many bash run-XXX scripts just do this,
32 # no point in duplication it all over the place
33 for x in *.tests; do
34 test -x "$x" || continue
35 name="${x%%.tests}"
36 test -f "$name.right" || continue
38 "$THIS_SH" "./$x" >"$name.xx" 2>&1
39 diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail"
40 } && echo "$1/$x: ok" || echo "$1/$x: fail"
41 done
45 # main part of this script
46 # Usage: run-all [directories]
48 if [ $# -lt 1 ]; then
49 # All sub directories
50 modules=`ls -d ash-*`
52 for module in $modules; do
53 do_test $module
54 done
55 else
56 while [ $# -ge 1 ]; do
57 if [ -d $1 ]; then
58 do_test $1
60 shift
61 done