diff options
Diffstat (limited to 'src/os/exec/exec_test.go')
| -rw-r--r-- | src/os/exec/exec_test.go | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index db84eabf26..3773963cb0 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -11,6 +11,7 @@ import ( "bufio" "bytes" "fmt" + "internal/testenv" "io" "io/ioutil" "log" @@ -27,13 +28,9 @@ import ( "time" ) -// iOS cannot fork -var iOS = runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") - func helperCommand(t *testing.T, s ...string) *exec.Cmd { - if runtime.GOOS == "nacl" || iOS { - t.Skipf("skipping on %s/%s, cannot fork", runtime.GOOS, runtime.GOARCH) - } + testenv.MustHaveExec(t) + cs := []string{"-test.run=TestHelperProcess", "--"} cs = append(cs, s...) cmd := exec.Command(os.Args[0], cs...) @@ -52,9 +49,7 @@ func TestEcho(t *testing.T) { } func TestCommandRelativeName(t *testing.T) { - if iOS { - t.Skip("skipping on darwin/%s, cannot fork", runtime.GOARCH) - } + testenv.MustHaveExec(t) // Run our own binary as a relative path // (e.g. "_test/exec.test") our parent directory. @@ -427,13 +422,11 @@ func TestExtraFilesFDShuffle(t *testing.T) { } func TestExtraFiles(t *testing.T) { - switch runtime.GOOS { - case "nacl", "windows": + testenv.MustHaveExec(t) + + if runtime.GOOS == "windows" { t.Skipf("skipping test on %q", runtime.GOOS) } - if iOS { - t.Skipf("skipping test on %s/%s, cannot fork", runtime.GOOS, runtime.GOARCH) - } // Ensure that file descriptors have not already been leaked into // our environment. |
