lxhope / go-testcov

`go test` that fails on uncovered lines and shows them

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-testcov Test coverage

go test that fails on untested lines and shows them

  • πŸŽ‰ Instant, actionable feedback on πŸ’š test run
  • πŸŽ‰ Onboard legacy code with top of the file // untested sections: 5 comment
  • πŸŽ‰ Mark untested code sections with inline // untested section comment
  • 🚫 PRs with bad test coverage
  • 🚫 External/paid coverage tools
go get github.com/grosser/go-testcov
go-testcov . # same arguments as `go test` uses
...
test output
...
pkg.go new untested sections introduced (1 current vs 0 configured)
pkg.go:20.14,21.11
pkg.go:54.5,56.5

Notes

  • coverage in go
  • Runtime overhead for coverage is about 3%
  • Use -covermode atomic when testing parallel algorithms
  • To keep the coverage.out file run with -cover

Development

Run go-testcov on itself:

go install
cd test
go-testcov

all tests are in test/ so the main library does not force installation of gomega + ginkgo

Author

Michael Grosser
michael@grosser.it
License: MIT

About

`go test` that fails on uncovered lines and shows them


Languages

Language:Go 100.0%