mirror of
https://github.com/golang/go
synced 2024-11-23 00:00:07 -07:00
cmd/go/internal/test: refresh flagdefs.go and fix test
The tests for cmd/go/internal/test were not running at all due to a missed call to m.Run in TestMain. That masked two missing vet analyzers ("directive" and "timeformat") and a missed update to the generator script in CL 355452. Fixes #58415. Change-Id: I7b0315952967ca07a866cdaa5903478b2873eb7a Reviewed-on: https://go-review.googlesource.com/c/go/+/466635 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com>
This commit is contained in:
parent
0d8d181bd5
commit
910f041ff0
@ -49,6 +49,7 @@ var passAnalyzersToVet = map[string]bool{
|
|||||||
"cgocall": true,
|
"cgocall": true,
|
||||||
"composites": true,
|
"composites": true,
|
||||||
"copylocks": true,
|
"copylocks": true,
|
||||||
|
"directive": true,
|
||||||
"errorsas": true,
|
"errorsas": true,
|
||||||
"framepointer": true,
|
"framepointer": true,
|
||||||
"httpresponse": true,
|
"httpresponse": true,
|
||||||
@ -66,6 +67,7 @@ var passAnalyzersToVet = map[string]bool{
|
|||||||
"structtag": true,
|
"structtag": true,
|
||||||
"testinggoroutine": true,
|
"testinggoroutine": true,
|
||||||
"tests": true,
|
"tests": true,
|
||||||
|
"timeformat": true,
|
||||||
"unmarshal": true,
|
"unmarshal": true,
|
||||||
"unreachable": true,
|
"unreachable": true,
|
||||||
"unsafeptr": true,
|
"unsafeptr": true,
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
"cmd/go/internal/test/internal/genflags"
|
"cmd/go/internal/test/internal/genflags"
|
||||||
"flag"
|
"flag"
|
||||||
"internal/testenv"
|
"internal/testenv"
|
||||||
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@ -16,6 +17,7 @@ import (
|
|||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
cfg.SetGOROOT(testenv.GOROOT(nil), false)
|
cfg.SetGOROOT(testenv.GOROOT(nil), false)
|
||||||
|
os.Exit(m.Run())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPassFlagToTestIncludesAllTestFlags(t *testing.T) {
|
func TestPassFlagToTestIncludesAllTestFlags(t *testing.T) {
|
||||||
|
@ -75,7 +75,7 @@ func testFlags() []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
case "testlogfile", "paniconexit0", "fuzzcachedir", "fuzzworker":
|
case "testlogfile", "paniconexit0", "fuzzcachedir", "fuzzworker", "gocoverdir":
|
||||||
// These flags are only for use by cmd/go.
|
// These flags are only for use by cmd/go.
|
||||||
default:
|
default:
|
||||||
names = append(names, name)
|
names = append(names, name)
|
||||||
|
Loading…
Reference in New Issue
Block a user