mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo/internal/testshared: log stdout when go command fails
Understanding a failure in the goCmd call is difficult because the important information might be in the stdout instead of stderr. Change-Id: Icf42974679103c69016129fe2ebb15d5a0a3b51a Reviewed-on: https://go-review.googlesource.com/c/go/+/659456 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
665af86992
commit
a4a5ef08bd
1 changed files with 2 additions and 2 deletions
|
|
@ -79,10 +79,10 @@ func goCmd(t *testing.T, args ...string) string {
|
|||
if err != nil {
|
||||
if t != nil {
|
||||
t.Helper()
|
||||
t.Fatalf("executing %s failed %v:\n%s", strings.Join(c.Args, " "), err, stderr)
|
||||
t.Fatalf("executing %q failed %v:\n%s\n%s", c, err, stderr, output)
|
||||
} else {
|
||||
// Panic instead of using log.Fatalf so that deferred cleanup may run in testMain.
|
||||
log.Panicf("executing %s failed %v:\n%s", strings.Join(c.Args, " "), err, stderr)
|
||||
log.Panicf("executing %q failed %v:\n%s\n%s", c, err, stderr, output)
|
||||
}
|
||||
}
|
||||
if testing.Verbose() && t != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue