aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/deptgt-ignore.mk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/unit-tests/deptgt-ignore.mk')
-rw-r--r--contrib/bmake/unit-tests/deptgt-ignore.mk30
1 files changed, 26 insertions, 4 deletions
diff --git a/contrib/bmake/unit-tests/deptgt-ignore.mk b/contrib/bmake/unit-tests/deptgt-ignore.mk
index 49c14d2cfd43..a0191847e69f 100644
--- a/contrib/bmake/unit-tests/deptgt-ignore.mk
+++ b/contrib/bmake/unit-tests/deptgt-ignore.mk
@@ -1,9 +1,31 @@
-# $NetBSD: deptgt-ignore.mk,v 1.3 2020/11/15 20:20:58 rillig Exp $
+# $NetBSD: deptgt-ignore.mk,v 1.4 2022/01/22 21:50:41 rillig Exp $
#
# Tests for the special target .IGNORE in dependency declarations, which
# does not stop if a command from this target exits with a non-zero status.
+#
+# This test only applies to compatibility mode. In jobs mode such as with
+# '-j1', all commands for a single target are bundled into a single shell
+# program, which is a different implementation technique, the .IGNORE applies
+# there as well.
+
+.MAKEFLAGS: -d0 # force stdout to be unbuffered
+
+all: depends-on-failed depends-on-ignored
+.PHONY: all depends-on-failed depends-on-ignored error-failed error-ignored
+
+error-failed error-ignored:
+ @echo '${.TARGET} before'
+ @false
+ @echo '${.TARGET} after'
+
+depends-on-failed: error-failed
+ @echo 'Making ${.TARGET} from ${.ALLSRC}.'
+depends-on-ignored: error-ignored
+ @echo 'Making ${.TARGET} from ${.ALLSRC}.'
-# TODO: Implementation
+# Even though the command 'false' in the middle fails, the remaining commands
+# are still run. After that, the target is marked made, so targets depending
+# on the target with the ignored commands are made.
+.IGNORE: error-ignored
-all:
- @:;
+#.MAKEFLAGS: -dg2