From: Daniel Morsing Date: Mon, 8 Oct 2012 14:36:45 +0000 (+0200) Subject: test: Make run.go's errorcheck behave like testlib. X-Git-Tag: go1.1rc2~2192 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c81293ada7184e5fed6aee632bbf9129a9a7f370;p=gostls13.git test: Make run.go's errorcheck behave like testlib. testlib will complain about any unmatched errors left in errorchecks while run.go will not. Fixes #4141. R=golang-dev, minux.ma, remyoudompheng, rsc CC=golang-dev https://golang.org/cl/6614060 --- diff --git a/test/run.go b/test/run.go index b6437ee1d3..b79323dd17 100644 --- a/test/run.go +++ b/test/run.go @@ -522,7 +522,9 @@ func (t *test) errorCheck(outStr string, full, short string) (err error) { } if strings.HasPrefix(line, "\t") { out[len(out)-1] += "\n" + line - } else { + } else if strings.HasPrefix(line, "go tool") { + continue + } else if strings.TrimSpace(line) != "" { out = append(out, line) } } @@ -553,6 +555,13 @@ func (t *test) errorCheck(outStr string, full, short string) (err error) { } } + if len(out) > 0 { + errs = append(errs, fmt.Errorf("Unmatched Errors:")) + for _, errLine := range out { + errs = append(errs, fmt.Errorf("%s", errLine)) + } + } + if len(errs) == 0 { return nil }