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 undocumented p...



details:   https://anonhg.NetBSD.org/src/rev/31ec86791fad
branches:  trunk
changeset: 942681:31ec86791fad
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 14 18:47:21 2020 +0000

description:
make(1): add test for undocumented path-to-abspath mapping for :tA

diffstat:

 usr.bin/make/unit-tests/varmod-to-abs.exp |   1 +
 usr.bin/make/unit-tests/varmod-to-abs.mk  |  13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r a54f5867969f -r 31ec86791fad usr.bin/make/unit-tests/varmod-to-abs.exp
--- a/usr.bin/make/unit-tests/varmod-to-abs.exp Sat Nov 14 18:36:27 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-to-abs.exp Sat Nov 14 18:47:21 2020 +0000
@@ -1,1 +1,2 @@
+make: "varmod-to-abs.mk" line 17: /dev/null
 exit status 0
diff -r a54f5867969f -r 31ec86791fad usr.bin/make/unit-tests/varmod-to-abs.mk
--- a/usr.bin/make/unit-tests/varmod-to-abs.mk  Sat Nov 14 18:36:27 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-to-abs.mk  Sat Nov 14 18:47:21 2020 +0000
@@ -1,9 +1,20 @@
-# $NetBSD: varmod-to-abs.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: varmod-to-abs.mk,v 1.3 2020/11/14 18:47:21 rillig Exp $
 #
 # Tests for the :tA variable modifier, which returns the absolute path for
 # each of the words in the variable value.
 
 # TODO: Implementation
 
+# Since 2016-06-03, it is possible to trick the :tA modifier into resolving
+# completely unrelated absolute paths by defining a global variable that has
+# the same name as the path that is to be resolved.  There are a few
+# restrictions though: The "redirected" path must start with a slash, and it
+# must exist. (See ModifyWord_Realpath).
+#
+# XXX: This is probably not intended.  It is caused by cached_realpath using
+# a GNode for keeping the cache, instead of a simple HashTable.
+does-not-exist.c=      /dev/null
+.info ${does-not-exist.c:L:tA}
+
 all:
        @:;



Home | Main Index | Thread Index | Old Index