diff --git a/git-codereview/util_test.go b/git-codereview/util_test.go index fd419a2..2d3bebe 100644 --- a/git-codereview/util_test.go +++ b/git-codereview/util_test.go @@ -324,6 +324,8 @@ func testMain(t *testing.T, args ...string) { mainCanDie = false // reset for next invocation defer func() { + t.Helper() + runLog = runLogTrap testStdout = stdoutTrap testStderr = stderrTrap @@ -344,6 +346,13 @@ func testMain(t *testing.T, args ...string) { } t.Fatalf("%s\nstdout:\n%sstderr:\n%s", msg, testStdout, testStderr) } + + if testStdout.Len() > 0 { + t.Logf("stdout:\n%s", testStdout) + } + if testStderr.Len() > 0 { + t.Logf("stderr:\n%s", testStderr) + } }() exitTrap = func() {