-FILES := \
+TEST := test.bin
+
+FILES := \
atomic_queue_test \
control_test \
dhcpclient \
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
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"