summaryrefslogtreecommitdiff
path: root/unit-tests/cmd-errors.mk
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2020-11-20 03:54:37 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2020-11-20 03:54:37 +0000
commit1b65f0bd2bda7121a90f8cb4c1cacaa20f1b681d (patch)
tree90c374b8513ec5109e1ec4e2228e2edf648e8756 /unit-tests/cmd-errors.mk
parent302da1a3d35c15cb29d76e0a939f8bcb13f7ad80 (diff)
Notes
Diffstat (limited to 'unit-tests/cmd-errors.mk')
-rw-r--r--unit-tests/cmd-errors.mk30
1 files changed, 30 insertions, 0 deletions
diff --git a/unit-tests/cmd-errors.mk b/unit-tests/cmd-errors.mk
new file mode 100644
index 000000000000..5ad4be311873
--- /dev/null
+++ b/unit-tests/cmd-errors.mk
@@ -0,0 +1,30 @@
+# $NetBSD: cmd-errors.mk,v 1.3 2020/11/09 23:36:34 rillig Exp $
+#
+# Demonstrate how errors in variable expansions affect whether the commands
+# are actually executed.
+
+all: undefined unclosed-variable unclosed-modifier unknown-modifier end
+
+# Undefined variables are not an error. They expand to empty strings.
+undefined:
+ : $@ ${UNDEFINED} eol
+
+# XXX: As of 2020-11-01, this command is executed even though it contains
+# parse errors.
+unclosed-variable:
+ : $@ ${UNCLOSED
+
+# XXX: As of 2020-11-01, this command is executed even though it contains
+# parse errors.
+unclosed-modifier:
+ : $@ ${UNCLOSED:
+
+# XXX: As of 2020-11-01, this command is executed even though it contains
+# parse errors.
+unknown-modifier:
+ : $@ ${UNKNOWN:Z} eol
+
+end:
+ : $@ eol
+
+# XXX: As of 2020-11-02, despite the parse errors, the exit status is 0.