Module Name:    src
Committed By:   rillig
Date:           Thu Aug 27 19:00:18 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: opt-debug-g1.exp opt-debug-g1.mk

Log Message:
make(1): add test for the -dg1 option


To generate a diff of this commit:
cvs rdiff -u -r1.909 -r1.910 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.119 -r1.120 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/opt-debug-g1.exp \
    src/usr.bin/make/unit-tests/opt-debug-g1.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.909 src/distrib/sets/lists/tests/mi:1.910
--- src/distrib/sets/lists/tests/mi:1.909	Thu Aug 27 15:32:37 2020
+++ src/distrib/sets/lists/tests/mi	Thu Aug 27 19:00:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.909 2020/08/27 15:32:37 riastradh Exp $
+# $NetBSD: mi,v 1.910 2020/08/27 19:00:17 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4804,6 +4804,8 @@
 ./usr/tests/usr.bin/make/unit-tests/opt-backwards.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-chdir.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-chdir.mk	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-g1.exp	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-g1.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-debug.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-debug.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-define.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.119 src/usr.bin/make/unit-tests/Makefile:1.120
--- src/usr.bin/make/unit-tests/Makefile:1.119	Sun Aug 23 14:46:33 2020
+++ src/usr.bin/make/unit-tests/Makefile	Thu Aug 27 19:00:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.119 2020/08/23 14:46:33 rillig Exp $
+# $NetBSD: Makefile,v 1.120 2020/08/27 19:00:17 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -168,6 +168,7 @@ TESTS+=		opt
 TESTS+=		opt-backwards
 TESTS+=		opt-chdir
 TESTS+=		opt-debug
+TESTS+=		opt-debug-g1
 TESTS+=		opt-define
 TESTS+=		opt-env
 TESTS+=		opt-file
@@ -325,6 +326,7 @@ FLAGS.doterror=		# none
 FLAGS.envfirst=		-e
 FLAGS.export=		# none
 FLAGS.lint=		-dL -k
+FLAGS.opt-debug-g1=	-dg1
 FLAGS.opt-ignore=	-i
 FLAGS.opt-keep-going=	-k
 FLAGS.opt-no-action=	-n
@@ -341,6 +343,9 @@ FLAGS.varname-dot-shell= -dpv
 FLAGS.varname-empty=	-dv '$${:U}=cmdline-u' '=cmline-plain'
 
 # Some tests need extra post-processing.
+SED_CMDS.opt-debug-g1=	-e 's,${.CURDIR},CURDIR,'
+SED_CMDS.opt-debug-g1+=	-e 's,[/[a-z]*/share/mk,/.../share/mk,'
+SED_CMDS.opt-debug-g1+=	-e '/Global Variables/,/Directory Cache/d'
 SED_CMDS.sh-dots+=	-e 's,^${.SHELL}: ,,' -e '/not found/s,command ,,'
 SED_CMDS.varmod-subst-regex+= \
 			-e 's,\(Regex compilation error:\).*,\1 (details omitted),'

Added files:

Index: src/usr.bin/make/unit-tests/opt-debug-g1.exp
diff -u /dev/null src/usr.bin/make/unit-tests/opt-debug-g1.exp:1.1
--- /dev/null	Thu Aug 27 19:00:18 2020
+++ src/usr.bin/make/unit-tests/opt-debug-g1.exp	Thu Aug 27 19:00:17 2020
@@ -0,0 +1,22 @@
+#*** Input graph:
+# all, made UNMADE, type OP_DEPENDS, flags none
+# made-target, made UNMADE, type OP_DEPENDS, flags none
+# made-target-no-sources, made UNMADE, type OP_DEPENDS, flags none
+# made-source, made UNMADE, type OP_DEPENDS, flags none
+# unmade-target, made UNMADE, type OP_DEPENDS, flags none
+# unmade-sources, made UNMADE, type none, flags none
+# unmade-target-no-sources, made UNMADE, type OP_DEPENDS, flags none
+
+
+#
+#   Files that are only sources:
+#	unmade-sources [unmade-sources] 
+# Stats: 0 hits 2 misses 0 near misses 0 losers (0%)
+# directory            referenced	hits
+# CURDIR          2	   0
+# .                             2	   0
+# /.../share/mk                 1	   0
+
+#*** Suffixes:
+#*** Transformations:
+exit status 0
Index: src/usr.bin/make/unit-tests/opt-debug-g1.mk
diff -u /dev/null src/usr.bin/make/unit-tests/opt-debug-g1.mk:1.1
--- /dev/null	Thu Aug 27 19:00:18 2020
+++ src/usr.bin/make/unit-tests/opt-debug-g1.mk	Thu Aug 27 19:00:17 2020
@@ -0,0 +1,19 @@
+# $NetBSD: opt-debug-g1.mk,v 1.1 2020/08/27 19:00:17 rillig Exp $
+#
+# Tests for the -dg1 command line option, which prints the input
+# graph before making anything.
+
+all: made-target made-target-no-sources
+
+made-target: made-source
+
+made-source:
+
+made-target-no-sources:
+
+unmade-target: unmade-sources
+
+unmade-target-no-sources:
+
+all:
+	@:;

Reply via email to