Jay Taylor's notes
back to listing indexaxw/gocov
[web search]gocov | Add covermode to testFlagDefn | 3 months ago | |
gocovutil | Support multiple packages, patterns | 3 years ago | |
.gitignore | Initial commit | 4 years ago | |
.travis.yml | Add Travis CI configuration file | 3 years ago | |
AUTHORS | Add Greg Ward to AUTHORS | 3 years ago | |
LICENSE | Split test flags as in go test | 7 months ago | |
README.md | Fix copy/paste | 2 years ago | |
gocov.go | Drop "gocov test", introduce "gocov convert" | 2 years ago | |
gocov_test.go | Drop "gocov test", introduce "gocov convert" | 2 years ago |
README.md
gocov
Coverage reporting tool for The Go Programming Language
Installation
go get github.com/axw/gocov/gocov
Usage
There are currently four gocov commands: test
, convert
, report
and annotate
.
gocov test
Running gocov test [args...]
will run go test [args...]
with
an implicit -coverprofile
added, and then output the result of
gocov convert
with the profile.
gocov convert
Running gocov convert <coverprofile>
will convert a coverage
profile generated by go tool cover
to gocov's JSON interchange
format. For example:
normalgo test -coverprofile=c.out
gocov convert c.out | gocov annotate -
normal
gocov report
Running gocov report <coverage.json>
will generate a textual
report from the coverage data output by gocov convert
. It is
assumed that the source code has not changed in between.
Output from gocov test
is printed to stdout so users can
pipe the output to gocov report
to view a summary of the test
coverage, for example: -
normalgocov test | gocov report
normal
gocov annotate
Running gocov annotate <coverage.json> <package[.receiver].function>
will generate a source listing of the specified function, annotating
it with coverage information, such as which lines have been missed.
Related tools
GoCovGUI: A simple GUI wrapper for the gocov coverage analysis tool.
gocov-html: A simple helper tool for generating HTML output from gocov.
gocov-xml: A simple helper tool for generating XML output in Cobertura format for CIs like Jenkins and others from gocov.
goveralls: Go integration for Coveralls.io continuous code coverage tracking system.