From 8a1a12fd05e96f9aab981fbd01811f03cab6a549 Mon Sep 17 00:00:00 2001
From: Will Rouesnel <w.rouesnel@gmail.com>
Date: Tue, 6 Jun 2017 23:45:48 +1000
Subject: [PATCH] Update Makefile test handling.

---
 .gitignore | 2 +-
 Makefile   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5fc26682..12ce4b2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,4 +10,4 @@ cover.out
 cover.*.out
 .coverage
 *.prom
-
+.metrics.*.*.prom
diff --git a/Makefile b/Makefile
index ced92f85..c38bac30 100644
--- a/Makefile
+++ b/Makefile
@@ -43,10 +43,10 @@ fmt: tools
 	gofmt -s -w $(GO_SRC)
 
 test: tools
-	@rm -rf $(COVERDIR)
 	@mkdir -p $(COVERDIR)
+	@rm -f $(COVERDIR)/*
 	for pkg in $(GO_PKGS) ; do \
-		go test -v -covermode count -coverprofile=$(COVERDIR)/$(echo $$pkg | tr '/' '-').out $(pkg) ; \
+		go test -v -covermode count -coverprofile=$(COVERDIR)/$$(echo $$pkg | tr '/' '-').out $$pkg ; \
 	done
 	gocovmerge $(shell find $(COVERDIR) -name '*.out') > cover.out