Mon Nov 2 20:37:50 2020 UTC ()
make(1): add test for unclosed variable after a colon


(rillig)
diff -r1.1 -r1.2 src/usr.bin/make/unit-tests/cmd-errors.exp
diff -r1.1 -r1.2 src/usr.bin/make/unit-tests/cmd-errors.mk

cvs diff -r1.1 -r1.2 src/usr.bin/make/unit-tests/cmd-errors.exp (expand / switch to context diff)
--- src/usr.bin/make/unit-tests/cmd-errors.exp 2020/11/02 20:20:42 1.1
+++ src/usr.bin/make/unit-tests/cmd-errors.exp 2020/11/02 20:37:50 1.2
@@ -1,5 +1,7 @@
 : undefined 
-: unclosed 
+make: Unclosed variable "UNCLOSED"
+: unclosed-variable 
+: unclosed-modifier 
 make: Unknown modifier 'Z'
 : unknown-modifier 
 : end

cvs diff -r1.1 -r1.2 src/usr.bin/make/unit-tests/cmd-errors.mk (expand / switch to context diff)
--- src/usr.bin/make/unit-tests/cmd-errors.mk 2020/11/02 20:20:42 1.1
+++ src/usr.bin/make/unit-tests/cmd-errors.mk 2020/11/02 20:37:50 1.2
@@ -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 @@
 # 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 @@
 
 end:
 	: $@
+
+# XXX: As of 2020-11-02, despite the parse errors, the exit status is 0.