diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-05 09:07:02 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-05 09:07:02 +0000 |
commit | 66d56c565e48a73309cca55e2d1a2225d9fcc8d9 (patch) | |
tree | 04d3a90ae936479c11d02d7194d32ead49eccf30 | |
parent | 50120dab4e78e6531d640fe8f86675f8d06a7467 (diff) | |
download | busybox-w32-66d56c565e48a73309cca55e2d1a2225d9fcc8d9.tar.gz busybox-w32-66d56c565e48a73309cca55e2d1a2225d9fcc8d9.tar.bz2 busybox-w32-66d56c565e48a73309cca55e2d1a2225d9fcc8d9.zip |
ash testsuite: modify it so that it can run hush and msh tests
-rwxr-xr-x | shell/ash_test/run-all | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/shell/ash_test/run-all b/shell/ash_test/run-all index e02333888..b0a6d1088 100755 --- a/shell/ash_test/run-all +++ b/shell/ash_test/run-all | |||
@@ -1,5 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | TOPDIR=$PWD | ||
4 | |||
3 | test -x ash || { | 5 | test -x ash || { |
4 | echo "No ./ash?! Perhaps you want to run 'ln -s ../../busybox ash'" | 6 | echo "No ./ash?! Perhaps you want to run 'ln -s ../../busybox ash'" |
5 | exit | 7 | exit |
@@ -18,6 +20,8 @@ do_test() | |||
18 | { | 20 | { |
19 | test -d "$1" || return 0 | 21 | test -d "$1" || return 0 |
20 | echo do_test "$1" | 22 | echo do_test "$1" |
23 | # $1 but with / replaced by # so that it can be used as filename part | ||
24 | noslash=`echo "$1" | sed 's:/:#:g'` | ||
21 | ( | 25 | ( |
22 | cd "$1" || { echo "cannot cd $1!"; exit 1; } | 26 | cd "$1" || { echo "cannot cd $1!"; exit 1; } |
23 | for x in run-*; do | 27 | for x in run-*; do |
@@ -27,8 +31,8 @@ do_test() | |||
27 | *.orig|*~) ;; | 31 | *.orig|*~) ;; |
28 | #*) echo $x ; sh $x ;; | 32 | #*) echo $x ; sh $x ;; |
29 | *) | 33 | *) |
30 | sh "$x" >"../$1-$x.fail" 2>&1 && \ | 34 | sh "$x" >"$TOPDIR/$noslash-$x.fail" 2>&1 && \ |
31 | { echo "$1/$x: ok"; rm "../$1-$x.fail"; } || echo "$1/$x: fail"; | 35 | { echo "$1/$x: ok"; rm "$TOPDIR/$noslash-$x.fail"; } || echo "$1/$x: fail"; |
32 | ;; | 36 | ;; |
33 | esac | 37 | esac |
34 | done | 38 | done |
@@ -40,7 +44,8 @@ do_test() | |||
40 | test -f "$name.right" || continue | 44 | test -f "$name.right" || continue |
41 | { | 45 | { |
42 | "$THIS_SH" "./$x" >"$name.xx" 2>&1 | 46 | "$THIS_SH" "./$x" >"$name.xx" 2>&1 |
43 | diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail" | 47 | diff -u "$name.xx" "$name.right" >"$TOPDIR/$noslash-$x.fail" \ |
48 | && rm -f "$name.xx" "$TOPDIR/$noslash-$x.fail" | ||
44 | } && echo "$1/$x: ok" || echo "$1/$x: fail" | 49 | } && echo "$1/$x: ok" || echo "$1/$x: fail" |
45 | done | 50 | done |
46 | ) | 51 | ) |
@@ -52,6 +57,9 @@ do_test() | |||
52 | if [ $# -lt 1 ]; then | 57 | if [ $# -lt 1 ]; then |
53 | # All sub directories | 58 | # All sub directories |
54 | modules=`ls -d ash-*` | 59 | modules=`ls -d ash-*` |
60 | # If you want to test ash against hush and msh testsuites | ||
61 | # (have to copy hush_test and msh_test dirs to current dir first): | ||
62 | #modules=`ls -d ash-* hush_test/hush-* msh_test/msh-*` | ||
55 | 63 | ||
56 | for module in $modules; do | 64 | for module in $modules; do |
57 | do_test $module | 65 | do_test $module |