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 directive unex...



details:   https://anonhg.NetBSD.org/src/rev/aae8c55ec5c7
branches:  trunk
changeset: 946711:aae8c55ec5c7
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 06 16:06:11 2020 +0000

description:
make(1): add test for directive unexport-env

diffstat:

 usr.bin/make/unit-tests/directive-unexport-env.exp |  12 ++++++++++++
 usr.bin/make/unit-tests/directive-unexport-env.mk  |  14 +++++++++++++-
 2 files changed, 25 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r 9ecb219c74fa -r aae8c55ec5c7 usr.bin/make/unit-tests/directive-unexport-env.exp
--- a/usr.bin/make/unit-tests/directive-unexport-env.exp        Sun Dec 06 15:40:46 2020 +0000
+++ b/usr.bin/make/unit-tests/directive-unexport-env.exp        Sun Dec 06 16:06:11 2020 +0000
@@ -1,1 +1,13 @@
+Global:UT_EXPORTED = value
+Global:UT_UNEXPORTED = value
+Global:.MAKE.EXPORTED = UT_EXPORTED
+Var_Parse: ${.MAKE.EXPORTED:O:u} with VARE_WANTRES
+Applying ${.MAKE.EXPORTED:O} to "UT_EXPORTED" (VARE_WANTRES, none, none)
+Result of ${.MAKE.EXPORTED:O} is "UT_EXPORTED" (VARE_WANTRES, none, none)
+Applying ${.MAKE.EXPORTED:u} to "UT_EXPORTED" (VARE_WANTRES, none, none)
+Result of ${.MAKE.EXPORTED:u} is "UT_EXPORTED" (VARE_WANTRES, none, none)
+Unexporting "UT_EXPORTED"
+Global:delete .MAKE.EXPORTED
+Global:.MAKEFLAGS =  -r -k -d v -d
+Global:.MAKEFLAGS =  -r -k -d v -d 0
 exit status 0
diff -r 9ecb219c74fa -r aae8c55ec5c7 usr.bin/make/unit-tests/directive-unexport-env.mk
--- a/usr.bin/make/unit-tests/directive-unexport-env.mk Sun Dec 06 15:40:46 2020 +0000
+++ b/usr.bin/make/unit-tests/directive-unexport-env.mk Sun Dec 06 16:06:11 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: directive-unexport-env.mk,v 1.3 2020/11/03 17:17:31 rillig Exp $
+# $NetBSD: directive-unexport-env.mk,v 1.4 2020/12/06 16:06:11 rillig Exp $
 #
 # Tests for the .unexport-env directive.
 
@@ -8,5 +8,17 @@
 .unexport-env                  # ok
 .unexport-environment          # oops: misspelled
 
+# Before 2020-12-06, the directive unexport-env was implemented strangely.
+# According to its documentation, it does not take any arguments, but the
+# Implementation accepted variable names as arguments and produced wrong debug
+# logging for them, saying "Unexporting" for variables that at this point were
+# not exported anymore.
+.MAKEFLAGS: -dv
+UT_EXPORTED=   value
+UT_UNEXPORTED= value
+.export UT_EXPORTED
+.unexport-env UT_EXPORTED UT_UNEXPORTED
+.MAKEFLAGS: -d0
+
 all:
        @:;



Home | Main Index | Thread Index | Old Index