]> Cypherpunks repositories - gostls13.git/commitdiff
go/internal/gcimporter,cmd/compile/internal/importer: skip tests that need 'go list...
authorBryan C. Mills <bcmills@google.com>
Wed, 19 Oct 2022 15:57:15 +0000 (11:57 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 19 Oct 2022 16:30:38 +0000 (16:30 +0000)
js/wasm doesn't support os.Exec, so it can't run 'go list' to locate
export data for packages in the standard library.

This fixes js/wasm test failures introduced in CL 442303.

For #47257.

Change-Id: I39289f376691493aa6fb447b3329f6508ab48d58
Reviewed-on: https://go-review.googlesource.com/c/go/+/444015
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/compile/internal/importer/gcimporter_test.go
src/go/internal/gcimporter/gcimporter_test.go

index ac502e6e37e8d6a8c5eeea6b53263d2fb95df2e7..988d7daa25ced6b171bf7f87be8f7b66fb52b74c 100644 (file)
@@ -30,6 +30,10 @@ func TestMain(m *testing.M) {
 // 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)
@@ -120,6 +124,8 @@ func TestImportTestdata(t *testing.T) {
                t.Skipf("gc-built packages not available (compiler = %s)", runtime.Compiler)
        }
 
+       skipSpecialPlatforms(t)
+
        testfiles := map[string][]string{
                "exports.go":  {"go/ast", "go/token"},
                "generics.go": nil,
index de6a791dc86fab48c42c08cbd10f84d36062c90d..7fa698d7c11c7a3b2cc52f1536a560b2b902bd7c 100644 (file)
@@ -37,6 +37,9 @@ func TestMain(m *testing.M) {
 // 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)
@@ -130,6 +133,8 @@ func TestImportTestdata(t *testing.T) {
                t.Skipf("gc-built packages not available (compiler = %s)", runtime.Compiler)
        }
 
+       skipSpecialPlatforms(t)
+
        testfiles := map[string][]string{
                "exports.go":  {"go/ast", "go/token"},
                "generics.go": nil,
@@ -168,6 +173,8 @@ func TestImportTypeparamTests(t *testing.T) {
                t.Skipf("gc-built packages not available (compiler = %s)", runtime.Compiler)
        }
 
+       skipSpecialPlatforms(t)
+
        tmpdir := mktmpdir(t)
        defer os.RemoveAll(tmpdir)