diff options
| author | rillig <rillig@NetBSD.org> | 2020-10-30 15:03:58 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2020-10-30 15:03:58 +0000 |
| commit | dade35fd20499538f2b4cd078a7ad3545d70b3ff (patch) | |
| tree | ce0c05a6b62a54d7a4154cc7594c7e8fb8eb596b /usr.bin/make | |
| parent | 49cec7dc1c9ef2eb8c0c935a43ccba03b4303e3b (diff) | |
make(1): move test flags for varname-dot-shell to the test itself
Diffstat (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/unit-tests/Makefile | 11 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/varname-dot-shell.exp | 26 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/varname-dot-shell.mk | 8 |
3 files changed, 26 insertions, 19 deletions
diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile index ae06bbd0d9e..1194e7d5b30 100644 --- a/usr.bin/make/unit-tests/Makefile +++ b/usr.bin/make/unit-tests/Makefile @@ -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.order= -j1 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 's,^${.SHELL:T}: ,,' 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 --git a/usr.bin/make/unit-tests/varname-dot-shell.exp b/usr.bin/make/unit-tests/varname-dot-shell.exp index a3d949076d4..6eaac2818dc 100644 --- a/usr.bin/make/unit-tests/varname-dot-shell.exp +++ b/usr.bin/make/unit-tests/varname-dot-shell.exp @@ -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 +CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES -ParseReadLine (18): '.undef .SHELL' +Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES +lhs = "(details omitted)", rhs = "(details omitted)", op = != +ParseReadLine (20): '.undef .SHELL' Global:delete .SHELL -ParseReadLine (19): '.SHELL= newly overwritten' +ParseReadLine (21): '.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 (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 --git a/usr.bin/make/unit-tests/varname-dot-shell.mk b/usr.bin/make/unit-tests/varname-dot-shell.mk index 44bc52c3641..a6bfba71af5 100644 --- a/usr.bin/make/unit-tests/varname-dot-shell.mk +++ b/usr.bin/make/unit-tests/varname-dot-shell.mk @@ -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 @@ ORIG_SHELL:= ${.SHELL} . error .endif +.MAKEFLAGS: -d0 + all: - @echo ${.SHELL:M*} + @:; |
