Module Name:    src
Committed By:   rillig
Date:           Sat Aug 29 15:06:33 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: depsrc-ignore.exp depsrc-ignore.mk

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


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/depsrc-ignore.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/depsrc-ignore.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/depsrc-ignore.exp
diff -u src/usr.bin/make/unit-tests/depsrc-ignore.exp:1.1 src/usr.bin/make/unit-tests/depsrc-ignore.exp:1.2
--- src/usr.bin/make/unit-tests/depsrc-ignore.exp:1.1	Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/depsrc-ignore.exp	Sat Aug 29 15:06:33 2020
@@ -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

Index: src/usr.bin/make/unit-tests/depsrc-ignore.mk
diff -u src/usr.bin/make/unit-tests/depsrc-ignore.mk:1.2 src/usr.bin/make/unit-tests/depsrc-ignore.mk:1.3
--- src/usr.bin/make/unit-tests/depsrc-ignore.mk:1.2	Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/depsrc-ignore.mk	Sat Aug 29 15:06:33 2020
@@ -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.
+# 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.
+#
+# 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.
+
+#.MAKEFLAGS: -de
+
+all: ignore-errors
 
-# TODO: Implementation
+ignore-errors: .IGNORE
+	@echo $@ begin
+	false $@
+	@echo $@ end
 
 all:
-	@:;
+	@echo $@ begin
+	false $@
+	@echo $@ end

Reply via email to