14 if test ! -x hush; then
15 if test ! -x ../../busybox; then
16 echo "Can't run tests. Put hush binary into this directory (`pwd`)"
19 echo "No ./hush - creating a link to ../../busybox"
20 ln -s ../../busybox hush
22 if test ! -f .config; then
23 if test ! -f ../../.config; then
24 echo "Missing .config file"
27 cp ../../.config . || exit 1
30 eval $(sed -e '/^#/d' -e '/^$/d' -e 's:^:export :' .config)
32 PATH="`pwd`:$PATH" # for hush and recho/zecho/printenv
40 test -d "$1" || return 0
42 # echo Running tests in directory "$1"
43 # $1 but with / replaced by # so that it can be used as filename part
44 noslash=`echo "$1" | sed 's:/:#:g'`
47 cd "$1" || { echo "cannot cd $1!"; exit 1; }
49 test -f "$x" || continue
51 "$0"|run-minimal|run-gprof) ;;
53 #*) echo $x ; sh $x ;;
56 sh "$x" >"$TOPDIR/$noslash-$x.fail" 2>&1 && \
57 { { echo " ok"; rm "$TOPDIR/$noslash-$x.fail"; } || echo " fail"; }
61 # Many bash run-XXX scripts just do this,
62 # no point in duplication it all over the place
64 test -x "$x" || continue
66 test -f "$name.right" || continue
67 # echo Running test: "$x"
70 "$THIS_SH" "./$x" >"$name.xx" 2>&1
72 # filter C library differences
74 -e "/: invalid option /s:'::g" \
76 test $r -eq 77 && rm -f "$TOPDIR/$noslash-$x.fail" && exit 77
77 diff -u "$name.xx" "$name.right" >"$TOPDIR/$noslash-$x.fail" \
78 && rm -f "$name.xx" "$TOPDIR/$noslash-$x.fail"
82 77) echo " skip (feature disabled)";;
83 *) echo " fail ($?)"; tret=1;;
90 # Main part of this script
91 # Usage: run-all [directories]
97 modules=`ls -d hush-*`
99 for module in $modules; do
100 do_test $module || ret=1
103 while [ $# -ge 1 ]; do