From e89823e0676d2a52c5a2276be6f64814a35342ff Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 30 Sep 2021 13:54:23 -0700 Subject: [PATCH] x/tools/go/internal/gcimporter: exclude a file from TestImportTypeparamTests Matching change for the corresponding file in CL 353389. To make the builds pass for now. For golang/go#48424. Change-Id: Id66837957ffec4e4b19faa0337a7587ea8bd6125 Reviewed-on: https://go-review.googlesource.com/c/tools/+/353395 Trust: Robert Griesemer Run-TryBot: Robert Griesemer TryBot-Result: Go Bot Reviewed-by: Robert Findley gopls-CI: kokoro --- go/internal/gcimporter/iexport_go118_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/go/internal/gcimporter/iexport_go118_test.go b/go/internal/gcimporter/iexport_go118_test.go index 3c9610ea759..50ac0f752df 100644 --- a/go/internal/gcimporter/iexport_go118_test.go +++ b/go/internal/gcimporter/iexport_go118_test.go @@ -80,6 +80,10 @@ func TestImportTypeparamTests(t *testing.T) { t.Skip("unified export data format is currently unsupported") } + skip := map[string]string{ + "issue48424.go": "go/types support missing", // TODO: need to implement this if #48424 is accepted + } + for _, entry := range list { if entry.IsDir() || !strings.HasSuffix(entry.Name(), ".go") { // For now, only consider standalone go files. @@ -87,17 +91,23 @@ func TestImportTypeparamTests(t *testing.T) { } t.Run(entry.Name(), func(t *testing.T) { + if reason, ok := skip[entry.Name()]; ok { + t.Skip(reason) + } + filename := filepath.Join(rootDir, entry.Name()) src, err := os.ReadFile(filename) if err != nil { t.Fatal(err) } + if !bytes.HasPrefix(src, []byte("// run")) && !bytes.HasPrefix(src, []byte("// compile")) { // We're bypassing the logic of run.go here, so be conservative about // the files we consider in an attempt to make this test more robust to // changes in test/typeparams. t.Skipf("not detected as a run test") } + testExportSrc(t, src) }) }