2025-01-05 09:11:58 +02:00
|
|
|
include make/compile_flags.mk
|
|
|
|
|
|
2025-01-05 09:07:55 +02:00
|
|
|
ITEST_FLAGS =
|
2025-01-05 09:20:10 +02:00
|
|
|
TEST_FLAGS =
|
2025-01-05 09:22:37 +02:00
|
|
|
DEV_TAGS = dev
|
2022-10-15 09:04:04 +02:00
|
|
|
|
|
|
|
|
# Define the integration test.run filter if the icase argument was provided.
|
|
|
|
|
ifneq ($(icase),)
|
2023-03-10 16:29:05 -08:00
|
|
|
ITEST_FLAGS += -test.run="TestLightningTerminal/$(icase)"
|
2022-10-15 09:04:04 +02:00
|
|
|
endif
|
2025-01-05 09:11:58 +02:00
|
|
|
|
2025-01-05 09:20:10 +02:00
|
|
|
# If a specific unit test case is being targeted, construct test.run filter.
|
|
|
|
|
ifneq ($(case),)
|
|
|
|
|
TEST_FLAGS += -test.run=$(case)
|
2025-01-05 09:24:44 +02:00
|
|
|
UNIT_TARGETED = yes
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# If specific package is being unit tested, construct the full name of the
|
|
|
|
|
# subpackage.
|
|
|
|
|
ifneq ($(pkg),)
|
|
|
|
|
UNITPKG := $(PKG)/$(pkg)
|
|
|
|
|
COVER_PKG := $(PKG)/$(pkg)
|
|
|
|
|
UNIT_TARGETED = yes
|
|
|
|
|
GOLIST = echo '$(PKG)/$(pkg)'
|
2025-01-05 09:20:10 +02:00
|
|
|
endif
|
|
|
|
|
|
2025-01-05 09:22:37 +02:00
|
|
|
# Add any additional tags that are passed in to make.
|
|
|
|
|
ifneq ($(tags),)
|
|
|
|
|
DEV_TAGS += ${tags}
|
|
|
|
|
endif
|
|
|
|
|
|
2025-01-05 09:24:44 +02:00
|
|
|
# UNIT_TARGETED is undefined iff a specific package and/or unit test case is
|
|
|
|
|
# not being targeted.
|
|
|
|
|
UNIT_TARGETED ?= no
|
|
|
|
|
|
|
|
|
|
# If a specific package/test case was requested, run the unit test for the
|
|
|
|
|
# targeted case. Otherwise, default to running all tests.
|
|
|
|
|
ifeq ($(UNIT_TARGETED), yes)
|
|
|
|
|
UNIT := $(GOTEST) -tags="$(DEV_TAGS) $(COMPILE_TAGS)" $(TEST_FLAGS) $(UNITPKG)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(UNIT_TARGETED), no)
|
2025-01-05 09:22:37 +02:00
|
|
|
UNIT := $(GOLIST) | $(XARGS) env $(GOTEST) -tags="$(DEV_TAGS) $(COMPILE_TAGS)" $(TEST_FLAGS)
|
2025-01-05 09:24:44 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
UNIT_RACE := $(UNIT) -race
|