aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/testutil_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'compiler_wrapper/testutil_test.go')
-rw-r--r--compiler_wrapper/testutil_test.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler_wrapper/testutil_test.go b/compiler_wrapper/testutil_test.go
index 3e568c77..3eb2c5fa 100644
--- a/compiler_wrapper/testutil_test.go
+++ b/compiler_wrapper/testutil_test.go
@@ -66,14 +66,14 @@ func withTestContext(t *testing.T, work func(ctx *testContext)) {
var _ env = (*testContext)(nil)
-func (ctx *testContext) getenv(key string) string {
+func (ctx *testContext) getenv(key string) (string, bool) {
for i := len(ctx.env) - 1; i >= 0; i-- {
entry := ctx.env[i]
if strings.HasPrefix(entry, key+"=") {
- return entry[len(key)+1:]
+ return entry[len(key)+1:], true
}
}
- return ""
+ return "", false
}
func (ctx *testContext) environ() []string {
@@ -108,10 +108,7 @@ func (ctx *testContext) run(cmd *command, stdin io.Reader, stdout io.Writer, std
// Keep calling the old wrapper when we are comparing the output of the
// old wrapper to the new wrapper.
if isCompareToOldWrapperCmd(cmd) {
- execCmd := newExecCmd(ctx, cmd)
- execCmd.Stdout = stdout
- execCmd.Stderr = stderr
- return execCmd.Run()
+ return runCmd(ctx, cmd, nil, stdout, stderr)
}
ctx.cmdCount++
ctx.lastCmd = cmd