From b7e1d2788bd1fb0009c09513874b0b243dbaba07 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 10 May 2015 23:04:02 +0200 Subject: [PATCH] Makefile: Split out coverage into a shell script --- Makefile | 6 +----- coverage_all.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100755 coverage_all.sh diff --git a/Makefile b/Makefile index 5a0644deb..a32466238 100644 --- a/Makefile +++ b/Makefile @@ -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)\" diff --git a/coverage_all.sh b/coverage_all.sh new file mode 100755 index 000000000..552387e41 --- /dev/null +++ b/coverage_all.sh @@ -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