From 80c33b44036ed2be3b827d0cf9f7fcbb69a1d2f3 Mon Sep 17 00:00:00 2001 From: Icarus Sparry Date: Thu, 8 Feb 2018 10:45:08 -0800 Subject: [PATCH] Fix Makefile Signed-off-by: Icarus Sparry --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 44d7fe2..532a6e1 100644 --- a/Makefile +++ b/Makefile @@ -51,10 +51,14 @@ check: gopath # to coverprofile, so there will be no need to pass an individual package. # At that time we can merge this target into check and run it against all # packages every time. +.PHONY: checkcoverage checkcoverage: gopath - test ${PKG} +ifeq (,${PKG}) + $(error PKG is not set, try make PKG=swupd checkcoverage) +else go test -cover ${GO_PACKAGE_PREFIX}/${PKG} -coverprofile=coverage.out go tool cover -html=coverage.out +endif .PHONY: lint lint: gopath