Skip to content

Instantly share code, notes, and snippets.

@melkorm
Forked from skarllot/Makefile.makefile
Created December 1, 2016 14:34
Show Gist options
  • Save melkorm/53168562063a88dcd92d262be112e359 to your computer and use it in GitHub Desktop.
Save melkorm/53168562063a88dcd92d262be112e359 to your computer and use it in GitHub Desktop.
Makefile to merge coverage data from all subpackages (Golang)
.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