From 81e97a13801eb0cc3887d1696208629e5dda77b5 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 15 May 2008 22:43:48 +0000 Subject: testsuite instrumentation fixes by Christian --- testsuite/testing.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'testsuite/testing.sh') diff --git a/testsuite/testing.sh b/testsuite/testing.sh index 028d09a28..ea59f317a 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 } -- cgit v1.2.3