Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): add test for unsetting an e...



details:   https://anonhg.NetBSD.org/src/rev/fad694006e00
branches:  trunk
changeset: 974293:fad694006e00
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jul 27 18:57:42 2020 +0000

description:
make(1): add test for unsetting an environment variable in -e mode

diffstat:

 usr.bin/make/unit-tests/envfirst.mk |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r a890b700803e -r fad694006e00 usr.bin/make/unit-tests/envfirst.mk
--- a/usr.bin/make/unit-tests/envfirst.mk       Mon Jul 27 18:51:03 2020 +0000
+++ b/usr.bin/make/unit-tests/envfirst.mk       Mon Jul 27 18:57:42 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: envfirst.mk,v 1.1 2020/07/25 21:19:29 rillig Exp $
+# $NetBSD: envfirst.mk,v 1.2 2020/07/27 18:57:42 rillig Exp $
 #
 # The -e option makes environment variables stronger than global variables.
 
@@ -31,5 +31,12 @@
 .error ${FROM_ENV}
 .endif
 
+# Even .undef doesn't work since it only affects the global context,
+# which is independent from the environment variables.
+.undef FROM_ENV
+.if ${FROM_ENV} != value-from-env
+.error ${FROM_ENV}
+.endif
+
 all:
        @: nothing



Home | Main Index | Thread Index | Old Index