The iOS test harness only includes the current test directory in its
app bundles, but the tests need access to all source code.
Change-Id: I8a902b183bc2745b4fbfffef867002d573abb1f5
Reviewed-on: https://go-review.googlesource.com/37961
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
}
func TestImportStdLib(t *testing.T) {
- if runtime.GOOS == "nacl" {
+ if !testenv.HasSrc() {
t.Skip("no source code available")
}
}
func TestImportedTypes(t *testing.T) {
- if runtime.GOOS == "nacl" {
+ if !testenv.HasSrc() {
t.Skip("no source code available")
}
}
func TestReimport(t *testing.T) {
- if runtime.GOOS == "nacl" {
+ if !testenv.HasSrc() {
t.Skip("no source code available")
}
return true
}
+// HasSrc reports whether the entire source tree is available under GOROOT.
+func HasSrc() bool {
+ switch runtime.GOOS {
+ case "nacl":
+ return false
+ case "darwin":
+ if strings.HasPrefix(runtime.GOARCH, "arm") {
+ return false
+ }
+ }
+ return true
+}
+
// MustHaveExec checks that the current system can start new processes
// using os.StartProcess or (more commonly) exec.Command.
// If not, MustHaveExec calls t.Skip with an explanation.