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 tests for unknown inden...



details:   https://anonhg.NetBSD.org/src/rev/e2d93aa13eb6
branches:  trunk
changeset: 936523:e2d93aa13eb6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Jul 28 18:25:33 2020 +0000

description:
make(1): add tests for unknown indented directives

It's quite expected that the .${:Uinfo} is not yet expanded when the
directive is parsed, otherwise the directive would have been accepted.
The surprising thing is that it is expanded at the point where the error
message is generated.

diffstat:

 usr.bin/make/unit-tests/directives.exp |   6 +++++-
 usr.bin/make/unit-tests/directives.mk  |  12 +++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r faee6acf4d13 -r e2d93aa13eb6 usr.bin/make/unit-tests/directives.exp
--- a/usr.bin/make/unit-tests/directives.exp    Tue Jul 28 18:15:11 2020 +0000
+++ b/usr.bin/make/unit-tests/directives.exp    Tue Jul 28 18:25:33 2020 +0000
@@ -31,7 +31,11 @@
 make: "directives.mk" line 133: 1 taken
 make: "directives.mk" line 134: Unknown directive "elsif"
 make: "directives.mk" line 135: 2 taken
-make: "directives.mk" line 140: end of the tests
+make: "directives.mk" line 140: Unknown directive "indented"
+make: "directives.mk" line 141: Unknown directive "indented"
+make: "directives.mk" line 142: Unknown directive "indented"
+make: "directives.mk" line 143: Unknown directive "info"
+make: "directives.mk" line 150: end of the tests
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r faee6acf4d13 -r e2d93aa13eb6 usr.bin/make/unit-tests/directives.mk
--- a/usr.bin/make/unit-tests/directives.mk     Tue Jul 28 18:15:11 2020 +0000
+++ b/usr.bin/make/unit-tests/directives.mk     Tue Jul 28 18:25:33 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: directives.mk,v 1.2 2020/07/28 17:47:57 rillig Exp $
+# $NetBSD: directives.mk,v 1.3 2020/07/28 18:25:33 rillig Exp $
 #
 # Tests for parsing directives, in the same order as in the manual page.
 #
@@ -137,6 +137,16 @@
 .info else taken
 .endif
 
+.indented none
+.  indented 2 spaces
+.      indented tab
+.${:Uinfo} directives cannot be indirect
+
+
+
+
+
+
 .info end of the tests
 
 all:



Home | Main Index | Thread Index | Old Index