anex-at-work / catcover

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Just concatenation tool for coverage files

Before...

I know, you can use a bash like this:

echo 'mode: atomic' > coverage.txt && go list ./... | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverprofile=coverage.tmp {} && tail -n +2 coverage.tmp >> coverage.txt' && rm coverage.tmp

(from here).

But:

If you use ginkgo, then you can use this utility do to the next steps:

  • run ginkgo -cover -r
  • concatenate all *.coverprofile into all_coverage.coverprofile
  • remove all excess lines with mode: atomic
  • make coverage.html file with go tool cover utility

Just compile and run ./coverage in the right place

And, in the end, you can open coverage.html in your browser and reach 100% coverage 8)

About

License:MIT License


Languages

Language:Go 100.0%