From 8c6c14c6d3a26ddfbb7f01773a1cf03c353d4b79 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 14 Apr 2015 14:13:47 +0100 Subject: [PATCH] Accumulate any errors from `go test` commands so we can report overall status --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e757a207..323d534e 100644 --- a/Makefile +++ b/Makefile @@ -69,14 +69,18 @@ $(DOCKER_DISTRIB): tests: echo "mode: count" > profile.cov + fail=0 ; \ for dir in $$(find . -type f -name '*_test.go' | xargs -n1 dirname | sort -u); do \ - output=$$(mktemp cover.XXXXXXXXXX); \ - go test -tags netgo -covermode=count -coverprofile=$$output $$dir; \ + output=$$(mktemp cover.XXXXXXXXXX) ; \ + if ! go test -tags netgo -covermode=count -coverprofile=$$output $$dir ; then \ + fail=1 ; \ + fi ; \ if [ -f $$output ]; then \ tail -n +2 <$$output >>profile.cov; \ rm $$output; \ fi \ - done + done ; \ + exit $$fail go tool cover -html=profile.cov -o=coverage.html $(PUBLISH): publish_%: