Skip to content

Commit 0a6c4c8

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
cmd/compile/internal/types2: fix tests on js/wasm
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 <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Bryan Mills <[email protected]>
1 parent 6774ddf commit 0a6c4c8

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

src/cmd/compile/internal/types2/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Only run where builders (build.golang.org) have
66
// access to compiled packages for import.
77
//
8-
//go:build !arm && !arm64
8+
//go:build !android && !ios && !js
99

1010
package types2_test
1111

src/cmd/compile/internal/types2/issues_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,8 @@ func TestIssue44515(t *testing.T) {
552552
}
553553

554554
func TestIssue43124(t *testing.T) {
555+
testenv.MustHaveGoBuild(t)
556+
555557
// All involved packages have the same name (template). Error messages should
556558
// disambiguate between text/template and html/template by printing the full
557559
// path.

src/cmd/compile/internal/types2/self_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package types2_test
66

77
import (
88
"cmd/compile/internal/syntax"
9+
"internal/testenv"
910
"path"
1011
"path/filepath"
1112
"runtime"
@@ -16,6 +17,8 @@ import (
1617
)
1718

1819
func TestSelf(t *testing.T) {
20+
testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files.
21+
1922
files, err := pkgFiles(".")
2023
if err != nil {
2124
t.Fatal(err)
@@ -29,6 +32,8 @@ func TestSelf(t *testing.T) {
2932
}
3033

3134
func BenchmarkCheck(b *testing.B) {
35+
testenv.MustHaveGoBuild(b) // The Go command is needed for the importer to determine the locations of stdlib .a files.
36+
3237
for _, p := range []string{
3338
filepath.Join("src", "net", "http"),
3439
filepath.Join("src", "go", "parser"),

src/cmd/compile/internal/types2/sizes_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package types2_test
99
import (
1010
"cmd/compile/internal/syntax"
1111
"cmd/compile/internal/types2"
12+
"internal/testenv"
1213
"testing"
1314
)
1415

@@ -101,6 +102,8 @@ const _ = unsafe.Offsetof(struct{ x int64 }{}.x)
101102

102103
// Issue #53884.
103104
func TestAtomicAlign(t *testing.T) {
105+
testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files.
106+
104107
const src = `
105108
package main
106109

src/cmd/compile/internal/types2/typestring_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ var dependentTestTypes = []testEntry{
109109
}
110110

111111
func TestTypeString(t *testing.T) {
112+
// The Go command is needed for the importer to determine the locations of stdlib .a files.
112113
testenv.MustHaveGoBuild(t)
113114

114115
var tests []testEntry

0 commit comments

Comments
 (0)