From 3df743ac2976d3a2c9aa5109647fd593b5d325be Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 12 Oct 2020 16:35:31 -0700 Subject: [PATCH] fix error when computing coverage Some packages can contain both external and internal tests. Listing these packages twice causes us to create two targets (which fails). Instead, use a single go list statement. --- coverage/Rules.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/coverage/Rules.mk b/coverage/Rules.mk index b8afab6d4..e0935d880 100644 --- a/coverage/Rules.mk +++ b/coverage/Rules.mk @@ -13,8 +13,7 @@ endif .PHONY: $(d)/coverage_deps # unit tests coverage -UTESTS_$(d) := $(shell $(GOCC) list -f '{{if (len .TestGoFiles)}}{{.ImportPath}}{{end}}' $(go-flags-with-tags) ./...) -UTESTS_$(d) += $(shell $(GOCC) list -f '{{if (len .XTestGoFiles)}}{{.ImportPath}}{{end}}' $(go-flags-with-tags) ./... | grep -v go-ipfs/vendor | grep -v go-ipfs/Godeps) +UTESTS_$(d) := $(shell $(GOCC) list -f '{{if (or (len .TestGoFiles) (len .XTestGoFiles))}}{{.ImportPath}}{{end}}' $(go-flags-with-tags) ./... | grep -v go-ipfs/vendor | grep -v go-ipfs/Godeps) UCOVER_$(d) := $(addsuffix .coverprofile,$(addprefix $(d)/unitcover/, $(subst /,_,$(UTESTS_$(d)))))