Module Name: src
Committed By: rillig
Date: Mon Dec 14 20:28:09 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: cond-eof.exp cond-eof.mk
Log Message:
make(1): add test for variable expressions after a parse error
These variable expressions don't need to be expanded, and they aren't.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cond-eof.exp \
src/usr.bin/make/unit-tests/cond-eof.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/cond-eof.exp
diff -u src/usr.bin/make/unit-tests/cond-eof.exp:1.1 src/usr.bin/make/unit-tests/cond-eof.exp:1.2
--- src/usr.bin/make/unit-tests/cond-eof.exp:1.1 Mon Dec 14 20:23:50 2020
+++ src/usr.bin/make/unit-tests/cond-eof.exp Mon Dec 14 20:28:09 2020
@@ -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
Index: src/usr.bin/make/unit-tests/cond-eof.mk
diff -u src/usr.bin/make/unit-tests/cond-eof.mk:1.1 src/usr.bin/make/unit-tests/cond-eof.mk:1.2
--- src/usr.bin/make/unit-tests/cond-eof.mk:1.1 Mon Dec 14 20:23:50 2020
+++ src/usr.bin/make/unit-tests/cond-eof.mk Mon Dec 14 20:28:09 2020
@@ -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 @@ SIDE_EFFECT= ${:!echo 'side effect' 1>&2
# 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