aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/run-all
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-03-28 15:43:47 +0000
committerMike Frysinger <vapier@gentoo.org>2009-03-28 15:43:47 +0000
commit42ab86520e08d8b598f46b7a4754b2730e55f173 (patch)
tree357298d999b5882955daff11c61f488ef8b94cee /shell/hush_test/run-all
parent25a6ca0dd4866d9b8e6cf140b119e1c434859719 (diff)
downloadbusybox-w32-42ab86520e08d8b598f46b7a4754b2730e55f173.tar.gz
busybox-w32-42ab86520e08d8b598f46b7a4754b2730e55f173.tar.bz2
busybox-w32-42ab86520e08d8b598f46b7a4754b2730e55f173.zip
make sure we exit based on test failure rather than always exiting with 0
Diffstat (limited to 'shell/hush_test/run-all')
-rwxr-xr-xshell/hush_test/run-all12
1 files changed, 9 insertions, 3 deletions
diff --git a/shell/hush_test/run-all b/shell/hush_test/run-all
index b79af2f67..b5db79f6c 100755
--- a/shell/hush_test/run-all
+++ b/shell/hush_test/run-all
@@ -25,6 +25,7 @@ do_test()
25 test -d "$1" || return 0 25 test -d "$1" || return 0
26# echo Running tests in directory "$1" 26# echo Running tests in directory "$1"
27 ( 27 (
28 tret=0
28 cd "$1" || { echo "cannot cd $1!"; exit 1; } 29 cd "$1" || { echo "cannot cd $1!"; exit 1; }
29 for x in run-*; do 30 for x in run-*; do
30 test -f "$x" || continue 31 test -f "$x" || continue
@@ -48,26 +49,31 @@ do_test()
48 { 49 {
49 "$THIS_SH" "./$x" >"$name.xx" 2>&1 50 "$THIS_SH" "./$x" >"$name.xx" 2>&1
50 diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail" 51 diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail"
51 } && echo "$1/$x: ok" || echo "$1/$x: fail" 52 } && echo "$1/$x: ok" || { echo "$1/$x: fail"; ((tret+=1)); }
52 done 53 done
54 exit ${tret}
53 ) 55 )
54} 56}
55 57
56# Main part of this script 58# Main part of this script
57# Usage: run-all [directories] 59# Usage: run-all [directories]
58 60
61ret=0
62
59if [ $# -lt 1 ]; then 63if [ $# -lt 1 ]; then
60 # All sub directories 64 # All sub directories
61 modules=`ls -d hush-*` 65 modules=`ls -d hush-*`
62 66
63 for module in $modules; do 67 for module in $modules; do
64 do_test $module 68 do_test $module || ret=1
65 done 69 done
66else 70else
67 while [ $# -ge 1 ]; do 71 while [ $# -ge 1 ]; do
68 if [ -d $1 ]; then 72 if [ -d $1 ]; then
69 do_test $1 73 do_test $1 || ret=1
70 fi 74 fi
71 shift 75 shift
72 done 76 done
73fi 77fi
78
79exit ${ret}