summaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/test/ssa_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/test/ssa_test.go')
-rw-r--r--src/cmd/compile/internal/test/ssa_test.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/test/ssa_test.go b/src/cmd/compile/internal/test/ssa_test.go
index 56cd1285ec..0b6a675238 100644
--- a/src/cmd/compile/internal/test/ssa_test.go
+++ b/src/cmd/compile/internal/test/ssa_test.go
@@ -12,7 +12,6 @@ import (
"go/token"
"internal/testenv"
"os"
- "os/exec"
"path/filepath"
"runtime"
"strings"
@@ -27,7 +26,7 @@ func runGenTest(t *testing.T, filename, tmpname string, ev ...string) {
testenv.MustHaveGoRun(t)
gotool := testenv.GoToolPath(t)
var stdout, stderr bytes.Buffer
- cmd := exec.Command(gotool, "run", filepath.Join("testdata", filename))
+ cmd := testenv.Command(t, gotool, "run", filepath.Join("testdata", filename))
cmd.Stdout = &stdout
cmd.Stderr = &stderr
if err := cmd.Run(); err != nil {
@@ -48,7 +47,7 @@ func runGenTest(t *testing.T, filename, tmpname string, ev ...string) {
stdout.Reset()
stderr.Reset()
- cmd = exec.Command(gotool, "run", "-gcflags=-d=ssa/check/on", rungo)
+ cmd = testenv.Command(t, gotool, "run", "-gcflags=-d=ssa/check/on", rungo)
cmd.Stdout = &stdout
cmd.Stderr = &stderr
cmd.Env = append(cmd.Env, ev...)
@@ -167,7 +166,7 @@ func TestCode(t *testing.T) {
for _, flag := range flags {
args := []string{"test", "-c", "-gcflags=-d=ssa/check/on" + flag, "-o", filepath.Join(tmpdir, "code.test")}
args = append(args, srcs...)
- out, err := exec.Command(gotool, args...).CombinedOutput()
+ out, err := testenv.Command(t, gotool, args...).CombinedOutput()
if err != nil || len(out) != 0 {
t.Fatalf("Build failed: %v\n%s\n", err, out)
}
@@ -180,7 +179,7 @@ func TestCode(t *testing.T) {
continue
}
t.Run(fmt.Sprintf("%s%s", test.name[4:], flag), func(t *testing.T) {
- out, err := exec.Command(filepath.Join(tmpdir, "code.test"), "-test.run="+test.name).CombinedOutput()
+ out, err := testenv.Command(t, filepath.Join(tmpdir, "code.test"), "-test.run="+test.name).CombinedOutput()
if err != nil || string(out) != "PASS\n" {
t.Errorf("Failed:\n%s\n", out)
}