Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Oct 2017 07:16:19 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r325219 - projects/runtime-coverage/share/mk
Message-ID:  <201710310716.v9V7GJqZ026962@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Tue Oct 31 07:16:18 2017
New Revision: 325219
URL: https://svnweb.freebsd.org/changeset/base/325219

Log:
  Checkpoint work to integrate coverage and make check together

Modified:
  projects/runtime-coverage/share/mk/suite.test.mk

Modified: projects/runtime-coverage/share/mk/suite.test.mk
==============================================================================
--- projects/runtime-coverage/share/mk/suite.test.mk	Tue Oct 31 06:59:28 2017	(r325218)
+++ projects/runtime-coverage/share/mk/suite.test.mk	Tue Oct 31 07:16:18 2017	(r325219)
@@ -79,6 +79,41 @@ Kyuafile: Makefile
 
 KYUA= ${LOCALBASE}/bin/kyua
 
+MAKE_CHECK_SANDBOX_DIR=	${.OBJDIR}/checkdir
+CLEANDIRS+=	${MAKE_CHECK_SANDBOX_DIR}
+
+.if ${MK_MAKE_CHECK_USE_SANDBOX} != "no" && make(check)
+DESTDIR:=	${MAKE_CHECK_SANDBOX_DIR}
+
+.if ${MK_MAKE_CHECK_TEST_WITH_COVERAGE} != "no"
+GCOV?=		gcov
+GCOV_PREFIX?=
+
+TESTS_ENV+=	GCOV=${GCOV} GCOV_PREFIX=${GCOV_PREFIX}
+.endif
+
+beforecheck:
+.for t in clean depend all
+.for dir in ${SRCTOP}/tests/tools ${.CURDIR}
+	@cd ${dir} && ${MAKE} $t
+.endfor
+.endfor
+	@cd ${SRCTOP} && ${MAKE} hierarchy DESTDIR=${DESTDIR}
+.for dir in ${SRCTOP}/tests/tools ${.CURDIR}
+	@cd ${dir} && ${MAKE} install DESTDIR=${DESTDIR}
+.endfor
+
+# NOTE: this is intentional to ensure that "make check" can be run multiple
+#       times. "aftercheck" won't be run if "make check" fails, is interrupted,
+#       etc.
+aftercheck:
+	find ${GCOV_PREFIX} -name \*.gcda
+.if ${MK_MAKE_CHECK_TEST_WITH_COVERAGE} != "no"
+	@env ${TESTS_ENV:Q} ${TESTSBASE}/tools/gather_coverage
+.endif
+	@cd ${.CURDIR} && ${MAKE} clean
+.endif
+
 # Definition of the "make check" target and supporting variables.
 #
 # This target, by necessity, can only work for native builds (i.e. a FreeBSD
@@ -99,26 +134,5 @@ realcheck: .PHONY
 		echo "LOCALBASE=\"${LOCALBASE}\""; \
 		false; \
 	fi
-	@env ${TESTS_ENV:Q} ${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile
-
-MAKE_CHECK_SANDBOX_DIR=	${.OBJDIR}/checkdir
-CLEANDIRS+=	${MAKE_CHECK_SANDBOX_DIR}
-
-.if ${MK_MAKE_CHECK_USE_SANDBOX} != "no" && make(check)
-DESTDIR:=	${MAKE_CHECK_SANDBOX_DIR}
-
-beforecheck:
-.for t in clean depend all
-	@cd ${.CURDIR} && ${MAKE} $t
-.endfor
-	@cd ${SRCTOP} && ${MAKE} hierarchy DESTDIR=${DESTDIR}
-	@cd ${.CURDIR} && ${MAKE} install \
-	    DESTDIR=${DESTDIR}
-
-# NOTE: this is intentional to ensure that "make check" can be run multiple
-#       times. "aftercheck" won't be run if "make check" fails, is interrupted,
-#       etc.
-aftercheck:
-	@cd ${.CURDIR} && ${MAKE} clean
-
-.endif
+	@env ${TESTS_ENV:Q} ${KYUA} test ${KYUA_VARIABLES} \
+	    -k ${DESTDIR}${TESTSDIR}/Kyuafile



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710310716.v9V7GJqZ026962>