[BACK]Return to bsd.regress.mk CVS log [TXT][DIR] Up to [local] / src / share / mk

File: [local] / src / share / mk / bsd.regress.mk (download)

Revision 1.1, Tue Jan 1 22:54:28 2002 UTC (22 years, 5 months ago) by art
Branch: MAIN

Start for a framework for regression tests. Simplifies the most common
regress test targets, provides logging of success/failure and various
minor features.

Much Makefile magic from espie@ who thinks that my shell programming skills
are "atrocious" (and I agree).

# No man pages for regression tests.
NOMAN=

# No installation.
install:

# If REGRESSTARGETS is defined and PROG is not defined, set a dummy
# PROG
.if defined(REGRESSTARGETS) && !defined(PROG)
PROG=
.endif

.include <bsd.prog.mk>

# XXX - Need full path to REGRESSLOG, otherwise there will be much pain.

REGRESSLOG?=/dev/null
REGRESSNAME=${.CURDIR:S/${BSDSRCDIR}\/regress\///}

.if defined(PROG) && !empty(PROG)
run-regress-${PROG}: ./${PROG}
	./${PROG}
.endif

.if !defined(REGRESSTARGETS)
REGRESSTARGETS=run-regress-${PROG}
.  if defined(REGRESSSKIP)
REGRESSSKIPTARGETS=run-regress-${PROG}
.  endif
.endif

REGRESSSKIPTARGETS?=

regress:
.for RT in ${REGRESSTARGETS} 
.  if ${REGRESSSKIPTARGETS:M${RT}}
	@echo -n "SKIP " >> ${REGRESSLOG}
.  else
	@if cd ${.CURDIR} && ${MAKE} ${RT}; then \
	    echo -n "SUCCESS " >> ${REGRESSLOG} ; \
    	else \
	    echo -n "FAIL " >> ${REGRESSLOG} ; \
	    echo FAILED ; \
	fi
.  endif
	@echo ${REGRESSNAME}/${RT:S/^run-regress-//} >> ${REGRESSLOG}
.endfor

.PHONY: regress