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 unified 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
@@ -25,17 +25,18 @@ make: "directives.mk" line 90: begin .el @@ -25,17 +25,18 @@ make: "directives.mk" line 90: begin .el
25make: "directives.mk" line 100: begin .elif misspellings tests, part 2 25make: "directives.mk" line 100: begin .elif misspellings tests, part 2
26make: "directives.mk" line 110: begin .elif misspellings tests, part 3 26make: "directives.mk" line 110: begin .elif misspellings tests, part 3
27make: "directives.mk" line 120: which branch is taken on misspelling after false? 27make: "directives.mk" line 120: which branch is taken on misspelling after false?
28make: "directives.mk" line 127: else taken 28make: "directives.mk" line 127: else taken
29make: "directives.mk" line 130: which branch is taken on misspelling after true? 29make: "directives.mk" line 130: which branch is taken on misspelling after true?
30make: "directives.mk" line 132: Unknown directive "elsif" 30make: "directives.mk" line 132: Unknown directive "elsif"
31make: "directives.mk" line 133: 1 taken 31make: "directives.mk" line 133: 1 taken
32make: "directives.mk" line 134: Unknown directive "elsif" 32make: "directives.mk" line 134: Unknown directive "elsif"
33make: "directives.mk" line 135: 2 taken 33make: "directives.mk" line 135: 2 taken
34make: "directives.mk" line 140: Unknown directive "indented" 34make: "directives.mk" line 140: Unknown directive "indented"
35make: "directives.mk" line 141: Unknown directive "indented" 35make: "directives.mk" line 141: Unknown directive "indented"
36make: "directives.mk" line 142: Unknown directive "indented" 36make: "directives.mk" line 142: Unknown directive "indented"
37make: "directives.mk" line 143: Unknown directive "info" 37make: "directives.mk" line 143: Unknown directive "info"
38make: "directives.mk" line 150: end of the tests 38make: "directives.mk" line 150: Could not find nonexistent.mk
 39make: "directives.mk" line 160: end of the tests
39make: Fatal errors encountered -- cannot continue 40make: Fatal errors encountered -- cannot continue
40make: stopped in unit-tests 41make: stopped in unit-tests
41exit status 1 42exit status 1

cvs diff -r1.4 -r1.5 src/usr.bin/make/unit-tests/Attic/directives.mk (expand / switch to unified 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,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: directives.mk,v 1.4 2020/07/28 19:19:30 rillig Exp $ 1# $NetBSD: directives.mk,v 1.5 2020/07/28 20:57:59 rillig Exp $
2# 2#
3# Tests for parsing directives, in the same order as in the manual page. 3# Tests for parsing directives, in the same order as in the manual page.
4# 4#
5# Each test group has 10 lines, to keep the line numbers in directives.exp 5# Each test group has 10 lines, to keep the line numbers in directives.exp
6# stable. 6# stable.
7# 7#
8# no tests for .error since it exits immediately, see ParseMessage. 8# no tests for .error since it exits immediately, see ParseMessage.
9 9
10.info begin .export tests 10.info begin .export tests
11.expor # misspelled 11.expor # misspelled
12.export # oops: missing argument 12.export # oops: missing argument
13.export VARNAME 13.export VARNAME
14.exporting works # oops: misspelled 14.exporting works # oops: misspelled
@@ -137,17 +137,27 @@ @@ -137,17 +137,27 @@
137.info else taken 137.info else taken
138.endif 138.endif
139 139
140.indented none 140.indented none
141. indented 2 spaces 141. indented 2 spaces
142. indented tab 142. indented tab
143.${:Uinfo} directives cannot be indirect 143.${:Uinfo} directives cannot be indirect
144 144
145 145
146 146
147 147
148 148
149 149
 150.include "nonexistent.mk"
 151.include "/dev/null" # size 0
 152# including a directory technically succeeds, but shouldn't.
 153#.include "." # directory
 154
 155
 156
 157
 158
 159
150.info end of the tests 160.info end of the tests
151 161
152all: 162all:
153 @: 163 @: