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): fix test for parsing obscur...
details: https://anonhg.NetBSD.org/src/rev/74ee0976d8b9
branches: trunk
changeset: 941991:74ee0976d8b9
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Nov 02 22:29:48 2020 +0000
description:
make(1): fix test for parsing obscure variable names
I had forgotten the :U modifier. Without that modifier, there's no
chance that the variable names would come out correctly.
diffstat:
usr.bin/make/unit-tests/varname.exp | 21 +++++++++++++--------
usr.bin/make/unit-tests/varname.mk | 9 ++++-----
2 files changed, 17 insertions(+), 13 deletions(-)
diffs (56 lines):
diff -r ce4ece57131a -r 74ee0976d8b9 usr.bin/make/unit-tests/varname.exp
--- a/usr.bin/make/unit-tests/varname.exp Mon Nov 02 22:16:24 2020 +0000
+++ b/usr.bin/make/unit-tests/varname.exp Mon Nov 02 22:29:48 2020 +0000
@@ -4,16 +4,21 @@
Var_Parse: ${VARNAME} with VARE_WANTRES
Global:VAR((( = 3 open parentheses
Var_Parse: ${VAR(((}}}}" != "3 open parentheses}}}" with VARE_WANTRES
-Var_Parse: ${VAR(((}= try1 with VARE_UNDEFERR|VARE_WANTRES
-Global:.ALLTARGETS = 3
-Global:.ALLTARGETS = 3 open
-Global:.ALLTARGETS = 3 open parentheses=
+Var_Parse: ${:UVAR(((}= try1 with VARE_UNDEFERR|VARE_WANTRES
+Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
+Result of ${:UVAR(((} is "VAR(((" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
+Global:.ALLTARGETS = VAR(((=)
+No closing parenthesis in archive specification
+make: "varname.mk" line 26: Error in archive specification: "VAR"
+Var_Parse: ${:UVAR\(\(\(}= try2 with VARE_UNDEFERR|VARE_WANTRES
+Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
+Result of ${:UVAR\(\(\(} is "VAR\(\(\(" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
+Global:.ALLTARGETS = VAR(((=) VAR\(\(\(=
make: "varname.mk" line 27: Need an operator
-Var_Parse: ${VAR\(\(\(}= try2 with VARE_UNDEFERR|VARE_WANTRES
-Global:.ALLTARGETS = 3 open parentheses= =
+Var_Parse: ${:UVAR\(\(\(}= try3 with VARE_UNDEFERR|VARE_WANTRES
+Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
+Result of ${:UVAR\(\(\(} is "VAR\(\(\(" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
make: "varname.mk" line 28: Need an operator
-Var_Parse: ${VAR\(\(\(}= try3 with VARE_UNDEFERR|VARE_WANTRES
-make: "varname.mk" line 29: Need an operator
Global:.MAKEFLAGS = -r -k -d v -d
Global:.MAKEFLAGS = -r -k -d v -d 0
make: Fatal errors encountered -- cannot continue
diff -r ce4ece57131a -r 74ee0976d8b9 usr.bin/make/unit-tests/varname.mk
--- a/usr.bin/make/unit-tests/varname.mk Mon Nov 02 22:16:24 2020 +0000
+++ b/usr.bin/make/unit-tests/varname.mk Mon Nov 02 22:29:48 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varname.mk,v 1.5 2020/11/02 22:16:24 rillig Exp $
+# $NetBSD: varname.mk,v 1.6 2020/11/02 22:29:48 rillig Exp $
#
# Tests for special variables, such as .MAKE or .PARSEDIR.
# And for variable names in general.
@@ -23,10 +23,9 @@
# In the above test, the variable name is constructed indirectly. Neither
# of the following expressions produces the intended effect.
-# TODO: explain what happens in the parser here.
-${VAR(((}= try1
-${VAR\(\(\(}= try2
-${VAR\(\(\(}= try3
+${:UVAR(((}= try1
+${:UVAR\(\(\(}= try2
+${:UVAR\(\(\(}= try3
.MAKEFLAGS: -d0
Home |
Main Index |
Thread Index |
Old Index