Add coverage to go tests

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2021-06-07 13:20:58 +02:00
parent 9aac07fe64
commit b930487dc5
2 changed files with 6 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
dist dist
*.swp *.swp
*.swo *.swo
/coverage.out

View File

@ -63,5 +63,9 @@ misspell:
vet: vet:
go vet $(MODULE)/... go vet $(MODULE)/...
COVERAGE_FILE := coverage.out
test: test:
go test $(MODULE)/... go test -coverprofile=$(COVERAGE_FILE) $(MODULE)/...
coverage: test
go tool cover -func=$(COVERAGE_FILE)