Tue Jul 28 20:57:59 2020 UTC ()
make(1): add test for including a nonexistent or empty file


(rillig)
diff -r1.4 -r1.5 src/usr.bin/make/unit-tests/directives.exp
diff -r1.4 -r1.5 src/usr.bin/make/unit-tests/directives.mk

cvs diff -r1.4 -r1.5 src/usr.bin/make/unit-tests/Attic/directives.exp (expand / switch to context diff)
--- src/usr.bin/make/unit-tests/Attic/directives.exp 2020/07/28 18:25:33 1.4
+++ src/usr.bin/make/unit-tests/Attic/directives.exp 2020/07/28 20:57:59 1.5
@@ -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

cvs diff -r1.4 -r1.5 src/usr.bin/make/unit-tests/Attic/directives.mk (expand / switch to context diff)
--- src/usr.bin/make/unit-tests/Attic/directives.mk 2020/07/28 19:19:30 1.4
+++ src/usr.bin/make/unit-tests/Attic/directives.mk 2020/07/28 20:57:59 1.5
@@ -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.
 #
@@ -141,6 +141,16 @@
 .  indented 2 spaces
 .	indented tab
 .${:Uinfo} directives cannot be indirect
+
+
+
+
+
+
+.include "nonexistent.mk"
+.include "/dev/null"		# size 0
+# including a directory technically succeeds, but shouldn't.
+#.include "."			# directory