mirror of
https://github.com/golang/go
synced 2024-09-23 19:20:13 -06:00
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
This commit is contained in:
parent
156d85c3e9
commit
c81293ada7
11
test/run.go
11
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user