aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/exec')
-rw-r--r--src/os/exec/exec_test.go2
-rw-r--r--src/os/exec/exec_windows_test.go3
-rw-r--r--src/os/exec/lp_windows_test.go4
3 files changed, 5 insertions, 4 deletions
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go
index 67e2d256b4..c2f643a645 100644
--- a/src/os/exec/exec_test.go
+++ b/src/os/exec/exec_test.go
@@ -752,7 +752,7 @@ func TestExtraFiles(t *testing.T) {
tempdir := t.TempDir()
exe := filepath.Join(tempdir, "read3.exe")
- c := exec.Command(testenv.GoToolPath(t), "build", "-o", exe, "read3.go")
+ c := testenv.Command(t, testenv.GoToolPath(t), "build", "-o", exe, "read3.go")
// Build the test without cgo, so that C library functions don't
// open descriptors unexpectedly. See issue 25628.
c.Env = append(os.Environ(), "CGO_ENABLED=0")
diff --git a/src/os/exec/exec_windows_test.go b/src/os/exec/exec_windows_test.go
index b39790d61a..efd37107ed 100644
--- a/src/os/exec/exec_windows_test.go
+++ b/src/os/exec/exec_windows_test.go
@@ -8,6 +8,7 @@ package exec_test
import (
"fmt"
+ "internal/testenv"
"io"
"os"
"os/exec"
@@ -69,7 +70,7 @@ func TestPipePassing(t *testing.T) {
func TestNoInheritHandles(t *testing.T) {
t.Parallel()
- cmd := exec.Command("cmd", "/c exit 88")
+ cmd := testenv.Command(t, "cmd", "/c exit 88")
cmd.SysProcAttr = &syscall.SysProcAttr{NoInheritHandles: true}
err := cmd.Run()
exitError, ok := err.(*exec.ExitError)
diff --git a/src/os/exec/lp_windows_test.go b/src/os/exec/lp_windows_test.go
index d797b6c53c..50d522948a 100644
--- a/src/os/exec/lp_windows_test.go
+++ b/src/os/exec/lp_windows_test.go
@@ -164,7 +164,7 @@ func (test lookPathTest) run(t *testing.T, tmpdir, printpathExe string) {
// Run "cmd.exe /c test.searchFor" with new environment and
// work directory set. All candidates are copies of printpath.exe.
// These will output their program paths when run.
- should, errCmd := test.runProg(t, env, exec.Command("cmd", "/c", test.searchFor))
+ should, errCmd := test.runProg(t, env, testenv.Command(t, "cmd", "/c", test.searchFor))
// Run the lookpath program with new environment and work directory set.
have, errLP := test.runProg(t, env, helperCommand(t, "lookpath", test.searchFor))
// Compare results.
@@ -572,7 +572,7 @@ func buildPrintPathExe(t *testing.T, dir string) string {
t.Fatalf("failed to execute template: %v", err)
}
outname := name + ".exe"
- cmd := exec.Command(testenv.GoToolPath(t), "build", "-o", outname, srcname)
+ cmd := testenv.Command(t, testenv.GoToolPath(t), "build", "-o", outname, srcname)
cmd.Dir = dir
out, err := cmd.CombinedOutput()
if err != nil {