The tests for cmd/go/internal/test were not running at all due to a
missed call to m.Run in TestMain. That masked a missing vet analyzer
("timeformat") and a missed update to the generator script in
CL 355452.
Fixes #58421.
Updates #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>
(cherry picked from commit
910f041ff0cdf90dbcd3bd22a272b9b7205a5add)
Reviewed-on: https://go-review.googlesource.com/c/go/+/466855
"structtag": true,
"testinggoroutine": true,
"tests": true,
+ "timeformat": true,
"unmarshal": true,
"unreachable": true,
"unsafeptr": true,
"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) {
}
func TestVetAnalyzersSetIsCorrect(t *testing.T) {
+ testenv.MustHaveGoBuild(t) // runs 'go tool vet -flags'
+
vetAns, err := genflags.VetAnalyzers()
if err != nil {
t.Fatal(err)
}
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)