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): test ignoring errors from s...



details:   https://anonhg.NetBSD.org/src/rev/5c7a771e9725
branches:  trunk
changeset: 957009:5c7a771e9725
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 14 13:17:47 2020 +0000

description:
make(1): test ignoring errors from shell commands in jobs mode

diffstat:

 usr.bin/make/unit-tests/job-flags.exp |   4 ++++
 usr.bin/make/unit-tests/job-flags.mk  |  17 +++++++++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)

diffs (53 lines):

diff -r fd0bfeac4a67 -r 5c7a771e9725 usr.bin/make/unit-tests/job-flags.exp
--- a/usr.bin/make/unit-tests/job-flags.exp     Sat Nov 14 13:07:39 2020 +0000
+++ b/usr.bin/make/unit-tests/job-flags.exp     Sat Nov 14 13:17:47 2020 +0000
@@ -4,5 +4,9 @@
 true in ignore
 false in ignore
 *** [ignore] Error code 1 (ignored)
+false without indentation
+false space
+false tab
+*** [ignore-cmds] Error code 1 (ignored)
 .END
 exit status 0
diff -r fd0bfeac4a67 -r 5c7a771e9725 usr.bin/make/unit-tests/job-flags.mk
--- a/usr.bin/make/unit-tests/job-flags.mk      Sat Nov 14 13:07:39 2020 +0000
+++ b/usr.bin/make/unit-tests/job-flags.mk      Sat Nov 14 13:17:47 2020 +0000
@@ -1,23 +1,32 @@
-# $NetBSD: job-flags.mk,v 1.1 2020/11/07 20:01:17 rillig Exp $
+# $NetBSD: job-flags.mk,v 1.2 2020/11/14 13:17:47 rillig Exp $
 #
 # Tests for Job.flags, which are controlled by special source dependencies
 # like .SILENT or .IGNORE, as well as the command line options -s or -i.
 
 .MAKEFLAGS: -j1
 
-all: silent .WAIT ignore
+all: silent .WAIT ignore .WAIT ignore-cmds
 
 .BEGIN:
        @echo $@
 
-silent: .SILENT
+silent: .SILENT .PHONY
        echo $@
 
-ignore: .IGNORE
+ignore: .IGNORE .PHONY
        @echo $@
        true in $@
        false in $@
        @echo 'Still there in $@'
 
+ignore-cmds: .PHONY
+       # This node is not marked .IGNORE; individual commands can be switched
+       # to ignore mode by prefixing them with a '-'.
+       -false without indentation
+       # This also works if the '-' is indented by a space or a tab.
+       # Leading whitespace is stripped off by ParseLine_ShellCommand.
+        -false space
+               -false tab
+
 .END:
        @echo $@



Home | Main Index | Thread Index | Old Index