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: demonstrate inconsistency in ....



details:   https://anonhg.NetBSD.org/src/rev/163b6b01fb76
branches:  trunk
changeset: 952753:163b6b01fb76
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Feb 16 18:02:19 2021 +0000

description:
make: demonstrate inconsistency in .undef of an exported variable

diffstat:

 usr.bin/make/unit-tests/directive-undef.exp |   1 +
 usr.bin/make/unit-tests/directive-undef.mk  |  21 +++++++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 6e510b1cbcbf -r 163b6b01fb76 usr.bin/make/unit-tests/directive-undef.exp
--- a/usr.bin/make/unit-tests/directive-undef.exp       Tue Feb 16 17:41:23 2021 +0000
+++ b/usr.bin/make/unit-tests/directive-undef.exp       Tue Feb 16 18:02:19 2021 +0000
@@ -1,5 +1,6 @@
 make: "directive-undef.mk" line 29: The .undef directive requires an argument
 make: "directive-undef.mk" line 86: Unknown modifier 'Z'
+make: "directive-undef.mk" line 103: warning: UT_EXPORTED is still listed in .MAKE.EXPORTED even though spaceit is not exported anymore.
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r 6e510b1cbcbf -r 163b6b01fb76 usr.bin/make/unit-tests/directive-undef.mk
--- a/usr.bin/make/unit-tests/directive-undef.mk        Tue Feb 16 17:41:23 2021 +0000
+++ b/usr.bin/make/unit-tests/directive-undef.mk        Tue Feb 16 18:02:19 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: directive-undef.mk,v 1.9 2020/12/22 20:10:21 rillig Exp $
+# $NetBSD: directive-undef.mk,v 1.10 2021/02/16 18:02:19 rillig Exp $
 #
 # Tests for the .undef directive.
 #
@@ -86,5 +86,22 @@
 .undef ${VARNAMES:L:Z}
 
 
+UT_EXPORTED=   exported-value
+.export UT_EXPORTED
+.if ${:!echo "\${UT_EXPORTED:-not-exported}"!} != "exported-value"
+.  error
+.endif
+.if !${.MAKE.EXPORTED:MUT_EXPORTED}
+.  error
+.endif
+.undef UT_EXPORTED             # XXX: does not update .MAKE.EXPORTED
+.if ${:!echo "\${UT_EXPORTED:-not-exported}"!} != "not-exported"
+.  error
+.endif
+.if ${.MAKE.EXPORTED:MUT_EXPORTED}
+.  warning UT_EXPORTED is still listed in .MAKE.EXPORTED even though $\
+          it is not exported anymore.
+.endif
+
+
 all:
-       @:;



Home | Main Index | Thread Index | Old Index