bsd.regress.mk revision 1.3
1# No man pages for regression tests.
2NOMAN=
3
4# No installation.
5install:
6
7# If REGRESSTARGETS is defined and PROG is not defined, set NOPROG
8.if defined(REGRESSTARGETS) && !defined(PROG)
9NOPROG=
10.endif
11
12.include <bsd.prog.mk>
13
14# XXX - Need full path to REGRESSLOG, otherwise there will be much pain.
15
16REGRESSLOG?=/dev/null
17REGRESSNAME=${.CURDIR:S/${BSDSRCDIR}\/regress\///}
18
19.if defined(PROG) && !empty(PROG)
20run-regress-${PROG}: ${PROG}
21	./${PROG}
22.endif
23
24.if !defined(REGRESSTARGETS)
25REGRESSTARGETS=run-regress-${PROG}
26.  if defined(REGRESSSKIP)
27REGRESSSKIPTARGETS=run-regress-${PROG}
28.  endif
29.endif
30
31REGRESSSKIPTARGETS?=
32
33regress:
34.for RT in ${REGRESSTARGETS} 
35.  if ${REGRESSSKIPTARGETS:M${RT}}
36	@echo -n "SKIP " >> ${REGRESSLOG}
37.  else
38# XXX - we need a better method to see if a test fails due to timeout or just
39#       normal failure.
40.   if !defined(REGRESSMAXTIME)
41	@if cd ${.CURDIR} && ${MAKE} ${RT}; then \
42	    echo -n "SUCCESS " >> ${REGRESSLOG} ; \
43	else \
44	    echo -n "FAIL " >> ${REGRESSLOG} ; \
45	    echo FAILED ; \
46	fi
47.   else
48	@if cd ${.CURDIR} && (ulimit -t ${REGRESSMAXTIME} ; ${MAKE} ${RT}); then \
49	    echo -n "SUCCESS " >> ${REGRESSLOG} ; \
50	else \
51	    echo -n "FAIL (timeout) " >> ${REGRESSLOG} ; \
52	    echo FAILED ; \
53	fi
54.   endif
55.  endif
56	@echo ${REGRESSNAME}/${RT:S/^run-regress-//} >> ${REGRESSLOG}
57.endfor
58
59.PHONY: regress
60