summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-08-28 23:54:21 +0000
committerjlam <jlam@pkgsrc.org>2004-08-28 23:54:21 +0000
commit53b1ea6a986af91394929685fed758bb6bf18b9f (patch)
treefc27822443550cbd1198709e974689c2aac8ff40 /regress
parente115892d8e98ecbd6533edfc54beebea5cb6ea2e (diff)
downloadpkgsrc-53b1ea6a986af91394929685fed758bb6bf18b9f.tar.gz
Provide a way to report the number of subtests passed and failed.
Diffstat (limited to 'regress')
-rw-r--r--regress/buildlink-transform/Makefile20
-rw-r--r--regress/buildlink-unwrap/Makefile20
2 files changed, 36 insertions, 4 deletions
diff --git a/regress/buildlink-transform/Makefile b/regress/buildlink-transform/Makefile
index d2af90747ed..bc55dbbb06a 100644
--- a/regress/buildlink-transform/Makefile
+++ b/regress/buildlink-transform/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2004/08/28 21:21:12 jlam Exp $
+# $NetBSD: Makefile,v 1.9 2004/08/28 23:54:21 jlam Exp $
#
# Run many buildlink transform tests in a single regression test to avoid
# having to keep creating the wrapper scripts over and over again.
@@ -54,6 +54,7 @@ post-${WRAPPER_PHASE}:
regress: ${WRAPPER_PHASE} do-regress
FAILED_TESTS= ${WRKDIR}/failed
+PASSED_TESTS= ${WRKDIR}/passed
do-regress:
@if [ -f ${FAILED_TESTS} ]; then \
@@ -61,11 +62,25 @@ do-regress:
${CAT} ${FAILED_TESTS} | while read test; do \
${ECHO} " $$test"; \
done; \
- exit `${CAT} ${FAILED_TESTS} | ${WC} -l`; \
+ exit 1; \
else \
${DO_NADA}; \
fi
+report-failed:
+ @if [ -f "${FAILED_TESTS}" ]; then \
+ ${ECHO} `${CAT} ${FAILED_TESTS} | ${WC} -l`; \
+ else \
+ ${ECHO} "0"; \
+ fi
+
+report-passed:
+ @if [ -f "${PASSED_TESTS}" ]; then \
+ ${ECHO} `${CAT} ${PASSED_TESTS} | ${WC} -l`; \
+ else \
+ ${ECHO} "0"; \
+ fi
+
TEST_RESULT= runtest=`${SETENV} ${REGRESS_ENV} regress $$test`; \
${ECHO} "(${.TARGET}) saw: $$test"; \
${ECHO} "(${.TARGET}) got: $$runtest"; \
@@ -73,6 +88,7 @@ TEST_RESULT= runtest=`${SETENV} ${REGRESS_ENV} regress $$test`; \
case $$runtest in \
$$expected) \
${ECHO} "(${.TARGET}) result: PASS"; \
+ ${ECHO} "${.TARGET}" >> ${PASSED_TESTS}; \
;; \
*) \
${ECHO} "(${.TARGET}) result: FAIL"; \
diff --git a/regress/buildlink-unwrap/Makefile b/regress/buildlink-unwrap/Makefile
index 76364476258..eb2633e94ac 100644
--- a/regress/buildlink-unwrap/Makefile
+++ b/regress/buildlink-unwrap/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2004/08/28 21:21:12 jlam Exp $
+# $NetBSD: Makefile,v 1.3 2004/08/28 23:54:21 jlam Exp $
DISTNAME= regress-buildlink-unwrap-0.0
CATEGORIES= regress
@@ -40,6 +40,7 @@ do-build:
regress: build do-regress
FAILED_TESTS= ${WRKDIR}/failed
+PASSED_TESTS= ${WRKDIR}/passed
do-regress:
@if [ -f ${FAILED_TESTS} ]; then \
@@ -47,11 +48,25 @@ do-regress:
${CAT} ${FAILED_TESTS} | while read test; do \
${ECHO} " $$test"; \
done; \
- exit `${CAT} ${FAILED_TESTS} | ${WC} -l`; \
+ exit 1; \
else \
${DO_NADA}; \
fi
+report-failed:
+ @if [ -f "${FAILED_TESTS}" ]; then \
+ ${ECHO} `${CAT} ${FAILED_TESTS} | ${WC} -l`; \
+ else \
+ ${ECHO} "0"; \
+ fi
+
+report-passed:
+ @if [ -f "${PASSED_TESTS}" ]; then \
+ ${ECHO} `${CAT} ${PASSED_TESTS} | ${WC} -l`; \
+ else \
+ ${ECHO} "0"; \
+ fi
+
TEST_RESULT= PATH="${WRKSRC}:${PATH}"; \
runtest=`$$test`; \
${ECHO} "(${.TARGET}) ran: $$test"; \
@@ -60,6 +75,7 @@ TEST_RESULT= PATH="${WRKSRC}:${PATH}"; \
case $$runtest in \
$$expected) \
${ECHO} "(${.TARGET}) result: PASS"; \
+ ${ECHO} "${.TARGET}" >> ${PASSED_TESTS}; \
;; \
*) \
${ECHO} "(${.TARGET}) result: FAIL"; \