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 test for unclosed varia...



details:   https://anonhg.NetBSD.org/src/rev/24a755f136c6
branches:  trunk
changeset: 945635:24a755f136c6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Nov 02 20:37:50 2020 +0000

description:
make(1): add test for unclosed variable after a colon

diffstat:

 usr.bin/make/unit-tests/cmd-errors.exp |   4 +++-
 usr.bin/make/unit-tests/cmd-errors.mk  |  14 +++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diffs (48 lines):

diff -r afa57378f05d -r 24a755f136c6 usr.bin/make/unit-tests/cmd-errors.exp
--- a/usr.bin/make/unit-tests/cmd-errors.exp    Mon Nov 02 20:20:42 2020 +0000
+++ b/usr.bin/make/unit-tests/cmd-errors.exp    Mon Nov 02 20:37:50 2020 +0000
@@ -1,5 +1,7 @@
 : undefined 
-: unclosed 
+make: Unclosed variable "UNCLOSED"
+: unclosed-variable 
+: unclosed-modifier 
 make: Unknown modifier 'Z'
 : unknown-modifier 
 : end
diff -r afa57378f05d -r 24a755f136c6 usr.bin/make/unit-tests/cmd-errors.mk
--- a/usr.bin/make/unit-tests/cmd-errors.mk     Mon Nov 02 20:20:42 2020 +0000
+++ b/usr.bin/make/unit-tests/cmd-errors.mk     Mon Nov 02 20:37:50 2020 +0000
@@ -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.



Home | Main Index | Thread Index | Old Index