tg.grepStdout(`\[no test files\]`, "did not print test summary")
tg.run("test", "-vet=off", filepath.Join(tg.tempdir, "p1.go"))
tg.grepStdout(`\[no test files\]`, "did not print test summary")
+
+ tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
+ tg.run("test", "vetcycle") // must not fail; #22890
}
func TestInstallDeps(t *testing.T) {
GoFiles []string
ImportMap map[string]string
PackageFile map[string]string
+
+ SucceedOnTypecheckFailure bool
}
// VetFlags are the flags to pass to vet.
vcfg.PackageFile["fmt"] = a1.built
}
+ // During go test, ignore type-checking failures during vet.
+ // We only run vet if the compilation has succeeded,
+ // so at least for now assume the bug is in vet.
+ // We know of at least #18395.
+ // TODO(rsc,gri): Try to remove this for Go 1.11.
+ vcfg.SucceedOnTypecheckFailure = cfg.CmdName == "test"
+
js, err := json.MarshalIndent(vcfg, "", "\t")
if err != nil {
return fmt.Errorf("internal error marshaling vet config: %v", err)
--- /dev/null
+package p
+
+
+type (
+ _ interface{ m(B1) }
+ A1 interface{ a(D1) }
+ B1 interface{ A1 }
+ C1 interface{ B1 /* ERROR issue #18395 */ }
+ D1 interface{ C1 }
+)
+
+var _ A1 = C1 /* ERROR cannot use C1 */ (nil)
tagList = []string{} // exploded version of tags flag; set in main
mustTypecheck bool
+
+ succeedOnTypecheckFailure bool // during go test, we ignore potential bugs in go/types
)
var exitCode = 0
ImportMap map[string]string
PackageFile map[string]string
+ SucceedOnTypecheckFailure bool
+
imp types.Importer
}
if err := json.Unmarshal(js, &vcfg); err != nil {
errorf("parsing vet config %s: %v", cfgFile, err)
}
+ succeedOnTypecheckFailure = vcfg.SucceedOnTypecheckFailure
stdImporter = &vcfg
inittypes()
mustTypecheck = true
// Type check the package.
errs := pkg.check(fs, astFiles)
if errs != nil {
+ if succeedOnTypecheckFailure {
+ os.Exit(0)
+ }
if *verbose || mustTypecheck {
for _, err := range errs {
fmt.Fprintf(os.Stderr, "%v\n", err)