Created
May 3, 2016 21:24
-
-
Save skarllot/13ebe8220822bc19494c8b076aabe9fc to your computer and use it in GitHub Desktop.
Makefile to merge coverage data from all subpackages (Golang)
This file contains hidden or 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