From: Alan T. DeKok Date: Wed, 31 Dec 2025 12:57:43 +0000 (-0500) Subject: have tests explicitly depend on each other. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb72ea92107309404ce914e130d816488e4fa7a0;p=thirdparty%2Ffreeradius-server.git have tests explicitly depend on each other. this is the first step in parallelization. --- diff --git a/src/tests/all.mk b/src/tests/all.mk index 7866e349f39..e2642d10aed 100644 --- a/src/tests/all.mk +++ b/src/tests/all.mk @@ -95,7 +95,7 @@ export ASAN_OPTIONS=malloc_context_size=50 detect_leaks=1 symbolize=1 export LSAN_OPTIONS=print_suppressions=0 fast_unwind_on_malloc=0 endif -SUBMAKEFILES := rbmonkey.mk $(subst src/tests/,,$(wildcard src/tests/*/all.mk)) +SUBMAKEFILES := rbmonkey.mk $(subst src/tests/,,$(wildcard src/tests/*/all.mk)) depends.mk endif .PHONY: $(BUILD_DIR)/tests diff --git a/src/tests/depends.mk b/src/tests/depends.mk new file mode 100644 index 00000000000..05a74864780 --- /dev/null +++ b/src/tests/depends.mk @@ -0,0 +1,59 @@ +# +# Track inter-test dependencies. +# +# This file MUST be included last from the "all.mk" file in this +# directory. Otherwise the macros for the individual tests aren't +# defined. +# + +# +# bin, trie, and dict tests can run in parallel. +# + +$(FILES.test.unit): $(FILES.test.dict) + +$(FILES.test.xlat): $(FILES.test.unit) + +$(FILES.test.keywords): $(FILES.test.trie) $(FILES.test.unit) | build.raddb + +$(FILES.test.modules): $(FILES.test.keywords) + +$(FILES.test.auth): $(FILES.test.keywords) + +$(FILES.test.radsniff): $(FILES.test.unit) + +$(FILES.test.process): $(FILES.test.keywords) + +# +# All of the tests which run a RADIUS server need to be run in +# series, so they all depend on each other +# +TEST_ALL_ORDER := radiusd-c radclient detail digest radmin eap vmps + +ifneq "$(FILES.test.tacacs)" "" +TEST_ALL_ORDER += tacacs +endif + +ifneq "$(FILES.test.ldap_sync)" "" +TEST_ALL_ORDER += ldap_sync +endif + +TEST_ALL_PREV = process + +# +# Ensure that all of the "radiusd -C" tests are run in series. +# +# At least until such time as they're either run in docker +# containers, OR they're all run on different ports. +# +define TEST_ALL_DEPS +$$(FILES.test.${1}): $$(FILES.test.$(TEST_ALL_PREV)) +TEST_ALL_PREV := ${1} +endef + +$(foreach x,$(TEST_ALL_ORDER),$(eval $(call TEST_ALL_DEPS,$x))) + +# +# @todo - loop over all tests in each directory which runs radiusd-c, +# serializing them, too. See src/tests/modules/all.mk for examples. +#