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 -dl comman...



details:   https://anonhg.NetBSD.org/src/rev/5ecae32a2a08
branches:  trunk
changeset: 1014776:5ecae32a2a08
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 03 07:52:30 2020 +0000

description:
make(1): add test for the -dl command line option

diffstat:

 usr.bin/make/unit-tests/opt-debug-loud.exp |   2 ++
 usr.bin/make/unit-tests/opt-debug-loud.mk  |  19 ++++++++++++++-----
 2 files changed, 16 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 98b38b13f163 -r 5ecae32a2a08 usr.bin/make/unit-tests/opt-debug-loud.exp
--- a/usr.bin/make/unit-tests/opt-debug-loud.exp        Sat Oct 03 06:36:01 2020 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-loud.exp        Sat Oct 03 07:52:30 2020 +0000
@@ -1,1 +1,3 @@
+echo all-word
+all-word
 exit status 0
diff -r 98b38b13f163 -r 5ecae32a2a08 usr.bin/make/unit-tests/opt-debug-loud.mk
--- a/usr.bin/make/unit-tests/opt-debug-loud.mk Sat Oct 03 06:36:01 2020 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-loud.mk Sat Oct 03 07:52:30 2020 +0000
@@ -1,13 +1,22 @@
-# $NetBSD: opt-debug-loud.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+# $NetBSD: opt-debug-loud.mk,v 1.2 2020/10/03 07:52:30 rillig Exp $
 #
 # Tests for the -dl command line option, which prints the commands before
 # running them, ignoring the command line option for silent mode (-s) as
 # well as the .SILENT special source and target, as well as the '@' prefix
 # for shell commands.
 
-# TODO: Implementation
+.MAKEFLAGS: -dl -s
+.SILENT:
 
-# TODO: What about ${:!cmd!}?
+# The -dl command line option does not affect commands that are run during
+# variable expansion, such as :!cmd! or :sh.
+.if ${:!echo word!} != "word"
+.  error
+.endif
 
-all:
-       @:;
+all: .SILENT
+       # Even though the command line option -s is given, .SILENT is set
+       # for all targets and for this target in particular, the command
+       # is still printed.  The -dl debugging option is stronger than all
+       # of these.
+       @echo all-word



Home | Main Index | Thread Index | Old Index