summaryrefslogtreecommitdiff
path: root/unit-tests/include-sub.mk
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2020-11-07 19:39:21 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2020-11-07 19:39:21 +0000
commit302da1a3d35c15cb29d76e0a939f8bcb13f7ad80 (patch)
treec2146dca82d530521c4d2cc46a95c26964311a2c /unit-tests/include-sub.mk
parent6bbc783f48498b808e19db4441299dc7d85a278b (diff)
downloadsrc-test2-af9587d85d857745db1119f026e9d9fac07f07a7.tar.gz
src-test2-af9587d85d857745db1119f026e9d9fac07f07a7.zip
Diffstat (limited to 'unit-tests/include-sub.mk')
-rw-r--r--unit-tests/include-sub.mk46
1 files changed, 39 insertions, 7 deletions
diff --git a/unit-tests/include-sub.mk b/unit-tests/include-sub.mk
index 28856fcc6e60..aeb7c3a69082 100644
--- a/unit-tests/include-sub.mk
+++ b/unit-tests/include-sub.mk
@@ -1,17 +1,49 @@
-# $NetBSD: include-sub.mk,v 1.1 2020/05/17 12:36:26 rillig Exp $
+# $NetBSD: include-sub.mk,v 1.6 2020/10/25 12:08:53 rillig Exp $
.if ${.INCLUDEDFROMFILE} == "include-main.mk"
-LOG+= sub-before-ok
+. info sub-before-ok
.else
-LOG+= sub-before-fail
+. warning sub-before-fail(${.INCLUDEDFROMFILE})
.endif
+# As of 2020-09-05, the .for loop is implemented as "including a file"
+# with a custom buffer. Therefore this loop has side effects on these
+# variables.
+.for i in once
+. if ${.INCLUDEDFROMFILE} == "include-main.mk"
+. info sub-before-for-ok
+. else
+. warning sub-before-for-fail(${.INCLUDEDFROMFILE})
+. endif
+.endfor
+
+# To see the variable 'includes' in action:
+#
+# Breakpoints:
+# Parse_File at "PtrVector_Push(&includes, curFile)"
+# ParseMessage at entry
+# Watches:
+# ((const IFile *[10])(*includes.items))
+# *curFile
+
+.for i in deeply
+. for i in nested
+. for i in include
.include "include-subsub.mk"
+. endfor
+. endfor
+.endfor
.if ${.INCLUDEDFROMFILE} == "include-main.mk"
-LOG+= sub-after-ok
+. info sub-after-ok
.else
-. for f in ${.INCLUDEDFROMFILE}
-LOG+= sub-after-fail\(${f:Q}\)
-. endfor
+. warning sub-after-fail(${.INCLUDEDFROMFILE})
.endif
+
+.for i in once
+. if ${.INCLUDEDFROMFILE} == "include-main.mk"
+. info sub-after-for-ok
+. else
+. warning sub-after-for-fail(${.INCLUDEDFROMFILE})
+. endif
+.endfor