]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use the new test framework
authorAlan T. DeKok <aland@freeradius.org>
Mon, 4 Nov 2019 23:59:54 +0000 (18:59 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 4 Nov 2019 23:59:54 +0000 (18:59 -0500)
and print out the goddamned error messages

src/tests/bin/all.mk
src/tests/bin/lib.sh

index 2bdc73cbd443676d57db7561a6f0e492c264e0c1..6d1a7f2a2ae2c77ec552574a192cdbf6fe79ccc5 100644 (file)
@@ -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
index 0c679a19e02eb5922a795e36641e0c02f42f8f88..c31b846d1df49c934cf5129c55741cd3eb5b2d43 100755 (executable)
@@ -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"