coverage made with love, literally
Loverage is a tool for Golang projects that verbalizes a test coverage basing on a names of test functions.
Install loverage using go get:
go get github.com/kovetskiy/loverage
Create testcases and declare test functions with following naming convention:
func TestF_B() { ... }
func TestT_B() { ... }
func TestT_M_B() { ... }
Where,
- F – tested function
- T – tested type
- M – tested type's method
- B – expected behavior
Examples:
func TestNewLogger_ReturnsLoggerInstance() { ... }
func TestLogger_ImplementsWriterInterface() { ... }
func TestLogger_Infof_WritesMessageWithInfoSeverity() { ... }
Spawn loverage in a directory with test files and see output
$ loverage
NewLogger Returns Logger Instance
Logger Implements Writer Interface
Logger.Infof Writes Message With Info Severity
Add loverage's output to your readme file as markdown table:
$ loverage --table >> README.md
And see resulting table:
Subject | Behavior |
---|---|
NewLogger | Returns Logger Instance |
Logger | Implements Writer Interface |
Logger.Infof | Writes Message With Info Severity |
MIT.