pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/mk
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.
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}
Home |
Main Index |
Thread Index |
Old Index