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 ParseDependenc...



details:   https://anonhg.NetBSD.org/src/rev/4587a9e35e48
branches:  trunk
changeset: 948350:4587a9e35e48
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 27 18:20:26 2020 +0000

description:
make(1): add test for ParseDependencyTargetWord

diffstat:

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

diffs (34 lines):

diff -r f7af6cf52988 -r 4587a9e35e48 usr.bin/make/unit-tests/deptgt.exp
--- a/usr.bin/make/unit-tests/deptgt.exp        Sun Dec 27 17:32:25 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt.exp        Sun Dec 27 18:20:26 2020 +0000
@@ -8,6 +8,7 @@
 ParseReadLine (37): '  : command for empty targets list'
 ParseReadLine (38): '.MAKEFLAGS: -d0'
 ParseDoDependency(.MAKEFLAGS: -d0)
+make: "deptgt.mk" line 46: Unknown modifier 'Z'
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r f7af6cf52988 -r 4587a9e35e48 usr.bin/make/unit-tests/deptgt.mk
--- a/usr.bin/make/unit-tests/deptgt.mk Sun Dec 27 17:32:25 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt.mk Sun Dec 27 18:20:26 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt.mk,v 1.9 2020/11/15 11:57:00 rillig Exp $
+# $NetBSD: deptgt.mk,v 1.10 2020/12/27 18:20:26 rillig Exp $
 #
 # Tests for special targets like .BEGIN or .SUFFIXES in dependency
 # declarations.
@@ -37,5 +37,13 @@
        : command for empty targets list
 .MAKEFLAGS: -d0
 
+# Just to show that a malformed expression is only expanded once in
+# ParseDependencyTargetWord.  The only way to produce an expression that
+# is well-formed on the first expansion and ill-formed on the second
+# expansion would be to use the variable modifier '::=' to modify the
+# targets.  This in turn would be such an extreme and unreliable edge case
+# that nobody uses it.
+$$$$$$$${:U:Z}:
+
 all:
        @:;



Home | Main Index | Thread Index | Old Index