aboutsummaryrefslogtreecommitdiff
path: root/src/os/executable_test.go
diff options
context:
space:
mode:
authorcui fliter <imcusg@gmail.com>2022-11-16 22:45:54 +0800
committerGopher Robot <gobot@golang.org>2022-11-17 16:24:19 +0000
commitf3ae7ac9d90a26e9bba1589ae934e62bf0ac17e0 (patch)
tree46b6d20afdc2ffad8b9b9fc066edfe383403724c /src/os/executable_test.go
parent86713ea31116ca295db98713d24c2cea41dcb5be (diff)
downloadgo-f3ae7ac9d90a26e9bba1589ae934e62bf0ac17e0.tar.xz
os: use testenv.Command instead of exec.Command in tests
testenv.Command sets a default timeout based on the test's deadline and sends SIGQUIT (where supported) in case of a hang. Change-Id: I32ea9ca11c30d8af3d5490f2db1674314962cc80 Reviewed-on: https://go-review.googlesource.com/c/go/+/451195 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Joedian Reid <joedian@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/os/executable_test.go')
-rw-r--r--src/os/executable_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/os/executable_test.go b/src/os/executable_test.go
index 719d6a61c3..b69fe41ea3 100644
--- a/src/os/executable_test.go
+++ b/src/os/executable_test.go
@@ -106,13 +106,13 @@ func TestExecutableDeleted(t *testing.T) {
t.Fatal(err)
}
- out, err := osexec.Command(testenv.GoToolPath(t), "build", "-o", exe, src).CombinedOutput()
+ out, err := testenv.Command(t, testenv.GoToolPath(t), "build", "-o", exe, src).CombinedOutput()
t.Logf("build output:\n%s", out)
if err != nil {
t.Fatal(err)
}
- out, err = osexec.Command(exe).CombinedOutput()
+ out, err = testenv.Command(t, exe).CombinedOutput()
t.Logf("exec output:\n%s", out)
if err != nil {
t.Fatal(err)