summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorart <art@openbsd.org>2002-01-03 00:28:28 +0000
committerart <art@openbsd.org>2002-01-03 00:28:28 +0000
commit81782cb65efa3ee99863d9c413b54c7ffa079d90 (patch)
tree4576445a31fc105e0c053d8f27461ca4a86034f7
parentdepend the tests on the test program. (diff)
downloadwireguard-openbsd-81782cb65efa3ee99863d9c413b54c7ffa079d90.tar.xz
wireguard-openbsd-81782cb65efa3ee99863d9c413b54c7ffa079d90.zip
Support for a new variable REGRESSMAXTIME that sets the cpu time
ulimit for tests. Needed for libc_r tests. With some help from marc@
-rw-r--r--share/mk/bsd.regress.mk15
1 files changed, 13 insertions, 2 deletions
diff --git a/share/mk/bsd.regress.mk b/share/mk/bsd.regress.mk
index d65bed8b2fc..8186e6a69f1 100644
--- a/share/mk/bsd.regress.mk
+++ b/share/mk/bsd.regress.mk
@@ -17,7 +17,7 @@ REGRESSLOG?=/dev/null
REGRESSNAME=${.CURDIR:S/${BSDSRCDIR}\/regress\///}
.if defined(PROG) && !empty(PROG)
-run-regress-${PROG}: ./${PROG}
+run-regress-${PROG}: ${PROG}
./${PROG}
.endif
@@ -35,12 +35,23 @@ regress:
. if ${REGRESSSKIPTARGETS:M${RT}}
@echo -n "SKIP " >> ${REGRESSLOG}
. else
+# XXX - we need a better method to see if a test fails due to timeout or just
+# normal failure.
+. if !defined(REGRESSMAXTIME)
@if cd ${.CURDIR} && ${MAKE} ${RT}; then \
echo -n "SUCCESS " >> ${REGRESSLOG} ; \
- else \
+ else \
echo -n "FAIL " >> ${REGRESSLOG} ; \
echo FAILED ; \
fi
+. else
+ @if cd ${.CURDIR} && (ulimit -t ${REGRESSMAXTIME} ; ${MAKE} ${RT}); then \
+ echo -n "SUCCESS " >> ${REGRESSLOG} ; \
+ else \
+ echo -n "FAIL (timeout) " >> ${REGRESSLOG} ; \
+ echo FAILED ; \
+ fi
+. endif
. endif
@echo ${REGRESSNAME}/${RT:S/^run-regress-//} >> ${REGRESSLOG}
.endfor