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): move test flags for varname...
details: https://anonhg.NetBSD.org/src/rev/f06101f6f87b
branches: trunk
changeset: 977646:f06101f6f87b
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Oct 30 15:03:58 2020 +0000
description:
make(1): move test flags for varname-dot-shell to the test itself
diffstat:
usr.bin/make/unit-tests/Makefile | 11 +++-----
usr.bin/make/unit-tests/varname-dot-shell.exp | 32 ++++++++++++++++----------
usr.bin/make/unit-tests/varname-dot-shell.mk | 8 +++++-
3 files changed, 29 insertions(+), 22 deletions(-)
diffs (106 lines):
diff -r 8c0f7880588b -r f06101f6f87b usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Fri Oct 30 14:56:23 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile Fri Oct 30 15:03:58 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.176 2020/10/29 18:19:41 rillig Exp $
+# $NetBSD: Makefile,v 1.177 2020/10/30 15:03:58 rillig Exp $
#
# Unit tests for make(1)
#
@@ -398,7 +398,6 @@
FLAGS.recursive= -dL
FLAGS.sh-leading-plus= -n
FLAGS.varmod-match-escape= -dv
-FLAGS.varname-dot-shell= -dpv
FLAGS.varname-empty= -dv '$${:U}=cmdline-u' '=cmline-plain'
# Some tests need extra postprocessing.
@@ -431,17 +430,15 @@
SED_CMDS.varshell+= -e '/command/s,No such.*,not found,'
SED_CMDS.varname-dot-parsedir= -e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,'
SED_CMDS.varname-dot-parsefile= -e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,'
-SED_CMDS.varname-dot-shell= -e 's, = /.*, = (details omitted),'
-SED_CMDS.varname-dot-shell+= -e 's,"/[^"]*","(details omitted)",'
-SED_CMDS.varname-dot-shell+= -e 's,\[/[^]]*\],[(details omitted)],'
+SED_CMDS.varname-dot-shell= -e 's, = /[^ ]*, = (details omitted),g'
+SED_CMDS.varname-dot-shell+= -e 's,"/[^" ]*","(details omitted)",g'
+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-dot-shell= \
- awk '/\.SHELL/ || /^ParseReadLine/'
POSTPROC.varname-empty= ${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p'
# Some tests reuse other tests, which makes them unnecessarily fragile.
diff -r 8c0f7880588b -r f06101f6f87b usr.bin/make/unit-tests/varname-dot-shell.exp
--- a/usr.bin/make/unit-tests/varname-dot-shell.exp Fri Oct 30 14:56:23 2020 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-shell.exp Fri Oct 30 15:03:58 2020 +0000
@@ -1,19 +1,25 @@
-ParseReadLine (8): 'ORIG_SHELL:= ${.SHELL}'
+ParseReadLine (10): 'ORIG_SHELL:= ${.SHELL}'
+Global:ORIG_SHELL =
Var_Parse: ${.SHELL} with VARE_WANTRES|VARE_ASSIGN
Global:delete .SHELL (not found)
Command:.SHELL = (details omitted)
-ParseReadLine (10): '.SHELL= overwritten'
+Global:ORIG_SHELL = (details omitted)
+ParseReadLine (12): '.SHELL= overwritten'
Global:.SHELL = overwritten
-Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
-ParseReadLine (18): '.undef .SHELL'
-Global:delete .SHELL
-ParseReadLine (19): '.SHELL= newly overwritten'
-Global:.SHELL = newly overwritten
+CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
-ParseReadLine (24): 'all:'
-ParseReadLine (25): ' @echo ${.SHELL:M*}'
-Var_Parse: ${.SHELL:M*} with VARE_WANTRES
-Applying ${.SHELL:M...} to "(details omitted)" (VARE_WANTRES, VAR_READONLY, none)
-Pattern[.SHELL] for [(details omitted)] is [*]
-Result of ${.SHELL:M*} is "(details omitted)" (VARE_WANTRES, VAR_READONLY, none)
+Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
+lhs = "(details omitted)", rhs = "(details omitted)", op = !=
+ParseReadLine (20): '.undef .SHELL'
+Global:delete .SHELL
+ParseReadLine (21): '.SHELL= newly overwritten'
+Global:.SHELL = newly overwritten
+CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
+Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
+Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
+lhs = "(details omitted)", rhs = "(details omitted)", op = !=
+ParseReadLine (26): '.MAKEFLAGS: -d0'
+ParseDoDependency(.MAKEFLAGS: -d0)
+Global:.MAKEFLAGS = -r -k -d cpv -d
+Global:.MAKEFLAGS = -r -k -d cpv -d 0
exit status 0
diff -r 8c0f7880588b -r f06101f6f87b usr.bin/make/unit-tests/varname-dot-shell.mk
--- a/usr.bin/make/unit-tests/varname-dot-shell.mk Fri Oct 30 14:56:23 2020 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-shell.mk Fri Oct 30 15:03:58 2020 +0000
@@ -1,10 +1,12 @@
-# $NetBSD: varname-dot-shell.mk,v 1.3 2020/10/24 08:46:08 rillig Exp $
+# $NetBSD: varname-dot-shell.mk,v 1.4 2020/10/30 15:03:58 rillig Exp $
#
# Tests for the special .SHELL variable, which contains the shell used for
# running the commands.
#
# This variable is read-only.
+.MAKEFLAGS: -dcpv
+
ORIG_SHELL:= ${.SHELL}
.SHELL= overwritten
@@ -21,5 +23,7 @@
. error
.endif
+.MAKEFLAGS: -d0
+
all:
- @echo ${.SHELL:M*}
+ @:;
Home |
Main Index |
Thread Index |
Old Index