aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/dep-var.mk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/unit-tests/dep-var.mk')
-rwxr-xr-xcontrib/bmake/unit-tests/dep-var.mk21
1 files changed, 14 insertions, 7 deletions
diff --git a/contrib/bmake/unit-tests/dep-var.mk b/contrib/bmake/unit-tests/dep-var.mk
index 4503424e31ab..f4a724f0ce7c 100755
--- a/contrib/bmake/unit-tests/dep-var.mk
+++ b/contrib/bmake/unit-tests/dep-var.mk
@@ -1,14 +1,16 @@
-# $NetBSD: dep-var.mk,v 1.6 2021/04/04 10:13:09 rillig Exp $
+# $NetBSD: dep-var.mk,v 1.7 2023/02/13 21:01:46 rillig Exp $
#
# Tests for variable references in dependency declarations.
#
# Uh oh, this feels so strange that probably nobody uses it. But it seems to
# be the only way to reach the lower half of SuffExpandChildren.
-# XXX: The -dv log says:
-# Var_Parse: ${UNDEF1} with VARE_UNDEFERR|VARE_WANTRES
-# but no error message is generated for this line.
-# The variable expression ${UNDEF1} simply expands to an empty string.
+.MAKEFLAGS: -dv
+
+# expect: Var_Parse: ${UNDEF1} (eval-defined)
+# Even though undefined expressions should lead to errors, no error message is
+# generated for this line. The variable expression ${UNDEF1} simply expands
+# to an empty string.
all: ${UNDEF1}
# Using a double dollar in order to circumvent immediate variable expansion
@@ -20,8 +22,8 @@ all: ${UNDEF1}
all: $${DEF2} a-$${DEF2}-b
# This variable is not defined at all.
-# XXX: The -dv log says:
-# Var_Parse: ${UNDEF3} with VARE_UNDEFERR|VARE_WANTRES
+# XXX: The -dv log says later when expanding the sources of 'all':
+# Var_Parse: ${UNDEF3} (eval-defined)
# but no error message is generated for this line, just like for UNDEF1.
# The variable expression ${UNDEF3} simply expands to an empty string.
all: $${UNDEF3}
@@ -81,8 +83,13 @@ all: $$$$)
# Since 2020-09-13, this generates a parse error in lint mode (-dL), but not
# in normal mode since ParseDependency does not handle any errors after
# calling Var_Parse.
+# expect: Var_Parse: ${:U\$)}: (eval-defined)
+# expect: Var_Parse: $INDIRECT_2-2-1 $): (parse-only)
+# expect: Var_Parse: $): (parse-only)
undef1 def2 a-def2-b 1-2-$$INDIRECT_2-2-1 ${:U\$)}:
@echo ${.TARGET:Q}
+.MAKEFLAGS: -d0
+
# XXX: Why is the exit status still 0, even though Parse_Error is called
# with PARSE_FATAL in SuffExpandChildren?