aboutsummaryrefslogtreecommitdiffstats
path: root/test/Makefile
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2024-11-13 17:23:22 +0100
committerLoïc Hoguin <[email protected]>2024-11-13 17:23:22 +0100
commite903cc89c5cc389305ee8dc0b15a8db250de1b37 (patch)
treee67c910a6f38062e78a022733e2cb31402c0441d /test/Makefile
parent4d3d3fa4e94f8c31c7012c4e076e9b5a9b8ecb0a (diff)
downloaderlang.mk-e903cc89c5cc389305ee8dc0b15a8db250de1b37.tar.gz
erlang.mk-e903cc89c5cc389305ee8dc0b15a8db250de1b37.tar.bz2
erlang.mk-e903cc89c5cc389305ee8dc0b15a8db250de1b37.zip
Greatly speed up test speed with -j
The tests were waiting for the test group to finish before they could continue with the next test group. Now "core" and "all" targets directly depend on individual test cases, allowing parallel Make to get to the next tests quicker and removing 1/3rd of the total run time. make check -j8 -k 5790,16s user 1207,08s system 627% cpu 18:35,49 total make check -j8 -k 6250,13s user 1326,77s system 972% cpu 12:59,16 total
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/Makefile b/test/Makefile
index 169cfd0..92c7be0 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -125,7 +125,8 @@ endef
.PHONY: all clean init
-all:: core
+all::
+ $t :
clean::
$t rm -rf erl_crash.dump packages/ $(filter-out test_rebar_git/,$(wildcard test_*/))
@@ -146,11 +147,14 @@ export REBAR3_GIT
.PHONY: core
-define include_core
-core:: core-$1
+CORE_TARGETS :=
+PLUGINS_TARGETS :=
+define include_core
include core_$1.mk
+CORE_TARGETS += $$(core_$1_TARGETS)
+
endef
$(eval $(foreach t,$(patsubst %.mk,%,$(patsubst core_%,%,$(wildcard core_*.mk))),$(call include_core,$t)))
@@ -158,14 +162,18 @@ $(eval $(foreach t,$(patsubst %.mk,%,$(patsubst core_%,%,$(wildcard core_*.mk)))
# Plugins.
define include_plugin
-all:: $1
-
include plugin_$1.mk
+PLUGINS_TARGETS += $$($1_TARGETS)
+
endef
$(eval $(foreach t,$(patsubst %.mk,%,$(patsubst plugin_%,%,$(wildcard plugin_*.mk))),$(call include_plugin,$t)))
+core:: $(CORE_TARGETS)
+
+all:: $(CORE_TARGETS) $(PLUGINS_TARGETS)
+
# Packages.
PACKAGES = $(foreach pkg,$(sort $(wildcard ../index/*.mk)),$(notdir $(basename $(pkg))))