]> Cypherpunks repositories - gostls13.git/commitdiff
internal/reflectlite: skip TestMirrorWithReflect reflect package source is unavailable
authorBryan C. Mills <bcmills@google.com>
Fri, 11 Oct 2019 12:58:52 +0000 (08:58 -0400)
committerBryan C. Mills <bcmills@google.com>
Fri, 11 Oct 2019 13:25:59 +0000 (13:25 +0000)
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: Elias Naur <mail@eliasnaur.com>
src/internal/reflectlite/reflect_mirror_test.go

index 59d3ec407eac0680a8c964cfafaa7a8663e2cee9..fbb6fb397ef2d6cfc26c2e5e1df93c8d66492718 100644 (file)
@@ -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)