Module Name:    src
Committed By:   jmmv
Date:           Fri Jun 18 13:14:21 UTC 2010

Modified Files:
        src/share/mk: bsd.test.mk

Log Message:
Prevent build breakage if TESTSDIR is not defined (as in 
tests/modules/k_helper).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/mk/bsd.test.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.test.mk
diff -u src/share/mk/bsd.test.mk:1.9 src/share/mk/bsd.test.mk:1.10
--- src/share/mk/bsd.test.mk:1.9	Fri Jun 18 10:10:57 2010
+++ src/share/mk/bsd.test.mk	Fri Jun 18 13:14:21 2010
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.test.mk,v 1.9 2010/06/18 10:10:57 jmmv Exp $
+# $NetBSD: bsd.test.mk,v 1.10 2010/06/18 13:14:21 jmmv Exp $
 #
 
 .include <bsd.init.mk>
@@ -79,14 +79,15 @@
 CLEANFILES += ${_TESTS_FIFO} ${_TESTS_LOG}
 
 .PHONY: test
-.if ${TESTSDIR} == ${TESTSBASE}
+.if defined(TESTSDIR)
+.  if ${TESTSDIR} == ${TESTSBASE}
 # Forbid this case.  It is likely to cause false positives/negatives and it
 # does not cover all the tests (e.g. it misses testing software in external).
 test:
 	@echo "*** Sorry, you cannot use make test from src/tests.  Install the"
 	@echo "*** tests into their final location and run them from /usr/tests"
 	@false
-.else
+.  else
 test:
 	@echo "*** WARNING: make test is experimental"
 	@echo "***"
@@ -94,7 +95,8 @@
 	@echo "*** installed in /usr/tests.  This test run may raise false"
 	@echo "*** positives and/or false negatives."
 	@echo
-	@cd ${DESTDIR}${TESTSDIR}; \
+	@set -e; \
+	cd ${DESTDIR}${TESTSDIR}; \
 	mkfifo ${_TESTS_FIFO}; \
 	cat ${_TESTS_FIFO} | tee ${_TESTS_LOG} | \
 	    ${TESTS_ENV} ${DESTDIR}/usr/bin/atf-report & \
@@ -106,4 +108,8 @@
 	echo "*** The verbatim output of atf-run has been saved to ${_TESTS_LOG}"; \
 	echo "*** Once again, note that "make test" is unsupported."; \
 	test $${result} -eq 0
+.  endif
+.else
+test:
+	@echo "*** No TESTSDIR defined; nothing to do."
 .endif

Reply via email to