Makefile: Split out coverage into a shell script

This commit is contained in:
Alexander Neumann 2015-05-10 23:04:02 +02:00
parent be8064cd97
commit b7e1d2788b
2 changed files with 11 additions and 5 deletions

View File

@ -49,11 +49,7 @@ test-integration: .gopath
all.cov: .gopath
cd $(BASEPATH) && \
go list ./... | \
while read pkg; do \
go test -covermode=count -coverprofile=$$(base64 <<< $$pkg).cov $$pkg; \
done
echo "mode: count" > all.cov; tail -q -n +2 *.cov >> all.cov
./coverage_all.sh all.cov
env:
@echo export GOPATH=\"$(GOPATH)\"

10
coverage_all.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
TARGETFILE="$1"
go list ./... | while read pkg; do
go test -covermode=count -coverprofile=$(base64 <<< $pkg).cov $pkg
done
echo "mode: count" > $TARGETFILE
tail -q -n +2 *.cov >> $TARGETFILE