Module Name: src
Committed By: rillig
Date: Mon Nov 2 20:37:50 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: cmd-errors.exp cmd-errors.mk
Log Message:
make(1): add test for unclosed variable after a colon
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cmd-errors.exp \
src/usr.bin/make/unit-tests/cmd-errors.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/cmd-errors.exp
diff -u src/usr.bin/make/unit-tests/cmd-errors.exp:1.1 src/usr.bin/make/unit-tests/cmd-errors.exp:1.2
--- src/usr.bin/make/unit-tests/cmd-errors.exp:1.1 Mon Nov 2 20:20:42 2020
+++ src/usr.bin/make/unit-tests/cmd-errors.exp Mon Nov 2 20:37:50 2020
@@ -1,5 +1,7 @@
: undefined
-: unclosed
+make: Unclosed variable "UNCLOSED"
+: unclosed-variable
+: unclosed-modifier
make: Unknown modifier 'Z'
: unknown-modifier
: end
Index: src/usr.bin/make/unit-tests/cmd-errors.mk
diff -u src/usr.bin/make/unit-tests/cmd-errors.mk:1.1 src/usr.bin/make/unit-tests/cmd-errors.mk:1.2
--- src/usr.bin/make/unit-tests/cmd-errors.mk:1.1 Mon Nov 2 20:20:42 2020
+++ src/usr.bin/make/unit-tests/cmd-errors.mk Mon Nov 2 20:37:50 2020
@@ -1,9 +1,9 @@
-# $NetBSD: cmd-errors.mk,v 1.1 2020/11/02 20:20:42 rillig Exp $
+# $NetBSD: cmd-errors.mk,v 1.2 2020/11/02 20:37:50 rillig Exp $
#
# Demonstrate how errors in variable expansions affect whether the commands
# are actually executed.
-all: undefined unclosed unknown-modifier end
+all: undefined unclosed-variable unclosed-modifier unknown-modifier end
# Undefined variables are not an error. They expand to empty strings.
undefined:
@@ -12,7 +12,13 @@ undefined:
# XXX: As of 2020-11-01, this obvious syntax error is not detected.
# XXX: As of 2020-11-01, this command is executed even though it contains
# parse errors.
-unclosed:
+unclosed-variable:
+ : $@ ${UNCLOSED
+
+# XXX: As of 2020-11-01, this obvious syntax error is not detected.
+# 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
@@ -22,3 +28,5 @@ unknown-modifier:
end:
: $@
+
+# XXX: As of 2020-11-02, despite the parse errors, the exit status is 0.