Received: by mail.netbsd.org (Postfix, from userid 605) id A39E584D9D; Mon, 23 Mar 2020 00:33:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 2C6D984D99 for ; Mon, 23 Mar 2020 00:33:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id J7T5UG3QbUBW for ; Mon, 23 Mar 2020 00:33:48 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 9E8A884D32 for ; Mon, 23 Mar 2020 00:33:48 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 98802FB27; Mon, 23 Mar 2020 00:33:48 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1584923628217910" MIME-Version: 1.0 Date: Mon, 23 Mar 2020 00:33:48 +0000 From: "Taylor R Campbell" Subject: CVS commit: pkgsrc/mk To: pkgsrc-changes@NetBSD.org Reply-To: riastradh@netbsd.org X-Mailer: log_accum Message-Id: <20200323003348.98802FB27@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1584923628217910 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: riastradh Date: Mon Mar 23 00:33:48 UTC 2020 Modified Files: pkgsrc/mk: bsd.pkg.barrier.mk pkgsrc/mk/build: test.mk Log Message: New target test-env, like build-env and configure-env. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 pkgsrc/mk/bsd.pkg.barrier.mk cvs rdiff -u -r1.23 -r1.24 pkgsrc/mk/build/test.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1584923628217910 Content-Disposition: inline Content-Length: 2824 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/bsd.pkg.barrier.mk diff -u pkgsrc/mk/bsd.pkg.barrier.mk:1.20 pkgsrc/mk/bsd.pkg.barrier.mk:1.21 --- pkgsrc/mk/bsd.pkg.barrier.mk:1.20 Sun Feb 9 20:33:38 2020 +++ pkgsrc/mk/bsd.pkg.barrier.mk Mon Mar 23 00:33:48 2020 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.barrier.mk,v 1.20 2020/02/09 20:33:38 rillig Exp $ +# $NetBSD: bsd.pkg.barrier.mk,v 1.21 2020/03/23 00:33:48 riastradh Exp $ _COOKIE.barrier= ${WRKDIR}/.barrier_cookie @@ -20,7 +20,7 @@ _BARRIER_POST_TARGETS+= extract _BARRIER_POST_TARGETS+= patch _BARRIER_POST_TARGETS+= configure configure-env _BARRIER_POST_TARGETS+= build build-env -_BARRIER_POST_TARGETS+= test +_BARRIER_POST_TARGETS+= test test-env _BARRIER_POST_TARGETS+= all _BARRIER_POST_TARGETS+= stage-install _BARRIER_POST_TARGETS+= stage-package-create Index: pkgsrc/mk/build/test.mk diff -u pkgsrc/mk/build/test.mk:1.23 pkgsrc/mk/build/test.mk:1.24 --- pkgsrc/mk/build/test.mk:1.23 Sun Oct 13 11:08:10 2019 +++ pkgsrc/mk/build/test.mk Mon Mar 23 00:33:48 2020 @@ -1,10 +1,16 @@ -# $NetBSD: test.mk,v 1.23 2019/10/13 11:08:10 rillig Exp $ +# $NetBSD: test.mk,v 1.24 2020/03/23 00:33:48 riastradh Exp $ # # After the "build" phase, many packages provide some sort of self-test # that can be run on the not-yet installed package. To enable these # tests, the package must define TEST_TARGET or override the do-test # target. Additionally, the pkgsrc user must define PKGSRC_RUN_TEST. # +# Public targets for developers: +# +# test-env: +# Runs an interactive shell (TEST_ENV_SHELL) in the environment +# that is used for testing the package. +# # User-settable variables: # # PKGSRC_RUN_TEST @@ -39,7 +45,7 @@ # _VARGROUPS+= test -_USER_VARS.test= PKGSRC_RUN_TEST +_USER_VARS.test= PKGSRC_RUN_TEST TEST_ENV_SHELL _PKG_VARS.test= TEST_TARGET TEST_DIRS TEST_ENV TEST_MAKE_FLAGS _USE_VARS.test= BUILD_DIRS MAKE_ENV MAKE_FLAGS MAKEFLAGS MAKE_FILE \ RECURSIVE_MAKE INTERACTIVE_STAGE BATCH WRKSRC @@ -188,3 +194,30 @@ test-cookie: .PHONY: test-clean test-clean: ${RUN} ${RM} -f ${_COOKIE.test} + +# test-env: +# Runs an interactive shell in the same environment that is +# also used for the tests. +# +# This is only used during development and testing of a package +# to work in the same environment as the actual test. +# +# User-settable variables: +# +# TEST_ENV_SHELL +# The shell to start. +# +# Default: ${SH} +# +# Keywords: debug test + +TEST_ENV_SHELL?= ${SH} +test-env: .PHONY ${_PKGSRC_BARRIER:Ubarrier:D_test-env} +_test-env: .PHONY wrapper + @${STEP_MSG} "Entering the test environment for ${PKGNAME}" +.if ${TEST_DIRS:[#]} > 1 || ${TEST_DIRS} != ${WRKSRC} + @${ECHO_MSG} "The TEST_DIRS are:" \ + ${TEST_DIRS:S,^${WRKSRC}$,.,:S,^${WRKSRC}/,,:Q} +.endif + ${RUN} cd ${WRKSRC} \ + && ${PKGSRC_SETENV} ${TEST_ENV} ${TEST_ENV_SHELL} --_----------=_1584923628217910--