Skip to content

Commit

Permalink
cmd/go: don't use a testlog if there is an exec command
Browse files Browse the repository at this point in the history
An exec command is normally used on platforms were the test is run in
some unusual way, making it less likely that the testlog will be useful.

Updates #22593

Change-Id: I0768f6da89cb559d8d675fdf6d685db9ecedab9e
Reviewed-on: https://go-review.googlesource.com/83578
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
ianlancetaylor committed Dec 13, 2017
1 parent 132b528 commit 1206e97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cmd/go/internal/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1265,11 +1265,12 @@ func (c *runCache) builderRunTest(b *work.Builder, a *work.Action) error {
return nil
}

execCmd := work.FindExecCmd()
testlogArg := []string{}
if !c.disableCache && cfg.Goos != "nacl" {
if !c.disableCache && len(execCmd) == 0 {
testlogArg = []string{"-test.testlogfile=" + a.Objdir + "testlog.txt"}
}
args := str.StringList(work.FindExecCmd(), a.Deps[0].Target, testlogArg, testArgs)
args := str.StringList(execCmd, a.Deps[0].Target, testlogArg, testArgs)

if testCoverProfile != "" {
// Write coverage to temporary profile, for merging later.
Expand Down

0 comments on commit 1206e97

Please sign in to comment.