]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/test: refresh flagdefs.go and fix test
authorBryan C. Mills <bcmills@google.com>
Wed, 8 Feb 2023 19:36:47 +0000 (14:36 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 8 Feb 2023 23:52:18 +0000 (23:52 +0000)
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>

src/cmd/go/internal/test/flagdefs.go
src/cmd/go/internal/test/flagdefs_test.go
src/cmd/go/internal/test/genflags.go

index b91204ee93758d7fc65d4d42334cf5f8ec62e16b..d9f4fca17a1c42bf6329e64391249830171e78b9 100644 (file)
@@ -49,6 +49,7 @@ var passAnalyzersToVet = map[string]bool{
        "cgocall":          true,
        "composites":       true,
        "copylocks":        true,
+       "directive":        true,
        "errorsas":         true,
        "framepointer":     true,
        "httpresponse":     true,
@@ -66,6 +67,7 @@ var passAnalyzersToVet = map[string]bool{
        "structtag":        true,
        "testinggoroutine": true,
        "tests":            true,
+       "timeformat":       true,
        "unmarshal":        true,
        "unreachable":      true,
        "unsafeptr":        true,
index 337f136d06177aecddb6637aa365e5c409ea5bc8..1c46d78b1bc1803653758a4eab72830ad7d34822 100644 (file)
@@ -9,6 +9,7 @@ import (
        "cmd/go/internal/test/internal/genflags"
        "flag"
        "internal/testenv"
+       "os"
        "reflect"
        "strings"
        "testing"
@@ -16,6 +17,7 @@ import (
 
 func TestMain(m *testing.M) {
        cfg.SetGOROOT(testenv.GOROOT(nil), false)
+       os.Exit(m.Run())
 }
 
 func TestPassFlagToTestIncludesAllTestFlags(t *testing.T) {
index 8c7554919a5c8cca0fe26fa6ece502327044c905..625f94133a147982902ad06474d61fb7773e9e16 100644 (file)
@@ -75,7 +75,7 @@ func testFlags() []string {
                }
 
                switch name {
-               case "testlogfile", "paniconexit0", "fuzzcachedir", "fuzzworker":
+               case "testlogfile", "paniconexit0", "fuzzcachedir", "fuzzworker", "gocoverdir":
                        // These flags are only for use by cmd/go.
                default:
                        names = append(names, name)