mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
all: use exec.Command.String in test logs
There is no need to manually construct a human-friendly string for a exec.Command. The String method does that for us. Change-Id: Iff1033478000bade9cbdc079f6143a7690374258 Reviewed-on: https://go-review.googlesource.com/c/go/+/659475 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
a4a5ef08bd
commit
e9558d3947
12 changed files with 40 additions and 44 deletions
|
|
@ -79,10 +79,10 @@ func goCmd(t *testing.T, args ...string) string {
|
|||
if err != nil {
|
||||
if t != nil {
|
||||
t.Helper()
|
||||
t.Fatalf("executing %q failed %v:\n%s\n%s", c, err, stderr, output)
|
||||
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 %q failed %v:\n%s\n%s", c, err, stderr, output)
|
||||
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