summaryrefslogtreecommitdiff
path: root/unit-tests/sh-dots.mk
diff options
context:
space:
mode:
Diffstat (limited to 'unit-tests/sh-dots.mk')
-rwxr-xr-xunit-tests/sh-dots.mk21
1 files changed, 19 insertions, 2 deletions
diff --git a/unit-tests/sh-dots.mk b/unit-tests/sh-dots.mk
index 36da5bce7a53..f85af9025e55 100755
--- a/unit-tests/sh-dots.mk
+++ b/unit-tests/sh-dots.mk
@@ -1,10 +1,12 @@
-# $NetBSD: sh-dots.mk,v 1.1 2020/08/22 11:27:02 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
# at the end.
-all: first hidden repeated commented
+.MAKEFLAGS: -d0 # switch stdout to being line-buffered
+
+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.
@@ -27,6 +29,21 @@ commented: .IGNORE
... # 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