]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/pack: use testenv.Command instead of exec.Command in tests
authorBryan C. Mills <bcmills@google.com>
Tue, 15 Nov 2022 15:45:00 +0000 (10:45 -0500)
committerGopher Robot <gobot@golang.org>
Tue, 15 Nov 2022 20:24:38 +0000 (20:24 +0000)
testenv.Command sets a default timeout based on the test's deadline
and sends SIGQUIT (where supported) in case of a hang.

Change-Id: Ia1dd1bacfa2c9378401bbce304ebf7ee3f159352
Reviewed-on: https://go-review.googlesource.com/c/go/+/450707
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/cmd/pack/pack_test.go

index ed241a0b5e4a8a5457267f852c30651c7251b9cb..be75738093512b8f34a4b55b6917d215b65e19d2 100644 (file)
@@ -12,7 +12,6 @@ import (
        "io"
        "io/fs"
        "os"
-       "os/exec"
        "path/filepath"
        "strings"
        "sync"
@@ -410,7 +409,7 @@ func TestRWithNonexistentFile(t *testing.T) {
 
 // doRun runs a program in a directory and returns the output.
 func doRun(t *testing.T, dir string, args ...string) string {
-       cmd := exec.Command(args[0], args[1:]...)
+       cmd := testenv.Command(t, args[0], args[1:]...)
        cmd.Dir = dir
        out, err := cmd.CombinedOutput()
        if err != nil {