aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2019-05-30 09:46:56 -0700
committerDamien Neil <dneil@google.com>2019-10-30 20:46:44 +0000
commit81a74b4e8d4a1740529bb951eaa9569d429e4c0f (patch)
treec54e366689ebc60a29901197517c4e1f6b3f5c9c /src/encoding
parentcd18da451faedc4218a5fd0e38f9b3d13aa5da01 (diff)
downloadgo-81a74b4e8d4a1740529bb951eaa9569d429e4c0f.tar.xz
testing: provide additional information when test funcs panic
Flush the output log up to the root when a test panics. Prior to this change, only the current test's output log was flushed to its parent, resulting in no output when a subtest panics. For the following test function: func Test(t *testing.T) { for i, test := range []int{1, 0, 2} { t.Run(fmt.Sprintf("%v/%v", i, test), func(t *testing.T) { _ = 1 / test }) } } Output before this change: panic: runtime error: integer divide by zero [recovered] panic: runtime error: integer divide by zero (stack trace follows) Output after this change: --- FAIL: Test (0.00s) --- FAIL: Test/1/0 (0.00s) panic: runtime error: integer divide by zero [recovered] (stack trace follows) Fixes #32121 Change-Id: Ifee07ccc005f0493a902190a8be734943123b6b7 Reviewed-on: https://go-review.googlesource.com/c/go/+/179599 Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/encoding')
0 files changed, 0 insertions, 0 deletions