Go test coverage rendering
- Go 98.8%
- Just 1.2%
Unkai - 雲海 (sea of clouds)
Go test coverage rendering
A sea of clouds covering the landscape
Install
go install codeberg.org/clouds666/unkai@latest
Usage
Go test coverage rendering - "Sea of clouds"
Usage:
unkai [flags]
Flags:
-c, --coverage string Pattern of the go sources (default "coverage/textfmt.out")
-f, --functions strings functions to show (empty means all, example "--function fun1,fun2")
-h, --help help for unkai
-s, --source string Directory of the go sources (default ".")
Examples
In this project
Terminal output
go run . --source ./data/example-project --functions some,other --coverage data/cover.out
Use freeze to get beautiful pictures
go run . --source ./data/example-project --functions some,other --coverage ./data/cover.out | tee /dev/tty | freeze
Result will be ./freeze.png
/clouds666/unkai/media/branch/latest/data/example-output.png
Forgejo
Make sure you have the file coverage/textfmt.out. For this example, the unit test coverage is enough. In the forgejo project root, run:
unkai --functions AddDeletedBranch,GetDeletedBranchByID
Developing
Using just
Run tests
just test
Show coverage
just cover-show GetFunctions,functionFilter