]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add go test -json flag
authorRuss Cox <rsc@golang.org>
Thu, 9 Nov 2017 03:03:19 +0000 (22:03 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 10 Nov 2017 18:00:51 +0000 (18:00 +0000)
commite9d2f1eb36b7600c196474f5de5fa3afd0403c99
tree893576f9dbca92a0cd0179f1c9fc92ce9025a1ea
parent3e2dc457a1b8cecd9554c64ee0d54800d5937fc9
cmd/go: add go test -json flag

This CL finally adds one of our longest-requested cmd/go features:
a way for test-running harnesses to access test output in structured form.

In fact the structured json output is more informative than the text
output, because the output from multiple parallel tests can be
interleaved as it becomes available, instead of needing to wait for
the previous test to finish before showing any output from the
next test.

See CL 76872 for the conversion details.

Fixes #2981.

Change-Id: I749c4fc260190af9fe633437a781ec0cf56b7260
Reviewed-on: https://go-review.googlesource.com/76873
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/go/go_test.go
src/cmd/go/internal/test/test.go
src/cmd/go/internal/test/testflag.go
src/cmd/go/testdata/src/sleepy1/p_test.go [new file with mode: 0644]
src/cmd/go/testdata/src/sleepy2/p_test.go [new file with mode: 0644]