]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/compile/internal/types2: fix tests on js/wasm
authorBryan C. Mills <bcmills@google.com>
Mon, 31 Oct 2022 15:14:35 +0000 (11:14 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 31 Oct 2022 15:44:19 +0000 (15:44 +0000)
The js/wasm builder started failing as of CL 432535 due to needing
'go build' to import standard-library packages that are no longer
installed to GOROOT/pkg. Since js/wasm can't exec subprocesses,
it cannot run 'go build' to generate the export data needed for
these tests.

For #47257.

Change-Id: I804235fd725faf00b27cbed79ee1f43dea8ab734
Reviewed-on: https://go-review.googlesource.com/c/go/+/446635
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>

src/cmd/compile/internal/types2/example_test.go
src/cmd/compile/internal/types2/issues_test.go
src/cmd/compile/internal/types2/self_test.go
src/cmd/compile/internal/types2/sizes_test.go
src/cmd/compile/internal/types2/typestring_test.go

index 85f5f2a61cc9b6aeffa129ffdb3aa401e2d9daac..b89cadfb4a24beaed6dfff90baa24b5f535aa9a1 100644 (file)
@@ -5,7 +5,7 @@
 // Only run where builders (build.golang.org) have
 // access to compiled packages for import.
 //
-//go:build !arm && !arm64
+//go:build !android && !ios && !js
 
 package types2_test
 
index 777f7af7bfae0f77cafe4883dfaa8415fda622aa..c45c536e910553069dbbc0a7cafa75328cb048d3 100644 (file)
@@ -552,6 +552,8 @@ func TestIssue44515(t *testing.T) {
 }
 
 func TestIssue43124(t *testing.T) {
+       testenv.MustHaveGoBuild(t)
+
        // All involved packages have the same name (template). Error messages should
        // disambiguate between text/template and html/template by printing the full
        // path.
index 9a01ccdf7a28bbce7903885bf51e36feaa4ab374..e68d52db42e2bd291bcb75b6dcff55a2fefab4e3 100644 (file)
@@ -6,6 +6,7 @@ package types2_test
 
 import (
        "cmd/compile/internal/syntax"
+       "internal/testenv"
        "path"
        "path/filepath"
        "runtime"
@@ -16,6 +17,8 @@ import (
 )
 
 func TestSelf(t *testing.T) {
+       testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files.
+
        files, err := pkgFiles(".")
        if err != nil {
                t.Fatal(err)
@@ -29,6 +32,8 @@ func TestSelf(t *testing.T) {
 }
 
 func BenchmarkCheck(b *testing.B) {
+       testenv.MustHaveGoBuild(b) // The Go command is needed for the importer to determine the locations of stdlib .a files.
+
        for _, p := range []string{
                filepath.Join("src", "net", "http"),
                filepath.Join("src", "go", "parser"),
index a6c8468d1f0c652e6b055666f3b191c6e82519c8..e548c2d0478391fe3e6909ff692c6596540d27c0 100644 (file)
@@ -9,6 +9,7 @@ package types2_test
 import (
        "cmd/compile/internal/syntax"
        "cmd/compile/internal/types2"
+       "internal/testenv"
        "testing"
 )
 
@@ -101,6 +102,8 @@ const _ = unsafe.Offsetof(struct{ x int64 }{}.x)
 
 // Issue #53884.
 func TestAtomicAlign(t *testing.T) {
+       testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files.
+
        const src = `
 package main
 
index 735b153fb27025acacf2108f718adcb68a679687..7dd9b3528115088bf0f280d275757816c52db63b 100644 (file)
@@ -109,6 +109,7 @@ var dependentTestTypes = []testEntry{
 }
 
 func TestTypeString(t *testing.T) {
+       // The Go command is needed for the importer to determine the locations of stdlib .a files.
        testenv.MustHaveGoBuild(t)
 
        var tests []testEntry