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/e83ebf592ab7
branches:  trunk
changeset: 1012385:e83ebf592ab7
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 45330ac4dad1 -r e83ebf592ab7 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 45330ac4dad1 -r e83ebf592ab7 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