From b993e449f8f0f77ea199210ab7cc357266ef56f7 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sun, 17 Apr 2011 23:39:53 -0400 Subject: [PATCH] shelltest: use a more magical magic number for success. There may be some odd situation where a shell returns 0 despite not executing the script correctly; now 0 is an error condition. --- redo-sh.do | 4 ++-- t/shelltest.do | 2 +- t/shelltest.od | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/redo-sh.do b/redo-sh.do index 761a162..9d50bbd 100644 --- a/redo-sh.do +++ b/redo-sh.do @@ -40,10 +40,10 @@ for sh in dash sh /usr/xpg4/bin/sh ash posh mksh ksh ksh88 ksh93 pdksh \ crash=${crash# } case $RV in - 0) echo "ok $msgs"; [ -n "$GOOD" ] || GOOD=$FOUND ;; + 40) echo "ok $msgs"; [ -n "$GOOD" ] || GOOD=$FOUND ;; 41) echo "failed $msgs" ;; 42) echo "warnings $msgs"; [ -n "$WARN" ] || WARN=$FOUND ;; - *) echo "crashed $crash" ;; + *) echo "crash $crash" ;; esac done diff --git a/t/shelltest.do b/t/shelltest.do index 5c65254..7a7d6fc 100644 --- a/t/shelltest.do +++ b/t/shelltest.do @@ -2,7 +2,7 @@ set +e ( . ./shelltest.od ) RV=$? case $RV in - 0) exit 0 ;; + 40) exit 0 ;; 42) exit 0 ;; *) exit 1 ;; esac diff --git a/t/shelltest.od b/t/shelltest.od index 767a4ea..ba9adec 100644 --- a/t/shelltest.od +++ b/t/shelltest.od @@ -365,4 +365,5 @@ set x y z . ./dotparams.od a b || fail 115 [ "$1-$2-$3" = "x-y-z" ] || fail 116 +[ -n "$FAIL" ] || exit 40 exit $FAIL