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