]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
re-run the tests if the dictionaries change
authorAlan T. DeKok <aland@freeradius.org>
Thu, 3 Dec 2020 17:09:25 +0000 (12:09 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 3 Dec 2020 21:09:04 +0000 (16:09 -0500)
src/tests/unit/all.mk

index b712b0239b9589566cbb7b852bcf265a7f2dd8c2..fabb6a2e9ca9ba03ccfd6cb48005ab15102c53b4 100644 (file)
@@ -39,26 +39,20 @@ $(eval $(call TEST_BOOTSTRAP))
 #
 $(FILES.$(TEST)): export TZ = GMT
 
+#
+#  Ensure that the protocol tests are run if any of the protocol dictionaries change
+#
+PROTOCOLS := $(subst $(DIR)/protocols/,,$(wildcard $(DIR)/protocols/*))
+define UNIT_TEST_PROTOCOLS
+$(addprefix $(OUTPUT)/,$(filter protocols/${1}/%.txt,$(FILES))): $(wildcard $(top_srcdir)/share/dictionary/${1}/dictionary*) $(BUILD_DIR)/lib/libfreeradius-${1}.la
+endef
+$(foreach x,$(PROTOCOLS),$(eval $(call UNIT_TEST_PROTOCOLS,$x)))
+
+
 #export ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer)
 #export ASAN_OPTIONS=malloc_context_size=50 detect_leaks=1 symbolize=1
 #export LSAN_OPTIONS=print_suppressions=0 fast_unwind_on_malloc=0
 
-#
-#  Look in each file for `proto foo`, and then make that file depend in `libfreeradius-foo.a`
-#
-DEPENDS_MK := $(OUTPUT)/depends.mk
-$(OUTPUT)/depends.mk: $(addprefix $(DIR)/,$(FILES)) | $(OUTPUT)
-       ${Q}rm -f $@
-       ${Q}touch $@
-       ${Q}for x in $^; do \
-               y=`grep '^proto ' $$x | sed 's/^proto //'`; \
-               if [ "$$y" != "" ]; then \
-                       z=`echo $$x | sed 's,src/,$(BUILD_DIR)/',`; \
-                       echo "$$z: $(BUILD_DIR)/lib/libfreeradius-$$y.la" >> $@; \
-                       echo "" >> $@; \
-               fi \
-       done
-
 #
 #  And the actual script to run each test.
 #