From owner-svn-src-projects@freebsd.org Wed Aug 2 03:06:09 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2709DC3EA4 for ; Wed, 2 Aug 2017 03:06:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC1A372CC5; Wed, 2 Aug 2017 03:06:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72368FN085368; Wed, 2 Aug 2017 03:06:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72368xl085367; Wed, 2 Aug 2017 03:06:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708020306.v72368xl085367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 03:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r321901 - projects/make-check-sandbox/share/mk X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/make-check-sandbox/share/mk X-SVN-Commit-Revision: 321901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2017 03:06:10 -0000 Author: ngie Date: Wed Aug 2 03:06:08 2017 New Revision: 321901 URL: https://svnweb.freebsd.org/changeset/base/321901 Log: Make "make check" smarter when run from a root directory If the user decides to specify HAS_TESTS in the upper directory, "make check" will now iterate down the "test" directory, running the tests with an assumably sane default value for $LD_LIBRARY_PATH, $PATH, etc. The purpose of this work is to simplify "make check" -- in particular, to increase dev-test velocity and get me (and others who pay attention, like me) out of the business of paying attention to Jenkins runs and get other developers to (hopefully) test their code more often prior to commit. Huge caveat: Obviously, this will fail miserably when the host can't run the target architecture/code. Necessary compat layer or qemu usermode will be required to make this possible, which is outside the scope of this work (batteries not included). Modified: projects/make-check-sandbox/share/mk/suite.test.mk Modified: projects/make-check-sandbox/share/mk/suite.test.mk ============================================================================== --- projects/make-check-sandbox/share/mk/suite.test.mk Wed Aug 2 02:56:48 2017 (r321900) +++ projects/make-check-sandbox/share/mk/suite.test.mk Wed Aug 2 03:06:08 2017 (r321901) @@ -99,4 +99,30 @@ realcheck: .PHONY echo "LOCALBASE=\"${LOCALBASE}\""; \ false; \ fi - @${KYUA} test -k ${CHECKDIR}/Kyuafile + @env ${TESTS_ENV:Q} ${KYUA} test -k ${CHECKDIR}/Kyuafile + +.ifdef _TESTS_USE_OBJDIR +DESTDIR= ${.OBJDIR}/checkdir +CLEANDIRS+= ${CHECKDIR} + +# XXX (ngie): use daemon(1) and a pidfile to lock the directory? +beforecheck: + @if [ -d "${DESTDIR}" ]; then \ + echo "${DESTDIR} already exists"; \ + echo "Aborting to avoid false positives with potentially" \ + "parallel instances of '${MAKE} check'"; \ + false; \ + fi +.for t in clean all + @cd ${.CURDIR} && ${MAKE} $t +.endfor + @cd ${.CURDIR} && ${MAKE} install \ + -D_FILESMKDIR \ + DESTDIR=${DESTDIR} + +# NOTE: this is intentional to ensure that "make check" can be run multiple +# times. It won't be run if "make check" fails or is interrupted +aftercheck: + @cd ${.CURDIR} && ${MAKE} clean + +.endif