diff options
author | Roland Shoemaker <roland@golang.org> | 2021-01-20 09:06:12 -0800 |
---|---|---|
committer | Dmitri Shuralyov <dmitshur@golang.org> | 2021-01-21 03:12:32 +0000 |
commit | b57ea3d3a4a49ffea832fb5f923c2d16eb7d2eb2 (patch) | |
tree | 1b30f9506b5c400608481b1bf10d28bbc12db349 | |
parent | 123e3786917997a2249299439e836115c73a53c5 (diff) | |
download | go-b57ea3d3a4a49ffea832fb5f923c2d16eb7d2eb2.tar.gz go-b57ea3d3a4a49ffea832fb5f923c2d16eb7d2eb2.zip |
[release-branch.go1.14] internal/execabs: only run tests on platforms that support them
Fixes #43792
Change-Id: I3bf022a28b194f0089ea96d93e56bbd9fb7e0aa8
Reviewed-on: https://go-review.googlesource.com/c/go/+/285055
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
-rw-r--r-- | src/internal/execabs/execabs_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/internal/execabs/execabs_test.go b/src/internal/execabs/execabs_test.go index a0b88dd2a0..1a197b8701 100644 --- a/src/internal/execabs/execabs_test.go +++ b/src/internal/execabs/execabs_test.go @@ -7,6 +7,7 @@ package execabs import ( "context" "fmt" + "internal/testenv" "io/ioutil" "os" "os/exec" @@ -30,6 +31,8 @@ func TestFixCmd(t *testing.T) { } func TestCommand(t *testing.T) { + testenv.MustHaveExec(t) + for _, cmd := range []func(string) *Cmd{ func(s string) *Cmd { return Command(s) }, func(s string) *Cmd { return CommandContext(context.Background(), s) }, @@ -71,6 +74,8 @@ func TestCommand(t *testing.T) { } func TestLookPath(t *testing.T) { + testenv.MustHaveExec(t) + tmpDir, err := ioutil.TempDir("", "execabs-test") if err != nil { t.Fatalf("ioutil.TempDir failed: %s", err) |