gocoverutil
gocoverutil copied to clipboard
gocoverutil
Install it with go get
:
go get -u github.com/AlekSi/gocoverutil
gocoverutil contains two commands: merge and test.
Merge command merges several go coverage profiles into a single file.
Run gocoverutil merge -h
for usage information. Example:
gocoverutil -coverprofile=cover.out merge internal/test/package1/package1.out internal/test/package2/package2.out
Test command runs go test -cover
with correct flags and merges profiles.
Packages list is passed as arguments; they may contain ...
patterns.
The list is expanded, sorted and duplicates and ignored packages are removed.
go test -coverpkg
flag is set automatically to the same list.
Only a single package is passed at once to go test
, so it always acts as if -p 1
is passed.
If tests are failing, gocoverutil exits with a correct exit code.
Run gocoverutil test -h
for usage information. Example:
gocoverutil -coverprofile=cover.out test -v -covermode=count github.com/AlekSi/gocoverutil/internal/test/...