mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/go: fix TestScript/vet_flags
Test caching can cause an incorrect test failure when the vet step result is reused, leading to not printing a vet command line at all. Avoid that with -a (we are also using -n so no real work is done). Fixes one failing case in 'go test cmd/go' on my Mac. Change-Id: I028284436b1ecc77145c886db902845b524f4b97 Reviewed-on: https://go-review.googlesource.com/c/go/+/718181 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Michael Matloob <matloob@google.com> Auto-Submit: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
a8fb94969c
commit
a494a26bc2
1 changed files with 6 additions and 5 deletions
11
src/cmd/go/testdata/script/vet_flags.txt
vendored
11
src/cmd/go/testdata/script/vet_flags.txt
vendored
|
|
@ -20,7 +20,8 @@ stderr '-unsafeptr'
|
|||
! stderr '-unsafeptr=false'
|
||||
|
||||
# -unreachable is disabled during test but on during plain vet.
|
||||
go test -n runtime
|
||||
# The -a makes sure the vet result is not cached, or else we won't print the command line.
|
||||
go test -a -n runtime
|
||||
stderr '-unreachable=false'
|
||||
|
||||
# A flag terminator should be allowed before the package list.
|
||||
|
|
@ -63,16 +64,16 @@ go test -n -vet= -run=none .
|
|||
stderr '[/\\]vet'$GOEXE'["]? .* -errorsas .* ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
|
||||
|
||||
# "go test" on a standard package should by default disable an explicit list.
|
||||
go test -n -run=none encoding/binary
|
||||
go test -a -n -run=none encoding/binary
|
||||
stderr '[/\\]vet'$GOEXE'["]? -unsafeptr=false -unreachable=false ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
|
||||
|
||||
go test -n -vet= -run=none encoding/binary
|
||||
go test -a -n -vet= -run=none encoding/binary
|
||||
stderr '[/\\]vet'$GOEXE'["]? -unsafeptr=false -unreachable=false ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
|
||||
|
||||
# Both should allow users to override via the -vet flag.
|
||||
go test -n -vet=unreachable -run=none .
|
||||
go test -a -n -vet=unreachable -run=none .
|
||||
stderr '[/\\]vet'$GOEXE'["]? -unreachable ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
|
||||
go test -n -vet=unreachable -run=none encoding/binary
|
||||
go test -a -n -vet=unreachable -run=none encoding/binary
|
||||
stderr '[/\\]vet'$GOEXE'["]? -unreachable ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
|
||||
|
||||
-- go.mod --
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue