Module Name:    src
Committed By:   rillig
Date:           Sat Oct  3 07:52:30 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: opt-debug-loud.exp opt-debug-loud.mk

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


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/opt-debug-loud.exp \
    src/usr.bin/make/unit-tests/opt-debug-loud.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/opt-debug-loud.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-loud.exp:1.1 src/usr.bin/make/unit-tests/opt-debug-loud.exp:1.2
--- src/usr.bin/make/unit-tests/opt-debug-loud.exp:1.1	Sat Sep  5 06:20:51 2020
+++ src/usr.bin/make/unit-tests/opt-debug-loud.exp	Sat Oct  3 07:52:30 2020
@@ -1 +1,3 @@
+echo all-word
+all-word
 exit status 0
Index: src/usr.bin/make/unit-tests/opt-debug-loud.mk
diff -u src/usr.bin/make/unit-tests/opt-debug-loud.mk:1.1 src/usr.bin/make/unit-tests/opt-debug-loud.mk:1.2
--- src/usr.bin/make/unit-tests/opt-debug-loud.mk:1.1	Sat Sep  5 06:20:51 2020
+++ src/usr.bin/make/unit-tests/opt-debug-loud.mk	Sat Oct  3 07:52:30 2020
@@ -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

Reply via email to