summaryrefslogtreecommitdiff
path: root/test/errchk
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-08-03 16:54:30 +0200
committerOndřej Surý <ondrej@sury.org>2011-08-03 16:54:30 +0200
commit28592ee1ea1f5cdffcf85472f9de0285d928cf12 (patch)
tree32944e18b23f7fe4a0818a694aa2a6dfb1835463 /test/errchk
parente836bee4716dc0d4d913537ad3ad1925a7ac32d0 (diff)
downloadgolang-upstream/59.tar.gz
Imported Upstream version 59upstream/59
Diffstat (limited to 'test/errchk')
-rwxr-xr-xtest/errchk16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/errchk b/test/errchk
index fbb021ce4..e89d75950 100755
--- a/test/errchk
+++ b/test/errchk
@@ -81,6 +81,19 @@ sub chk {
next;
}
$regexp = $1;
+
+ # Turn relative line number in message into absolute line number.
+ if($regexp =~ /LINE(([+-])([0-9]+))?/) {
+ my $n = $line;
+ if(defined($1)) {
+ if($2 eq "+") {
+ $n += int($3);
+ } else {
+ $n -= int($3);
+ }
+ }
+ $regexp = "$`$file:$n$'";
+ }
@errmsg = grep { /$file:$line[:[]/ } @out;
@out = grep { !/$file:$line[:[]/ } @out;
@@ -93,6 +106,9 @@ sub chk {
if(@match == 0) {
bug();
print STDERR "errchk: $file:$line: error message does not match '$regexp'\n";
+ foreach my $l (@errmsg) {
+ print STDERR "> $l";
+ }
next;
}
}