PHONY cover cover test echo mode count cover-all out foreach package p

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
.PHONY: cover
cover: test
@echo "mode: count" > cover-all.out
@$(foreach package,$(packages), \
tail -n +2 $(package)/cover.out >> cover-all.out;)
@gocover-cobertura < cover-all.out > cover-cobertura.xml
@go tool cover -func=cover-all.out | tail -n 1
.PHONY: show
show:
echo "Launching web browser to show overall coverage..."
go tool cover -html=cover-all.out