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: in the test varname-empty, kee...
details: https://anonhg.NetBSD.org/src/rev/722c02827273
branches: trunk
changeset: 1018429:722c02827273
user: rillig <rillig%NetBSD.org@localhost>
date: Wed Feb 03 08:34:15 2021 +0000
description:
make: in the test varname-empty, keep more debug output
Filtering out the interesting lines based on the very specific pattern
"Var_Set" was surprising.
diffstat:
usr.bin/make/unit-tests/Makefile | 5 ++-
usr.bin/make/unit-tests/varname-empty.exp | 37 ++++++++++++++++++++++++++++++-
usr.bin/make/unit-tests/varname-empty.mk | 9 ++++++-
3 files changed, 47 insertions(+), 4 deletions(-)
diffs (99 lines):
diff -r 5006689d5c90 -r 722c02827273 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Wed Feb 03 08:08:18 2021 +0000
+++ b/usr.bin/make/unit-tests/Makefile Wed Feb 03 08:34:15 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.266 2021/02/02 17:27:35 rillig Exp $
+# $NetBSD: Makefile,v 1.267 2021/02/03 08:34:15 rillig Exp $
#
# Unit tests for make(1)
#
@@ -519,11 +519,12 @@
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'
+SED_CMDS.varname-empty= -e 's,${.CURDIR},<curdir>,g'
+SED_CMDS.varname-empty+= -e '/\.SHELL/d'
# Some tests need an additional round of postprocessing.
POSTPROC.deptgt-suffixes= awk '/^\#\*\*\* Suffixes/,/^never-stop/'
POSTPROC.gnode-submake= awk '/Input graph/, /^$$/'
-POSTPROC.varname-empty= ${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p'
# Some tests reuse other tests, which makes them unnecessarily fragile.
export-all.rawout: export.mk
diff -r 5006689d5c90 -r 722c02827273 usr.bin/make/unit-tests/varname-empty.exp
--- a/usr.bin/make/unit-tests/varname-empty.exp Wed Feb 03 08:08:18 2021 +0000
+++ b/usr.bin/make/unit-tests/varname-empty.exp Wed Feb 03 08:34:15 2021 +0000
@@ -1,13 +1,48 @@
+Var_Parse: ${:U} with VARE_WANTRES
+Applying ${:U} to "" (VARE_WANTRES, none, VES_UNDEF)
+Result of ${:U} is "" (VARE_WANTRES, none, VES_DEF)
Var_Set("${:U}", "cmdline-u", ...) name expands to empty string - ignored
Var_Set("", "cmdline-plain", ...) name expands to empty string - ignored
+Global:.CURDIR = <curdir>
+Var_Parse: ${MAKE_OBJDIR_CHECK_WRITABLE:U} with VARE_WANTRES
+Applying ${MAKE_OBJDIR_CHECK_WRITABLE:U} to "" (VARE_WANTRES, none, VES_UNDEF)
+Result of ${MAKE_OBJDIR_CHECK_WRITABLE:U} is "" (VARE_WANTRES, none, VES_DEF)
+Global:.OBJDIR = <curdir>
+Global:delete .PATH (not found)
+Global:.PATH = .
+Global:.PATH = . <curdir>
+Global:.TARGETS =
+Internal:MAKEFILE = varname-empty.mk
+Global:.MAKE.MAKEFILES = varname-empty.mk
+Global:.PARSEDIR = <curdir>
+Global:.PARSEFILE = varname-empty.mk
+Global:delete .INCLUDEDFROMDIR (not found)
+Global:delete .INCLUDEDFROMFILE (not found)
Var_Set("", "default", ...) name expands to empty string - ignored
Var_Set("", "assigned", ...) name expands to empty string - ignored
Var_Set("", "appended", ...) name expands to empty string - ignored
Var_Set("", "", ...) name expands to empty string - ignored
Var_Set("", "subst", ...) name expands to empty string - ignored
Var_Set("", "shell-output", ...) name expands to empty string - ignored
+Var_Parse: ${:Ufallback} != "fallback" with VARE_UNDEFERR|VARE_WANTRES
+Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VES_UNDEF)
+Result of ${:Ufallback} is "fallback" (VARE_UNDEFERR|VARE_WANTRES, none, VES_DEF)
+Var_Parse: ${:U} with VARE_WANTRES
+Applying ${:U} to "" (VARE_WANTRES, none, VES_UNDEF)
+Result of ${:U} is "" (VARE_WANTRES, none, VES_DEF)
Var_Set("${:U}", "assigned indirectly", ...) name expands to empty string - ignored
-Var_Set("", "assigned", ...) name expands to empty string - ignored
+Var_Parse: ${:Ufallback} != "fallback" with VARE_UNDEFERR|VARE_WANTRES
+Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VES_UNDEF)
+Result of ${:Ufallback} is "fallback" (VARE_UNDEFERR|VARE_WANTRES, none, VES_DEF)
+Var_Parse: ${:U} with VARE_WANTRES
+Applying ${:U} to "" (VARE_WANTRES, none, VES_UNDEF)
+Result of ${:U} is "" (VARE_WANTRES, none, VES_DEF)
+Var_Append("${:U}", "appended indirectly", ...) name expands to empty string - ignored
+Var_Parse: ${:Ufallback} != "fallback" with VARE_UNDEFERR|VARE_WANTRES
+Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VES_UNDEF)
+Result of ${:Ufallback} is "fallback" (VARE_UNDEFERR|VARE_WANTRES, none, VES_DEF)
+Global:.MAKEFLAGS = -r -d v -d
+Global:.MAKEFLAGS = -r -d v -d 0
out: fallback
out: 1 2 3
exit status 0
diff -r 5006689d5c90 -r 722c02827273 usr.bin/make/unit-tests/varname-empty.mk
--- a/usr.bin/make/unit-tests/varname-empty.mk Wed Feb 03 08:08:18 2021 +0000
+++ b/usr.bin/make/unit-tests/varname-empty.mk Wed Feb 03 08:34:15 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varname-empty.mk,v 1.7 2020/10/23 17:53:01 rillig Exp $
+# $NetBSD: varname-empty.mk,v 1.8 2021/02/03 08:34:15 rillig Exp $
#
# Tests for the special variable with the empty name.
#
@@ -41,6 +41,13 @@
. error
.endif
+${:U}+= appended indirectly
+.if ${:Ufallback} != "fallback"
+. error
+.endif
+
+.MAKEFLAGS: -d0
+
# Before 2020-08-22, the simple assignment operator '=' after an empty
# variable name had an off-by-one bug in Parse_DoVar. The code that was
# supposed to "skip to operator character" started its search _after_ the
Home |
Main Index |
Thread Index |
Old Index