Commit c7b7c433 authored by Russ Cox's avatar Russ Cox

cmd/go: do not let test vet failures stop reporting of later test results

(This only manifested in test vet failures for packages without tests,
or else we'd probably have seen this sooner.)

Fixes #23047.

Change-Id: I41d09a7780999bbe1951377ffcc811ba86ea5000
Reviewed-on: https://go-review.googlesource.com/83955
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent c4da6101
......@@ -5275,6 +5275,10 @@ func TestTestVet(t *testing.T) {
tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
tg.run("test", "vetcycle") // must not fail; #22890
tg.runFail("test", "vetfail/...")
tg.grepStderr(`Printf format %d`, "did not diagnose bad Printf")
tg.grepStdout(`ok\s+vetfail/p2`, "did not run vetfail/p2")
}
func TestInstallDeps(t *testing.T) {
......
......@@ -1087,7 +1087,7 @@ func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, prin
Func: c.builderRunTest,
Deps: []*work.Action{buildAction},
Package: p,
IgnoreFail: true,
IgnoreFail: true, // run (prepare output) even if build failed
TryCache: c.tryCache,
Objdir: testDir,
}
......@@ -1102,6 +1102,7 @@ func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, prin
Func: builderCleanTest,
Deps: []*work.Action{runAction},
Package: p,
IgnoreFail: true, // clean even if test failed
Objdir: testDir,
}
printAction = &work.Action{
......@@ -1109,6 +1110,7 @@ func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, prin
Func: builderPrintTest,
Deps: []*work.Action{cleanAction},
Package: p,
IgnoreFail: true, // print even if test failed
}
}
if installAction != nil {
......
package p1
import "fmt"
func F() {
fmt.Printf("%d", "hello") // causes vet error
}
package p2
import _ "vetfail/p1"
func F() {
}
package p2
import "testing"
func TestF(t *testing.T) {
F()
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment