Module Name:    src
Committed By:   rillig
Date:           Sun Nov 22 23:45:20 UTC 2020

Modified Files:
        src/distrib/sets/lists/tests: mi
        src/usr.bin/make/unit-tests: Makefile
Added Files:
        src/usr.bin/make/unit-tests: suff-transform-debug.exp
            suff-transform-debug.mk

Log Message:
make(1): add test for debug output from transformation rules


To generate a diff of this commit:
cvs rdiff -u -r1.973 -r1.974 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/suff-transform-debug.exp \
    src/usr.bin/make/unit-tests/suff-transform-debug.mk

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.973 src/distrib/sets/lists/tests/mi:1.974
--- src/distrib/sets/lists/tests/mi:1.973	Sun Nov 22 20:36:17 2020
+++ src/distrib/sets/lists/tests/mi	Sun Nov 22 23:45:20 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.973 2020/11/22 20:36:17 rillig Exp $
+# $NetBSD: mi,v 1.974 2020/11/22 23:45:20 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5293,6 +5293,8 @@
 ./usr/tests/usr.bin/make/unit-tests/suff-rebuild.mk				tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-self.exp				tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-self.mk				tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/suff-transform-debug.exp			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/suff-transform-debug.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-transform-endless.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-transform-endless.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-transform-expand.exp			tests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.218 src/usr.bin/make/unit-tests/Makefile:1.219
--- src/usr.bin/make/unit-tests/Makefile:1.218	Sun Nov 22 20:36:17 2020
+++ src/usr.bin/make/unit-tests/Makefile	Sun Nov 22 23:45:20 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.218 2020/11/22 20:36:17 rillig Exp $
+# $NetBSD: Makefile,v 1.219 2020/11/22 23:45:20 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -270,6 +270,7 @@ TESTS+=		suff-main
 TESTS+=		suff-main-several
 TESTS+=		suff-rebuild
 TESTS+=		suff-self
+TESTS+=		suff-transform-debug
 TESTS+=		suff-transform-endless
 TESTS+=		suff-transform-expand
 TESTS+=		suff-transform-select
@@ -446,7 +447,6 @@ SED_CMDS.job-output-long-lines= \
 	-e '/^bb*--- job-a ---$$/d'
 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>,'
@@ -454,8 +454,10 @@ SED_CMDS.opt-debug-jobs+=	-e 's,JobFinis
 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.sh-dots=		-e 's,^.*\.\.\.:.*,<normalized: ...: not found>,'
 SED_CMDS.suff-main+=		${STD_SED_CMDS.dg1}
 SED_CMDS.suff-main-several+=	${STD_SED_CMDS.dg1}
+SED_CMDS.suff-transform-debug+=	${STD_SED_CMDS.dg1}
 SED_CMDS.var-op-shell+=	\
 	-e 's,^${.SHELL:T}: [ 0-9:]*,,' \
 	-e '/command/s,No such.*,not found,'
@@ -474,7 +476,8 @@ POSTPROC.deptgt-suffixes= awk '/^\#\*\*\
 POSTPROC.gnode-submake=	awk '/Input graph/, /^$$/'
 POSTPROC.varname-empty=	${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p'
 # The directory cache contains the hard-coded '/usr/share/mk'.
-POSTPROC.suff-main-several=	awk '/Directory Cache/,/^$$/ { next } { print }'
+POSTPROC.suff-main-several=	${STD_POSTPROC.dg1}
+POSTPROC.suff-transform-debug=	${STD_POSTPROC.dg1}
 
 # Some tests reuse other tests, which makes them unnecessarily fragile.
 export-all.rawout: export.mk
@@ -491,6 +494,7 @@ STD_SED_CMDS.dg1+=	-e 's,^\(\.MAKE *=\) 
 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>,'
+STD_POSTPROC.dg1=	awk '/Directory Cache/,/^$$/ { next } { print }'
 
 # End of the configuration helpers section.
 

Added files:

Index: src/usr.bin/make/unit-tests/suff-transform-debug.exp
diff -u /dev/null src/usr.bin/make/unit-tests/suff-transform-debug.exp:1.1
--- /dev/null	Sun Nov 22 23:45:20 2020
+++ src/usr.bin/make/unit-tests/suff-transform-debug.exp	Sun Nov 22 23:45:20 2020
@@ -0,0 +1,55 @@
+#*** Input graph:
+# all, made UNMADE, type OP_DEPENDS, flags none
+
+
+#
+#   Files that are only sources:
+#*** Global Variables:
+.ALLTARGETS      =  all
+.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
+
+#*** Suffixes:
+# ".a" (num 1, ref 2)
+#	To: 
+#	From: .cpp 
+#	Search Path: 
+# ".c" (num 2, ref 2)
+#	To: .cpp 
+#	From: 
+#	Search Path: 
+# ".cpp" (num 3, ref 3)
+#	To: .a 
+#	From: .c 
+#	Search Path: 
+#*** Transformations:
+.c.cpp          :
+	: Making ${.TARGET} from impsrc ${.IMPSRC} allsrc ${.ALLSRC}.
+
+.cpp.a          :
+	: Making ${.TARGET} from impsrc ${.IMPSRC} allsrc ${.ALLSRC}.
+
+exit status 0
Index: src/usr.bin/make/unit-tests/suff-transform-debug.mk
diff -u /dev/null src/usr.bin/make/unit-tests/suff-transform-debug.mk:1.1
--- /dev/null	Sun Nov 22 23:45:20 2020
+++ src/usr.bin/make/unit-tests/suff-transform-debug.mk	Sun Nov 22 23:45:20 2020
@@ -0,0 +1,12 @@
+# $NetBSD: suff-transform-debug.mk,v 1.1 2020/11/22 23:45:20 rillig Exp $
+#
+# Test how the debug output of transformation rules looks.
+
+.MAKEFLAGS: -dg1
+
+.SUFFIXES: .a .c .cpp
+
+.c.cpp .cpp.a:
+	: Making ${.TARGET} from impsrc ${.IMPSRC} allsrc ${.ALLSRC}.
+
+all:

Reply via email to