From: Alan T. DeKok Date: Sun, 3 Nov 2019 14:43:54 +0000 (-0500) Subject: use DIR for local directory X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be977b6ec32d6c1e02873120119ed0132f86fa7d;p=thirdparty%2Ffreeradius-server.git use DIR for local directory we don't need TEST_FILES_DIR, because the boilermake framework already sets DIR. But we also need to re-set DIR as a rule-specific variable when running the test. Because eval of makefile and running of rule are done at two different times --- diff --git a/src/tests/unit/all.mk b/src/tests/unit/all.mk index 82b7b43eb6b..ff49971bdd3 100644 --- a/src/tests/unit/all.mk +++ b/src/tests/unit/all.mk @@ -7,16 +7,11 @@ # TEST := test.unit -# -# Base directory for the test files -# -TEST_FILES_DIR := $(top_srcdir)/src/tests/unit - # # The files are put here in order. Later tests need # functionality from earlier test. # -FILES := $(subst $(TEST_FILES_DIR)/,,$(call FIND_FILES_SUFFIX,$(TEST_FILES_DIR),*.txt)) +FILES := $(subst $(DIR)/,,$(call FIND_FILES_SUFFIX,$(DIR),*.txt)) # dict.txt - removed because the unit tests don't allow for protocol namespaces @@ -34,9 +29,10 @@ $(FILES.$(TEST)): export TZ = GMT # And the actual script to run each test. # $(OUTPUT)/%: $(DIR)/% $(TESTBINDIR)/unit_test_attribute - ${Q}echo UNIT-TEST $(subst $(TEST_FILES_DIR)/,,$<) - ${Q}if ! $(TESTBIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -d $(top_srcdir)/src/tests/unit -r "$@" $<; then \ - echo "$(TESTBIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -d $(top_srcdir)/src/tests/unit -r \"$@\" $<"; \ + $(eval DIR:=${top_srcdir}/src/tests/unit) + ${Q}echo UNIT-TEST $(subst $(DIR)/,,$<) + ${Q}if ! $(TESTBIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -d $(DIR) -r "$@" $<; then \ + echo "$(TESTBIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -d $(DIR) -r \"$@\" $<"; \ rm -f $(BUILD_DIR)/tests/test.unit; \ exit 1; \ fi