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 nested .for lo...



details:   https://anonhg.NetBSD.org/src/rev/7b018f6fbfff
branches:  trunk
changeset: 944011:7b018f6fbfff
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Sep 14 18:49:24 2020 +0000

description:
make(1): add test for nested .for loops with the same variable name

diffstat:

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

diffs (29 lines):

diff -r a0506ffbfa38 -r 7b018f6fbfff usr.bin/make/unit-tests/directive-for.exp
--- a/usr.bin/make/unit-tests/directive-for.exp Mon Sep 14 18:27:15 2020 +0000
+++ b/usr.bin/make/unit-tests/directive-for.exp Mon Sep 14 18:49:24 2020 +0000
@@ -1,1 +1,2 @@
+make: "directive-for.mk" line 100: outer
 exit status 0
diff -r a0506ffbfa38 -r 7b018f6fbfff usr.bin/make/unit-tests/directive-for.mk
--- a/usr.bin/make/unit-tests/directive-for.mk  Mon Sep 14 18:27:15 2020 +0000
+++ b/usr.bin/make/unit-tests/directive-for.mk  Mon Sep 14 18:49:24 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for.mk,v 1.2 2020/09/02 22:58:59 rillig Exp $
+# $NetBSD: directive-for.mk,v 1.3 2020/09/14 18:49:24 rillig Exp $
 #
 # Tests for the .for directive.
 
@@ -93,5 +93,13 @@
 .  error This must be a make from before 2009.
 .endif
 
+# When the outer .for loop is expanded, it sees the expression ${i} and
+# expands it.  The inner loop then has nothing more to expand.
+.for i in outer
+.  for i in inner
+.    info ${i}
+.  endfor
+.endfor
+
 all:
        @:;



Home | Main Index | Thread Index | Old Index