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:
qmuntal 2025-03-20 10:02:31 +01:00 committed by Quim Muntal
parent a4a5ef08bd
commit e9558d3947
12 changed files with 40 additions and 44 deletions

View file

@ -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 {