| @@ -1,564 +1,563 @@ | | | @@ -1,564 +1,563 @@ |
1 | # $NetBSD: Makefile,v 1.183 2020/11/02 20:20:42 rillig Exp $ | | 1 | # $NetBSD: Makefile,v 1.184 2020/11/02 20:40:10 rillig Exp $ |
2 | # | | 2 | # |
3 | # Unit tests for make(1) | | 3 | # Unit tests for make(1) |
4 | # | | 4 | # |
5 | # The main targets are: | | 5 | # The main targets are: |
6 | # | | 6 | # |
7 | # all: | | 7 | # all: |
8 | # run all the tests | | 8 | # run all the tests |
9 | # test: | | 9 | # test: |
10 | # run 'all', and compare to expected results | | 10 | # run 'all', and compare to expected results |
11 | # accept: | | 11 | # accept: |
12 | # move generated output to expected results | | 12 | # move generated output to expected results |
13 | # | | 13 | # |
14 | # Settable variables | | 14 | # Settable variables |
15 | # | | 15 | # |
16 | # TEST_MAKE | | 16 | # TEST_MAKE |
17 | # The make program to be tested. | | 17 | # The make program to be tested. |
18 | # | | 18 | # |
19 | # | | 19 | # |
20 | # Adding a test case | | 20 | # Adding a test case |
21 | # | | 21 | # |
22 | # Each feature should get its own set of tests in its own suitably | | 22 | # Each feature should get its own set of tests in its own suitably |
23 | # named makefile (*.mk), with its own set of expected results (*.exp), | | 23 | # named makefile (*.mk), with its own set of expected results (*.exp), |
24 | # and it should be added to the TESTS list. | | 24 | # and it should be added to the TESTS list. |
25 | # | | 25 | # |
26 | # Any added files must also be added to src/distrib/sets/lists/tests/mi. | | 26 | # Any added files must also be added to src/distrib/sets/lists/tests/mi. |
27 | # To do that, just run "make sync-mi" in this directory. | | 27 | # To do that, just run "make sync-mi" in this directory. |
28 | # | | 28 | # |
29 | # A few *.mk files are helper files for other tests (such as include-sub.mk) | | 29 | # A few *.mk files are helper files for other tests (such as include-sub.mk) |
30 | # and are thus not added to TESTS. Such files must be ignored in | | 30 | # and are thus not added to TESTS. Such files must be ignored in |
31 | # src/tests/usr.bin/make/t_make.sh. | | 31 | # src/tests/usr.bin/make/t_make.sh. |
32 | # | | 32 | # |
33 | | | 33 | |
34 | # Each test is in a sub-makefile. | | 34 | # Each test is in a sub-makefile. |
35 | # Keep the list sorted. | | 35 | # Keep the list sorted. |
36 | # Any test that is commented out must be ignored in | | 36 | # Any test that is commented out must be ignored in |
37 | # src/tests/usr.bin/make/t_make.sh as well. | | 37 | # src/tests/usr.bin/make/t_make.sh as well. |
38 | TESTS+= archive | | 38 | TESTS+= archive |
39 | TESTS+= archive-suffix | | 39 | TESTS+= archive-suffix |
40 | TESTS+= cmd-errors | | 40 | TESTS+= cmd-errors |
41 | TESTS+= cmd-interrupt | | 41 | TESTS+= cmd-interrupt |
42 | TESTS+= cmdline | | 42 | TESTS+= cmdline |
43 | TESTS+= comment | | 43 | TESTS+= comment |
44 | TESTS+= cond-cmp-numeric | | 44 | TESTS+= cond-cmp-numeric |
45 | TESTS+= cond-cmp-numeric-eq | | 45 | TESTS+= cond-cmp-numeric-eq |
46 | TESTS+= cond-cmp-numeric-ge | | 46 | TESTS+= cond-cmp-numeric-ge |
47 | TESTS+= cond-cmp-numeric-gt | | 47 | TESTS+= cond-cmp-numeric-gt |
48 | TESTS+= cond-cmp-numeric-le | | 48 | TESTS+= cond-cmp-numeric-le |
49 | TESTS+= cond-cmp-numeric-lt | | 49 | TESTS+= cond-cmp-numeric-lt |
50 | TESTS+= cond-cmp-numeric-ne | | 50 | TESTS+= cond-cmp-numeric-ne |
51 | TESTS+= cond-cmp-string | | 51 | TESTS+= cond-cmp-string |
52 | TESTS+= cond-cmp-unary | | 52 | TESTS+= cond-cmp-unary |
53 | TESTS+= cond-func | | 53 | TESTS+= cond-func |
54 | TESTS+= cond-func-commands | | 54 | TESTS+= cond-func-commands |
55 | TESTS+= cond-func-defined | | 55 | TESTS+= cond-func-defined |
56 | TESTS+= cond-func-empty | | 56 | TESTS+= cond-func-empty |
57 | TESTS+= cond-func-exists | | 57 | TESTS+= cond-func-exists |
58 | TESTS+= cond-func-make | | 58 | TESTS+= cond-func-make |
59 | TESTS+= cond-func-target | | 59 | TESTS+= cond-func-target |
60 | TESTS+= cond-late | | 60 | TESTS+= cond-late |
61 | TESTS+= cond-op | | 61 | TESTS+= cond-op |
62 | TESTS+= cond-op-and | | 62 | TESTS+= cond-op-and |
63 | TESTS+= cond-op-not | | 63 | TESTS+= cond-op-not |
64 | TESTS+= cond-op-or | | 64 | TESTS+= cond-op-or |
65 | TESTS+= cond-op-parentheses | | 65 | TESTS+= cond-op-parentheses |
66 | TESTS+= cond-short | | 66 | TESTS+= cond-short |
67 | TESTS+= cond-token-number | | 67 | TESTS+= cond-token-number |
68 | TESTS+= cond-token-plain | | 68 | TESTS+= cond-token-plain |
69 | TESTS+= cond-token-string | | 69 | TESTS+= cond-token-string |
70 | TESTS+= cond-token-var | | 70 | TESTS+= cond-token-var |
71 | TESTS+= cond-undef-lint | | 71 | TESTS+= cond-undef-lint |
72 | TESTS+= cond1 | | 72 | TESTS+= cond1 |
73 | TESTS+= counter | | 73 | TESTS+= counter |
74 | TESTS+= counter-append | | 74 | TESTS+= counter-append |
75 | TESTS+= dep | | 75 | TESTS+= dep |
76 | TESTS+= dep-colon | | 76 | TESTS+= dep-colon |
77 | TESTS+= dep-colon-bug-cross-file | | 77 | TESTS+= dep-colon-bug-cross-file |
78 | TESTS+= dep-double-colon | | 78 | TESTS+= dep-double-colon |
79 | TESTS+= dep-double-colon-indep | | 79 | TESTS+= dep-double-colon-indep |
80 | TESTS+= dep-exclam | | 80 | TESTS+= dep-exclam |
81 | TESTS+= dep-none | | 81 | TESTS+= dep-none |
82 | TESTS+= dep-percent | | 82 | TESTS+= dep-percent |
83 | TESTS+= dep-var | | 83 | TESTS+= dep-var |
84 | TESTS+= dep-wildcards | | 84 | TESTS+= dep-wildcards |
85 | TESTS+= depsrc | | 85 | TESTS+= depsrc |
86 | TESTS+= depsrc-end | | 86 | TESTS+= depsrc-end |
87 | TESTS+= depsrc-exec | | 87 | TESTS+= depsrc-exec |
88 | TESTS+= depsrc-ignore | | 88 | TESTS+= depsrc-ignore |
89 | TESTS+= depsrc-made | | 89 | TESTS+= depsrc-made |
90 | TESTS+= depsrc-make | | 90 | TESTS+= depsrc-make |
91 | TESTS+= depsrc-meta | | 91 | TESTS+= depsrc-meta |
92 | TESTS+= depsrc-nometa | | 92 | TESTS+= depsrc-nometa |
93 | TESTS+= depsrc-nometa_cmp | | 93 | TESTS+= depsrc-nometa_cmp |
94 | TESTS+= depsrc-nopath | | 94 | TESTS+= depsrc-nopath |
95 | TESTS+= depsrc-notmain | | 95 | TESTS+= depsrc-notmain |
96 | TESTS+= depsrc-optional | | 96 | TESTS+= depsrc-optional |
97 | TESTS+= depsrc-phony | | 97 | TESTS+= depsrc-phony |
98 | TESTS+= depsrc-precious | | 98 | TESTS+= depsrc-precious |
99 | TESTS+= depsrc-recursive | | 99 | TESTS+= depsrc-recursive |
100 | TESTS+= depsrc-silent | | 100 | TESTS+= depsrc-silent |
101 | TESTS+= depsrc-use | | 101 | TESTS+= depsrc-use |
102 | TESTS+= depsrc-usebefore | | 102 | TESTS+= depsrc-usebefore |
103 | TESTS+= depsrc-usebefore-double-colon | | 103 | TESTS+= depsrc-usebefore-double-colon |
104 | TESTS+= depsrc-wait | | 104 | TESTS+= depsrc-wait |
105 | TESTS+= deptgt | | 105 | TESTS+= deptgt |
106 | TESTS+= deptgt-begin | | 106 | TESTS+= deptgt-begin |
107 | TESTS+= deptgt-default | | 107 | TESTS+= deptgt-default |
108 | TESTS+= deptgt-delete_on_error | | 108 | TESTS+= deptgt-delete_on_error |
109 | TESTS+= deptgt-end | | 109 | TESTS+= deptgt-end |
110 | TESTS+= deptgt-end-jobs | | 110 | TESTS+= deptgt-end-jobs |
111 | TESTS+= deptgt-error | | 111 | TESTS+= deptgt-error |
112 | TESTS+= deptgt-ignore | | 112 | TESTS+= deptgt-ignore |
113 | TESTS+= deptgt-interrupt | | 113 | TESTS+= deptgt-interrupt |
114 | TESTS+= deptgt-main | | 114 | TESTS+= deptgt-main |
115 | TESTS+= deptgt-makeflags | | 115 | TESTS+= deptgt-makeflags |
116 | TESTS+= deptgt-no_parallel | | 116 | TESTS+= deptgt-no_parallel |
117 | TESTS+= deptgt-nopath | | 117 | TESTS+= deptgt-nopath |
118 | TESTS+= deptgt-notparallel | | 118 | TESTS+= deptgt-notparallel |
119 | TESTS+= deptgt-objdir | | 119 | TESTS+= deptgt-objdir |
120 | TESTS+= deptgt-order | | 120 | TESTS+= deptgt-order |
121 | TESTS+= deptgt-path | | 121 | TESTS+= deptgt-path |
122 | TESTS+= deptgt-path-suffix | | 122 | TESTS+= deptgt-path-suffix |
123 | TESTS+= deptgt-phony | | 123 | TESTS+= deptgt-phony |
124 | TESTS+= deptgt-precious | | 124 | TESTS+= deptgt-precious |
125 | TESTS+= deptgt-shell | | 125 | TESTS+= deptgt-shell |
126 | TESTS+= deptgt-silent | | 126 | TESTS+= deptgt-silent |
127 | TESTS+= deptgt-stale | | 127 | TESTS+= deptgt-stale |
128 | TESTS+= deptgt-suffixes | | 128 | TESTS+= deptgt-suffixes |
129 | TESTS+= dir | | 129 | TESTS+= dir |
130 | TESTS+= dir-expand-path | | 130 | TESTS+= dir-expand-path |
131 | TESTS+= directive | | 131 | TESTS+= directive |
132 | TESTS+= directive-dinclude | | 132 | TESTS+= directive-dinclude |
133 | TESTS+= directive-elif | | 133 | TESTS+= directive-elif |
134 | TESTS+= directive-elifdef | | 134 | TESTS+= directive-elifdef |
135 | TESTS+= directive-elifmake | | 135 | TESTS+= directive-elifmake |
136 | TESTS+= directive-elifndef | | 136 | TESTS+= directive-elifndef |
137 | TESTS+= directive-elifnmake | | 137 | TESTS+= directive-elifnmake |
138 | TESTS+= directive-else | | 138 | TESTS+= directive-else |
139 | TESTS+= directive-endif | | 139 | TESTS+= directive-endif |
140 | TESTS+= directive-error | | 140 | TESTS+= directive-error |
141 | TESTS+= directive-export | | 141 | TESTS+= directive-export |
142 | TESTS+= directive-export-env | | 142 | TESTS+= directive-export-env |
143 | TESTS+= directive-export-gmake | | 143 | TESTS+= directive-export-gmake |
144 | TESTS+= directive-export-literal | | 144 | TESTS+= directive-export-literal |
145 | TESTS+= directive-for | | 145 | TESTS+= directive-for |
146 | TESTS+= directive-for-generating-endif | | 146 | TESTS+= directive-for-generating-endif |
147 | TESTS+= directive-hyphen-include | | 147 | TESTS+= directive-hyphen-include |
148 | TESTS+= directive-if | | 148 | TESTS+= directive-if |
149 | TESTS+= directive-ifdef | | 149 | TESTS+= directive-ifdef |
150 | TESTS+= directive-ifmake | | 150 | TESTS+= directive-ifmake |
151 | TESTS+= directive-ifndef | | 151 | TESTS+= directive-ifndef |
152 | TESTS+= directive-ifnmake | | 152 | TESTS+= directive-ifnmake |
153 | TESTS+= directive-include | | 153 | TESTS+= directive-include |
154 | TESTS+= directive-include-fatal | | 154 | TESTS+= directive-include-fatal |
155 | TESTS+= directive-info | | 155 | TESTS+= directive-info |
156 | TESTS+= directive-sinclude | | 156 | TESTS+= directive-sinclude |
157 | TESTS+= directive-undef | | 157 | TESTS+= directive-undef |
158 | TESTS+= directive-unexport | | 158 | TESTS+= directive-unexport |
159 | TESTS+= directive-unexport-env | | 159 | TESTS+= directive-unexport-env |
160 | TESTS+= directive-warning | | 160 | TESTS+= directive-warning |
161 | TESTS+= directives | | 161 | TESTS+= directives |
162 | TESTS+= dollar | | 162 | TESTS+= dollar |
163 | TESTS+= doterror | | 163 | TESTS+= doterror |
164 | TESTS+= dotwait | | 164 | TESTS+= dotwait |
165 | TESTS+= envfirst | | 165 | TESTS+= envfirst |
166 | TESTS+= error | | 166 | TESTS+= error |
167 | TESTS+= # escape # broken by reverting POSIX changes | | 167 | TESTS+= # escape # broken by reverting POSIX changes |
168 | TESTS+= export | | 168 | TESTS+= export |
169 | TESTS+= export-all | | 169 | TESTS+= export-all |
170 | TESTS+= export-env | | 170 | TESTS+= export-env |
171 | TESTS+= export-variants | | 171 | TESTS+= export-variants |
172 | TESTS+= forloop | | 172 | TESTS+= forloop |
173 | TESTS+= forsubst | | 173 | TESTS+= forsubst |
174 | TESTS+= hanoi-include | | 174 | TESTS+= hanoi-include |
175 | TESTS+= impsrc | | 175 | TESTS+= impsrc |
176 | TESTS+= include-main | | 176 | TESTS+= include-main |
177 | TESTS+= job-output-long-lines | | 177 | TESTS+= job-output-long-lines |
178 | TESTS+= lint | | 178 | TESTS+= lint |
179 | TESTS+= make-exported | | 179 | TESTS+= make-exported |
180 | TESTS+= moderrs | | 180 | TESTS+= moderrs |
181 | TESTS+= modmatch | | 181 | TESTS+= modmatch |
182 | TESTS+= modmisc | | 182 | TESTS+= modmisc |
183 | TESTS+= modts | | 183 | TESTS+= modts |
184 | TESTS+= modword | | 184 | TESTS+= modword |
185 | TESTS+= opt | | 185 | TESTS+= opt |
186 | TESTS+= opt-backwards | | 186 | TESTS+= opt-backwards |
187 | TESTS+= opt-chdir | | 187 | TESTS+= opt-chdir |
188 | TESTS+= opt-debug | | 188 | TESTS+= opt-debug |
189 | TESTS+= opt-debug-all | | 189 | TESTS+= opt-debug-all |
190 | TESTS+= opt-debug-archive | | 190 | TESTS+= opt-debug-archive |
191 | TESTS+= opt-debug-curdir | | 191 | TESTS+= opt-debug-curdir |
192 | TESTS+= opt-debug-cond | | 192 | TESTS+= opt-debug-cond |
193 | TESTS+= opt-debug-dir | | 193 | TESTS+= opt-debug-dir |
194 | TESTS+= opt-debug-errors | | 194 | TESTS+= opt-debug-errors |
195 | TESTS+= opt-debug-file | | 195 | TESTS+= opt-debug-file |
196 | TESTS+= opt-debug-for | | 196 | TESTS+= opt-debug-for |
197 | TESTS+= opt-debug-graph1 | | 197 | TESTS+= opt-debug-graph1 |
198 | TESTS+= opt-debug-graph2 | | 198 | TESTS+= opt-debug-graph2 |
199 | TESTS+= opt-debug-graph3 | | 199 | TESTS+= opt-debug-graph3 |
200 | TESTS+= opt-debug-hash | | 200 | TESTS+= opt-debug-hash |
201 | TESTS+= opt-debug-jobs | | 201 | TESTS+= opt-debug-jobs |
202 | TESTS+= opt-debug-lint | | 202 | TESTS+= opt-debug-lint |
203 | TESTS+= opt-debug-loud | | 203 | TESTS+= opt-debug-loud |
204 | TESTS+= opt-debug-meta | | 204 | TESTS+= opt-debug-meta |
205 | TESTS+= opt-debug-making | | 205 | TESTS+= opt-debug-making |
206 | TESTS+= opt-debug-no-rm | | 206 | TESTS+= opt-debug-no-rm |
207 | TESTS+= opt-debug-parse | | 207 | TESTS+= opt-debug-parse |
208 | TESTS+= opt-debug-suff | | 208 | TESTS+= opt-debug-suff |
209 | TESTS+= opt-debug-targets | | 209 | TESTS+= opt-debug-targets |
210 | TESTS+= opt-debug-varraw | | 210 | TESTS+= opt-debug-varraw |
211 | TESTS+= opt-debug-var | | 211 | TESTS+= opt-debug-var |
212 | TESTS+= opt-debug-x-trace | | 212 | TESTS+= opt-debug-x-trace |
213 | TESTS+= opt-define | | 213 | TESTS+= opt-define |
214 | TESTS+= opt-env | | 214 | TESTS+= opt-env |
215 | TESTS+= opt-file | | 215 | TESTS+= opt-file |
216 | TESTS+= opt-ignore | | 216 | TESTS+= opt-ignore |
217 | TESTS+= opt-include-dir | | 217 | TESTS+= opt-include-dir |
218 | TESTS+= opt-jobs | | 218 | TESTS+= opt-jobs |
219 | TESTS+= opt-jobs-internal | | 219 | TESTS+= opt-jobs-internal |
220 | TESTS+= opt-keep-going | | 220 | TESTS+= opt-keep-going |
221 | TESTS+= opt-m-include-dir | | 221 | TESTS+= opt-m-include-dir |
222 | TESTS+= opt-no-action | | 222 | TESTS+= opt-no-action |
223 | TESTS+= opt-no-action-at-all | | 223 | TESTS+= opt-no-action-at-all |
224 | TESTS+= opt-query | | 224 | TESTS+= opt-query |
225 | TESTS+= opt-raw | | 225 | TESTS+= opt-raw |
226 | TESTS+= opt-silent | | 226 | TESTS+= opt-silent |
227 | TESTS+= opt-touch | | 227 | TESTS+= opt-touch |
228 | TESTS+= opt-tracefile | | 228 | TESTS+= opt-tracefile |
229 | TESTS+= opt-var-expanded | | 229 | TESTS+= opt-var-expanded |
230 | TESTS+= opt-var-literal | | 230 | TESTS+= opt-var-literal |
231 | TESTS+= opt-warnings-as-errors | | 231 | TESTS+= opt-warnings-as-errors |
232 | TESTS+= opt-where-am-i | | 232 | TESTS+= opt-where-am-i |
233 | TESTS+= opt-x-reduce-exported | | 233 | TESTS+= opt-x-reduce-exported |
234 | TESTS+= order | | 234 | TESTS+= order |
235 | TESTS+= parse-var | | 235 | TESTS+= parse-var |
236 | TESTS+= phony-end | | 236 | TESTS+= phony-end |
237 | TESTS+= posix | | 237 | TESTS+= posix |
238 | TESTS+= # posix1 # broken by reverting POSIX changes | | 238 | TESTS+= # posix1 # broken by reverting POSIX changes |
239 | TESTS+= qequals | | 239 | TESTS+= qequals |
240 | TESTS+= recursive | | 240 | TESTS+= recursive |
241 | TESTS+= sh | | 241 | TESTS+= sh |
242 | TESTS+= sh-dots | | 242 | TESTS+= sh-dots |
243 | TESTS+= sh-jobs | | 243 | TESTS+= sh-jobs |
244 | TESTS+= sh-jobs-error | | 244 | TESTS+= sh-jobs-error |
245 | TESTS+= sh-leading-at | | 245 | TESTS+= sh-leading-at |
246 | TESTS+= sh-leading-hyphen | | 246 | TESTS+= sh-leading-hyphen |
247 | TESTS+= sh-leading-plus | | 247 | TESTS+= sh-leading-plus |
248 | TESTS+= sh-meta-chars | | 248 | TESTS+= sh-meta-chars |
249 | TESTS+= sh-multi-line | | 249 | TESTS+= sh-multi-line |
250 | TESTS+= sh-single-line | | 250 | TESTS+= sh-single-line |
251 | TESTS+= shell-csh | | 251 | TESTS+= shell-csh |
252 | TESTS+= shell-custom | | 252 | TESTS+= shell-custom |
253 | TESTS+= shell-ksh | | 253 | TESTS+= shell-ksh |
254 | TESTS+= shell-sh | | 254 | TESTS+= shell-sh |
255 | TESTS+= suff-add-later | | 255 | TESTS+= suff-add-later |
256 | TESTS+= suff-clear-regular | | 256 | TESTS+= suff-clear-regular |
257 | TESTS+= suff-clear-single | | 257 | TESTS+= suff-clear-single |
258 | TESTS+= suff-lookup | | 258 | TESTS+= suff-lookup |
259 | TESTS+= suff-main | | 259 | TESTS+= suff-main |
260 | TESTS+= suff-rebuild | | 260 | TESTS+= suff-rebuild |
261 | TESTS+= suff-transform-endless | | 261 | TESTS+= suff-transform-endless |
262 | TESTS+= suff-transform-expand | | 262 | TESTS+= suff-transform-expand |
263 | TESTS+= suff-transform-select | | 263 | TESTS+= suff-transform-select |
264 | TESTS+= sunshcmd | | 264 | TESTS+= sunshcmd |
265 | TESTS+= ternary | | 265 | TESTS+= ternary |
266 | TESTS+= unexport | | 266 | TESTS+= unexport |
267 | TESTS+= unexport-env | | 267 | TESTS+= unexport-env |
268 | TESTS+= use-inference | | 268 | TESTS+= use-inference |
269 | TESTS+= var-class | | 269 | TESTS+= var-class |
270 | TESTS+= var-class-cmdline | | 270 | TESTS+= var-class-cmdline |
271 | TESTS+= var-class-env | | 271 | TESTS+= var-class-env |
272 | TESTS+= var-class-global | | 272 | TESTS+= var-class-global |
273 | TESTS+= var-class-local | | 273 | TESTS+= var-class-local |
274 | TESTS+= var-class-local-legacy | | 274 | TESTS+= var-class-local-legacy |
275 | TESTS+= var-op | | 275 | TESTS+= var-op |
276 | TESTS+= var-op-append | | 276 | TESTS+= var-op-append |
277 | TESTS+= var-op-assign | | 277 | TESTS+= var-op-assign |
278 | TESTS+= var-op-default | | 278 | TESTS+= var-op-default |
279 | TESTS+= var-op-expand | | 279 | TESTS+= var-op-expand |
280 | TESTS+= var-op-shell | | 280 | TESTS+= var-op-shell |
281 | TESTS+= var-op-sunsh | | 281 | TESTS+= var-op-sunsh |
282 | TESTS+= var-recursive | | 282 | TESTS+= var-recursive |
283 | TESTS+= varcmd | | 283 | TESTS+= varcmd |
284 | TESTS+= vardebug | | 284 | TESTS+= vardebug |
285 | TESTS+= varfind | | 285 | TESTS+= varfind |
286 | TESTS+= varmisc | | 286 | TESTS+= varmisc |
287 | TESTS+= varmod | | 287 | TESTS+= varmod |
288 | TESTS+= varmod-assign | | 288 | TESTS+= varmod-assign |
289 | TESTS+= varmod-defined | | 289 | TESTS+= varmod-defined |
290 | TESTS+= varmod-edge | | 290 | TESTS+= varmod-edge |
291 | TESTS+= varmod-exclam-shell | | 291 | TESTS+= varmod-exclam-shell |
292 | TESTS+= varmod-extension | | 292 | TESTS+= varmod-extension |
293 | TESTS+= varmod-gmtime | | 293 | TESTS+= varmod-gmtime |
294 | TESTS+= varmod-hash | | 294 | TESTS+= varmod-hash |
295 | TESTS+= varmod-head | | 295 | TESTS+= varmod-head |
296 | TESTS+= varmod-ifelse | | 296 | TESTS+= varmod-ifelse |
297 | TESTS+= varmod-l-name-to-value | | 297 | TESTS+= varmod-l-name-to-value |
298 | TESTS+= varmod-localtime | | 298 | TESTS+= varmod-localtime |
299 | TESTS+= varmod-loop | | 299 | TESTS+= varmod-loop |
300 | TESTS+= varmod-match | | 300 | TESTS+= varmod-match |
301 | TESTS+= varmod-match-escape | | 301 | TESTS+= varmod-match-escape |
302 | TESTS+= varmod-no-match | | 302 | TESTS+= varmod-no-match |
303 | TESTS+= varmod-order | | 303 | TESTS+= varmod-order |
304 | TESTS+= varmod-order-reverse | | 304 | TESTS+= varmod-order-reverse |
305 | TESTS+= varmod-order-shuffle | | 305 | TESTS+= varmod-order-shuffle |
306 | TESTS+= varmod-path | | 306 | TESTS+= varmod-path |
307 | TESTS+= varmod-quote | | 307 | TESTS+= varmod-quote |
308 | TESTS+= varmod-quote-dollar | | 308 | TESTS+= varmod-quote-dollar |
309 | TESTS+= varmod-range | | 309 | TESTS+= varmod-range |
310 | TESTS+= varmod-remember | | 310 | TESTS+= varmod-remember |
311 | TESTS+= varmod-root | | 311 | TESTS+= varmod-root |
312 | TESTS+= varmod-select-words | | 312 | TESTS+= varmod-select-words |
313 | TESTS+= varmod-shell | | 313 | TESTS+= varmod-shell |
314 | TESTS+= varmod-subst | | 314 | TESTS+= varmod-subst |
315 | TESTS+= varmod-subst-regex | | 315 | TESTS+= varmod-subst-regex |
316 | TESTS+= varmod-sysv | | 316 | TESTS+= varmod-sysv |
317 | TESTS+= varmod-tail | | 317 | TESTS+= varmod-tail |
318 | TESTS+= varmod-to-abs | | 318 | TESTS+= varmod-to-abs |
319 | TESTS+= varmod-to-lower | | 319 | TESTS+= varmod-to-lower |
320 | TESTS+= varmod-to-many-words | | 320 | TESTS+= varmod-to-many-words |
321 | TESTS+= varmod-to-one-word | | 321 | TESTS+= varmod-to-one-word |
322 | TESTS+= varmod-to-separator | | 322 | TESTS+= varmod-to-separator |
323 | TESTS+= varmod-to-upper | | 323 | TESTS+= varmod-to-upper |
324 | TESTS+= varmod-undefined | | 324 | TESTS+= varmod-undefined |
325 | TESTS+= varmod-unique | | 325 | TESTS+= varmod-unique |
326 | TESTS+= varname | | 326 | TESTS+= varname |
327 | TESTS+= varname-dollar | | 327 | TESTS+= varname-dollar |
328 | TESTS+= varname-dot-alltargets | | 328 | TESTS+= varname-dot-alltargets |
329 | TESTS+= varname-dot-curdir | | 329 | TESTS+= varname-dot-curdir |
330 | TESTS+= varname-dot-includes | | 330 | TESTS+= varname-dot-includes |
331 | TESTS+= varname-dot-includedfromdir | | 331 | TESTS+= varname-dot-includedfromdir |
332 | TESTS+= varname-dot-includedfromfile | | 332 | TESTS+= varname-dot-includedfromfile |
333 | TESTS+= varname-dot-libs | | 333 | TESTS+= varname-dot-libs |
334 | TESTS+= varname-dot-make-dependfile | | 334 | TESTS+= varname-dot-make-dependfile |
335 | TESTS+= varname-dot-make-expand_variables | | 335 | TESTS+= varname-dot-make-expand_variables |
336 | TESTS+= varname-dot-make-exported | | 336 | TESTS+= varname-dot-make-exported |
337 | TESTS+= varname-dot-make-jobs | | 337 | TESTS+= varname-dot-make-jobs |
338 | TESTS+= varname-dot-make-jobs-prefix | | 338 | TESTS+= varname-dot-make-jobs-prefix |
339 | TESTS+= varname-dot-make-level | | 339 | TESTS+= varname-dot-make-level |
340 | TESTS+= varname-dot-make-makefile_preference | | 340 | TESTS+= varname-dot-make-makefile_preference |
341 | TESTS+= varname-dot-make-makefiles | | 341 | TESTS+= varname-dot-make-makefiles |
342 | TESTS+= varname-dot-make-meta-bailiwick | | 342 | TESTS+= varname-dot-make-meta-bailiwick |
343 | TESTS+= varname-dot-make-meta-created | | 343 | TESTS+= varname-dot-make-meta-created |
344 | TESTS+= varname-dot-make-meta-files | | 344 | TESTS+= varname-dot-make-meta-files |
345 | TESTS+= varname-dot-make-meta-ignore_filter | | 345 | TESTS+= varname-dot-make-meta-ignore_filter |
346 | TESTS+= varname-dot-make-meta-ignore_paths | | 346 | TESTS+= varname-dot-make-meta-ignore_paths |
347 | TESTS+= varname-dot-make-meta-ignore_patterns | | 347 | TESTS+= varname-dot-make-meta-ignore_patterns |
348 | TESTS+= varname-dot-make-meta-prefix | | 348 | TESTS+= varname-dot-make-meta-prefix |
349 | TESTS+= varname-dot-make-mode | | 349 | TESTS+= varname-dot-make-mode |
350 | TESTS+= varname-dot-make-path_filemon | | 350 | TESTS+= varname-dot-make-path_filemon |
351 | TESTS+= varname-dot-make-pid | | 351 | TESTS+= varname-dot-make-pid |
352 | TESTS+= varname-dot-make-ppid | | 352 | TESTS+= varname-dot-make-ppid |
353 | TESTS+= varname-dot-make-save_dollars | | 353 | TESTS+= varname-dot-make-save_dollars |
354 | TESTS+= varname-dot-makeoverrides | | 354 | TESTS+= varname-dot-makeoverrides |
355 | TESTS+= varname-dot-newline | | 355 | TESTS+= varname-dot-newline |
356 | TESTS+= varname-dot-objdir | | 356 | TESTS+= varname-dot-objdir |
357 | TESTS+= varname-dot-parsedir | | 357 | TESTS+= varname-dot-parsedir |
358 | TESTS+= varname-dot-parsefile | | 358 | TESTS+= varname-dot-parsefile |
359 | TESTS+= varname-dot-path | | 359 | TESTS+= varname-dot-path |
360 | TESTS+= varname-dot-shell | | 360 | TESTS+= varname-dot-shell |
361 | TESTS+= varname-dot-targets | | 361 | TESTS+= varname-dot-targets |
362 | TESTS+= varname-empty | | 362 | TESTS+= varname-empty |
363 | TESTS+= varname-make | | 363 | TESTS+= varname-make |
364 | TESTS+= varname-make_print_var_on_error | | 364 | TESTS+= varname-make_print_var_on_error |
365 | TESTS+= varname-make_print_var_on_error-jobs | | 365 | TESTS+= varname-make_print_var_on_error-jobs |
366 | TESTS+= varname-makefile | | 366 | TESTS+= varname-makefile |
367 | TESTS+= varname-makeflags | | 367 | TESTS+= varname-makeflags |
368 | TESTS+= varname-pwd | | 368 | TESTS+= varname-pwd |
369 | TESTS+= varname-vpath | | 369 | TESTS+= varname-vpath |
370 | TESTS+= varparse-dynamic | | 370 | TESTS+= varparse-dynamic |
371 | TESTS+= varparse-mod | | 371 | TESTS+= varparse-mod |
372 | TESTS+= varparse-undef-partial | | 372 | TESTS+= varparse-undef-partial |
373 | TESTS+= varquote | | 373 | TESTS+= varquote |
374 | TESTS+= varshell | | 374 | TESTS+= varshell |
375 | | | 375 | |
376 | # Additional environment variables for some of the tests. | | 376 | # Additional environment variables for some of the tests. |
377 | # The base environment is -i PATH="$PATH". | | 377 | # The base environment is -i PATH="$PATH". |
378 | ENV.envfirst= FROM_ENV=value-from-env | | 378 | ENV.envfirst= FROM_ENV=value-from-env |
379 | ENV.varmisc= FROM_ENV=env | | 379 | ENV.varmisc= FROM_ENV=env |
380 | ENV.varmisc+= FROM_ENV_BEFORE=env | | 380 | ENV.varmisc+= FROM_ENV_BEFORE=env |
381 | ENV.varmisc+= FROM_ENV_AFTER=env | | 381 | ENV.varmisc+= FROM_ENV_AFTER=env |
382 | ENV.varmod-localtime+= TZ=Europe/Berlin | | 382 | ENV.varmod-localtime+= TZ=Europe/Berlin |
383 | | | 383 | |
384 | # Override make flags for some of the tests; default is -k. | | 384 | # Override make flags for some of the tests; default is -k. |
385 | # If possible, write ".MAKEFLAGS: -dv" in the test .mk file instead of | | 385 | # If possible, write ".MAKEFLAGS: -dv" in the test .mk file instead of |
386 | # settings FLAGS.test=-dv here, since that is closer to the test code. | | 386 | # settings FLAGS.test=-dv here, since that is closer to the test code. |
387 | FLAGS.cond-func-make= via-cmdline | | 387 | FLAGS.cond-func-make= via-cmdline |
388 | FLAGS.directive-ifmake= first second | | 388 | FLAGS.directive-ifmake= first second |
389 | FLAGS.doterror= # none | | 389 | FLAGS.doterror= # none |
390 | FLAGS.envfirst= -e | | 390 | FLAGS.envfirst= -e |
391 | FLAGS.export= # none | | 391 | FLAGS.export= # none |
392 | FLAGS.opt-ignore= -i | | 392 | FLAGS.opt-ignore= -i |
393 | FLAGS.opt-keep-going= -k | | 393 | FLAGS.opt-keep-going= -k |
394 | FLAGS.opt-no-action= -n | | 394 | FLAGS.opt-no-action= -n |
395 | FLAGS.opt-query= -q | | 395 | FLAGS.opt-query= -q |
396 | FLAGS.opt-var-expanded= -v VAR -v VALUE | | 396 | FLAGS.opt-var-expanded= -v VAR -v VALUE |
397 | FLAGS.opt-var-literal= -V VAR -V VALUE | | 397 | FLAGS.opt-var-literal= -V VAR -V VALUE |
398 | FLAGS.opt-warnings-as-errors= -W | | 398 | FLAGS.opt-warnings-as-errors= -W |
399 | FLAGS.order= -j1 | | 399 | FLAGS.order= -j1 |
400 | FLAGS.recursive= -dL | | 400 | FLAGS.recursive= -dL |
401 | FLAGS.sh-leading-plus= -n | | 401 | FLAGS.sh-leading-plus= -n |
402 | FLAGS.varname-empty= -dv '$${:U}=cmdline-u' '=cmline-plain' | | 402 | FLAGS.varname-empty= -dv '$${:U}=cmdline-u' '=cmline-plain' |
403 | | | 403 | |
404 | # Some tests need extra postprocessing. | | 404 | # Some tests need extra postprocessing. |
405 | SED_CMDS.job-output-long-lines= \ | | 405 | SED_CMDS.job-output-long-lines= \ |
406 | ${:D Job separators on their own line are ok. } \ | | 406 | ${:D Job separators on their own line are ok. } \ |
407 | -e '/^--- job-[ab] ---$$/d' \ | | 407 | -e '/^--- job-[ab] ---$$/d' \ |
408 | ${:D Plain output lines are ok as well. } \ | | 408 | ${:D Plain output lines are ok as well. } \ |
409 | ${:D They may come in multiples of 1024 or as 10000. } \ | | 409 | ${:D They may come in multiples of 1024 or as 10000. } \ |
410 | -e '/^aa*$$/d' \ | | 410 | -e '/^aa*$$/d' \ |
411 | -e '/^bb*$$/d' \ | | 411 | -e '/^bb*$$/d' \ |
412 | ${:D The following lines should rather not occur since the job } \ | | 412 | ${:D The following lines should rather not occur since the job } \ |
413 | ${:D marker should always be at the beginning of the line. } \ | | 413 | ${:D marker should always be at the beginning of the line. } \ |
414 | -e '/^aa*--- job-b ---$$/d' \ | | 414 | -e '/^aa*--- job-b ---$$/d' \ |
415 | -e '/^bb*--- job-a ---$$/d' | | 415 | -e '/^bb*--- job-a ---$$/d' |
416 | SED_CMDS.opt-debug-graph1= \ | | 416 | SED_CMDS.opt-debug-graph1= \ |
417 | -e 's,${.CURDIR},CURDIR,' | | 417 | -e 's,${.CURDIR},CURDIR,' |
418 | SED_CMDS.opt-debug-graph1+= \ | | 418 | SED_CMDS.opt-debug-graph1+= \ |
419 | -e '/Global Variables:/,/Suffixes:/d' | | 419 | -e '/Global Variables:/,/Suffixes:/d' |
420 | SED_CMDS.sh-dots= -e 's,^.*\.\.\.:.*,<normalized: ...: not found>,' | | 420 | SED_CMDS.sh-dots= -e 's,^.*\.\.\.:.*,<normalized: ...: not found>,' |
421 | SED_CMDS.opt-debug-jobs= -e 's,([0-9][0-9]*),(<pid>),' | | 421 | SED_CMDS.opt-debug-jobs= -e 's,([0-9][0-9]*),(<pid>),' |
422 | SED_CMDS.opt-debug-jobs+= -e 's,pid [0-9][0-9]*,pid <pid>,' | | 422 | SED_CMDS.opt-debug-jobs+= -e 's,pid [0-9][0-9]*,pid <pid>,' |
423 | SED_CMDS.opt-debug-jobs+= -e 's,Process [0-9][0-9]*,Process <pid>,' | | 423 | SED_CMDS.opt-debug-jobs+= -e 's,Process [0-9][0-9]*,Process <pid>,' |
424 | SED_CMDS.opt-debug-jobs+= -e 's,JobFinish: [0-9][0-9]*,JobFinish: <pid>,' | | 424 | SED_CMDS.opt-debug-jobs+= -e 's,JobFinish: [0-9][0-9]*,JobFinish: <pid>,' |
425 | # The "-q" may be there or not, see jobs.c, variable shells. | | 425 | # The "-q" may be there or not, see jobs.c, variable shells. |
426 | SED_CMDS.opt-debug-jobs+= -e 's,^\(.Command: sh\) -q,\1,' | | 426 | SED_CMDS.opt-debug-jobs+= -e 's,^\(.Command: sh\) -q,\1,' |
427 | SED_CMDS.varmod-subst-regex+= \ | | 427 | SED_CMDS.varmod-subst-regex+= \ |
428 | -e 's,\(Regex compilation error:\).*,\1 (details omitted),' | | 428 | -e 's,\(Regex compilation error:\).*,\1 (details omitted),' |
429 | SED_CMDS.varmod-edge+= -e 's, line [0-9]*:, line omitted:,' | | 429 | SED_CMDS.varmod-edge+= -e 's, line [0-9]*:, line omitted:,' |
430 | SED_CMDS.varshell+= -e 's,^${.SHELL:T}: ,,' | | 430 | SED_CMDS.varshell+= -e 's,^${.SHELL:T}: ,,' |
431 | SED_CMDS.varshell+= -e '/command/s,No such.*,not found,' | | 431 | SED_CMDS.varshell+= -e '/command/s,No such.*,not found,' |
432 | SED_CMDS.varname-dot-parsedir= -e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,' | | 432 | SED_CMDS.varname-dot-parsedir= -e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,' |
433 | SED_CMDS.varname-dot-parsefile= -e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,' | | 433 | SED_CMDS.varname-dot-parsefile= -e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,' |
434 | SED_CMDS.varname-dot-shell= -e 's, = /[^ ]*, = (details omitted),g' | | 434 | SED_CMDS.varname-dot-shell= -e 's, = /[^ ]*, = (details omitted),g' |
435 | SED_CMDS.varname-dot-shell+= -e 's,"/[^" ]*","(details omitted)",g' | | 435 | SED_CMDS.varname-dot-shell+= -e 's,"/[^" ]*","(details omitted)",g' |
436 | SED_CMDS.varname-dot-shell+= -e 's,\[/[^] ]*\],[(details omitted)],g' | | 436 | SED_CMDS.varname-dot-shell+= -e 's,\[/[^] ]*\],[(details omitted)],g' |
437 | | | 437 | |
438 | # Some tests need an additional round of postprocessing. | | 438 | # Some tests need an additional round of postprocessing. |
439 | POSTPROC.deptgt-suffixes= \ | | 439 | POSTPROC.deptgt-suffixes= \ |
440 | ${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p' | | 440 | ${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p' |
441 | POSTPROC.varname= ${TOOL_SED} -n -e '/^MAGIC/p' -e '/^ORDER_/p' | | 441 | POSTPROC.varname= ${TOOL_SED} -n -e '/^MAGIC/p' -e '/^ORDER_/p' |
442 | POSTPROC.varname-empty= ${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p' | | 442 | POSTPROC.varname-empty= ${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p' |
443 | | | 443 | |
444 | # Some tests reuse other tests, which makes them unnecessarily fragile. | | 444 | # Some tests reuse other tests, which makes them unnecessarily fragile. |
445 | export-all.rawout: export.mk | | 445 | export-all.rawout: export.mk |
446 | unexport.rawout: export.mk | | 446 | unexport.rawout: export.mk |
447 | unexport-env.rawout: export.mk | | 447 | unexport-env.rawout: export.mk |
448 | | | 448 | |
449 | # End of the configuration section. | | 449 | # End of the configuration section. |
450 | | | 450 | |
451 | .MAIN: all | | 451 | .MAIN: all |
452 | | | 452 | |
453 | UNIT_TESTS:= ${.PARSEDIR} | | 453 | UNIT_TESTS:= ${.PARSEDIR} |
454 | .PATH: ${UNIT_TESTS} | | 454 | .PATH: ${UNIT_TESTS} |
455 | | | 455 | |
456 | .if ${USE_ABSOLUTE_TESTNAMES:Uno} == yes | | 456 | .if ${USE_ABSOLUTE_TESTNAMES:Uno} == yes |
457 | OUTFILES= ${TESTS:@test@${.CURDIR:tA}/${test}.out@} | | 457 | OUTFILES= ${TESTS:@test@${.CURDIR:tA}/${test}.out@} |
458 | .else | | 458 | .else |
459 | OUTFILES= ${TESTS:=.out} | | 459 | OUTFILES= ${TESTS:=.out} |
460 | .endif | | 460 | .endif |
461 | | | 461 | |
462 | all: ${OUTFILES} | | 462 | all: ${OUTFILES} |
463 | | | 463 | |
464 | CLEANFILES= *.rawout *.out *.status *.tmp *.core *.tmp | | 464 | CLEANFILES= *.rawout *.out *.status *.tmp *.core *.tmp |
465 | CLEANFILES+= obj*.[och] lib*.a # posix1.mk | | 465 | CLEANFILES+= obj*.[och] lib*.a # posix1.mk |
466 | CLEANFILES+= issue* .[ab]* # suffixes.mk | | 466 | CLEANFILES+= issue* .[ab]* # suffixes.mk |
467 | CLEANDIRS= dir dummy # posix1.mk | | 467 | CLEANDIRS= dir dummy # posix1.mk |
468 | | | 468 | |
469 | clean: | | 469 | clean: |
470 | rm -f ${CLEANFILES} | | 470 | rm -f ${CLEANFILES} |
471 | rm -rf ${CLEANDIRS} | | 471 | rm -rf ${CLEANDIRS} |
472 | | | 472 | |
473 | TEST_MAKE?= ${.MAKE} | | 473 | TEST_MAKE?= ${.MAKE} |
474 | TOOL_SED?= sed | | 474 | TOOL_SED?= sed |
475 | | | 475 | |
476 | # ensure consistent results from sort(1) | | 476 | # ensure consistent results from sort(1) |
477 | LC_ALL= C | | 477 | LC_ALL= C |
478 | LANG= C | | 478 | LANG= C |
479 | .export LANG LC_ALL | | 479 | .export LANG LC_ALL |
480 | | | 480 | |
481 | MAKE_TEST_ENV?= MALLOC_OPTIONS="JA" # for jemalloc | | 481 | MAKE_TEST_ENV?= MALLOC_OPTIONS="JA" # for jemalloc |
482 | | | 482 | |
483 | # Each test is run in a sub-make, to keep the tests for interfering with | | 483 | # Each test is run in a sub-make, to keep the tests for interfering with |
484 | # each other, and because they use different environment variables and | | 484 | # each other, and because they use different environment variables and |
485 | # command line options. | | 485 | # command line options. |
486 | .SUFFIXES: .mk .rawout .out | | 486 | .SUFFIXES: .mk .rawout .out |
487 | .mk.rawout: | | 487 | .mk.rawout: |
488 | @${_MKMSG_TEST:Uecho '# test '} ${.PREFIX} | | 488 | @${_MKMSG_TEST:Uecho '# test '} ${.PREFIX} |
489 | @set -eu; \ | | 489 | @set -eu; \ |
490 | cd ${.OBJDIR}; \ | | 490 | cd ${.OBJDIR}; \ |
491 | env -i PATH="$$PATH" ${MAKE_TEST_ENV} ${ENV.${.PREFIX:T}} \ | | 491 | env -i PATH="$$PATH" ${MAKE_TEST_ENV} ${ENV.${.PREFIX:T}} \ |
492 | ${TEST_MAKE} \ | | 492 | ${TEST_MAKE} \ |
493 | -r -C ${.CURDIR} -f ${.IMPSRC} \ | | 493 | -r -C ${.CURDIR} -f ${.IMPSRC} \ |
494 | ${FLAGS.${.PREFIX:T}:U-k} \ | | 494 | ${FLAGS.${.PREFIX:T}:U-k} \ |
495 | > ${.TARGET}.tmp 2>&1 \ | | 495 | > ${.TARGET}.tmp 2>&1 \ |
496 | && status=$$? || status=$$?; \ | | 496 | && status=$$? || status=$$?; \ |
497 | echo $$status > ${.TARGET:R}.status | | 497 | echo $$status > ${.TARGET:R}.status |
498 | @mv ${.TARGET}.tmp ${.TARGET} | | 498 | @mv ${.TARGET}.tmp ${.TARGET} |
499 | | | 499 | |
500 | # Postprocess the test output so that the results can be compared. | | 500 | # Postprocess the test output so that the results can be compared. |
501 | # | | 501 | # |
502 | # always pretend .MAKE was called 'make' | | 502 | # always pretend .MAKE was called 'make' |
503 | _SED_CMDS+= -e 's,^${TEST_MAKE:T:S,.,\\.,g}[][0-9]*:,make:,' | | 503 | _SED_CMDS+= -e 's,^${TEST_MAKE:T:S,.,\\.,g}[][0-9]*:,make:,' |
504 | _SED_CMDS+= -e 's,${TEST_MAKE:S,.,\\.,g},make,' | | 504 | _SED_CMDS+= -e 's,${TEST_MAKE:S,.,\\.,g},make,' |
505 | # replace anything after 'stopped in' with unit-tests | | 505 | # replace anything after 'stopped in' with unit-tests |
506 | _SED_CMDS+= -e '/stopped/s, /.*, unit-tests,' | | 506 | _SED_CMDS+= -e '/stopped/s, /.*, unit-tests,' |
507 | # strip ${.CURDIR}/ from the output | | 507 | # strip ${.CURDIR}/ from the output |
508 | _SED_CMDS+= -e 's,${.CURDIR:S,.,\\.,g}/,,g' | | 508 | _SED_CMDS+= -e 's,${.CURDIR:S,.,\\.,g}/,,g' |
509 | _SED_CMDS+= -e 's,${UNIT_TESTS:S,.,\\.,g}/,,g' | | 509 | _SED_CMDS+= -e 's,${UNIT_TESTS:S,.,\\.,g}/,,g' |
510 | | | 510 | |
511 | .rawout.out: | | 511 | .rawout.out: |
512 | @${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.PREFIX:T}} \ | | 512 | @${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.PREFIX:T}} \ |
513 | < ${.IMPSRC} > ${.TARGET}.tmp1 | | 513 | < ${.IMPSRC} > ${.TARGET}.tmp1 |
514 | @${POSTPROC.${.PREFIX:T}:Ucat} < ${.TARGET}.tmp1 > ${.TARGET}.tmp2 | | 514 | @${POSTPROC.${.PREFIX:T}:Ucat} < ${.TARGET}.tmp1 > ${.TARGET}.tmp2 |
515 | @rm ${.TARGET}.tmp1 | | 515 | @rm ${.TARGET}.tmp1 |
516 | @echo "exit status `cat ${.TARGET:R}.status`" >> ${.TARGET}.tmp2 | | 516 | @echo "exit status `cat ${.TARGET:R}.status`" >> ${.TARGET}.tmp2 |
517 | @mv ${.TARGET}.tmp2 ${.TARGET} | | 517 | @mv ${.TARGET}.tmp2 ${.TARGET} |
518 | | | 518 | |
519 | # Compare all output files | | 519 | # Compare all output files |
520 | test: ${OUTFILES} .PHONY | | 520 | test: ${OUTFILES} .PHONY |
521 | @failed= ; \ | | 521 | @failed= ; \ |
522 | for test in ${TESTS}; do \ | | 522 | for test in ${TESTS}; do \ |
523 | diff -u ${UNIT_TESTS}/$${test}.exp $${test}.out \ | | 523 | diff -u ${UNIT_TESTS}/$${test}.exp $${test}.out \ |
524 | || failed="$${failed}$${failed:+ }$${test}" ; \ | | 524 | || failed="$${failed}$${failed:+ }$${test}" ; \ |
525 | done ; \ | | 525 | done ; \ |
526 | if [ -n "$${failed}" ]; then \ | | 526 | if [ -n "$${failed}" ]; then \ |
527 | echo "Failed tests: $${failed}" ; false ; \ | | 527 | echo "Failed tests: $${failed}" ; false ; \ |
528 | else \ | | 528 | else \ |
529 | echo "All tests passed" ; \ | | 529 | echo "All tests passed" ; \ |
530 | fi | | 530 | fi |
531 | | | 531 | |
532 | accept: | | 532 | accept: |
533 | @for test in ${TESTS}; do \ | | 533 | @for test in ${TESTS}; do \ |
534 | cmp -s ${UNIT_TESTS}/$${test}.exp $${test}.out \ | | 534 | cmp -s ${UNIT_TESTS}/$${test}.exp $${test}.out \ |
535 | || { echo "Replacing $${test}.exp" ; \ | | 535 | || { echo "Replacing $${test}.exp" ; \ |
536 | cp $${test}.out ${UNIT_TESTS}/$${test}.exp ; } \ | | 536 | cp $${test}.out ${UNIT_TESTS}/$${test}.exp ; } \ |
537 | done | | 537 | done |
538 | | | 538 | |
539 | # Note: only works for adding tests. | | 539 | # Note: only works for adding tests. |
540 | # To remove a test, the $$mi file must be edited manually. | | 540 | # To remove a test, the $$mi file must be edited manually. |
541 | sync-mi: | | 541 | sync-mi: |
542 | @set -eu; \ | | 542 | @set -eu; \ |
543 | cd "${MAKEFILE:tA:H}/../../.."; \ | | 543 | cd "${MAKEFILE:tA:H}/../../.."; \ |
544 | mi="distrib/sets/lists/tests/mi"; \ | | 544 | mi="distrib/sets/lists/tests/mi"; \ |
545 | cvs update "$$mi"; \ | | 545 | cvs update "$$mi"; \ |
546 | testsdir="usr.bin/make/unit-tests"; \ | | 546 | testsdir="usr.bin/make/unit-tests"; \ |
547 | fmt="./usr/tests/$$testsdir/%s\ttests-usr.bin-tests\tcompattestfile,atf\\n"; \ | | 547 | fmt="./usr/tests/$$testsdir/%s\ttests-usr.bin-tests\tcompattestfile,atf\\n"; \ |
548 | cat "$$mi" > "$$mi.tmp"; \ | | 548 | cat "$$mi" > "$$mi.tmp"; \ |
549 | (cd "$$testsdir" && ls *.exp *.mk) | xargs printf "$$fmt" >> "$$mi.tmp"; \ | | 549 | (cd "$$testsdir" && ls *.exp *.mk) | xargs printf "$$fmt" >> "$$mi.tmp"; \ |
550 | distrib/sets/fmt-list "$$mi.tmp"; \ | | 550 | distrib/sets/fmt-list "$$mi.tmp"; \ |
551 | echo $$?; \ | | | |
552 | mv "$$mi.tmp" "$$mi"; \ | | 551 | mv "$$mi.tmp" "$$mi"; \ |
553 | cvs diff "$$mi" || true | | 552 | cvs diff "$$mi" || true |
554 | | | 553 | |
555 | .if exists(${TEST_MAKE}) | | 554 | .if exists(${TEST_MAKE}) |
556 | ${TESTS:=.rawout}: ${TEST_MAKE} | | 555 | ${TESTS:=.rawout}: ${TEST_MAKE} |
557 | # in meta mode, we *know* if a target script is impacted | | 556 | # in meta mode, we *know* if a target script is impacted |
558 | # by a makefile change. | | 557 | # by a makefile change. |
559 | .if ${.MAKE.MODE:Unormal:Mmeta} == "" | | 558 | .if ${.MAKE.MODE:Unormal:Mmeta} == "" |
560 | ${TESTS:=.rawout}: ${.PARSEDIR}/Makefile | | 559 | ${TESTS:=.rawout}: ${.PARSEDIR}/Makefile |
561 | .endif | | 560 | .endif |
562 | .endif | | 561 | .endif |
563 | | | 562 | |
564 | .-include <bsd.obj.mk> | | 563 | .-include <bsd.obj.mk> |