internal/testenv: remove darwin/arm case from NeedsGoBuild

This function was derived from internal/testenv.HasGoBuild
in the standard library, which has since been updated
(in https://go-review.googlesource.com/c/go/+/260719)
to permit darwin/arm64 builds.

Change-Id: Ifc793b52b65ee3eedb2f41fbcbfbe36a20cfdbcc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/403795
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Alan Donovan 2022-05-04 15:37:49 -04:00
parent 54c7ba520b
commit 4911e4af7d
1 changed files with 4 additions and 5 deletions

View File

@ -224,22 +224,21 @@ func NeedsGoPackagesEnv(t Testing, env []string) {
// NeedsGoBuild skips t if the current system can't build programs with “go build”
// and then run them with os.StartProcess or exec.Command.
// android, and darwin/arm systems don't have the userspace go build needs to run,
// Android doesn't have the userspace go build needs to run,
// and js/wasm doesn't support running subprocesses.
func NeedsGoBuild(t Testing) {
if t, ok := t.(helperer); ok {
t.Helper()
}
// This logic was derived from internal/testing.HasGoBuild and
// may need to be updated as that function evolves.
NeedsTool(t, "go")
switch runtime.GOOS {
case "android", "js":
t.Skipf("skipping test: %v can't build and run Go binaries", runtime.GOOS)
case "darwin":
if strings.HasPrefix(runtime.GOARCH, "arm") {
t.Skipf("skipping test: darwin/arm can't build and run Go binaries")
}
}
}