make(1): move test flags to test varmod-match-escape.mk

This commit is contained in:
rillig 2020-11-01 19:02:22 +00:00
parent 36e147d608
commit e24143bc70
3 changed files with 30 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.180 2020/10/31 20:30:06 rillig Exp $
# $NetBSD: Makefile,v 1.181 2020/11/01 19:02:22 rillig Exp $
#
# Unit tests for make(1)
#
@ -398,7 +398,6 @@ FLAGS.opt-warnings-as-errors= -W
FLAGS.order= -j1
FLAGS.recursive= -dL
FLAGS.sh-leading-plus= -n
FLAGS.varmod-match-escape= -dv
FLAGS.varname-empty= -dv '$${:U}=cmdline-u' '=cmline-plain'
# Some tests need extra postprocessing.
@ -438,7 +437,6 @@ SED_CMDS.varname-dot-shell+= -e 's,\[/[^] ]*\],[(details omitted)],g'
# Some tests need an additional round of postprocessing.
POSTPROC.deptgt-suffixes= \
${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p'
POSTPROC.varmod-match-escape= ${TOOL_SED} -n -e '/^Pattern/p'
POSTPROC.varname= ${TOOL_SED} -n -e '/^MAGIC/p' -e '/^ORDER_/p'
POSTPROC.varname-empty= ${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p'

View File

@ -1,5 +1,29 @@
Var_Parse: ${SPECIALS:M${:U}\:} != ${SPECIALS:M\:${:U}} with VARE_UNDEFERR|VARE_WANTRES
Applying ${SPECIALS:M...} to "\: : \\ * \*" (VARE_UNDEFERR|VARE_WANTRES, none, none)
Var_Parse: ${:U}\: with VARE_UNDEFERR|VARE_WANTRES
Applying ${:U} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
Result of ${:U} is "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
Pattern[SPECIALS] for [\: : \\ * \*] is [\:]
ModifyWords: split "\: : \\ * \*" into 5 words
VarMatch [\:] [\:]
VarMatch [:] [\:]
VarMatch [\\] [\:]
VarMatch [*] [\:]
VarMatch [\*] [\:]
Result of ${SPECIALS:M${:U}\:} is ":" (VARE_UNDEFERR|VARE_WANTRES, none, none)
Var_Parse: ${SPECIALS:M\:${:U}} with VARE_UNDEFERR|VARE_WANTRES
Applying ${SPECIALS:M...} to "\: : \\ * \*" (VARE_UNDEFERR|VARE_WANTRES, none, none)
Var_Parse: ${:U} with VARE_UNDEFERR|VARE_WANTRES
Applying ${:U} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
Result of ${:U} is "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
Pattern[SPECIALS] for [\: : \\ * \*] is [:]
Pattern[.MAKE.DEPENDFILE] for [.depend] is [/dev/null]
Pattern[.MAKE.DEPENDFILE] for [.depend] is [no*]
ModifyWords: split "\: : \\ * \*" into 5 words
VarMatch [\:] [:]
VarMatch [:] [:]
VarMatch [\\] [:]
VarMatch [*] [:]
VarMatch [\*] [:]
Result of ${SPECIALS:M\:${:U}} is ":" (VARE_UNDEFERR|VARE_WANTRES, none, none)
Global:.MAKEFLAGS = -r -k -d v -d
Global:.MAKEFLAGS = -r -k -d v -d 0
exit status 0

View File

@ -1,4 +1,4 @@
# $NetBSD: varmod-match-escape.mk,v 1.2 2020/10/24 08:46:08 rillig Exp $
# $NetBSD: varmod-match-escape.mk,v 1.3 2020/11/01 19:02:22 rillig Exp $
#
# As of 2020-08-01, the :M and :N modifiers interpret backslashes differently,
# depending on whether there was a variable expression somewhere before the
@ -10,11 +10,11 @@
# their plain variants '{', '}' and ':'. In the pattern matching from
# Str_Match, only \*, \? or \[ would make a noticeable difference.
SPECIALS= \: : \\ * \*
RELEVANT= yes
.MAKEFLAGS: -dv
.if ${SPECIALS:M${:U}\:} != ${SPECIALS:M\:${:U}}
. warning unexpected
.endif
RELEVANT= no
.MAKEFLAGS: -d0
all:
@:;