Commit d189bdd6 authored by Bryan C. Mills's avatar Bryan C. Mills

internal/reflectlite: skip TestMirrorWithReflect reflect package source is unavailable

Fixes #34847

Change-Id: Ibb58c8820cdab8b9f3755fcfba754ad0c9ca982f
Reviewed-on: https://go-review.googlesource.com/c/go/+/200657
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarElias Naur <mail@eliasnaur.com>
parent d0f10a6e
......@@ -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()
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment