Module Name: src Committed By: rillig Date: Tue Feb 16 18:02:19 UTC 2021
Modified Files: src/usr.bin/make/unit-tests: directive-undef.exp directive-undef.mk Log Message: make: demonstrate inconsistency in .undef of an exported variable To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/directive-undef.exp cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/directive-undef.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/directive-undef.exp diff -u src/usr.bin/make/unit-tests/directive-undef.exp:1.5 src/usr.bin/make/unit-tests/directive-undef.exp:1.6 --- src/usr.bin/make/unit-tests/directive-undef.exp:1.5 Tue Dec 22 20:10:21 2020 +++ src/usr.bin/make/unit-tests/directive-undef.exp Tue Feb 16 18:02:19 2021 @@ -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 Index: src/usr.bin/make/unit-tests/directive-undef.mk diff -u src/usr.bin/make/unit-tests/directive-undef.mk:1.9 src/usr.bin/make/unit-tests/directive-undef.mk:1.10 --- src/usr.bin/make/unit-tests/directive-undef.mk:1.9 Tue Dec 22 20:10:21 2020 +++ src/usr.bin/make/unit-tests/directive-undef.mk Tue Feb 16 18:02:19 2021 @@ -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 @@ ${DOLLAR}= dollar .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: - @:;