From: Alan T. DeKok Date: Mon, 4 Nov 2019 23:59:54 +0000 (-0500) Subject: use the new test framework X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d829a5606eec4fcc961ee684b8af48ac5b2fe0cb;p=thirdparty%2Ffreeradius-server.git use the new test framework and print out the goddamned error messages --- diff --git a/src/tests/bin/all.mk b/src/tests/bin/all.mk index 2bdc73cbd44..6d1a7f2a2ae 100644 --- a/src/tests/bin/all.mk +++ b/src/tests/bin/all.mk @@ -1,4 +1,6 @@ -FILES := \ +TEST := test.bin + +FILES := \ atomic_queue_test \ control_test \ dhcpclient \ @@ -18,38 +20,16 @@ FILES := \ unit_test_module -DICT_DIR := $(top_srcdir)/share/dictionary - -# -# Create the output directory -# -.PHONY: $(BUILD_DIR)/tests/bin -$(BUILD_DIR)/tests/bin: - ${Q}mkdir -p $@ +$(eval $(call TEST_BOOTSTRAP)) # # Files in the output dir depend on the bin tests, and on the binary # that we're running # -$(BUILD_DIR)/tests/bin/%: $(DIR)/% $(TESTBINDIR)/% | $(BUILD_DIR)/tests/bin +$(BUILD_DIR)/tests/bin/%: $(DIR)/% ${Q}echo BIN-TEST $(notdir $@) - ${Q}TESTBIN="$(TESTBIN)" TESTBINDIR="$(TESTBINDIR)" DICT_DIR="$(DICT_DIR)" $< + ${Q}if ! TESTBIN="$(TESTBIN)" DICT_DIR="$(top_srcdir)/share/dictionary" $<; then \ + echo TESTBIN=\"$(TESTBIN)\" DICT_DIR="$(top_srcdir)/share/dictionary" $<; \ + exit 1; \ + fi ${Q}touch $@ - -# -# Get all of the bin test output files -# -TEST.BIN_FILES := $(addprefix $(BUILD_DIR)/tests/bin/,$(FILES)) - -$(TEST.BIN_FILES): $(TEST.DICT_FILES) - -# -# Depend on the output files, and create the directory first. -# -test.bin: $(TEST.BIN_FILES) - -.PHONY: clean.test.bin -clean.test.bin: - ${Q}rm -rf $(BUILD_DIR)/tests/bin/ - -clean.test: clean.test.bin diff --git a/src/tests/bin/lib.sh b/src/tests/bin/lib.sh index 0c679a19e02..c31b846d1df 100755 --- a/src/tests/bin/lib.sh +++ b/src/tests/bin/lib.sh @@ -1,6 +1,7 @@ do_test() { - if ! $@ 1> /dev/null 2>&1; then + if ! $@ 1> build/tests/bin/$(basename $0).log 2>&1; then echo "Failed executing '$@' - error $?" + cat build/tests/bin/$(basename $0).log [ -n "$cb_do_test" ] && eval "$cb_do_test"