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 more output to test for...



details:   https://anonhg.NetBSD.org/src/rev/c1c60f988c36
branches:  trunk
changeset: 946289:c1c60f988c36
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 22 18:25:43 2020 +0000

description:
make(1): add more output to test for -dg1

Previously, the variables section had been omitted.  This was because
the variables had been output in hashcode order until 2020-10-18, and
because some of the variable values are specific to the test environment
or the individual run (MACHINE_ARCH, MAKE.PPID).

diffstat:

 usr.bin/make/unit-tests/Makefile             |  23 ++++++++++++-----
 usr.bin/make/unit-tests/opt-debug-graph1.exp |  36 ++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 7 deletions(-)

diffs (96 lines):

diff -r de98197eddf1 -r c1c60f988c36 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Sun Nov 22 18:13:52 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Sun Nov 22 18:25:43 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.214 2020/11/21 21:41:27 rillig Exp $
+# $NetBSD: Makefile,v 1.215 2020/11/22 18:25:43 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -445,12 +445,9 @@
        ${:D marker should always be at the beginning of the line. } \
        -e '/^aa*--- job-b ---$$/d' \
        -e '/^bb*--- job-a ---$$/d'
-SED_CMDS.objdir-writable= -e 's,${RO_OBJDIR},OBJDIR/roobj,g'
-SED_CMDS.opt-debug-graph1= \
-                       -e 's,${.CURDIR},CURDIR,'
-SED_CMDS.opt-debug-graph1+= \
-                       -e '/Global Variables:/,/Suffixes:/d'
-SED_CMDS.sh-dots=      -e 's,^.*\.\.\.:.*,<normalized: ...: not found>,'
+SED_CMDS.objdir-writable=      -e 's,${RO_OBJDIR},OBJDIR/roobj,g'
+SED_CMDS.opt-debug-graph1=     ${STD_SED_CMDS.dg1}
+SED_CMDS.sh-dots=              -e 's,^.*\.\.\.:.*,<normalized: ...: not found>,'
 SED_CMDS.opt-debug-jobs=       -e 's,([0-9][0-9]*),(<pid>),'
 SED_CMDS.opt-debug-jobs+=      -e 's,pid [0-9][0-9]*,pid <pid>,'
 SED_CMDS.opt-debug-jobs+=      -e 's,Process [0-9][0-9]*,Process <pid>,'
@@ -458,6 +455,7 @@
 SED_CMDS.opt-debug-jobs+=      -e 's,Command: ${.SHELL:T},Command: <shell>,'
 # The "-q" may be there or not, see jobs.c, variable shells.
 SED_CMDS.opt-debug-jobs+=      -e 's,^\(.Command: <shell>\) -q,\1,'
+SED_CMDS.suff-main+=           ${STD_SED_CMDS.dg1}
 SED_CMDS.var-op-shell+=        \
        -e 's,^${.SHELL:T}: [ 0-9:]*,,' \
        -e '/command/s,No such.*,not found,'
@@ -483,6 +481,17 @@
 
 # End of the configuration section.
 
+# Some standard sed commands, to be used in the SED_CMDS above.
+
+# Omit details from the output of the -dg1 option such as process IDs.
+STD_SED_CMDS.dg1=      -e 's,${.CURDIR},<curdir>,'
+STD_SED_CMDS.dg1+=     -e 's,^\(\.MAKE *=\) .*,\1 <details omitted>,'
+STD_SED_CMDS.dg1+=     -e 's,^\(\.MAKE\.[A-Z_]* *=\) .*,\1 <details omitted>,'
+STD_SED_CMDS.dg1+=     -e 's,^\(MACHINE[_ARCH]* *=\) .*,\1 <details omitted>,'
+STD_SED_CMDS.dg1+=     -e 's,^\(MAKE *=\) .*,\1 <details omitted>,'
+
+# End of the configuration helpers section.
+
 .MAIN: all
 
 UNIT_TESTS:=   ${.PARSEDIR}
diff -r de98197eddf1 -r c1c60f988c36 usr.bin/make/unit-tests/opt-debug-graph1.exp
--- a/usr.bin/make/unit-tests/opt-debug-graph1.exp      Sun Nov 22 18:13:52 2020 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-graph1.exp      Sun Nov 22 18:25:43 2020 +0000
@@ -13,5 +13,41 @@
 #   Files that are only sources:
 #      unmade-sources [unmade-sources]
 #      unmade-silent-source [unmade-silent-source] .SILENT
+#*** Global Variables:
+.ALLTARGETS      =  all made-target made-target-no-sources made-source unmade-target unmade-sources unmade-silent-source unmade-target-no-sources
+.CURDIR          = <curdir>
+.INCLUDES        = 
+.LIBS            = 
+.MAKE            = <details omitted>
+.MAKE.DEPENDFILE = <details omitted>
+.MAKE.LEVEL      = <details omitted>
+.MAKE.MAKEFILES  = <details omitted>
+.MAKE.MAKEFILE_PREFERENCE = <details omitted>
+.MAKE.OS         = <details omitted>
+.MAKE.PATH_FILEMON = <details omitted>
+.MAKE.PID        = <details omitted>
+.MAKE.PPID       = <details omitted>
+.MAKEFLAGS       =  -r -k -d g1
+.MAKEOVERRIDES   = 
+.OBJDIR          = <curdir>
+.PATH            = . <curdir>
+.TARGETS         = 
+.newline         = 
+
+MACHINE          = <details omitted>
+MACHINE_ARCH     = <details omitted>
+MAKE             = <details omitted>
+MFLAGS           =   -r -k -d g1
+#*** Command-line Variables:
+.MAKE.LEVEL.ENV  = MAKELEVEL
+
+#*** Directory Cache:
+# Stats: 0 hits 2 misses 0 near misses 0 losers (0%)
+# directory            referenced      hits
+# <curdir>          2     0
+# .                             2         0
+# /usr/share/mk                 1         0
+
+#*** Suffixes:
 #*** Transformations:
 exit status 0



Home | Main Index | Thread Index | Old Index