mirror of
https://github.com/golang/go.git
synced 2026-08-02 20:44:20 +08:00
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:
parent
10f7480a0e
commit
4d1000c44e
31
src/cmd/go/testdata/script/test_vet.txt
vendored
31
src/cmd/go/testdata/script/test_vet.txt
vendored
@ -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
|
||||
|
||||
|
||||
37
src/cmd/go/testdata/script/test_vet_vetall.txt
vendored
Normal file
37
src/cmd/go/testdata/script/test_vet_vetall.txt
vendored
Normal 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
|
||||
Loading…
x
Reference in New Issue
Block a user