Module Name: src
Committed By: rillig
Date: Mon Jul 27 19:53:37 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: export.exp export.mk
Log Message:
make(1): add test for exporting single-character variables
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/export.exp \
src/usr.bin/make/unit-tests/export.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/export.exp
diff -u src/usr.bin/make/unit-tests/export.exp:1.2 src/usr.bin/make/unit-tests/export.exp:1.3
--- src/usr.bin/make/unit-tests/export.exp:1.2 Mon Jul 27 19:45:56 2020
+++ src/usr.bin/make/unit-tests/export.exp Mon Jul 27 19:53:37 2020
@@ -1,3 +1,4 @@
+&=ampersand
.MAKE.LEVEL.ENV=MAKELEVEL
MAKELEVEL=1
UT_DOLLAR=This is $UT_FU
Index: src/usr.bin/make/unit-tests/export.mk
diff -u src/usr.bin/make/unit-tests/export.mk:1.2 src/usr.bin/make/unit-tests/export.mk:1.3
--- src/usr.bin/make/unit-tests/export.mk:1.2 Mon Jul 27 19:45:56 2020
+++ src/usr.bin/make/unit-tests/export.mk Mon Jul 27 19:53:37 2020
@@ -1,4 +1,4 @@
-# $Id: export.mk,v 1.2 2020/07/27 19:45:56 rillig Exp $
+# $Id: export.mk,v 1.3 2020/07/27 19:53:37 rillig Exp $
UT_TEST=export
UT_FOO=foo${BAR}
@@ -10,8 +10,28 @@ UT_DOLLAR= This is $$UT_FU
.export UT_FU UT_FOO
.export UT_DOLLAR
-# this one will be ignored
+
+.if !defined(.MAKE.PID)
+.error .MAKE.PID must be defined
+.endif
+@= at
+%= percent
+*= asterisk
+${:U!}= exclamation # A direct != would try to run "exclamation"
+ # as a shell command and assign its output
+ # to the empty variable.
+&= ampersand
+
+# This is ignored because it is internal.
.export .MAKE.PID
+# These are ignored because they are local to the target.
+.export @
+.export %
+.export *
+.export !
+.export &
+# This is ignored because it is undefined.
+.export UNDEFINED
BAR=bar is ${UT_FU}