diff options
| author | Russ Cox <rsc@golang.org> | 2015-06-05 11:01:53 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-06-16 18:07:36 +0000 |
| commit | 7bc3e5880675ce4aae245f46d193924cff5efdfb (patch) | |
| tree | bc5991015f83aa4852edaf31b096fc968c3f6369 /src/net/http/cgi | |
| parent | 047f07a285edbc60f64018973be7ce6b341fe22d (diff) | |
| download | go-7bc3e5880675ce4aae245f46d193924cff5efdfb.tar.xz | |
all: extract "can I exec?" check from tests into internal/testenv
Change-Id: I7b54be9d8b50b39e01c6be21f310ae9a10404e9d
Reviewed-on: https://go-review.googlesource.com/10753
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/net/http/cgi')
| -rw-r--r-- | src/net/http/cgi/matryoshka_test.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/net/http/cgi/matryoshka_test.go b/src/net/http/cgi/matryoshka_test.go index c89c6d525e..32d59c09a3 100644 --- a/src/net/http/cgi/matryoshka_test.go +++ b/src/net/http/cgi/matryoshka_test.go @@ -12,24 +12,19 @@ import ( "bytes" "errors" "fmt" + "internal/testenv" "io" "net/http" "net/http/httptest" "os" - "runtime" "testing" "time" ) -// iOS cannot fork, so we skip some tests -var iOS = runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") - // This test is a CGI host (testing host.go) that runs its own binary // as a child process testing the other half of CGI (child.go). func TestHostingOurselves(t *testing.T) { - if runtime.GOOS == "nacl" || iOS { - t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH) - } + testenv.MustHaveExec(t) h := &Handler{ Path: os.Args[0], @@ -96,9 +91,7 @@ func (w *limitWriter) Write(p []byte) (n int, err error) { // If there's an error copying the child's output to the parent, test // that we kill the child. func TestKillChildAfterCopyError(t *testing.T) { - if runtime.GOOS == "nacl" || iOS { - t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH) - } + testenv.MustHaveExec(t) defer func() { testHookStartProcess = nil }() proc := make(chan *os.Process, 1) @@ -143,9 +136,7 @@ func TestKillChildAfterCopyError(t *testing.T) { // Test that a child handler writing only headers works. // golang.org/issue/7196 func TestChildOnlyHeaders(t *testing.T) { - if runtime.GOOS == "nacl" || iOS { - t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH) - } + testenv.MustHaveExec(t) h := &Handler{ Path: os.Args[0], |
