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 special .I...



details:   https://anonhg.NetBSD.org/src/rev/7ebd1821041f
branches:  trunk
changeset: 975481:7ebd1821041f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 29 15:06:33 2020 +0000

description:
make(1): add test for the special .IGNORE dependency source

diffstat:

 usr.bin/make/unit-tests/depsrc-ignore.exp |  12 ++++++++++-
 usr.bin/make/unit-tests/depsrc-ignore.mk  |  33 +++++++++++++++++++++++++++---
 2 files changed, 40 insertions(+), 5 deletions(-)

diffs (57 lines):

diff -r 64b245fead52 -r 7ebd1821041f usr.bin/make/unit-tests/depsrc-ignore.exp
--- a/usr.bin/make/unit-tests/depsrc-ignore.exp Sat Aug 29 15:05:33 2020 +0000
+++ b/usr.bin/make/unit-tests/depsrc-ignore.exp Sat Aug 29 15:06:33 2020 +0000
@@ -1,1 +1,11 @@
-exit status 0
+ignore-errors begin
+false ignore-errors
+ignore-errors end
+all begin
+*** Error code 1 (ignored)
+false all
+*** Error code 1 (continuing)
+
+Stop.
+make: stopped in unit-tests
+exit status 1
diff -r 64b245fead52 -r 7ebd1821041f usr.bin/make/unit-tests/depsrc-ignore.mk
--- a/usr.bin/make/unit-tests/depsrc-ignore.mk  Sat Aug 29 15:05:33 2020 +0000
+++ b/usr.bin/make/unit-tests/depsrc-ignore.mk  Sat Aug 29 15:06:33 2020 +0000
@@ -1,8 +1,33 @@
-# $NetBSD: depsrc-ignore.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: depsrc-ignore.mk,v 1.3 2020/08/29 15:06:33 rillig Exp $
+#
+# Tests for the special source .IGNORE in dependency declarations,
+# which ignores any command failures for that target.
+#
+# Even though ignore-errors fails, the all target is still made.
+# Since the all target is not marked with .IGNORE, it stops at the
+# first failing command.
 #
-# Tests for the special source .IGNORE in dependency declarations.
+# XXX: The messages in the output are confusing.
+# The "ignored" comes much too late to be related to the "false
+# ignore-errors".
+# The "continuing" is confusing as well since it doesn't answer the
+# question "continuing with what?".
+#
+# Even more interestingly, enabling the debugging option -de changes
+# the order in which the messages appear.  Now the "ignored" message
+# is issued in the correct position.  The manual page even defines the
+# buffering of debug_file and stdout, so there should be no variance.
 
-# TODO: Implementation
+#.MAKEFLAGS: -de
+
+all: ignore-errors
+
+ignore-errors: .IGNORE
+       @echo $@ begin
+       false $@
+       @echo $@ end
 
 all:
-       @:;
+       @echo $@ begin
+       false $@
+       @echo $@ end



Home | Main Index | Thread Index | Old Index