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 variable expre...



details:   https://anonhg.NetBSD.org/src/rev/d9a9965311f8
branches:  trunk
changeset: 957901:d9a9965311f8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Dec 14 20:28:09 2020 +0000

description:
make(1): add test for variable expressions after a parse error

These variable expressions don't need to be expanded, and they aren't.

diffstat:

 usr.bin/make/unit-tests/cond-eof.exp |  6 +++---
 usr.bin/make/unit-tests/cond-eof.mk  |  9 +++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diffs (44 lines):

diff -r 9e6ae0f53d2f -r d9a9965311f8 usr.bin/make/unit-tests/cond-eof.exp
--- a/usr.bin/make/unit-tests/cond-eof.exp      Mon Dec 14 20:23:49 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-eof.exp      Mon Dec 14 20:28:09 2020 +0000
@@ -1,9 +1,9 @@
 side effect
-make: "cond-eof.mk" line 14: Malformed conditional (0 ${SIDE_EFFECT})
+make: "cond-eof.mk" line 15: Malformed conditional (0 ${SIDE_EFFECT} ${SIDE_EFFECT2})
 side effect
-make: "cond-eof.mk" line 16: Malformed conditional (1 ${SIDE_EFFECT})
+make: "cond-eof.mk" line 17: Malformed conditional (1 ${SIDE_EFFECT} ${SIDE_EFFECT2})
 side effect
-make: "cond-eof.mk" line 18: Malformed conditional ((0) ${SIDE_EFFECT})
+make: "cond-eof.mk" line 19: Malformed conditional ((0) ${SIDE_EFFECT} ${SIDE_EFFECT2})
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r 9e6ae0f53d2f -r d9a9965311f8 usr.bin/make/unit-tests/cond-eof.mk
--- a/usr.bin/make/unit-tests/cond-eof.mk       Mon Dec 14 20:23:49 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-eof.mk       Mon Dec 14 20:28:09 2020 +0000
@@ -1,9 +1,10 @@
-# $NetBSD: cond-eof.mk,v 1.1 2020/12/14 20:23:50 rillig Exp $
+# $NetBSD: cond-eof.mk,v 1.2 2020/12/14 20:28:09 rillig Exp $
 #
 # Tests for parsing conditions, especially the end of such conditions, which
 # are represented as the token TOK_EOF.
 
 SIDE_EFFECT=   ${:!echo 'side effect' 1>&2!}
+SIDE_EFFECT2=  ${:!echo 'side effect 2' 1>&2!}
 
 # In the following conditions, ${SIDE_EFFECT} is the position of the first
 # parse error.  It is always fully evaluated, even if it were not necessary
@@ -11,9 +12,9 @@
 # an edge case that does not occur during normal operation, therefore there
 # is no need to optimize for this case, and it would slow down the common
 # case as well.
-.if 0 ${SIDE_EFFECT}
+.if 0 ${SIDE_EFFECT} ${SIDE_EFFECT2}
 .endif
-.if 1 ${SIDE_EFFECT}
+.if 1 ${SIDE_EFFECT} ${SIDE_EFFECT2}
 .endif
-.if (0) ${SIDE_EFFECT}
+.if (0) ${SIDE_EFFECT} ${SIDE_EFFECT2}
 .endif



Home | Main Index | Thread Index | Old Index