diff options
author | Loïc Hoguin <[email protected]> | 2024-11-13 17:23:22 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2024-11-13 17:23:22 +0100 |
commit | e903cc89c5cc389305ee8dc0b15a8db250de1b37 (patch) | |
tree | e67c910a6f38062e78a022733e2cb31402c0441d | |
parent | 4d3d3fa4e94f8c31c7012c4e076e9b5a9b8ecb0a (diff) | |
download | erlang.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
-rw-r--r-- | test/Makefile | 18 | ||||
-rw-r--r-- | test/core_app.mk | 6 | ||||
-rw-r--r-- | test/core_apps.mk | 6 | ||||
-rw-r--r-- | test/core_autopatch.mk | 6 | ||||
-rw-r--r-- | test/core_compat.mk | 6 | ||||
-rw-r--r-- | test/core_deps.mk | 6 | ||||
-rw-r--r-- | test/core_makedep.mk | 6 | ||||
-rw-r--r-- | test/core_misc.mk | 6 | ||||
-rw-r--r-- | test/core_plugins.mk | 6 | ||||
-rw-r--r-- | test/core_query.mk | 6 | ||||
-rw-r--r-- | test/core_upgrade.mk | 6 | ||||
-rw-r--r-- | test/plugin_asciidoc.mk | 6 | ||||
-rw-r--r-- | test/plugin_bootstrap.mk | 6 | ||||
-rw-r--r-- | test/plugin_c_src.mk | 6 | ||||
-rw-r--r-- | test/plugin_concuerror.mk | 6 | ||||
-rw-r--r-- | test/plugin_cover.mk | 6 | ||||
-rw-r--r-- | test/plugin_ct.mk | 6 | ||||
-rw-r--r-- | test/plugin_dialyzer.mk | 6 | ||||
-rw-r--r-- | test/plugin_edoc.mk | 6 | ||||
-rw-r--r-- | test/plugin_erlydtl.mk | 6 | ||||
-rw-r--r-- | test/plugin_escript.mk | 6 | ||||
-rw-r--r-- | test/plugin_eunit.mk | 6 | ||||
-rw-r--r-- | test/plugin_hex.mk | 6 | ||||
-rw-r--r-- | test/plugin_proper.mk | 6 | ||||
-rw-r--r-- | test/plugin_protobuffs.mk | 10 | ||||
-rw-r--r-- | test/plugin_relx.mk | 6 | ||||
-rw-r--r-- | test/plugin_shell.mk | 6 | ||||
-rw-r--r-- | test/plugin_sphinx.mk | 8 | ||||
-rw-r--r-- | test/plugin_triq.mk | 6 | ||||
-rw-r--r-- | test/plugin_xref.mk | 6 |
30 files changed, 103 insertions, 95 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)))) diff --git a/test/core_app.mk b/test/core_app.mk index 7d270e3..7c9c046 100644 --- a/test/core_app.mk +++ b/test/core_app.mk @@ -1,10 +1,10 @@ # Core: Building applications. -CORE_APP_TARGETS = $(call list_targets,core-app) +core_app_TARGETS = $(call list_targets,core-app) -.PHONY: core-app $(CORE_APP_TARGETS) +.PHONY: core-app $(core_app_TARGETS) -core-app: $(CORE_APP_TARGETS) +core-app: $(core_app_TARGETS) ifdef LEGACY core-app-appsrc-change: init diff --git a/test/core_apps.mk b/test/core_apps.mk index 72466b2..1b8ee21 100644 --- a/test/core_apps.mk +++ b/test/core_apps.mk @@ -1,10 +1,10 @@ # Core: Multi-applications. -CORE_APPS_TARGETS = $(call list_targets,core-apps) +core_apps_TARGETS = $(call list_targets,core-apps) -.PHONY: core-apps $(CORE_APPS_TARGETS) +.PHONY: core-apps $(core_apps_TARGETS) -core-apps: $(CORE_APPS_TARGETS) +core-apps: $(core_apps_TARGETS) core-apps-build: init diff --git a/test/core_autopatch.mk b/test/core_autopatch.mk index 2624f79..5dab972 100644 --- a/test/core_autopatch.mk +++ b/test/core_autopatch.mk @@ -1,10 +1,10 @@ # Core: Autopatch. -CORE_AUTOPATCH_TARGETS = $(call list_targets,core-autopatch) +core_autopatch_TARGETS = $(call list_targets,core-autopatch) -.PHONY: core-autopatch $(CORE_AUTOPATCH_TARGETS) +.PHONY: core-autopatch $(core_autopatch_TARGETS) -core-autopatch: $(CORE_AUTOPATCH_TARGETS) +core-autopatch: $(core_autopatch_TARGETS) core-autopatch-extended: init diff --git a/test/core_compat.mk b/test/core_compat.mk index b759a2b..b4223b5 100644 --- a/test/core_compat.mk +++ b/test/core_compat.mk @@ -2,13 +2,13 @@ # # Note: autopatch functionality is covered separately. -CORE_COMPAT_TARGETS = $(call list_targets,core-compat) +core_compat_TARGETS = $(call list_targets,core-compat) REBAR3_BINARY = https://s3.amazonaws.com/rebar3/rebar3 -.PHONY: core-compat $(CORE_COMPAT_TARGETS) +.PHONY: core-compat $(core_compat_TARGETS) -core-compat: $(CORE_COMPAT_TARGETS) +core-compat: $(core_compat_TARGETS) core-compat-auto-rebar: init diff --git a/test/core_deps.mk b/test/core_deps.mk index 0308e0c..5d65a42 100644 --- a/test/core_deps.mk +++ b/test/core_deps.mk @@ -1,10 +1,10 @@ # Core: Packages and dependencies. -CORE_DEPS_TARGETS = $(call list_targets,core-deps) +core_deps_TARGETS = $(call list_targets,core-deps) -.PHONY: core-deps $(CORE_DEPS_TARGETS) +.PHONY: core-deps $(core_deps_TARGETS) -core-deps: $(CORE_DEPS_TARGETS) +core-deps: $(core_deps_TARGETS) ifneq ($(PLATFORM),msys2) core-deps-build-c-8cc: init diff --git a/test/core_makedep.mk b/test/core_makedep.mk index 077df6b..6efb2df 100644 --- a/test/core_makedep.mk +++ b/test/core_makedep.mk @@ -1,10 +1,10 @@ # Core: COMPILE_FIRST dependencies generation. -CORE_MAKEDEP_TARGETS = $(call list_targets,core-makedep) +core_makedep_TARGETS = $(call list_targets,core-makedep) -.PHONY: core-makedep $(CORE_MAKEDEP_TARGETS) +.PHONY: core-makedep $(core_makedep_TARGETS) -core-makedep: $(CORE_MAKEDEP_TARGETS) +core-makedep: $(core_makedep_TARGETS) core-makedep-behavior: init diff --git a/test/core_misc.mk b/test/core_misc.mk index 9b7aa92..3cd8562 100644 --- a/test/core_misc.mk +++ b/test/core_misc.mk @@ -2,11 +2,11 @@ # # The miscellaneous tests use the prefix "core-", not "core-misc-". -CORE_MISC_TARGETS = $(filter-out core-misc,$(call list_targets,core)) +core_misc_TARGETS = $(filter-out core-misc,$(call list_targets,core)) -.PHONY: core-misc $(CORE_MISC_TARGETS) +.PHONY: core-misc $(core_misc_TARGETS) -core-misc: $(CORE_MISC_TARGETS) +core-misc: $(core_misc_TARGETS) core-clean-crash-dump: init diff --git a/test/core_plugins.mk b/test/core_plugins.mk index f8fbff3..dcffb9a 100644 --- a/test/core_plugins.mk +++ b/test/core_plugins.mk @@ -1,10 +1,10 @@ # Core: External plugins. -CORE_PLUGINS_TARGETS = $(call list_targets,core-plugins) +core_plugins_TARGETS = $(call list_targets,core-plugins) -.PHONY: core-plugins $(CORE_PLUGINS_TARGETS) +.PHONY: core-plugins $(core_plugins_TARGETS) -core-plugins: $(CORE_PLUGINS_TARGETS) +core-plugins: $(core_plugins_TARGETS) core-plugins-all: init diff --git a/test/core_query.mk b/test/core_query.mk index 85e863f..394652a 100644 --- a/test/core_query.mk +++ b/test/core_query.mk @@ -1,10 +1,10 @@ # Core: Querying dependencies. -CORE_QUERY_TARGETS = $(call list_targets,core-query) +core_query_TARGETS = $(call list_targets,core-query) -.PHONY: core-query $(CORE_QUERY_TARGETS) +.PHONY: core-query $(core_query_TARGETS) -core-query: $(CORE_QUERY_TARGETS) +core-query: $(core_query_TARGETS) core-query-deps: init diff --git a/test/core_upgrade.mk b/test/core_upgrade.mk index 84ff54a..f165098 100644 --- a/test/core_upgrade.mk +++ b/test/core_upgrade.mk @@ -1,10 +1,10 @@ # Core: Erlang.mk upgrade. -CORE_UPGRADE_TARGETS = $(call list_targets,core-upgrade) +core_upgrade_TARGETS = $(call list_targets,core-upgrade) -.PHONY: core-upgrade $(CORE_UPGRADE_TARGETS) +.PHONY: core-upgrade $(core_upgrade_TARGETS) -core-upgrade: $(CORE_UPGRADE_TARGETS) +core-upgrade: $(core_upgrade_TARGETS) core-upgrade-changelog: init diff --git a/test/plugin_asciidoc.mk b/test/plugin_asciidoc.mk index 29dfd07..b2240ce 100644 --- a/test/plugin_asciidoc.mk +++ b/test/plugin_asciidoc.mk @@ -1,10 +1,10 @@ # AsciiDoc plugin. -ASCIIDOC_TARGETS = $(call list_targets,asciidoc) +asciidoc_TARGETS = $(call list_targets,asciidoc) -.PHONY: asciidoc $(ASCIIDOC_TARGETS) +.PHONY: asciidoc $(asciidoc_TARGETS) -asciidoc: $(ASCIIDOC_TARGETS) +asciidoc: $(asciidoc_TARGETS) # Disable the Asciidoc tests requiring the DocBook toolchain # when Asciidoc is not installed. The toolchain is too heavy for CI. diff --git a/test/plugin_bootstrap.mk b/test/plugin_bootstrap.mk index 7093fce..ac10ca0 100644 --- a/test/plugin_bootstrap.mk +++ b/test/plugin_bootstrap.mk @@ -1,10 +1,10 @@ # Bootstrap plugin. -BOOTSTRAP_TARGETS = $(call list_targets,bootstrap) +bootstrap_TARGETS = $(call list_targets,bootstrap) -.PHONY: bootstrap $(BOOTSTRAP_TARGETS) +.PHONY: bootstrap $(bootstrap_TARGETS) -bootstrap: $(BOOTSTRAP_TARGETS) +bootstrap: $(bootstrap_TARGETS) bootstrap-app: init diff --git a/test/plugin_c_src.mk b/test/plugin_c_src.mk index 91422d3..5330452 100644 --- a/test/plugin_c_src.mk +++ b/test/plugin_c_src.mk @@ -1,10 +1,10 @@ # C source plugin. -C_SRC_TARGETS = $(call list_targets,c-src) +c_src_TARGETS = $(call list_targets,c-src) -.PHONY: c-src $(C_SRC_TARGETS) +.PHONY: c-src $(c_src_TARGETS) -c-src: $(C_SRC_TARGETS) +c-src: $(c_src_TARGETS) c_src: c-src ifeq ($(PLATFORM),msys2) diff --git a/test/plugin_concuerror.mk b/test/plugin_concuerror.mk index f1b9288..5bd4231 100644 --- a/test/plugin_concuerror.mk +++ b/test/plugin_concuerror.mk @@ -1,10 +1,10 @@ # Concuerror plugin. -CONCUERROR_TARGETS = $(call list_targets,concuerror) +concuerror_TARGETS = $(call list_targets,concuerror) -.PHONY: concuerror $(CONCUERROR_TARGETS) +.PHONY: concuerror $(concuerror_TARGETS) -concuerror: $(CONCUERROR_TARGETS) +concuerror: $(concuerror_TARGETS) concuerror-app: init diff --git a/test/plugin_cover.mk b/test/plugin_cover.mk index 2ad8ef4..0e1ff5b 100644 --- a/test/plugin_cover.mk +++ b/test/plugin_cover.mk @@ -1,10 +1,10 @@ # Common Test plugin. -COVER_TARGETS = $(call list_targets,cover) +cover_TARGETS = $(call list_targets,cover) -.PHONY: cover $(COVER_TARGETS) +.PHONY: cover $(cover_TARGETS) -cover: $(COVER_TARGETS) +cover: $(cover_TARGETS) cover-ct: init diff --git a/test/plugin_ct.mk b/test/plugin_ct.mk index 6c31f49..a1ecf82 100644 --- a/test/plugin_ct.mk +++ b/test/plugin_ct.mk @@ -1,10 +1,10 @@ # Common Test plugin. -CT_TARGETS = $(call list_targets,ct) +ct_TARGETS = $(call list_targets,ct) -.PHONY: ct $(CT_TARGETS) +.PHONY: ct $(ct_TARGETS) -ct: $(CT_TARGETS) +ct: $(ct_TARGETS) ct-all: init diff --git a/test/plugin_dialyzer.mk b/test/plugin_dialyzer.mk index 732f568..48a2fd6 100644 --- a/test/plugin_dialyzer.mk +++ b/test/plugin_dialyzer.mk @@ -1,14 +1,14 @@ # Dialyzer plugin. -DIALYZER_TARGETS = $(call list_targets,dialyzer) +dialyzer_TARGETS = $(call list_targets,dialyzer) ifneq ($(shell which sem 2>/dev/null),) DIALYZER_MUTEX = sem --fg --id dialyzer endif -.PHONY: dialyzer $(DIALYZER_TARGETS) +.PHONY: dialyzer $(dialyzer_TARGETS) -dialyzer: $(DIALYZER_TARGETS) +dialyzer: $(dialyzer_TARGETS) dialyzer-app: init diff --git a/test/plugin_edoc.mk b/test/plugin_edoc.mk index 575f6df..6dc8252 100644 --- a/test/plugin_edoc.mk +++ b/test/plugin_edoc.mk @@ -1,10 +1,10 @@ # EDoc plugin. -EDOC_TARGETS = $(call list_targets,edoc) +edoc_TARGETS = $(call list_targets,edoc) -.PHONY: edoc $(EDOC_TARGETS) +.PHONY: edoc $(edoc_TARGETS) -edoc: $(EDOC_TARGETS) +edoc: $(edoc_TARGETS) edoc-build: init diff --git a/test/plugin_erlydtl.mk b/test/plugin_erlydtl.mk index 1dac6e1..0cc0774 100644 --- a/test/plugin_erlydtl.mk +++ b/test/plugin_erlydtl.mk @@ -1,10 +1,10 @@ # ErlyDTL plugin. -ERLYDTL_TARGETS = $(call list_targets,erlydtl) +erlydtl_TARGETS = $(call list_targets,erlydtl) -.PHONY: erlydtl $(ERLYDTL_TARGETS) +.PHONY: erlydtl $(erlydtl_TARGETS) -erlydtl: $(ERLYDTL_TARGETS) +erlydtl: $(erlydtl_TARGETS) erlydtl-compile: init diff --git a/test/plugin_escript.mk b/test/plugin_escript.mk index 6479e3f..d816198 100644 --- a/test/plugin_escript.mk +++ b/test/plugin_escript.mk @@ -1,10 +1,10 @@ # Escript plugin. -ESCRIPT_TARGETS = $(call list_targets,escript) +escript_TARGETS = $(call list_targets,escript) -.PHONY: escript $(ESCRIPT_TARGETS) +.PHONY: escript $(escript_TARGETS) -escript: $(ESCRIPT_TARGETS) +escript: $(escript_TARGETS) escript-build: init diff --git a/test/plugin_eunit.mk b/test/plugin_eunit.mk index 823f619..ba3b192 100644 --- a/test/plugin_eunit.mk +++ b/test/plugin_eunit.mk @@ -1,10 +1,10 @@ # EUnit plugin. -EUNIT_TARGETS = $(call list_targets,eunit) +eunit_TARGETS = $(call list_targets,eunit) -.PHONY: eunit $(EUNIT_TARGETS) +.PHONY: eunit $(eunit_TARGETS) -eunit: $(EUNIT_TARGETS) +eunit: $(eunit_TARGETS) eunit-all: init diff --git a/test/plugin_hex.mk b/test/plugin_hex.mk index 66bf6fc..88ee259 100644 --- a/test/plugin_hex.mk +++ b/test/plugin_hex.mk @@ -4,11 +4,11 @@ # be started and available on port 4000, and the HEX=1 variable # must be set. -HEX_TARGETS = $(call list_targets,hex) +hex_TARGETS = $(call list_targets,hex) -.PHONY: hex $(HEX_TARGETS) +.PHONY: hex $(hex_TARGETS) -hex: $(HEX_TARGETS) +hex: $(hex_TARGETS) ifeq ($(shell netcat -z localhost 4000 && echo ok),ok) hex-user-create: init diff --git a/test/plugin_proper.mk b/test/plugin_proper.mk index 108b6e4..42a324d 100644 --- a/test/plugin_proper.mk +++ b/test/plugin_proper.mk @@ -1,10 +1,10 @@ # PropEr plugin. -PROPER_TARGETS = $(call list_targets,proper) +proper_TARGETS = $(call list_targets,proper) -.PHONY: proper $(PROPER_TARGETS) +.PHONY: proper $(proper_TARGETS) -proper: $(PROPER_TARGETS) +proper: $(proper_TARGETS) proper-test-dir: init diff --git a/test/plugin_protobuffs.mk b/test/plugin_protobuffs.mk index 31198f5..2daadf1 100644 --- a/test/plugin_protobuffs.mk +++ b/test/plugin_protobuffs.mk @@ -1,10 +1,10 @@ # Protocol buffers plugin. -PROTOBUFFS_TARGETS = $(call list_targets,protobuffs) +protobuffs_TARGETS = $(call list_targets,protobuffs) -.PHONY: protobuffs $(PROTOBUFFS_TARGETS) +.PHONY: protobuffs $(protobuffs_TARGETS) -protobuffs: $(PROTOBUFFS_TARGETS) +protobuffs: $(protobuffs_TARGETS) PROTOBUFFS_URL = https://raw.githubusercontent.com/basho/erlang_protobuffs/master/test/erlang_protobuffs_SUITE_data @@ -47,7 +47,7 @@ protobuffs-compile-imports: init $t cp ../erlang.mk $(APP)/ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v - $i "Add protobuffs to the list of dependencies" + $i "Add gpb to the list of dependencies" $t perl -ni.bak -e 'print;if ($$.==1) {print "BUILD_DEPS = gpb\n"}' $(APP)/Makefile $i "Download two proto files with an import" @@ -110,7 +110,7 @@ protobuffs-makefile-change: init $t cp ../erlang.mk $(APP)/ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v - $i "Add protobuffs to the list of dependencies" + $i "Add gpb to the list of dependencies" $t perl -ni.bak -e 'print;if ($$.==1) {print "BUILD_DEPS = gpb\n"}' $(APP)/Makefile $i "Download two proto files" diff --git a/test/plugin_relx.mk b/test/plugin_relx.mk index 7e08fe0..9b8f3c4 100644 --- a/test/plugin_relx.mk +++ b/test/plugin_relx.mk @@ -3,9 +3,9 @@ # Sleeps when interacting with relx script are necessary after start and upgrade # as both of those interactions are not synchronized. -RELX_TARGETS = $(call list_targets,relx) +relx_TARGETS = $(call list_targets,relx) -.PHONY: relx $(RELX_TARGETS) +.PHONY: relx $(relx_TARGETS) ifeq ($(PLATFORM),msys2) RELX_REL_EXT = .cmd @@ -13,7 +13,7 @@ else RELX_REL_EXT = endif -relx: $(RELX_TARGETS) +relx: $(relx_TARGETS) relx-rel: init diff --git a/test/plugin_shell.mk b/test/plugin_shell.mk index 533f0a7..83b9883 100644 --- a/test/plugin_shell.mk +++ b/test/plugin_shell.mk @@ -1,10 +1,10 @@ # Shell plugin. -SHELL_TARGETS = $(call list_targets,shell) +shell_TARGETS = $(call list_targets,shell) -.PHONY: shell $(C_SRC_TARGETS) +.PHONY: shell $(shell_TARGETS) -shell: $(SHELL_TARGETS) +shell: $(shell_TARGETS) shell-compile: init diff --git a/test/plugin_sphinx.mk b/test/plugin_sphinx.mk index 915bf8b..834a273 100644 --- a/test/plugin_sphinx.mk +++ b/test/plugin_sphinx.mk @@ -2,14 +2,14 @@ # Disable this test suite when sphinx is not installed. ifeq ($(shell which sphinx-build),) -SPHINX_TARGETS = +sphinx_TARGETS = else -SPHINX_TARGETS = $(call list_targets,sphinx) +sphinx_TARGETS = $(call list_targets,sphinx) endif -.PHONY: sphinx $(SPHINX_TARGETS) +.PHONY: sphinx $(sphinx_TARGETS) -sphinx: $(SPHINX_TARGETS) +sphinx: $(sphinx_TARGETS) sphinx-build: init diff --git a/test/plugin_triq.mk b/test/plugin_triq.mk index 58fd217..bf81d98 100644 --- a/test/plugin_triq.mk +++ b/test/plugin_triq.mk @@ -1,10 +1,10 @@ # Triq plugin. -TRIQ_TARGETS = $(call list_targets,triq) +triq_TARGETS = $(call list_targets,triq) -.PHONY: triq $(TRIQ_TARGETS) +.PHONY: triq $(triq_TARGETS) -triq: $(TRIQ_TARGETS) +triq: $(triq_TARGETS) triq-test-dir: init diff --git a/test/plugin_xref.mk b/test/plugin_xref.mk index 0246e23..e98d7d0 100644 --- a/test/plugin_xref.mk +++ b/test/plugin_xref.mk @@ -1,10 +1,10 @@ # Xref plugin. -XREF_TARGETS = $(call list_targets,xref) +xref_TARGETS = $(call list_targets,xref) -.PHONY: xref $(XREF_TARGETS) +.PHONY: xref $(xref_TARGETS) -xref: $(XREF_TARGETS) +xref: $(xref_TARGETS) xref-check: init |