make: allow optional extra tags when running unit tests

This commit is contained in:
Andras Banki-Horvath committed 2020-09-17 14:50:19 +02:00
1 parent 9c47392dfa
commit 357cd7d7a7
2 files changed
+7 -2

No files matched your search

-2
View File
@@ -43,8 +43,6 @@ GOTEST := GO111MODULE=on go test
GOVERSION := $(shell go version | awk '{print $$3}')
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
GOLIST := go list -deps $(PKG)/... | grep '$(PKG)'| grep -v '/vendor/'
GOLISTCOVER := $(shell go list -deps -f '{{.ImportPath}}' ./... | grep '$(PKG)' | sed -e 's/^$(ESCPKG)/./')
RM := rm -f
CP := cp
+7
View File
@@ -28,6 +28,10 @@ ifneq ($(icase),)
TEST_FLAGS += -test.run=TestLightningNetworkDaemon/$(icase)
endif
ifneq ($(tags),)
DEV_TAGS += ${tags}
endif
# Define the log tags that will be applied only when running unit tests. If none
# are provided, we default to "nolog" which will be silent.
ifneq ($(log),)
@@ -44,6 +48,9 @@ else
TEST_FLAGS += -test.timeout=40m
endif
GOLIST := go list -tags="$(DEV_TAGS)" -deps $(PKG)/... | grep '$(PKG)'| grep -v '/vendor/'
GOLISTCOVER := $(shell go list -tags="$(DEV_TAGS)" -deps -f '{{.ImportPath}}' ./... | grep '$(PKG)' | sed -e 's/^$(ESCPKG)/./')
# UNIT_TARGTED is undefined iff a specific package and/or unit test case is
# not being targeted.
UNIT_TARGETED ?= no