]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
have tests explicitly depend on each other.
authorAlan T. DeKok <aland@freeradius.org>
Wed, 31 Dec 2025 12:57:43 +0000 (07:57 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 31 Dec 2025 13:00:07 +0000 (08:00 -0500)
this is the first step in parallelization.

src/tests/all.mk
src/tests/depends.mk [new file with mode: 0644]

index 7866e349f39ea09bc28da0f37b1e94544b5af476..e2642d10aed46796fbbaf81dff712aa0115538e6 100644 (file)
@@ -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 (file)
index 0000000..05a7486
--- /dev/null
@@ -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.
+#