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): add test for the undocument...



details:   https://anonhg.NetBSD.org/src/rev/7b8ab1d8363d
branches:  trunk
changeset: 937842:7b8ab1d8363d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Aug 28 04:05:35 2020 +0000

description:
make(1): add test for the undocumented .NULL special dependency target

diffstat:

 usr.bin/make/unit-tests/Makefile            |   6 +++++-
 usr.bin/make/unit-tests/deptgt-suffixes.exp |   6 ++++++
 usr.bin/make/unit-tests/deptgt-suffixes.mk  |  14 ++++++++++++--
 3 files changed, 23 insertions(+), 3 deletions(-)

diffs (62 lines):

diff -r ff8a19296aaf -r 7b8ab1d8363d usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Fri Aug 28 03:51:06 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Fri Aug 28 04:05:35 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.122 2020/08/28 03:51:06 rillig Exp $
+# $NetBSD: Makefile,v 1.123 2020/08/28 04:05:35 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -322,6 +322,8 @@
 ENV.varmisc+=          FROM_ENV_AFTER=env
 
 # Override make flags for some of the tests; default is -k.
+# If possible, write ".MAKEFLAGS: -dv" in the test .mk file instead of
+# settings FLAGS.test=-dv here, since that is closer to the test code.
 FLAGS.archive=         -dA
 FLAGS.counter=         -dv
 FLAGS.doterror=                # none
@@ -360,6 +362,8 @@
 
 # Some tests need an additional round of postprocessing.
 POSTPROC.counter=      ${TOOL_SED} -n -e '/:RELEVANT = yes/,/:RELEVANT = no/p'
+POSTPROC.deptgt-suffixes= \
+                       ${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p'
 POSTPROC.vardebug=     ${TOOL_SED} -n -e '/:RELEVANT = yes/,/:RELEVANT = no/p'
 POSTPROC.varmod-match-escape= ${TOOL_SED} -n -e '/^Pattern/p'
 POSTPROC.varname-dot-shell= \
diff -r ff8a19296aaf -r 7b8ab1d8363d usr.bin/make/unit-tests/deptgt-suffixes.exp
--- a/usr.bin/make/unit-tests/deptgt-suffixes.exp       Fri Aug 28 03:51:06 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt-suffixes.exp       Fri Aug 28 04:05:35 2020 +0000
@@ -1,1 +1,7 @@
+#*** Suffixes:
+# `.custom-null' [1]  (SUFF_NULL)
+#      To: 
+#      From: 
+#      Search Path: . .. 
+#*** Transformations:
 exit status 0
diff -r ff8a19296aaf -r 7b8ab1d8363d usr.bin/make/unit-tests/deptgt-suffixes.mk
--- a/usr.bin/make/unit-tests/deptgt-suffixes.mk        Fri Aug 28 03:51:06 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt-suffixes.mk        Fri Aug 28 04:05:35 2020 +0000
@@ -1,8 +1,18 @@
-# $NetBSD: deptgt-suffixes.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: deptgt-suffixes.mk,v 1.3 2020/08/28 04:05:35 rillig Exp $
 #
 # Tests for the special target .SUFFIXES in dependency declarations.
+#
+# See also:
+#      varname-dot-includes.mk
+#      varname-dot-libs.mk
 
-# TODO: Implementation
+.MAKEFLAGS: -dg1
+
+.SUFFIXES: .custom-null
+
+# TODO: What is the effect of this? How is it useful?
+.NULL: .custom-null
+.PATH.custom-null: . ..
 
 all:
        @:;



Home | Main Index | Thread Index | Old Index