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: demonstrate that neither -dg2 ...



details:   https://anonhg.NetBSD.org/src/rev/a7a933967a89
branches:  trunk
changeset: 980379:a7a933967a89
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Feb 02 17:27:35 2021 +0000

description:
make: demonstrate that neither -dg2 nor -dg3 produces debug output

diffstat:

 usr.bin/make/unit-tests/Makefile             |   9 ++++++++-
 usr.bin/make/unit-tests/opt-debug-graph2.exp |  11 ++++++++++-
 usr.bin/make/unit-tests/opt-debug-graph2.mk  |  22 ++++++++++++++++++----
 usr.bin/make/unit-tests/opt-debug-graph3.exp |  11 ++++++++++-
 usr.bin/make/unit-tests/opt-debug-graph3.mk  |  22 ++++++++++++++++++----
 5 files changed, 64 insertions(+), 11 deletions(-)

diffs (122 lines):

diff -r fdb1a2ff018b -r a7a933967a89 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Tue Feb 02 16:18:16 2021 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Tue Feb 02 17:27:35 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.265 2021/02/01 20:31:41 rillig Exp $
+# $NetBSD: Makefile,v 1.266 2021/02/02 17:27:35 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -488,6 +488,8 @@
        -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.opt-debug-graph2=     ${STD_SED_CMDS.dg2}
+SED_CMDS.opt-debug-graph3=     ${STD_SED_CMDS.dg3}
 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>,'
@@ -539,6 +541,11 @@
 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_SED_CMDS.dg1+=     -e 's,^\(\.SHELL *=\) .*,\1 <details omitted>,'
+
+STD_SED_CMDS.dg2=      ${STD_SED_CMDS.dg1}
+STD_SED_CMDS.dg2+=     -e 's,\(last modified\) ..:..:.. ... ..\, ....,\1 <timestamp>,'
+STD_SED_CMDS.dg3=      ${STD_SED_CMDS.dg2}
 
 # Omit details such as process IDs from the output of the -dj option.
 STD_SED_CMDS.dj= \
diff -r fdb1a2ff018b -r a7a933967a89 usr.bin/make/unit-tests/opt-debug-graph2.exp
--- a/usr.bin/make/unit-tests/opt-debug-graph2.exp      Tue Feb 02 16:18:16 2021 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-graph2.exp      Tue Feb 02 17:27:35 2021 +0000
@@ -1,1 +1,10 @@
-exit status 0
+: 'Making made-target.'
+false
+*** Error code 1 (continuing)
+false
+*** Error code 1 (continuing)
+`all' not remade because of errors.
+
+Stop.
+make: stopped in unit-tests
+exit status 1
diff -r fdb1a2ff018b -r a7a933967a89 usr.bin/make/unit-tests/opt-debug-graph2.mk
--- a/usr.bin/make/unit-tests/opt-debug-graph2.mk       Tue Feb 02 16:18:16 2021 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-graph2.mk       Tue Feb 02 17:27:35 2021 +0000
@@ -1,9 +1,23 @@
-# $NetBSD: opt-debug-graph2.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+# $NetBSD: opt-debug-graph2.mk,v 1.2 2021/02/02 17:27:35 rillig Exp $
 #
 # Tests for the -dg2 command line option, which prints the input
 # graph after making everything, or before exiting on error.
+#
+# FIXME: The documentation is wrong.  There is no debug output despite
+# the error.
 
-# TODO: Implementation
+.MAKEFLAGS: -dg2
+
+.MAIN: all
 
-all:
-       @:;
+made-target: .PHONY
+       : 'Making $@.'
+
+error-target: .PHONY
+       false
+
+aborted-target: .PHONY aborted-target-dependency
+aborted-target-dependency: .PHONY
+       false
+
+all: made-target error-target aborted-target
diff -r fdb1a2ff018b -r a7a933967a89 usr.bin/make/unit-tests/opt-debug-graph3.exp
--- a/usr.bin/make/unit-tests/opt-debug-graph3.exp      Tue Feb 02 16:18:16 2021 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-graph3.exp      Tue Feb 02 17:27:35 2021 +0000
@@ -1,1 +1,10 @@
-exit status 0
+: 'Making made-target.'
+false
+*** Error code 1 (continuing)
+false
+*** Error code 1 (continuing)
+`all' not remade because of errors.
+
+Stop.
+make: stopped in unit-tests
+exit status 1
diff -r fdb1a2ff018b -r a7a933967a89 usr.bin/make/unit-tests/opt-debug-graph3.mk
--- a/usr.bin/make/unit-tests/opt-debug-graph3.mk       Tue Feb 02 16:18:16 2021 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-graph3.mk       Tue Feb 02 17:27:35 2021 +0000
@@ -1,9 +1,23 @@
-# $NetBSD: opt-debug-graph3.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+# $NetBSD: opt-debug-graph3.mk,v 1.2 2021/02/02 17:27:35 rillig Exp $
 #
 # Tests for the -dg3 command line option, which prints the input
 # graph before exiting on error.
+#
+# FIXME: The documentation is wrong.  There is no debug output despite
+# the error.
 
-# TODO: Implementation
+.MAKEFLAGS: -dg3
+
+.MAIN: all
 
-all:
-       @:;
+made-target: .PHONY
+       : 'Making $@.'
+
+error-target: .PHONY
+       false
+
+aborted-target: .PHONY aborted-target-dependency
+aborted-target-dependency: .PHONY
+       false
+
+all: made-target error-target aborted-target



Home | Main Index | Thread Index | Old Index