Module Name: src
Committed By: rillig
Date: Mon Jul 27 18:57:42 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: envfirst.mk
Log Message:
make(1): add test for unsetting an environment variable in -e mode
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/envfirst.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/unit-tests/envfirst.mk
diff -u src/usr.bin/make/unit-tests/envfirst.mk:1.1 src/usr.bin/make/unit-tests/envfirst.mk:1.2
--- src/usr.bin/make/unit-tests/envfirst.mk:1.1 Sat Jul 25 21:19:29 2020
+++ src/usr.bin/make/unit-tests/envfirst.mk Mon Jul 27 18:57:42 2020
@@ -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 @@ FROM_ENV?= default
.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