File: Makefile

package info (click to toggle)
dgit 12.16
  • links: PTS, VCS
  • area: main
  • in suites: trixie-proposed-updates
  • size: 3,368 kB
  • sloc: perl: 13,443; sh: 6,466; python: 334; makefile: 324; tcl: 69
file content (24 lines) | stat: -rw-r--r-- 791 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# usage: tests/using-intree make -f tests/Makefile
# optionally setting
#   TESTSCRIPTS='tests/tests/foo tests/tests/bar')
#   DGIT_TEST_RETRY_COUNT=<a smallish integer>

TESTSCRIPTS ?= $(shell tests/enumerate-tests)
TESTNAMES := $(notdir $(TESTSCRIPTS))

all: $(foreach t,$(TESTNAMES),tests/tmp/$t.ok)
	@echo "ALL PASSED$${DGIT_TESTS_PROGRESSIVE+ AT SOME POINT}"

tests/tmp/%.ok: tests/tests/%
ifeq ($(DGIT_TEST_RETRY_COUNT),)
	$(DGIT_TEST_RUN_PFX) tests/tests/$* >tests/tmp/$*.log 2>&1
else
	@for retry in $$( seq 1 $(DGIT_TEST_RETRY_COUNT) ); do		\
		echo "[$$retry] $*";					\
	$(DGIT_TEST_RUN_PFX) tests/tests/$* >tests/tmp/$*.$$retry.log 2>&1; \
		rc=$$?;							\
		if [ $$rc = 0 ]; then exit 0; fi;			\
		echo >&2 "[$$retry] $* TEST FAILED $$rc";		\
	done; exit $$rc
endif
	@touch $@