diff --git a/src/cmd/compile/internal/importer/gcimporter_test.go b/src/cmd/compile/internal/importer/gcimporter_test.go index 988d7daa25ced6..03562d394fad47 100644 --- a/src/cmd/compile/internal/importer/gcimporter_test.go +++ b/src/cmd/compile/internal/importer/gcimporter_test.go @@ -26,20 +26,6 @@ func TestMain(m *testing.M) { os.Exit(m.Run()) } -// skipSpecialPlatforms causes the test to be skipped for platforms where -// builders (build.golang.org) don't have access to compiled packages for -// import. -func skipSpecialPlatforms(t *testing.T) { - t.Helper() - testenv.MustHaveGoBuild(t) - - // TODO(bcmills): Is this still accurate now that ios is its own GOOS? - switch platform := runtime.GOOS + "-" + runtime.GOARCH; platform { - case "darwin-arm64": - t.Skipf("no compiled packages available for import on %s", platform) - } -} - // compile runs the compiler on filename, with dirname as the working directory, // and writes the output file to outdirname. // compile gives the resulting package a packagepath of testdata/. @@ -124,7 +110,7 @@ func TestImportTestdata(t *testing.T) { t.Skipf("gc-built packages not available (compiler = %s)", runtime.Compiler) } - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) testfiles := map[string][]string{ "exports.go": {"go/ast", "go/token"}, @@ -159,7 +145,7 @@ func TestImportTestdata(t *testing.T) { } func TestVersionHandling(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -250,7 +236,7 @@ func TestVersionHandling(t *testing.T) { } func TestImportStdLib(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -290,7 +276,7 @@ var importedObjectTests = []struct { } func TestImportedTypes(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -373,7 +359,7 @@ func verifyInterfaceMethodRecvs(t *testing.T, named *types2.Named, level int) { } func TestIssue5815(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -402,7 +388,7 @@ func TestIssue5815(t *testing.T) { // Smoke test to ensure that imported methods get the correct package. func TestCorrectMethodPackage(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -424,7 +410,7 @@ func TestCorrectMethodPackage(t *testing.T) { } func TestIssue13566(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -463,7 +449,7 @@ func TestIssue13566(t *testing.T) { } func TestIssue13898(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -509,7 +495,7 @@ func TestIssue13898(t *testing.T) { } func TestIssue15517(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -548,7 +534,7 @@ func TestIssue15517(t *testing.T) { } func TestIssue15920(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -565,7 +551,7 @@ func TestIssue15920(t *testing.T) { } func TestIssue20046(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -586,7 +572,7 @@ func TestIssue20046(t *testing.T) { } } func TestIssue25301(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -603,7 +589,7 @@ func TestIssue25301(t *testing.T) { } func TestIssue25596(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { diff --git a/src/go/internal/gcimporter/gcimporter_test.go b/src/go/internal/gcimporter/gcimporter_test.go index 7fa698d7c11c7a..bcbaa558d3b801 100644 --- a/src/go/internal/gcimporter/gcimporter_test.go +++ b/src/go/internal/gcimporter/gcimporter_test.go @@ -33,19 +33,6 @@ func TestMain(m *testing.M) { os.Exit(m.Run()) } -// skipSpecialPlatforms causes the test to be skipped for platforms where -// builders (build.golang.org) don't have access to compiled packages for -// import. -func skipSpecialPlatforms(t *testing.T) { - t.Helper() - testenv.MustHaveGoBuild(t) - - switch platform := runtime.GOOS + "-" + runtime.GOARCH; platform { - case "darwin-arm64": - t.Skipf("no compiled packages available for import on %s", platform) - } -} - // compile runs the compiler on filename, with dirname as the working directory, // and writes the output file to outdirname. // compile gives the resulting package a packagepath of testdata/. @@ -133,7 +120,7 @@ func TestImportTestdata(t *testing.T) { t.Skipf("gc-built packages not available (compiler = %s)", runtime.Compiler) } - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) testfiles := map[string][]string{ "exports.go": {"go/ast", "go/token"}, @@ -173,7 +160,7 @@ func TestImportTypeparamTests(t *testing.T) { t.Skipf("gc-built packages not available (compiler = %s)", runtime.Compiler) } - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) tmpdir := mktmpdir(t) defer os.RemoveAll(tmpdir) @@ -291,7 +278,7 @@ func checkFile(t *testing.T, filename string, src []byte) *types.Package { } func TestVersionHandling(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -384,7 +371,7 @@ func TestVersionHandling(t *testing.T) { } func TestImportStdLib(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -424,7 +411,7 @@ var importedObjectTests = []struct { } func TestImportedTypes(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -500,7 +487,7 @@ func verifyInterfaceMethodRecvs(t *testing.T, named *types.Named, level int) { } func TestIssue5815(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -529,7 +516,7 @@ func TestIssue5815(t *testing.T) { // Smoke test to ensure that imported methods get the correct package. func TestCorrectMethodPackage(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -553,7 +540,7 @@ func TestCorrectMethodPackage(t *testing.T) { } func TestIssue13566(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -592,7 +579,7 @@ func TestIssue13566(t *testing.T) { } func TestTypeNamingOrder(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -616,7 +603,7 @@ func TestTypeNamingOrder(t *testing.T) { } func TestIssue13898(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -663,7 +650,7 @@ func TestIssue13898(t *testing.T) { } func TestIssue15517(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -703,7 +690,7 @@ func TestIssue15517(t *testing.T) { } func TestIssue15920(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -720,7 +707,7 @@ func TestIssue15920(t *testing.T) { } func TestIssue20046(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -741,7 +728,7 @@ func TestIssue20046(t *testing.T) { } } func TestIssue25301(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" { @@ -758,7 +745,7 @@ func TestIssue25301(t *testing.T) { } func TestIssue25596(t *testing.T) { - skipSpecialPlatforms(t) + testenv.MustHaveGoBuild(t) // This package only handles gc export data. if runtime.Compiler != "gc" {