aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/ct.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-12-29 00:13:04 +0100
committerLoïc Hoguin <[email protected]>2015-12-29 00:13:04 +0100
commit60e3b55fe07d087504a4e9f5c163d5cb75afbcfa (patch)
tree3c32854835a4279f36ac7f783ad79e385adb69f4 /plugins/ct.mk
parent1ceffe2a00b9f329b14518cc5b64230acd956cdc (diff)
downloaderlang.mk-60e3b55fe07d087504a4e9f5c163d5cb75afbcfa.tar.gz
erlang.mk-60e3b55fe07d087504a4e9f5c163d5cb75afbcfa.tar.bz2
erlang.mk-60e3b55fe07d087504a4e9f5c163d5cb75afbcfa.zip
Add Common Test docs and tests
Also fixes issues with multi application repositories, and add support for running a specific group/case in a given test suite.
Diffstat (limited to 'plugins/ct.mk')
-rw-r--r--plugins/ct.mk24
1 files changed, 20 insertions, 4 deletions
diff --git a/plugins/ct.mk b/plugins/ct.mk
index fb4b1ca..2d45032 100644
--- a/plugins/ct.mk
+++ b/plugins/ct.mk
@@ -1,7 +1,7 @@
# Copyright (c) 2013-2015, Loïc Hoguin <[email protected]>
# This file is part of erlang.mk and subject to the terms of the ISC License.
-.PHONY: ct distclean-ct
+.PHONY: ct apps-ct distclean-ct
# Configuration.
@@ -36,17 +36,33 @@ CT_RUN = ct_run \
-logdir $(CURDIR)/logs
ifeq ($(CT_SUITES),)
-ct:
+ct: $(if $(IS_APP),,apps-ct)
else
-ct: test-build
+ct: test-build $(if $(IS_APP),,apps-ct)
$(verbose) mkdir -p $(CURDIR)/logs/
$(gen_verbose) $(CT_RUN) -suite $(addsuffix _SUITE,$(CT_SUITES)) $(CT_OPTS)
endif
+ifneq ($(ALL_APPS_DIRS),)
+apps-ct:
+ $(verbose) for app in $(ALL_APPS_DIRS); do $(MAKE) -C $$app ct IS_APP=1; done
+endif
+
+ifndef t
+CT_EXTRA =
+else
+ifeq (,$(findstring :,$t))
+CT_EXTRA = -group $t
+else
+t_words = $(subst :, ,$t)
+CT_EXTRA = -group $(firstword $(t_words)) -case $(lastword $(t_words))
+endif
+endif
+
define ct_suite_target
ct-$(1): test-build
$(verbose) mkdir -p $(CURDIR)/logs/
- $(gen_verbose) $(CT_RUN) -suite $(addsuffix _SUITE,$(1)) $(CT_OPTS)
+ $(gen_verbose) $(CT_RUN) -suite $(addsuffix _SUITE,$(1)) $(CT_EXTRA) $(CT_OPTS)
endef
$(foreach test,$(CT_SUITES),$(eval $(call ct_suite_target,$(test))))