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 tests/make: test traditional include...



details:   https://anonhg.NetBSD.org/src/rev/db9440f5263a
branches:  trunk
changeset: 1027631:db9440f5263a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 14 00:38:32 2021 +0000

description:
tests/make: test traditional include directive

diffstat:

 usr.bin/make/unit-tests/directive-include.exp |   3 +++
 usr.bin/make/unit-tests/directive-include.mk  |  15 ++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 5dd2eda1364e -r db9440f5263a usr.bin/make/unit-tests/directive-include.exp
--- a/usr.bin/make/unit-tests/directive-include.exp     Tue Dec 14 00:17:53 2021 +0000
+++ b/usr.bin/make/unit-tests/directive-include.exp     Tue Dec 14 00:38:32 2021 +0000
@@ -6,6 +6,9 @@
 make: "directive-include.mk" line 47: Could not find "
 make: "directive-include.mk" line 52: Unknown modifier "Z"
 make: "directive-include.mk" line 52: Could not find nonexistent.mk
+make: "directive-include.mk" line 57: Cannot open /nonexistent
+make: "directive-include.mk" line 62: Invalid line type
+make: "directive-include.mk" line 65: Could not find 
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r 5dd2eda1364e -r db9440f5263a usr.bin/make/unit-tests/directive-include.mk
--- a/usr.bin/make/unit-tests/directive-include.mk      Tue Dec 14 00:17:53 2021 +0000
+++ b/usr.bin/make/unit-tests/directive-include.mk      Tue Dec 14 00:38:32 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: directive-include.mk,v 1.7 2021/12/03 22:48:07 rillig Exp $
+# $NetBSD: directive-include.mk,v 1.8 2021/12/14 00:38:32 rillig Exp $
 #
 # Tests for the .include directive, which includes another file.
 
@@ -51,4 +51,17 @@
 # FIXME: Add proper error handling, no file must be included here.
 .include "nonexistent${:U123:Z}.mk"
 
+# The traditional include directive is seldom used.
+include /dev/null              # comment
+# expect+1: Cannot open /nonexistent
+include /nonexistent           # comment
+sinclude /nonexistent          # comment
+include ${:U/dev/null}         # comment
+include /dev/null /dev/null
+# expect+1: Invalid line type
+include
+# XXX: trailing whitespace in diagnostic, missing quotes around filename
+# expect+1: Could not find
+include ${:U}
+
 all:



Home | Main Index | Thread Index | Old Index