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 Replace ${.OBJDIR} with <curdir> for...



details:   https://anonhg.NetBSD.org/src/rev/ccfa8a93f8f1
branches:  trunk
changeset: 989899:ccfa8a93f8f1
user:      sjg <sjg%NetBSD.org@localhost>
date:      Tue Oct 19 15:59:26 2021 +0000

description:
Replace ${.OBJDIR} with <curdir> for consistent results.

If we replace ${.OBJDIR} with <objdir> some tests produce
different results depending on the value of .OBJDIR

For similar reasons eliminate .OBJDIR and .PATH from output of
varname-empty

Reviewed by: rillig

diffstat:

 usr.bin/make/unit-tests/Makefile          |  16 ++++++++++------
 usr.bin/make/unit-tests/varname-empty.exp |   4 ----
 2 files changed, 10 insertions(+), 10 deletions(-)

diffs (51 lines):

diff -r 00933e4d52c3 -r ccfa8a93f8f1 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Tue Oct 19 08:02:42 2021 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Tue Oct 19 15:59:26 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.283 2021/08/30 17:08:13 rillig Exp $
+# $NetBSD: Makefile,v 1.284 2021/10/19 15:59:26 sjg Exp $
 #
 # Unit tests for make(1)
 #
@@ -530,9 +530,7 @@
 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 '/\.PARSEDIR/d'
-SED_CMDS.varname-empty+=       -e '/\.SHELL/d'
+SED_CMDS.varname-empty=                ${.OBJDIR .PARSEDIR .PATH .SHELL:L:@v@-e '/\\$v/d'@}
 
 # Some tests need an additional round of postprocessing.
 POSTPROC.deptgt-suffixes=      awk '/^\#\*\*\* Suffixes/,/^never-stop/'
@@ -689,8 +687,14 @@
 # replace anything after 'stopped in' with unit-tests
 _SED_CMDS+=    -e '/stopped/s, /.*, unit-tests,'
 _SED_CMDS+=    -e 's,${TMPDIR},TMPDIR,g'
-# strip ${.CURDIR}/ from the output
-_SED_CMDS+=    -e 's,${.CURDIR:S,.,\\.,g}/,,g'
+# canonicalize ${.OBJDIR} and ${.CURDIR}
+.if ${.OBJDIR} != ${.CURDIR}
+# yes this is inaccurate but none of the tests expect <objdir> anywhere
+# which we get depending on how MAKEOBJDIR is set.
+_SED_CMDS+=    -e 's,${.OBJDIR},<curdir>,g'
+.endif
+_SED_CMDS+=    -e 's,${.CURDIR},<curdir>,g'
+_SED_CMDS+=    -e 's,<curdir>/,,g'
 _SED_CMDS+=    -e 's,${UNIT_TESTS:S,.,\\.,g}/,,g'
 
 .rawout.out:
diff -r 00933e4d52c3 -r ccfa8a93f8f1 usr.bin/make/unit-tests/varname-empty.exp
--- a/usr.bin/make/unit-tests/varname-empty.exp Tue Oct 19 08:02:42 2021 +0000
+++ b/usr.bin/make/unit-tests/varname-empty.exp Tue Oct 19 15:59:26 2021 +0000
@@ -2,10 +2,6 @@
 Var_SetExpand: variable name "" expands to empty string, with value "cmdline-plain" - ignored
 Global: .CURDIR = <curdir>
 Var_Parse: ${MAKE_OBJDIR_CHECK_WRITABLE} (eval)
-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



Home | Main Index | Thread Index | Old Index