]> Cypherpunks repositories - gostls13.git/commit
cmd/test2json: fix test log output containing test output
authorRuss Cox <rsc@golang.org>
Thu, 4 Jan 2018 18:25:31 +0000 (13:25 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 4 Jan 2018 20:12:12 +0000 (20:12 +0000)
commitb32ac54620067dacc793192fb862ddf2e6cd4386
treea096148f64ed74b2af4013805e3c036e7652efaa
parent23e68d7651a0017a6fc8223a964ec3d6db53d4bb
cmd/test2json: fix test log output containing test output

If test case framing appears in ordinary test output,
then test2json can get confused. If the fake framing is being
saved with t.Logf/t.Errorf/etc then we can already
distinguish it from real framing, and the code did.
It just forgot to write that framing as output (1-line fix).

If the fake framing is being generated by printing directly
to stdout/stderr, then test2json will simply get confused.
There's not a lot to do at that point (maybe it's even a feature).

Fixes #23036.

Change-Id: I29449c7ace304172b89d8babe23de507c0500455
Reviewed-on: https://go-review.googlesource.com/86238
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/internal/test2json/test2json.go
src/cmd/internal/test2json/testdata/issue23036.json [new file with mode: 0644]
src/cmd/internal/test2json/testdata/issue23036.test [new file with mode: 0644]