Module Name: src
Committed By: rillig
Date: Mon May 8 09:24:42 UTC 2023
Modified Files:
src/usr.bin/make/unit-tests: directive-for.exp directive-for.mk
Log Message:
tests/make: add more tests for unusual variable names in .for loops
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/directive-for.exp
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/unit-tests/directive-for.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/directive-for.exp
diff -u src/usr.bin/make/unit-tests/directive-for.exp:1.13 src/usr.bin/make/unit-tests/directive-for.exp:1.14
--- src/usr.bin/make/unit-tests/directive-for.exp:1.13 Mon May 8 09:01:20 2023
+++ src/usr.bin/make/unit-tests/directive-for.exp Mon May 8 09:24:42 2023
@@ -16,16 +16,19 @@ make: "directive-for.mk" line 140: ][ ][
make: "directive-for.mk" line 140: }{ }{ }{
make: "directive-for.mk" line 148: outer value value
make: "directive-for.mk" line 148: outer "quoted" \"quoted\"
-make: "directive-for.mk" line 154: Unknown modifier "Z"
-make: "directive-for.mk" line 155: XXX: Not reached word1
-make: "directive-for.mk" line 155: XXX: Not reached word3
-make: "directive-for.mk" line 160: no iteration variables in for
-make: "directive-for.mk" line 162: Missing argument for ".error"
-make: "directive-for.mk" line 163: for-less endfor
-make: "directive-for.mk" line 187: 1 open conditional
-make: "directive-for.mk" line 203: for-less endfor
-make: "directive-for.mk" line 204: if-less endif
-make: "directive-for.mk" line 212: if-less endif
+make: "directive-for.mk" line 154: $ value value
+make: "directive-for.mk" line 160: <> <> <a>
+make: "directive-for.mk" line 160: <> <> <b>
+make: "directive-for.mk" line 166: Unknown modifier "Z"
+make: "directive-for.mk" line 167: XXX: Not reached word1
+make: "directive-for.mk" line 167: XXX: Not reached word3
+make: "directive-for.mk" line 172: no iteration variables in for
+make: "directive-for.mk" line 174: Missing argument for ".error"
+make: "directive-for.mk" line 175: for-less endfor
+make: "directive-for.mk" line 199: 1 open conditional
+make: "directive-for.mk" line 215: for-less endfor
+make: "directive-for.mk" line 216: if-less endif
+make: "directive-for.mk" line 224: if-less endif
For: new loop 2
For: end for 2
For: end for 1
Index: src/usr.bin/make/unit-tests/directive-for.mk
diff -u src/usr.bin/make/unit-tests/directive-for.mk:1.16 src/usr.bin/make/unit-tests/directive-for.mk:1.17
--- src/usr.bin/make/unit-tests/directive-for.mk:1.16 Mon May 8 09:01:20 2023
+++ src/usr.bin/make/unit-tests/directive-for.mk Mon May 8 09:24:42 2023
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for.mk,v 1.16 2023/05/08 09:01:20 rillig Exp $
+# $NetBSD: directive-for.mk,v 1.17 2023/05/08 09:24:42 rillig Exp $
#
# Tests for the .for directive.
#
@@ -147,6 +147,18 @@ var= outer
.for var:Q in value "quoted"
. info ${var} ${var:Q} ${var:Q:Q}
.endfor
+# The short expression '$$' is preserved, the long expressions are
+# substituted.
+# expect+2: $ value value
+.for $ in value
+. info $$ ${$} $($)
+.endfor
+# From https://gnats.netbsd.org/53146.
+# expect+3: <> <> <a>
+# expect+2: <> <> <b>
+.for $(FOO) in a b
+. info <$(FOO)> <$(foo)> <$($(FOO))>
+.endfor
# XXX: A parse error or evaluation error in the items of the .for loop