summaryrefslogtreecommitdiff
path: root/test/errchk
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2008-10-17 07:41:18 -0700
committerRuss Cox <rsc@golang.org>2008-10-17 07:41:18 -0700
commit7a7402209de050bf21c09a7c918a699159cef1f0 (patch)
tree5eb71baa2782cf605a6f459f54ccdb86513cce3d /test/errchk
parent297760acbb7566c434afc42e4e5bdffece84cea7 (diff)
downloadgo-7a7402209de050bf21c09a7c918a699159cef1f0.tar.gz
make sure errchk only says BUG once,
so that run's count is correct R=iant,r DELTA=20 (12 added, 0 deleted, 8 changed) OCL=17329 CL=17342
Diffstat (limited to 'test/errchk')
-rwxr-xr-xtest/errchk18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/errchk b/test/errchk
index 61b77e39d..a8476a625 100755
--- a/test/errchk
+++ b/test/errchk
@@ -43,6 +43,15 @@ fi
cat $TMPOUT $TMPERR | grep -v '^ ' > $TMPALL
+didbug=false
+bug() {
+ if ! $didbug
+ then
+ echo 1>&2 -n BUG: ''
+ didbug=true
+ fi
+}
+
header=0
echo 0 > $TMPSTAT
pr -n -t $SOURCEFILE | grep '// ERROR' | while read line; do
@@ -52,17 +61,20 @@ pr -n -t $SOURCEFILE | grep '// ERROR' | while read line; do
grep -v "$SOURCEFILE:$lineno" < $TMPALL > $TMPTMP
mv -f $TMPTMP $TMPALL
if test -z "$errmsg"; then
- echo 1>&2 "BUG: errchk: $SOURCEFILE: missing expected error message on line $lineno: '$regexp'"
+ bug
+ echo 1>&2 "errchk: $SOURCEFILE: missing expected error message on line $lineno: '$regexp'"
echo 1 > $TMPSTAT
elif ! echo "$errmsg" | egrep -q "$regexp"; then
- echo 1>&2 "BUG: errchk: $SOURCEFILE: error message on line $lineno does not match '$regexp'"
+ bug
+ echo 1>&2 "errchk: $SOURCEFILE: error message on line $lineno does not match '$regexp'"
echo 1>&2 $errmsg
echo 1 > $TMPSTAT
fi
done
if test -s $TMPALL; then
- echo 1>&2 "BUG: errchk: $SOURCEFILE: unmatched error messages:"
+ bug
+ echo 1>&2 "errchk: $SOURCEFILE: unmatched error messages:"
echo 1>&2 "=================================================="
cat 1>&2 $TMPALL
echo 1>&2 "=================================================="