Skip to content

Commit

Permalink
internal/reflectlite: skip TestMirrorWithReflect reflect package sour…
Browse files Browse the repository at this point in the history
…ce is unavailable

Fixes #34847

Change-Id: Ibb58c8820cdab8b9f3755fcfba754ad0c9ca982f
Reviewed-on: https://go-review.googlesource.com/c/go/+/200657
Run-TryBot: Bryan C. Mills <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Elias Naur <[email protected]>
  • Loading branch information
Bryan C. Mills committed Oct 11, 2019
1 parent d0f10a6 commit d189bdd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/internal/reflectlite/reflect_mirror_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ func loadTypes(path, pkgName string, v visitor) {
}

func TestMirrorWithReflect(t *testing.T) {
reflectDir := filepath.Join(runtime.GOROOT(), "src", "reflect")
if _, err := os.Stat(reflectDir); os.IsNotExist(err) {
// On some mobile builders, the test binary executes on a machine without a
// complete GOROOT source tree.
t.Skipf("GOROOT source not present")
}

var wg sync.WaitGroup
rl, r := newVisitor(), newVisitor()

Expand All @@ -95,7 +102,7 @@ func TestMirrorWithReflect(t *testing.T) {
v visitor
}{
{".", "reflectlite", rl},
{filepath.Join(runtime.GOROOT(), "src", "reflect"), "reflect", r},
{reflectDir, "reflect", r},
} {
tc := tc
wg.Add(1)
Expand Down

0 comments on commit d189bdd

Please sign in to comment.