From e24143bc705dbdfbc9a56e719a0cbd14ddb12e82 Mon Sep 17 00:00:00 2001 From: rillig Date: Sun, 1 Nov 2020 19:02:22 +0000 Subject: [PATCH] make(1): move test flags to test varmod-match-escape.mk --- usr.bin/make/unit-tests/Makefile | 4 +-- .../make/unit-tests/varmod-match-escape.exp | 28 +++++++++++++++++-- .../make/unit-tests/varmod-match-escape.mk | 6 ++-- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile index c88fa4fd5afd..c9948f45908a 100644 --- a/usr.bin/make/unit-tests/Makefile +++ b/usr.bin/make/unit-tests/Makefile @@ -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' diff --git a/usr.bin/make/unit-tests/varmod-match-escape.exp b/usr.bin/make/unit-tests/varmod-match-escape.exp index 2546e563ad59..0f4217e4247b 100644 --- a/usr.bin/make/unit-tests/varmod-match-escape.exp +++ b/usr.bin/make/unit-tests/varmod-match-escape.exp @@ -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 diff --git a/usr.bin/make/unit-tests/varmod-match-escape.mk b/usr.bin/make/unit-tests/varmod-match-escape.mk index a3a244a65b9e..44f300f2acd0 100644 --- a/usr.bin/make/unit-tests/varmod-match-escape.mk +++ b/usr.bin/make/unit-tests/varmod-match-escape.mk @@ -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: @:;