Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/test2json: handle running command and processing output #22789

Closed
rsc opened this issue Nov 17, 2017 · 3 comments
Closed

cmd/test2json: handle running command and processing output #22789

rsc opened this issue Nov 17, 2017 · 3 comments

Comments

@rsc
Copy link
Contributor

rsc commented Nov 17, 2017

The official way to get JSON output from a test binary foo.test is

./foo.test -test.v 2>&1 | go tool test2json

but that's annoying on Unix and harder on Windows. Probably go tool test2json should accept a command to run and process:

go tool test2json ./foo.test -test.v
@rsc rsc added this to the Go1.10 milestone Nov 17, 2017
@zolotov
Copy link
Contributor

zolotov commented Nov 28, 2017

go tool test2json ./foo.test -test.v is the solution for cross-platform running.

Still, I would prefer something like ./foo.test -test.json. It's consistent with the rest of the testing arguments and it's definitely debuggable with Delve. I'm not sure whether Delve will work fine with the go tool test2json tool.

@gopherbot
Copy link

Change https://golang.org/cl/81555 mentions this issue: cmd/test2json: add ability to run test binary

@zolotov
Copy link
Contributor

zolotov commented Dec 7, 2017

For some reason my comment was just ignored. Filed #23033

@golang golang locked and limited conversation to collaborators Dec 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants