-
-
Save melkorm/53168562063a88dcd92d262be112e359 to your computer and use it in GitHub Desktop.
Makefile to merge coverage data from all subpackages (Golang)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: test-cover-html | |
PACKAGES = $(shell find ./ -type d -not -path '*/\.*') | |
test-cover-html: | |
echo "mode: count" > coverage-all.out | |
$(foreach pkg,$(PACKAGES),\ | |
go test -coverprofile=coverage.out -covermode=count $(pkg);\ | |
tail -n +2 coverage.out >> coverage-all.out;) | |
go tool cover -html=coverage-all.out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment