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>
This commit is contained in:
Russ Cox 2015-06-05 11:01:53 -04:00
parent 047f07a285
commit 7bc3e58806
21 changed files with 163 additions and 233 deletions

View file

@ -5,6 +5,7 @@
package main
import (
"internal/testenv"
"io/ioutil"
"os"
"os/exec"
@ -15,15 +16,7 @@ import (
)
func buildObjdump(t *testing.T) (tmp, exe string) {
switch runtime.GOOS {
case "android", "nacl":
t.Skipf("skipping on %s", runtime.GOOS)
case "darwin":
switch runtime.GOARCH {
case "arm", "arm64":
t.Skipf("skipping on %s/%s, cannot fork", runtime.GOOS, runtime.GOARCH)
}
}
testenv.MustHaveGoBuild(t)
tmp, err := ioutil.TempDir("", "TestObjDump")
if err != nil {