6 if test ! -x ../../busybox; then
7 echo "Can't run tests. Put ash binary into this directory (`pwd`)"
10 echo "No ./ash - creating a link to ../../busybox"
11 ln -s ../../busybox ash
13 if test ! -f .config; then
14 if test ! -f ../../.config; then
15 echo "Missing .config file"
18 cp ../../.config . || exit 1
21 eval $(sed -e '/^#/d' -e '/^$/d' -e 's:^:export :' .config)
23 test -x printenv || gcc -O2 -o printenv printenv.c || exit $?
24 test -x recho || gcc -O2 -o recho recho.c || exit $?
25 test -x zecho || gcc -O2 -o zecho zecho.c || exit $?
27 PATH="`pwd`:$PATH" # for ash and recho/zecho/printenv
35 test -d "$1" || return 0
37 # echo Running tests in directory "$1"
38 # $1 but with / replaced by # so that it can be used as filename part
39 noslash=`echo "$1" | sed 's:/:#:g'`
41 cd "$1" || { echo "cannot cd $1!"; exit 1; }
43 test -f "$x" || continue
45 "$0"|run-minimal|run-gprof) ;;
47 #*) echo $x ; sh $x ;;
50 sh "$x" >"$TOPDIR/$noslash-$x.fail" 2>&1 && \
51 { { echo " ok"; rm "$TOPDIR/$noslash-$x.fail"; } || echo " fail"; }
55 # Many bash run-XXX scripts just do this,
56 # no point in duplication it all over the place
58 test -x "$x" || continue
60 test -f "$name.right" || continue
61 # echo Running test: "$x"
64 "$THIS_SH" "./$x" >"$name.xx" 2>&1
65 diff -u "$name.xx" "$name.right" >"$TOPDIR/$noslash-$x.fail" \
66 && rm -f "$name.xx" "$TOPDIR/$noslash-$x.fail"
67 } && echo " ok" || echo " fail"
72 # Main part of this script
73 # Usage: run-all [directories]
80 # If you want to test ash against hush testsuite
81 # (have to copy hush_test dir to current dir first):
82 #modules=`ls -d ash-* hush_test/hush-*`
84 for module in $modules; do
85 do_test $module || ret=1
88 while [ $# -ge 1 ]; do