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 exporting sing...



details:   https://anonhg.NetBSD.org/src/rev/6fa5bc2c57a1
branches:  trunk
changeset: 1012333:6fa5bc2c57a1
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jul 27 19:53:37 2020 +0000

description:
make(1): add test for exporting single-character variables

diffstat:

 usr.bin/make/unit-tests/export.exp |   1 +
 usr.bin/make/unit-tests/export.mk  |  24 ++++++++++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diffs (47 lines):

diff -r ca909e518875 -r 6fa5bc2c57a1 usr.bin/make/unit-tests/export.exp
--- a/usr.bin/make/unit-tests/export.exp        Mon Jul 27 19:45:56 2020 +0000
+++ b/usr.bin/make/unit-tests/export.exp        Mon Jul 27 19:53:37 2020 +0000
@@ -1,3 +1,4 @@
+&=ampersand
 .MAKE.LEVEL.ENV=MAKELEVEL
 MAKELEVEL=1
 UT_DOLLAR=This is $UT_FU
diff -r ca909e518875 -r 6fa5bc2c57a1 usr.bin/make/unit-tests/export.mk
--- a/usr.bin/make/unit-tests/export.mk Mon Jul 27 19:45:56 2020 +0000
+++ b/usr.bin/make/unit-tests/export.mk Mon Jul 27 19:53:37 2020 +0000
@@ -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 @@
 
 .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}
 



Home | Main Index | Thread Index | Old Index