Skip to content

Commit

Permalink
internal/gcimporter: skip tests earlier when 'go build' is not available
Browse files Browse the repository at this point in the history
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 <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
  • Loading branch information
Bryan C. Mills authored and gopherbot committed Dec 2, 2022
1 parent 2ad6325 commit bdcd082
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/gcimporter/gcimporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const testfile = "exports.go"

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

tmpdir := mktmpdir(t)
defer os.RemoveAll(tmpdir)
Expand Down Expand Up @@ -164,6 +165,7 @@ func TestImportTypeparamTests(t *testing.T) {
}

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

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

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

0 comments on commit bdcd082

Please sign in to comment.