diff options
author | Russ Cox <rsc@golang.org> | 2009-07-30 16:46:14 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-07-30 16:46:14 -0700 |
commit | 0e26006a48566d0eb9947fb814839df053812abc (patch) | |
tree | 413365520b2fa7535b11aeeeedba7ca625287e66 /test/errchk | |
parent | 84ec82c83f9d2f80347a75f07a17def6657ee6b6 (diff) | |
download | go-0e26006a48566d0eb9947fb814839df053812abc.tar.gz |
use errchk in more places.
let errchk exit 0 even if it has reported a BUG.
it echoed BUG and that's all that matters.
R=r
DELTA=143 (1 added, 89 deleted, 53 changed)
OCL=32533
CL=32542
Diffstat (limited to 'test/errchk')
-rwxr-xr-x | test/errchk | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/test/errchk b/test/errchk index 31e548aa5..00694c256 100755 --- a/test/errchk +++ b/test/errchk @@ -28,19 +28,18 @@ TMPOUT=/tmp/errchk-out-$$ TMPERR=/tmp/errchk-err-$$ TMPALL=/tmp/errchk-all-$$ TMPTMP=/tmp/errchk-tmp-$$ -TMPSTAT=/tmp/errchk-stat-$$ TMPBUG=/tmp/errchk-bug-$$ -rm -f $TMPOUT $TMPERR $TMPALL $TMPTMP $TMPSTAT $TMPBUG +rm -f $TMPOUT $TMPERR $TMPALL $TMPTMP $TMPBUG -trap "rm -f $TMPOUT $TMPERR $TMPALL $TMPTMP $TMPSTAT $TMPBUG" 0 1 2 3 14 15 +trap "rm -f $TMPOUT $TMPERR $TMPALL $TMPTMP $TMPBUG" 0 1 2 3 14 15 if $* >$TMPOUT 2>$TMPERR; then echo 1>&2 "BUG: errchk: command succeeded unexpectedly" cat $TMPOUT cat 1>&2 $TMPERR rm -f $TMPOUT $TMPERR - exit 1 + exit 0 fi cat $TMPOUT $TMPERR | grep -v '^ ' > $TMPALL @@ -54,7 +53,6 @@ bug() { } header=0 -echo 0 > $TMPSTAT pr -n -t $SOURCEFILE | grep '// ERROR' | while read line; do lineno=`echo $line | sed -e 's/^[ ]*\([0-9]*\).*$/\1/'` regexp=`echo $line | sed -e 's|.*// ERROR "\([^"]*\)".*$|\1|'` @@ -64,12 +62,10 @@ pr -n -t $SOURCEFILE | grep '// ERROR' | while read line; do if test -z "$errmsg"; then bug echo 1>&2 "errchk: $SOURCEFILE:$lineno: missing expected error: '$regexp'" - echo 1 > $TMPSTAT elif ! echo "$errmsg" | egrep -q "$regexp"; then bug echo 1>&2 "errchk: $SOURCEFILE:$lineno: error message does not match '$regexp'" echo 1>&2 $errmsg - echo 1 > $TMPSTAT fi done @@ -79,9 +75,6 @@ if test -s $TMPALL; then echo 1>&2 "==================================================" cat 1>&2 $TMPALL echo 1>&2 "==================================================" - echo 1 > $TMPSTAT fi -status=`cat $TMPSTAT` - -exit $status +exit 0 |