Module Name:    src
Committed By:   rillig
Date:           Mon Sep 21 03:45:29 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: Makefile varname-dot-parsedir.exp
            varname-dot-parsedir.mk varname-dot-parsefile.exp
            varname-dot-parsefile.mk

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varname-dot-parsedir.exp \
    src/usr.bin/make/unit-tests/varname-dot-parsefile.mk
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/varname-dot-parsedir.mk
cvs rdiff -u -r1.2 -r1.3 \
    src/usr.bin/make/unit-tests/varname-dot-parsefile.exp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.143 src/usr.bin/make/unit-tests/Makefile:1.144
--- src/usr.bin/make/unit-tests/Makefile:1.143	Tue Sep 15 16:22:04 2020
+++ src/usr.bin/make/unit-tests/Makefile	Mon Sep 21 03:45:29 2020
@@ -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-subst-regex+= \
 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)],'

Index: src/usr.bin/make/unit-tests/varname-dot-parsedir.exp
diff -u src/usr.bin/make/unit-tests/varname-dot-parsedir.exp:1.3 src/usr.bin/make/unit-tests/varname-dot-parsedir.exp:1.4
--- src/usr.bin/make/unit-tests/varname-dot-parsedir.exp:1.3	Sat Sep 12 11:55:28 2020
+++ src/usr.bin/make/unit-tests/varname-dot-parsedir.exp	Mon Sep 21 03:45:29 2020
@@ -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
Index: src/usr.bin/make/unit-tests/varname-dot-parsefile.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-parsefile.mk:1.3 src/usr.bin/make/unit-tests/varname-dot-parsefile.mk:1.4
--- src/usr.bin/make/unit-tests/varname-dot-parsefile.mk:1.3	Sat Sep 12 11:55:28 2020
+++ src/usr.bin/make/unit-tests/varname-dot-parsefile.mk	Mon Sep 21 03:45:29 2020
@@ -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"

Index: src/usr.bin/make/unit-tests/varname-dot-parsedir.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-parsedir.mk:1.4 src/usr.bin/make/unit-tests/varname-dot-parsedir.mk:1.5
--- src/usr.bin/make/unit-tests/varname-dot-parsedir.mk:1.4	Sat Sep 12 11:55:28 2020
+++ src/usr.bin/make/unit-tests/varname-dot-parsedir.mk	Mon Sep 21 03:45:29 2020
@@ -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"

Index: src/usr.bin/make/unit-tests/varname-dot-parsefile.exp
diff -u src/usr.bin/make/unit-tests/varname-dot-parsefile.exp:1.2 src/usr.bin/make/unit-tests/varname-dot-parsefile.exp:1.3
--- src/usr.bin/make/unit-tests/varname-dot-parsefile.exp:1.2	Sat Sep 12 11:55:28 2020
+++ src/usr.bin/make/unit-tests/varname-dot-parsefile.exp	Mon Sep 21 03:45:29 2020
@@ -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

Reply via email to