From 6e05ba17b0d0f982f1fa473fa2b1a046266eb8f5 Mon Sep 17 00:00:00 2001 From: Tobias Lindahl Date: Thu, 3 Jun 2021 13:44:06 +0200 Subject: [PATCH] test: add Makefile target for running one testsuite locally --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6f21a6147..1e869a479 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,8 @@ REL_PROFILES := emqx emqx-edge PKG_PROFILES := emqx-pkg emqx-edge-pkg PROFILES := $(REL_PROFILES) $(PKG_PROFILES) default +CT_NODE_NAME ?= 'test@127.0.0.1' + export REBAR_GIT_CLONE_OPTIONS += --depth=1 .PHONY: default @@ -44,7 +46,7 @@ proper: $(REBAR) .PHONY: ct ct: $(REBAR) - @ENABLE_COVER_COMPILE=1 $(REBAR) ct --name 'test@127.0.0.1' -c -v + @ENABLE_COVER_COMPILE=1 $(REBAR) ct --name $(CT_NODE_NAME) -c -v APPS=$(shell $(CURDIR)/scripts/find-apps.sh) @@ -52,7 +54,7 @@ APPS=$(shell $(CURDIR)/scripts/find-apps.sh) .PHONY: $(APPS:%=%-ct) define gen-app-ct-target $1-ct: - $(REBAR) ct --name 'test@127.0.0.1' -v --suite $(shell $(CURDIR)/scripts/find-suites.sh $1) + $(REBAR) ct --name $(CT_NODE_NAME) -v --suite $(shell $(CURDIR)/scripts/find-suites.sh $1) endef $(foreach app,$(APPS),$(eval $(call gen-app-ct-target,$(app)))) @@ -64,6 +66,14 @@ $1-prop: endef $(foreach app,$(APPS),$(eval $(call gen-app-prop-target,$(app)))) +.PHONY: ct-suite +ct-suite: $(REBAR) +ifneq ($(TESTCASE),) + $(REBAR) ct -v --readable=false --name $(CT_NODE_NAME) --suite $(SUITE) --case $(TESTCASE) +else + $(REBAR) ct -v --readable=false --name $(CT_NODE_NAME) --suite $(SUITE) +endif + .PHONY: cover cover: $(REBAR) @ENABLE_COVER_COMPILE=1 $(REBAR) cover