Skip to content

Commit 44120fc

Browse files
Bryan C. Millsrsc
Bryan C. Mills
authored andcommitted
[internal-branch.go1.20-vendor] internal/gcimporter: skip tests earlier when 'go build' is not available
This fixes tests failing on the Android builders on Go 1.20 after CL 454499. Previously the tests were skipped in the 'compile' helper function, but as of that CL they fail before reaching that point due to missing export data for packages in std. Updates golang/go#56967. Updates golang/go#47257. Change-Id: Ief953b6dbc54c8e0b1f71fc18a0d6ab212caf308 Reviewed-on: https://go-review.googlesource.com/c/tools/+/454500 gopls-CI: kokoro <[email protected]> Reviewed-by: Jamal Carvalho <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]> (cherry picked from commit bdcd082) Reviewed-on: https://go-review.googlesource.com/c/tools/+/462638 Reviewed-by: Russ Cox <[email protected]>
1 parent 0e9ef4d commit 44120fc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/gcimporter/gcimporter_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ const testfile = "exports.go"
118118

119119
func TestImportTestdata(t *testing.T) {
120120
needsCompiler(t, "gc")
121+
testenv.NeedsGoBuild(t) // to find stdlib export data in the build cache
121122

122123
tmpdir := mktmpdir(t)
123124
defer os.RemoveAll(tmpdir)
@@ -164,6 +165,7 @@ func TestImportTypeparamTests(t *testing.T) {
164165
}
165166

166167
testenv.NeedsGo1Point(t, 18) // requires generics
168+
testenv.NeedsGoBuild(t) // to find stdlib export data in the build cache
167169

168170
// This package only handles gc export data.
169171
if runtime.Compiler != "gc" {
@@ -601,6 +603,7 @@ func TestCorrectMethodPackage(t *testing.T) {
601603
func TestIssue13566(t *testing.T) {
602604
// This package only handles gc export data.
603605
needsCompiler(t, "gc")
606+
testenv.NeedsGoBuild(t) // to find stdlib export data in the build cache
604607

605608
// On windows, we have to set the -D option for the compiler to avoid having a drive
606609
// letter and an illegal ':' in the import path - just skip it (see also issue #3483).

0 commit comments

Comments
 (0)