diff options
author | Denis Vlasenko | 2008-05-15 22:43:48 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-05-15 22:43:48 +0000 |
commit | 81e97a13801eb0cc3887d1696208629e5dda77b5 (patch) | |
tree | f3537a330e23179f90e85aabbbb027f0144f25a1 /testsuite/testing.sh | |
parent | e251337a4d605e22715ed28b0a168b7fe18c4c9f (diff) | |
download | busybox-81e97a13801eb0cc3887d1696208629e5dda77b5.zip busybox-81e97a13801eb0cc3887d1696208629e5dda77b5.tar.gz |
testsuite instrumentation fixes by Christian
Diffstat (limited to 'testsuite/testing.sh')
-rwxr-xr-x | testsuite/testing.sh | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/testsuite/testing.sh b/testsuite/testing.sh index 028d09a..ea59f31 100755 --- a/testsuite/testing.sh +++ b/testsuite/testing.sh @@ -37,7 +37,7 @@ export FAILCOUNT=0 export SKIP= # Helper for helpers. Oh my... -test x"$ECHO" = x"" && { +test x"$ECHO" != x"" || { ECHO="echo" test x"`echo -ne`" = x"" || { # Compile and use a replacement 'echo' which understands -e -n @@ -68,15 +68,15 @@ optional() testing() { NAME="$1" - [ -z "$1" ] && NAME="$2" + [ -n "$1" ] || NAME="$2" if [ $# -ne 5 ] then echo "Test $NAME has wrong number of arguments (must be 5) ($# $*)" >&2 - exit + exit 1 fi - [ -n "$DEBUG" ] && set -x + [ -z "$DEBUG" ] || set -x if [ -n "$SKIP" ] then @@ -90,18 +90,17 @@ testing() $ECHO -ne "$5" | eval "$2" > actual RETVAL=$? - cmp expected actual >/dev/null 2>/dev/null - if [ $? -ne 0 ] + if cmp expected actual >/dev/null 2>/dev/null then + echo "PASS: $NAME" + else FAILCOUNT=$(($FAILCOUNT + 1)) echo "FAIL: $NAME" - [ -n "$VERBOSE" ] && diff -u expected actual - else - echo "PASS: $NAME" + [ -z "$VERBOSE" ] || diff -u expected actual fi rm -f input expected actual - [ -n "$DEBUG" ] && set +x + [ -z "$DEBUG" ] || set +x return $RETVAL } |