mirror of
https://github.com/golang/go
synced 2024-11-18 12:04:57 -07:00
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: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
23be728950
commit
3a1271dad7
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user