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 non-obvious .M...



details:   https://anonhg.NetBSD.org/src/rev/3d2bd9d45f93
branches:  trunk
changeset: 937130:3d2bd9d45f93
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 09 12:59:16 2020 +0000

description:
make(1): add test for non-obvious .MAKE.EXPORTED edge case

diffstat:

 distrib/sets/lists/tests/mi               |   4 +++-
 usr.bin/make/unit-tests/Makefile          |   4 +++-
 usr.bin/make/unit-tests/make-exported.exp |   3 +++
 usr.bin/make/unit-tests/make-exported.mk  |  16 ++++++++++++++++
 4 files changed, 25 insertions(+), 2 deletions(-)

diffs (70 lines):

diff -r 62cdfc216f31 -r 3d2bd9d45f93 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sun Aug 09 11:04:05 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Sun Aug 09 12:59:16 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.886 2020/08/07 19:24:27 rillig Exp $
+# $NetBSD: mi,v 1.887 2020/08/09 12:59:16 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4576,6 +4576,8 @@
 ./usr/tests/usr.bin/make/unit-tests/include-subsub.mk  tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/lint.exp   tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/lint.mk    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/make-exported.exp  tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/make-exported.mk   tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/misc.exp   tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/misc.mk    tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/moderrs.exp        tests-usr.bin-tests     compattestfile,atf
diff -r 62cdfc216f31 -r 3d2bd9d45f93 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Sun Aug 09 11:04:05 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Sun Aug 09 12:59:16 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.89 2020/08/07 19:24:27 rillig Exp $
+# $NetBSD: Makefile,v 1.90 2020/08/09 12:59:16 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -59,6 +59,7 @@
 TESTS+=                impsrc
 TESTS+=                include-main
 TESTS+=                lint
+TESTS+=                make-exported
 TESTS+=                misc
 TESTS+=                moderrs
 TESTS+=                modmatch
@@ -93,6 +94,7 @@
 ENV.export=            -i PATH=${PATH:Q}
 ENV.export-variants=   -i PATH=${PATH:Q}
 ENV.lint=              -i
+ENV.make-exported=     -i PATH=${PATH:Q}
 ENV.recursive=         -i
 ENV.varmisc=           FROM_ENV=env
 ENV.varmisc+=          FROM_ENV_BEFORE=env
diff -r 62cdfc216f31 -r 3d2bd9d45f93 usr.bin/make/unit-tests/make-exported.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/make-exported.exp Sun Aug 09 12:59:16 2020 +0000
@@ -0,0 +1,3 @@
+-literal=make-exported-value
+UT_VAR=
+exit status 0
diff -r 62cdfc216f31 -r 3d2bd9d45f93 usr.bin/make/unit-tests/make-exported.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/make-exported.mk  Sun Aug 09 12:59:16 2020 +0000
@@ -0,0 +1,16 @@
+# $NetBSD: make-exported.mk,v 1.1 2020/08/09 12:59:16 rillig Exp $
+#
+# As of 2020-08-09, the code in Var_Export is shared between the .export
+# directive and the .MAKE.EXPORTED variable.  This leads to non-obvious
+# behavior for certain variable assignments.
+
+-env=          make-exported-value
+-literal=      make-exported-value
+UT_VAR=                ${UNEXPANDED}
+
+# The following behavior is probably not intended.
+.MAKE.EXPORTED=                -env            # like .export-env
+.MAKE.EXPORTED=                -literal UT_VAR # like .export-literal PATH
+
+all:
+       @env | sort | grep -E '^UT_|make-exported-value' || true



Home | Main Index | Thread Index | Old Index