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): fix tests for .PARSEDIR/.PA...



details:   https://anonhg.NetBSD.org/src/rev/4086320b9410
branches:  trunk
changeset: 955133:4086320b9410
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Sep 21 03:45:29 2020 +0000

description:
make(1): fix tests for .PARSEDIR/.PARSEFILE

The output of these tests previously depended upon whether the test
makefile was specified as relative or as absolute path.  In NetBSD, it
is specified as relative path, in FreeBSD as absolute path.

Adjust the expected output to hide this difference; in the .rawout files
it is still visible.

diffstat:

 usr.bin/make/unit-tests/Makefile                  |  4 +++-
 usr.bin/make/unit-tests/varname-dot-parsedir.exp  |  4 ++--
 usr.bin/make/unit-tests/varname-dot-parsedir.mk   |  7 ++++---
 usr.bin/make/unit-tests/varname-dot-parsefile.exp |  4 ++--
 usr.bin/make/unit-tests/varname-dot-parsefile.mk  |  7 ++++---
 5 files changed, 15 insertions(+), 11 deletions(-)

diffs (84 lines):

diff -r 1a707084799c -r 4086320b9410 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Mon Sep 21 03:12:25 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Mon Sep 21 03:45:29 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.143 2020/09/15 16:22:04 rillig Exp $
+# $NetBSD: Makefile,v 1.144 2020/09/21 03:45:29 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -389,6 +389,8 @@
 SED_CMDS.varmod-edge+= -e 's, line [0-9]*:, line omitted:,'
 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)],'
diff -r 1a707084799c -r 4086320b9410 usr.bin/make/unit-tests/varname-dot-parsedir.exp
--- a/usr.bin/make/unit-tests/varname-dot-parsedir.exp  Mon Sep 21 03:12:25 2020 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-parsedir.exp  Mon Sep 21 03:45:29 2020 +0000
@@ -1,5 +1,5 @@
 make: "varname-dot-parsedir.mk" line 28: At this point, .PARSEDIR is undefined.
-make: "/fake-absolute-path/varname-dot-parsedir.mk" line 33: The location can be faked.
-make: "varname-dot-parsedir.mk" line 37: The location is no longer fake.
+make: "<normalized>" line 34: The location can be faked in some cases.
+make: "varname-dot-parsedir.mk" line 38: The location is no longer fake.
 At run time, .PARSEDIR is undefined.
 exit status 0
diff -r 1a707084799c -r 4086320b9410 usr.bin/make/unit-tests/varname-dot-parsedir.mk
--- a/usr.bin/make/unit-tests/varname-dot-parsedir.mk   Mon Sep 21 03:12:25 2020 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-parsedir.mk   Mon Sep 21 03:45:29 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varname-dot-parsedir.mk,v 1.4 2020/09/12 11:55:28 rillig Exp $
+# $NetBSD: varname-dot-parsedir.mk,v 1.5 2020/09/21 03:45:29 rillig Exp $
 #
 # Tests for the special .PARSEDIR variable, which contains the directory part
 # of the file that is currently parsed.
@@ -28,9 +28,10 @@
 .info At this point, .PARSEDIR is undefined.
 
 # There is absolutely no point in faking the location of the file that is
-# being parsed.  Technically, it's possible though.
+# being parsed.  Technically, it's possible though, but only if the file
+# being parsed is a relative pathname.  See PrintLocation for details.
 .PARSEDIR = /fake-absolute-path
-.info The location can be faked.
+.info The location can be faked in some cases.
 
 # After including another file, .PARSEDIR is reset.
 .include "/dev/null"
diff -r 1a707084799c -r 4086320b9410 usr.bin/make/unit-tests/varname-dot-parsefile.exp
--- a/usr.bin/make/unit-tests/varname-dot-parsefile.exp Mon Sep 21 03:12:25 2020 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-parsefile.exp Mon Sep 21 03:45:29 2020 +0000
@@ -1,5 +1,5 @@
 make: "varname-dot-parsefile.mk" line 23: At this point, .PARSEFILE is undefined.
-make: "fake-parsefile" line 28: The location can be faked.
-make: "varname-dot-parsefile.mk" line 32: The location is no longer fake.
+make: "<normalized>" line 29: The location can be faked in some cases.
+make: "varname-dot-parsefile.mk" line 33: The location is no longer fake.
 At run time, .PARSEFILE is undefined.
 exit status 0
diff -r 1a707084799c -r 4086320b9410 usr.bin/make/unit-tests/varname-dot-parsefile.mk
--- a/usr.bin/make/unit-tests/varname-dot-parsefile.mk  Mon Sep 21 03:12:25 2020 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-parsefile.mk  Mon Sep 21 03:45:29 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varname-dot-parsefile.mk,v 1.3 2020/09/12 11:55:28 rillig Exp $
+# $NetBSD: varname-dot-parsefile.mk,v 1.4 2020/09/21 03:45:29 rillig Exp $
 #
 # Tests for the special .PARSEFILE variable, which contains the basename part
 # of the file that is currently parsed.
@@ -23,9 +23,10 @@
 .info At this point, .PARSEFILE is undefined.
 
 # There is absolutely no point in faking the location of the file that is
-# being parsed.  Technically, it's possible though.
+# being parsed.  Technically, it's possible though, but only if the file
+# being parsed is a relative pathname.  See PrintLocation for details.
 .PARSEFILE = fake-parsefile
-.info The location can be faked.
+.info The location can be faked in some cases.
 
 # After including another file, .PARSEFILE is reset.
 .include "/dev/null"



Home | Main Index | Thread Index | Old Index