Skip to content

Commit

Permalink
cmd/go/internal/test: refresh flagdefs.go and fix test
Browse files Browse the repository at this point in the history
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 golang#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>
  • Loading branch information
Bryan C. Mills authored and gopherbot committed Feb 8, 2023
1 parent 0d8d181 commit 910f041
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/cmd/go/internal/test/flagdefs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/cmd/go/internal/test/flagdefs_test.go
Expand Up @@ -9,13 +9,15 @@ import (
"cmd/go/internal/test/internal/genflags"
"flag"
"internal/testenv"
"os"
"reflect"
"strings"
"testing"
)

func TestMain(m *testing.M) {
cfg.SetGOROOT(testenv.GOROOT(nil), false)
os.Exit(m.Run())
}

func TestPassFlagToTestIncludesAllTestFlags(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/go/internal/test/genflags.go
Expand Up @@ -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)
Expand Down

0 comments on commit 910f041

Please sign in to comment.