all: enable more tests on macOS/ARM64

Updates #38485.

Change-Id: Iac96f5ffe88521fcb11eab306d0df6463bdce046
Reviewed-on: https://go-review.googlesource.com/c/go/+/256920
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Cherry Zhang 2020-09-17 15:02:26 -04:00
parent 2e4ceaf963
commit db428ad7b6
10 changed files with 14 additions and 21 deletions

View file

@ -603,7 +603,7 @@ func TestExtar(t *testing.T) {
if runtime.Compiler == "gccgo" { if runtime.Compiler == "gccgo" {
t.Skip("skipping -extar test when using gccgo") t.Skip("skipping -extar test when using gccgo")
} }
if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" { if runtime.GOOS == "ios" {
t.Skip("shell scripts are not executable on iOS hosts") t.Skip("shell scripts are not executable on iOS hosts")
} }

View file

@ -36,7 +36,7 @@ func TestMain(m *testing.M) {
} }
func maybeSkip(t *testing.T) { func maybeSkip(t *testing.T) {
if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" { if runtime.GOOS == "ios" {
t.Skip("iOS does not have a full file tree") t.Skip("iOS does not have a full file tree")
} }
} }

View file

@ -221,10 +221,8 @@ func pkgImportPath(pkgpath string) *load.Package {
// See https://golang.org/issue/18878. // See https://golang.org/issue/18878.
func TestRespectSetgidDir(t *testing.T) { func TestRespectSetgidDir(t *testing.T) {
switch runtime.GOOS { switch runtime.GOOS {
case "darwin", "ios": case "ios":
if runtime.GOARCH == "arm64" { t.Skip("can't set SetGID bit with chmod on iOS")
t.Skip("can't set SetGID bit with chmod on iOS")
}
case "windows", "plan9": case "windows", "plan9":
t.Skip("chown/chmod setgid are not supported on Windows or Plan 9") t.Skip("chown/chmod setgid are not supported on Windows or Plan 9")
} }

View file

@ -120,7 +120,7 @@ func TestMultiplePackageImport(t *testing.T) {
} }
func TestLocalDirectory(t *testing.T) { func TestLocalDirectory(t *testing.T) {
if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" { if runtime.GOOS == "ios" {
t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH) t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
} }
@ -250,7 +250,7 @@ func TestMatchFile(t *testing.T) {
} }
func TestImportCmd(t *testing.T) { func TestImportCmd(t *testing.T) {
if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" { if runtime.GOOS == "ios" {
t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH) t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
} }

View file

@ -51,12 +51,7 @@ func testableNetwork(network string) bool {
switch network { switch network {
case "unix", "unixgram": case "unix", "unixgram":
switch runtime.GOOS { switch runtime.GOOS {
case "darwin", "ios": case "ios", "android":
switch runtime.GOARCH {
case "arm64":
return false
}
case "android":
return false return false
} }
} }

View file

@ -990,7 +990,7 @@ func TestDialerControl(t *testing.T) {
// except that it won't skip testing on non-mobile builders. // except that it won't skip testing on non-mobile builders.
func mustHaveExternalNetwork(t *testing.T) { func mustHaveExternalNetwork(t *testing.T) {
t.Helper() t.Helper()
mobile := runtime.GOOS == "android" || (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" mobile := runtime.GOOS == "android" || runtime.GOOS == "ios"
if testenv.Builder() == "" || mobile { if testenv.Builder() == "" || mobile {
testenv.MustHaveExternalNetwork(t) testenv.MustHaveExternalNetwork(t)
} }

View file

@ -82,7 +82,7 @@ func testableNetwork(network string) bool {
} }
func iOS() bool { func iOS() bool {
return (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" return runtime.GOOS == "ios"
} }
// testableAddress reports whether address of network is testable on // testableAddress reports whether address of network is testable on

View file

@ -431,7 +431,7 @@ func chtmpdir(t *testing.T) (restore func()) {
} }
func TestWalk(t *testing.T) { func TestWalk(t *testing.T) {
if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" { if runtime.GOOS == "ios" {
restore := chtmpdir(t) restore := chtmpdir(t)
defer restore() defer restore()
} }
@ -1278,7 +1278,7 @@ func TestDriveLetterInEvalSymlinks(t *testing.T) {
} }
func TestBug3486(t *testing.T) { // https://golang.org/issue/3486 func TestBug3486(t *testing.T) { // https://golang.org/issue/3486
if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" { if runtime.GOOS == "ios" {
t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH) t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH)
} }
root, err := filepath.EvalSymlinks(runtime.GOROOT() + "/test") root, err := filepath.EvalSymlinks(runtime.GOROOT() + "/test")

View file

@ -20,8 +20,8 @@ func TestPanicOnFault(t *testing.T) {
if runtime.GOARCH == "s390x" { if runtime.GOARCH == "s390x" {
t.Skip("s390x fault addresses are missing the low order bits") t.Skip("s390x fault addresses are missing the low order bits")
} }
if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" { if runtime.GOOS == "ios" {
t.Skip("darwin/arm64 doesn't provide fault addresses") t.Skip("iOS doesn't provide fault addresses")
} }
m, err := syscall.Mmap(-1, 0, 0x1000, syscall.PROT_READ /* Note: no PROT_WRITE */, syscall.MAP_SHARED|syscall.MAP_ANON) m, err := syscall.Mmap(-1, 0, 0x1000, syscall.PROT_READ /* Note: no PROT_WRITE */, syscall.MAP_SHARED|syscall.MAP_ANON)
if err != nil { if err != nil {

View file

@ -70,7 +70,7 @@ func _() {
// Thus this test also verifies that the Flock_t structure can be // Thus this test also verifies that the Flock_t structure can be
// roundtripped with F_SETLK and F_GETLK. // roundtripped with F_SETLK and F_GETLK.
func TestFcntlFlock(t *testing.T) { func TestFcntlFlock(t *testing.T) {
if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" { if runtime.GOOS == "ios" {
t.Skip("skipping; no child processes allowed on iOS") t.Skip("skipping; no child processes allowed on iOS")
} }
flock := syscall.Flock_t{ flock := syscall.Flock_t{