Module Name: src
Committed By: rillig
Date: Sun Dec 27 18:20:26 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: deptgt.exp deptgt.mk
Log Message:
make(1): add test for ParseDependencyTargetWord
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/deptgt.exp
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/deptgt.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/deptgt.exp
diff -u src/usr.bin/make/unit-tests/deptgt.exp:1.5 src/usr.bin/make/unit-tests/deptgt.exp:1.6
--- src/usr.bin/make/unit-tests/deptgt.exp:1.5 Sun Nov 15 11:57:00 2020
+++ src/usr.bin/make/unit-tests/deptgt.exp Sun Dec 27 18:20:26 2020
@@ -8,6 +8,7 @@ ParseDoDependency(: empty-source)
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
Index: src/usr.bin/make/unit-tests/deptgt.mk
diff -u src/usr.bin/make/unit-tests/deptgt.mk:1.9 src/usr.bin/make/unit-tests/deptgt.mk:1.10
--- src/usr.bin/make/unit-tests/deptgt.mk:1.9 Sun Nov 15 11:57:00 2020
+++ src/usr.bin/make/unit-tests/deptgt.mk Sun Dec 27 18:20:26 2020
@@ -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 @@ ${:U}: empty-source
: 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:
@:;