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 including a no...



details:   https://anonhg.NetBSD.org/src/rev/c6e42c799877
branches:  trunk
changeset: 936535:c6e42c799877
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Jul 28 20:57:59 2020 +0000

description:
make(1): add test for including a nonexistent or empty file

diffstat:

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

diffs (39 lines):

diff -r aa68b1010e27 -r c6e42c799877 usr.bin/make/unit-tests/directives.exp
--- a/usr.bin/make/unit-tests/directives.exp    Tue Jul 28 20:36:43 2020 +0000
+++ b/usr.bin/make/unit-tests/directives.exp    Tue Jul 28 20:57:59 2020 +0000
@@ -35,7 +35,8 @@
 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: "directives.mk" line 150: Could not find nonexistent.mk
+make: "directives.mk" line 160: end of the tests
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r aa68b1010e27 -r c6e42c799877 usr.bin/make/unit-tests/directives.mk
--- a/usr.bin/make/unit-tests/directives.mk     Tue Jul 28 20:36:43 2020 +0000
+++ b/usr.bin/make/unit-tests/directives.mk     Tue Jul 28 20:57:59 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: directives.mk,v 1.4 2020/07/28 19:19:30 rillig Exp $
+# $NetBSD: directives.mk,v 1.5 2020/07/28 20:57:59 rillig Exp $
 #
 # Tests for parsing directives, in the same order as in the manual page.
 #
@@ -147,6 +147,16 @@
 
 
 
+.include "nonexistent.mk"
+.include "/dev/null"           # size 0
+# including a directory technically succeeds, but shouldn't.
+#.include "."                  # directory
+
+
+
+
+
+
 .info end of the tests
 
 all:



Home | Main Index | Thread Index | Old Index