cmd/go: split test_vet script test for improved parallelism

For #78152

Change-Id: I0e0a0a4bcec2c3785619162bd837fbe76a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/798361
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Michael Matloob 2026-07-03 17:04:08 -04:00
parent 10f7480a0e
commit 4d1000c44e
2 changed files with 37 additions and 31 deletions

View File

@ -16,22 +16,6 @@ go test -vet=off p1.go
! stderr '[\\/]vet.*-shift'
stdout '\[no test files\]'
# ensure all runs non-default vet
! go test -vet=all ./vetall/...
stderr 'using resp before checking for errors'
# Test issue #47309
! go test -vet=bools,xyz ./vetall/...
stderr '-vet argument must be a supported analyzer'
# Test with a single analyzer
! go test -vet=httpresponse ./vetall/...
stderr 'using resp before checking for errors'
# Test with a list of analyzers
go test -vet=atomic,bools,nilfunc ./vetall/...
stdout 'm/vetall.*\[no tests to run\]'
# Test issue #22890
go test m/vetcycle
stdout 'm/vetcycle.*\[no test files\]'
@ -67,21 +51,6 @@ import "fmt"
func F() {
fmt.Printf("%d") // oops
}
-- vetall/p.go --
package p
import "net/http"
func F() {
resp, err := http.Head("example.com")
defer resp.Body.Close()
if err != nil {
panic(err)
}
// (defer statement belongs here)
}
-- vetall/p_test.go --
package p
-- vetcycle/p.go --
package p

View File

@ -0,0 +1,37 @@
[short] skip
# ensure all runs non-default vet
! go test -vet=all ./vetall/...
stderr 'using resp before checking for errors'
# Test issue #47309
! go test -vet=bools,xyz ./vetall/...
stderr '-vet argument must be a supported analyzer'
# Test with a single analyzer
! go test -vet=httpresponse ./vetall/...
stderr 'using resp before checking for errors'
# Test with a list of analyzers
go test -vet=atomic,bools,nilfunc ./vetall/...
stdout 'm/vetall.*\[no tests to run\]'
-- go.mod --
module m
go 1.16
-- vetall/p.go --
package p
import "net/http"
func F() {
resp, err := http.Head("example.com")
defer resp.Body.Close()
if err != nil {
panic(err)
}
// (defer statement belongs here)
}
-- vetall/p_test.go --
package p