aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/ct.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-01-22 15:37:17 +0100
committerLoïc Hoguin <[email protected]>2016-01-22 15:37:17 +0100
commite13e544c5022ef26cd956f1b99c42e1f5989b8e1 (patch)
tree25c811f5f76a507d5d2f8a50cb8e82b984297c99 /plugins/ct.mk
parent18a707431d2e7c1bdd97e2b2a2f71c5ff1c45ba8 (diff)
downloaderlang.mk-e13e544c5022ef26cd956f1b99c42e1f5989b8e1.tar.gz
erlang.mk-e13e544c5022ef26cd956f1b99c42e1f5989b8e1.tar.bz2
erlang.mk-e13e544c5022ef26cd956f1b99c42e1f5989b8e1.zip
Allow running apps/ ct test suites in parallel
I'm mostly trying to fix tests when ran in parallel, although this is also a nice optimization for those who use multi-app repositories.
Diffstat (limited to 'plugins/ct.mk')
-rw-r--r--plugins/ct.mk14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/ct.mk b/plugins/ct.mk
index 2d45032..c8f7bf8 100644
--- a/plugins/ct.mk
+++ b/plugins/ct.mk
@@ -40,12 +40,18 @@ ct: $(if $(IS_APP),,apps-ct)
else
ct: test-build $(if $(IS_APP),,apps-ct)
$(verbose) mkdir -p $(CURDIR)/logs/
- $(gen_verbose) $(CT_RUN) -suite $(addsuffix _SUITE,$(CT_SUITES)) $(CT_OPTS)
+ $(gen_verbose) $(CT_RUN) -sname ct_$(PROJECT) -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
+define ct_app_target
+apps-ct-$1:
+ $(MAKE) -C $1 ct IS_APP=1
+endef
+
+$(foreach app,$(ALL_APPS_DIRS),$(eval $(call ct_app_target,$(app))))
+
+apps-ct: $(addprefix apps-ct-,$(ALL_APPS_DIRS))
endif
ifndef t
@@ -62,7 +68,7 @@ endif
define ct_suite_target
ct-$(1): test-build
$(verbose) mkdir -p $(CURDIR)/logs/
- $(gen_verbose) $(CT_RUN) -suite $(addsuffix _SUITE,$(1)) $(CT_EXTRA) $(CT_OPTS)
+ $(gen_verbose) $(CT_RUN) -sname ct_$(PROJECT) -suite $(addsuffix _SUITE,$(1)) $(CT_EXTRA) $(CT_OPTS)
endef
$(foreach test,$(CT_SUITES),$(eval $(call ct_suite_target,$(test))))