diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2025-07-03 21:55:51 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2025-07-03 21:55:51 +0200 |
| commit | 29699af9c17c356b243ac3bed7d64260e819503f (patch) | |
| tree | 68d830d708e94f8e37055134a33690332e4420af | |
| parent | 3b2c63e67fd72abc42bf792b2b30809241732107 (diff) | |
| download | go-gg-29699af9c17c356b243ac3bed7d64260e819503f.tar.gz | |
fix coverage reporting across package imports
| -rw-r--r-- | Makefile | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -12,9 +12,12 @@ static-check: FORCE @printf "\e[1;36m>> reuse lint\e[0m\n" @if ! reuse lint -q; then reuse lint; fi +GO_COVERPKGS := $(shell go list ./... | tr '\n' , | sed 's/,$$//') +GO_TESTPKGS := $(shell go list -f '{{if or .TestGoFiles .XTestGoFiles}}{{.ImportPath}}{{end}}' ./...) + build/cover.out: FORCE @printf "\e[1;36m>> go test\e[0m\n" - go test -shuffle=on -coverprofile=build/cover.out -covermode=count ./... + go test -shuffle=on -coverprofile=build/cover.out -covermode=count -coverpkg=$(GO_COVERPKGS) $(GO_TESTPKGS) build/cover.html: build/cover.out @printf "\e[1;36m>> go tool cover\e[0m\n" go tool cover -html $< -o $@ |
