Commit 3a1271da authored by Elias Naur's avatar Elias Naur

go/internal/srcimporter: skip tests on iOS

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 23be7289
......@@ -76,7 +76,7 @@ func walkDir(t *testing.T, path string, endTime time.Time) (int, bool) {
}
func TestImportStdLib(t *testing.T) {
if runtime.GOOS == "nacl" {
if !testenv.HasSrc() {
t.Skip("no source code available")
}
......@@ -102,7 +102,7 @@ var importedObjectTests = []struct {
}
func TestImportedTypes(t *testing.T) {
if runtime.GOOS == "nacl" {
if !testenv.HasSrc() {
t.Skip("no source code available")
}
......@@ -134,7 +134,7 @@ func TestImportedTypes(t *testing.T) {
}
func TestReimport(t *testing.T) {
if runtime.GOOS == "nacl" {
if !testenv.HasSrc() {
t.Skip("no source code available")
}
......
......@@ -114,6 +114,19 @@ func HasExec() bool {
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.
......
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