]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Define test.ldap_sync to run tests for all types of directory
authorNick Porter <nick@portercomputing.co.uk>
Wed, 13 Apr 2022 09:25:02 +0000 (10:25 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 29 Aug 2022 12:33:24 +0000 (13:33 +0100)
src/tests/ldap_sync/all.mk [new file with mode: 0644]

diff --git a/src/tests/ldap_sync/all.mk b/src/tests/ldap_sync/all.mk
new file mode 100644 (file)
index 0000000..c795a6f
--- /dev/null
@@ -0,0 +1,34 @@
+#
+#
+#
+TEST := test.ldap_sync
+
+#
+#  Find all the LDAP syncs for which we have a configured server
+#
+FILES := $(subst $(DIR)/,,$(wildcard $(DIR)/*/all.mk))
+
+define LDAP_FILTER
+ifeq "$($(shell echo ${1} | tr a-z A-Z)_TEST_SERVER)" ""
+  FILES_SKIP += ${2}
+endif
+endef
+
+$(foreach x,$(FILES),$(eval $(call LDAP_FILTER,$(firstword $(subst /, ,$x)),$x)))
+FILES := $(filter-out $(FILES_SKIP),$(FILES))
+
+#
+#  Include the make file for each type of LDAP sync with a test server
+#
+SUBMAKEFILES := $(FILES)
+
+#
+#  Define target to run all ldap_sync tests
+#
+$(TEST): test.ldap_sync.dir $(patsubst %/all.mk,test.ldap_sync/%,$(FILES))
+
+#
+#  Ensure diretory for "touch" files exists
+#
+test.ldap_sync.dir:
+       ${Q}mkdir -p $(BUILD_DIR)/tests/test.ldap_sync