1 # usage: tests/using-intree make -f tests/Makefile
3 # TESTSCRIPTS='tests/tests/foo tests/tests/bar')
4 # DGIT_TEST_RETRY_COUNT=<a smallish integer>
6 TESTSCRIPTS ?= $(shell tests/enumerate-tests)
7 TESTNAMES := $(notdir $(TESTSCRIPTS))
9 all: $(foreach t,$(TESTNAMES),tests/tmp/$t.ok)
10 @echo "ALL PASSED$${DGIT_TESTS_PROGRESSIVE+ AT SOME POINT}"
12 tests/tmp/%.ok: tests/tests/%
13 ifeq ($(DGIT_TEST_RETRY_COUNT),)
14 $(DGIT_TEST_RUN_PFX) tests/tests/$* >tests/tmp/$*.log 2>&1
16 @for retry in $$( seq 1 $(DGIT_TEST_RETRY_COUNT) ); do \
17 echo "[$$retry] $*"; \
18 $(DGIT_TEST_RUN_PFX) tests/tests/$* >tests/tmp/$*.$$retry.log 2>&1; \
20 if [ $$rc = 0 ]; then exit 0; fi; \
21 echo >&2 "[$$retry] $* TEST FAILED $$rc"; \