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 tests for generating th...
details: https://anonhg.NetBSD.org/src/rev/c52de3a36117
branches: trunk
changeset: 977535:c52de3a36117
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Oct 25 22:04:24 2020 +0000
description:
make(1): add tests for generating the ... command indirectly
diffstat:
usr.bin/make/unit-tests/sh-dots.exp | 7 +++++++
usr.bin/make/unit-tests/sh-dots.mk | 19 +++++++++++++++++--
2 files changed, 24 insertions(+), 2 deletions(-)
diffs (58 lines):
diff -r 9771c3771455 -r c52de3a36117 usr.bin/make/unit-tests/sh-dots.exp
--- a/usr.bin/make/unit-tests/sh-dots.exp Sun Oct 25 21:51:48 2020 +0000
+++ b/usr.bin/make/unit-tests/sh-dots.exp Sun Oct 25 22:04:24 2020 +0000
@@ -9,7 +9,14 @@
<normalized: ...: not found>
*** Error code 127 (ignored)
commented delayed commented
+indirect regular
+indirect-space regular
+...
+make: exec(...) failed (No such file or directory)
+*** Error code 1 (ignored)
+indirect-space deferred
first delayed first
repeated delayed repeated
repeated delayed twice repeated
+indirect deferred
exit status 0
diff -r 9771c3771455 -r c52de3a36117 usr.bin/make/unit-tests/sh-dots.mk
--- a/usr.bin/make/unit-tests/sh-dots.mk Sun Oct 25 21:51:48 2020 +0000
+++ b/usr.bin/make/unit-tests/sh-dots.mk Sun Oct 25 22:04:24 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: sh-dots.mk,v 1.2 2020/10/18 18:12:42 rillig Exp $
+# $NetBSD: sh-dots.mk,v 1.3 2020/10/25 22:04:24 rillig Exp $
#
# Tests for the special shell command line "...", which does not run the
# commands below it but appends them to the list of commands that are run
@@ -6,7 +6,7 @@
.MAKEFLAGS: -d0 # switch stdout to being line-buffered
-all: first hidden repeated commented
+all: first hidden repeated commented indirect indirect-space
# The ${.TARGET} correctly expands to the target name, even though the
# commands are run separately from the main commands.
@@ -29,6 +29,21 @@
... # Run the below commands later
@echo commented delayed ${.TARGET}
+# The dots don't have to be written literally, they can also come from a
+# variable expression.
+indirect:
+ @echo indirect regular
+ ${:U...}
+ @echo indirect deferred
+
+# If the dots are followed by a space, that space is part of the command and
+# thus does not defer the command below it.
+indirect-space: .IGNORE
+ @echo indirect-space regular
+ ${:U... }
+ @echo indirect-space deferred
+
+
# The "..." can appear more than once, even though that doesn't make sense.
# The second "..." is a no-op.
repeated: .IGNORE
Home |
Main Index |
Thread Index |
Old Index