From db9a0d7528bbeca78bdf36cecbc191ff7be812d5 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Wed, 1 Apr 2015 12:32:35 +0000 Subject: [PATCH] More feedback on test 'harness' --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 55679886..6b6a0d9d 100644 --- a/Makefile +++ b/Makefile @@ -62,11 +62,12 @@ $(DOCKER_DISTRIB): tests: echo "mode: count" > profile.cov - for dir in $$(find . -type f -name '*_test.go' | xargs -n1 dirname | sort -u); do \ - go test -tags netgo -covermode=count -coverprofile=$$dir/profile.tmp $$dir; \ - if [ -f $$dir/profile.tmp ]; then \ - cat $$dir/profile.tmp | tail -n +2 >> profile.cov; \ - rm $$dir/profile.tmp; \ + for dir in $$(find . -type f -name '*_test.go' | xargs -n1 dirname | sort -u); do \ + output=$$(tempfile -p cover); \ + go test -tags netgo -covermode=count -coverprofile=$$output $$dir; \ + if [ -f $$output ]; then \ + tail -n +2 <$$output >>profile.cov; \ + rm $$output; \ fi \ done go tool cover -html=profile.cov -o=coverage.html