12 if test ! -x hush
; then
13 if test ! -x ..
/..
/busybox
; then
14 echo "Can't run tests. Put hush binary into this directory (`pwd`)"
17 echo "No ./hush - creating a link to ../../busybox"
18 ln -s ..
/..
/busybox hush
20 if test ! -f .config
; then
21 if test ! -f ..
/..
/.config
; then
22 echo "Missing .config file"
25 cp ..
/..
/.config . ||
exit 1
28 eval $
(sed -e '/^#/d' -e '/^$/d' -e 's:^:export :' .config
)
30 PATH
="`pwd`:$PATH" # for hush and recho/zecho/printenv
38 test -d "$1" ||
return 0
40 # echo Running tests in directory "$1"
43 cd "$1" ||
{ echo "cannot cd $1!"; exit 1; }
45 test -f "$x" ||
continue
47 "$0"|run-minimal|run-gprof
) ;;
49 #*) echo $x ; sh $x ;;
52 sh
"$x" >"../$1-$x.fail" 2>&1 && \
53 { { echo " ok"; rm "../$1-$x.fail"; } ||
echo " fail"; }
57 # Many bash run-XXX scripts just do this,
58 # no point in duplication it all over the place
60 test -x "$x" ||
continue
62 test -f "$name.right" ||
continue
63 # echo Running test: "$x"
66 "$THIS_SH" "./$x" >"$name.xx" 2>&1
67 # filter C library differences
69 -e "/: invalid option /s:'::g" \
71 test $?
-eq 77 && rm -f "../$1-$x.fail" && exit 77
72 diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail"
76 77) echo " skip (feature disabled)";;
77 *) echo " fail"; tret
=1;;
84 # Main part of this script
85 # Usage: run-all [directories]
91 modules
=`ls -d hush-*`
93 for module
in $modules; do
94 do_test
$module || ret
=1
97 while [ $# -ge 1 ]; do