Created
October 21, 2016 20:28
-
-
Save wolfgangmeyers/dae31604aebee87b198f3ad34b37b23e to your computer and use it in GitHub Desktop.
How to count the number of running tests for a go project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go test ./... -v | grep -c RUN |
Note that this will count tests as well as subtests. This is essentially double counting if your all your regular tests do is spin off subtests.
(commenting, because this is the top google result for "golang number of tests")
Note that this will count tests as well as subtests. This is essentially double counting if your all your regular tests do is spin off subtests.
(commenting, because this is the top google result for "golang number of tests")
That's a good point. I think that at when I posted this, I was still using Go 1.6. I'd probably use something like python to parse the subtest output.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wonderful.