diff options
Diffstat (limited to 'unit-tests/include-sub.mk')
-rw-r--r-- | unit-tests/include-sub.mk | 46 |
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 |