Prevent GHC from silently dying when preprocessor is not found
[ghc.git] / testsuite / tests / driver / all.T
1 test('driver011',
2      extra_clean(['A011.hi', 'A011.o']),
3      run_command,
4      ['$MAKE -s --no-print-directory test011'])
5
6 test('driver012',
7      extra_clean(['A012.hi', 'A012.ooo']),
8      run_command,
9      ['$MAKE -s --no-print-directory test012'])
10
11 test('driver013',
12      extra_clean(['A013.xhi', 'A013.o']),
13      run_command,
14      ['$MAKE -s --no-print-directory test013'])
15
16 test('driver014',
17      extra_clean(['A014.hi', 'obj014/A014.o', 'obj014']),
18      run_command,
19      ['$MAKE -s --no-print-directory test014'])
20
21 test('driver015',
22      extra_clean(['A015.o', 'hi015/A015.hi', 'hi015']),
23      run_command,
24      ['$MAKE -s --no-print-directory test015'])
25
26 test('driver016',
27      extra_clean(['F016.hi', 'F016.o', 'F016_stub.h']),
28      run_command,
29      ['$MAKE -s --no-print-directory test016'])
30
31 test('driver017',
32      extra_clean(['F017.hi', 'F017.o',
33                   'stub017/TestStub017_stub.h', 'stub017/']),
34      run_command,
35      ['$MAKE -s --no-print-directory test017'])
36
37 test('driver018',
38      extra_clean(['F018.hi', 'F018_stub.h',
39                   'obj018/TestStub018.o', 'obj018/TestStub018_stub.o',
40                   'obj018']),
41      run_command,
42      ['$MAKE -s --no-print-directory test018'])
43
44 test('driver018a',
45      extra_clean(['F018a.hi', 'F018a_stub.h',
46                   'F018a.obj.018']),
47      run_command,
48      ['$MAKE -s --no-print-directory test018a'])
49
50 test('driver019',
51      extra_clean(['out019/TestStub019.hi',
52                   'out019/TestStub019.o',
53                   'out019/TestStub019_stub.h',
54                   'out019/TestStub019_stub.o']),
55      run_command,
56      ['$MAKE -s --no-print-directory test019'])
57
58 test('driver021',
59      extra_clean(['B021/C.hi', 'B021/C.o']),
60      run_command,
61      ['$MAKE -s --no-print-directory test021'])
62
63 test('driver022',
64      extra_clean(['B022/C.hi', 'B022/C.ooo']),
65      run_command,
66      ['$MAKE -s --no-print-directory test022'])
67
68 test('driver023',
69      extra_clean(['B023/C.xhi', 'B023/C.o']),
70      run_command,
71      ['$MAKE -s --no-print-directory test023'])
72
73 test('driver024',
74      extra_clean(['B024/C.hi', 'obj024/B024/C.o', 'obj024/B024', 'obj024']),
75      run_command,
76      ['$MAKE -s --no-print-directory test024'])
77
78 test('driver024a',
79      extra_clean(['obj024a/B024a/stub.o', 'obj024a/B024a', 'obj024a',
80                   'B024a/stub.c', 'B024a/']),
81      run_command,
82      ['$MAKE -s --no-print-directory test024a'])
83
84 test('driver025',
85      extra_clean(['B025/C.hi', 'B025/C.o',
86                   'hi025/B025/C.hi', 'hi025/B025', 'hi025']),
87      run_command,
88      ['$MAKE -s --no-print-directory test025'])
89
90 test('driver026',
91      extra_clean(['d026/P/Q.hi', 'd026/P/Q.o']),
92      run_command,
93      ['$MAKE -s --no-print-directory test026'])
94
95 test('driver027',
96      extra_clean(['B027/F.hi', 'B027/F.o',
97                   'B027/F_stub.h', 'B027/F_stub.o']),
98      run_command,
99      ['$MAKE -s --no-print-directory test027'])
100
101 test('driver028',
102      extra_clean(['B028/F.hi', 'B028/F.o',
103                   'stub028/B028/F_stub.h', 'stub028/B028/', 'stub028/']),
104      run_command,
105      ['$MAKE -s --no-print-directory test028'])
106
107 test('driver031',
108      extra_clean(['A031.hi', 'A031.o']),
109      run_command,
110      ['$MAKE -s --no-print-directory test031'])
111
112 test('driver032',
113      extra_clean(['A032.hi', 'obj032/A032.o', 'obj032/']),
114      run_command,
115      ['$MAKE -s --no-print-directory test032'])
116
117 test('driver033',
118      extra_clean(['A033.hi', 'A033.o', 'hi033/A033.hi', 'hi033']),
119      run_command,
120      ['$MAKE -s --no-print-directory test033'])
121
122 test('driver034',
123      extra_clean(['F034.hi', 'F034.o', 'F034_stub.h']),
124      run_command,
125      ['$MAKE -s --no-print-directory test034'])
126
127 test('driver035',
128      extra_clean(['F035.hi', 'F035.o',
129                   'stub035/TestStub035_stub.h', 'stub035/']),
130      run_command,
131      ['$MAKE -s --no-print-directory test035'])
132
133 test('driver041',
134      extra_clean(['B041/C.hi', 'B041/C.o']),
135      run_command,
136      ['$MAKE -s --no-print-directory test041'])
137
138 test('driver042',
139      extra_clean(['B042/C.hi', 'obj042/B042/C.o', 'obj042/B042/', 'obj042/']),
140      run_command,
141      ['$MAKE -s --no-print-directory test042'])
142
143 test('driver042stub',
144      extra_clean(['B042stub/C.hi', 'obj042stub/B042stub/C.o', 'obj042stub/B042stub/', 'obj042stub/']),
145      run_command,
146      ['$MAKE -s --no-print-directory test042stub'])
147
148 test('driver043',
149      extra_clean(['B043/C.hi', 'B043/C.o',
150                   'hi043/B043/C.hi', 'hi043/B043', 'hi043']),
151      run_command,
152      ['$MAKE -s --no-print-directory test043'])
153
154 test('driver044',
155      extra_clean(['B044/F.hi', 'B044/F.o',
156                   'B044/F_stub.h', 'B044/F_stub.o']),
157      run_command,
158      ['$MAKE -s --no-print-directory test044'])
159
160 test('driver045',
161      extra_clean(['B045/F.hi', 'B045/F.o',
162                   'stub045/B045/F_stub.h', 'stub045/B045/', 'stub045/']),
163      run_command,
164      ['$MAKE -s --no-print-directory test045'])
165
166 test('driver051',
167      extra_clean(['d051_1/P/Q.hi', 'd051_1/P/Q.o',
168                   'd051_2/R/S.hi', 'd051_2/R/S.o']),
169      run_command,
170      ['$MAKE -s --no-print-directory test051'])
171
172 test('driver052',
173      extra_clean(['d052_1/P/Q.hi', 'd052_1/P/Q.o',
174                   'd052_2/R/S.hi', 'd052_2/R/S.o',
175                   'obj052/P/Q.o', 'obj052/P',
176                   'obj052/R/S.o', 'obj052/R',
177                   'obj052']),
178      run_command,
179      ['$MAKE -s --no-print-directory test052'])
180
181 test('driver053',
182      extra_clean(['d053_1/P/Q.hi', 'd053_1/P/Q.o',
183                   'd053_2/R/S.hi', 'd053_2/R/S.o',
184                   'hi053/P/Q.hi', 'hi053/P',
185                   'hi053/R/S.hi', 'hi053/R',
186                   'hi053']),
187      run_command,
188      ['$MAKE -s --no-print-directory test053'])
189
190 test('driver061a',
191      extra_clean(['A061a.hi', 'A061a.o', 'A061a.s']),
192      run_command,
193      ['$MAKE -s --no-print-directory test061a'])
194
195 test('driver061b',
196      extra_clean(['A061b.hi', 'A061b.o', 'A061b.s']),
197      run_command,
198      ['$MAKE -s --no-print-directory test061b'])
199
200
201 test('driver062a',
202      extra_clean(['Hello062a.hs', 'Hello062a.hi', 'Hello062a.o',
203                   'hello062a', 'hello062a.exe']),
204      run_command,
205      ['$MAKE -s --no-print-directory test062a'])
206 test('driver062b',
207      extra_clean(['Hello062b.hs', 'Hello062b.hi', 'Hello062b.o',
208                   'hello062b', 'hello062b.exe']),
209      run_command,
210      ['$MAKE -s --no-print-directory test062b'])
211 test('driver062c',
212      extra_clean(['Hello062c.hs', 'Hello062c.hi', 'Hello062c.o',
213                   'hello062c', 'hello062c.exe']),
214      run_command,
215      ['$MAKE -s --no-print-directory test062c'])
216 test('driver062d',
217      extra_clean(['B062d/Hello062d.hi', 'B062d/Hello062d.o',
218                   'B062d/Hello062d.hs', 'B062d/',
219                   'hello062d', 'hello062d.exe']),
220      run_command,
221      ['$MAKE -s --no-print-directory test062d'])
222 test('driver062e',
223      extra_clean(['B062e/Hello062e.hi', 'B062e/Hello062e.o',
224                   'B062e/Hello062e.hs', 'B062e/',
225                   'hello062e', 'hello062e.exe']),
226      run_command,
227      ['$MAKE -s --no-print-directory test062e'])
228
229 test('driver063',
230      extra_clean(['A063.hi', 'A063.o', 'A063.hc',
231                   'D063.hi', 'D063.o', 'D063.hc']),
232      run_command,
233      ['$MAKE -s --no-print-directory test063'])
234
235 test('driver064',
236      extra_clean(['A064.hi', 'A064.o', 'A064.hspp']),
237      run_command,
238      ['$MAKE -s --no-print-directory test064'])
239
240 test('driver065',
241      extra_clean(['A065.hi', 'A065.o', 'A065.hspp']),
242      run_command,
243      ['$MAKE -s --no-print-directory test065'])
244
245 test('driver066',
246      extra_clean(['A066.hi', 'A066.o', 'A066.tmp']),
247      run_command,
248      ['$MAKE -s --no-print-directory test066'])
249
250 test('driver067',
251      extra_clean(['A067.hi', 'A067.o', 'A067.tmp']),
252      run_command,
253      ['$MAKE -s --no-print-directory test067'])
254
255 test('driver070',
256      extra_clean(['A070.hi', 'A070.o', 'A070.s']),
257      run_command,
258      ['$MAKE -s --no-print-directory test070'])
259
260 test('driver071',
261      extra_clean(['A071.hi', 'A071.o', 'A071.tmp']),
262      run_command,
263      ['$MAKE -s --no-print-directory test071'])
264
265 test('driver081a',
266      extra_clean(['Test_081a.hs', 'Test_081a.hi', 'Test_081a.o',
267                   'Test_081a', 'Test_081a.exe']),
268      run_command,
269      ['$MAKE -s --no-print-directory test081a'])
270
271 test('driver081b',
272      extra_clean(['Test.081b.hs', 'Test.081b.hi', 'Test.081b.o',
273                   'Test.081b', 'Test.081b.exe']),
274      run_command,
275      ['$MAKE -s --no-print-directory test081b'])
276
277 test('driver100',
278      extra_clean(['overlap/List.hi', 'overlap/List.o',
279                   'overlap/Overlap.hi', 'overlap/Overlap.o']),
280      run_command,
281      ['$MAKE -s --no-print-directory test100'])
282
283 test('driver200',
284      extra_clean(['depend200', 'depend200.bak']),
285      run_command,
286      ['$MAKE -s --no-print-directory test200'])
287
288 test('T2566',
289      normalise_fun(normalise_errmsg),
290      run_command,
291      ['$MAKE -s --no-print-directory T2566'])
292
293 test('pragma001', normal, compile, [''])
294 test('pragma002', normal, compile, [''])
295
296 test('T2499', normal, compile_fail, [''])
297
298 test('mode001', normal, run_command,
299      ['$MAKE -s --no-print-directory mode001'])
300
301 if config.os == 'mingw32':
302      only_windows = normal
303 else:
304      only_windows = skip
305
306 test('shared001',
307      [only_windows,
308       extra_clean(['Shared001.hi', 'Shared001.o', 'HSdll.dll.a', 'HSdll.dll', 'Shared001_stub.h', 'Shared001_stub.o'])],
309      run_command,
310      ['$MAKE -s --no-print-directory shared001'])
311
312 if config.os == 'darwin':
313   only_darwin = normal
314 else:
315   only_darwin = skip
316
317 test('static001',
318      [only_darwin, expect_broken(8127),
319       extra_clean(['Static001.hi', 'Static001.o', 'liba.a', 'Static001_stub.h', 'Static001_stub.o'])],
320      run_command,
321      ['$MAKE -s --no-print-directory static001'])
322
323 test('dynHelloWorld',
324      only_ways(['dyn']),
325      compile_and_run,
326      [''])
327
328 test('T5313',
329      extra_run_opts('"' + config.libdir + '"'),
330      compile_and_run,
331      ['-package ghc'])
332
333 test('T2464', normal, compile, [''])
334 test('T3674',
335      [ignore_output,
336       extra_clean(['T3674_pre.hi', 'T3674_pre.o', 'T3674_pre', 'T3674_pre.exe'])],
337      run_command, 
338      ['$MAKE -s --no-print-directory T3674'])
339
340 test('rtsopts001',
341      extra_clean(['rtsOpts.hi', 'rtsOpts.o', 'rtsOpts', 'rtsOpts.exe']),
342      run_command,
343      ['$MAKE -s --no-print-directory rtsopts001'])
344 test('rtsopts002', normal, run_command,
345                 ['$MAKE -s --no-print-directory rtsopts002'])
346
347 test('withRtsOpts', [ extra_clean(['withRtsOpts', 'withRtsOpts.exe',
348                                    'withRtsOpts.hi', 'withRtsOpts.o',
349                                    'withRtsOpts.out']) ],
350                     run_command,
351                     ['$MAKE -s --no-print-directory withRtsOpts'])
352 test('T3389', normal, compile_and_run, [''])
353 test('T3364', normalise_fun(normalise_errmsg), run_command,
354      ['$MAKE -s --no-print-directory T3364'])
355 test('T4437', only_ways(['normal']), compile_and_run, ['-package ghc'])
356
357 test('werror', normal, compile_fail, [''])
358
359 test('T706',
360      [req_interp,
361       extra_clean(['T706.hs'])],
362      run_command,
363      ['$MAKE -s --no-print-directory T706'])
364 test('spacesInArgs',
365      extra_run_opts('"a   b"   "c   d"'),
366      compile_and_run,
367      [''])
368
369 test('T5584',
370      extra_clean(['T5584_in/A.hi-boot', 'T5584_out/T5584/A.o-boot']),
371      run_command, ['$MAKE -s --no-print-directory T5584'])
372 test('T5198', extra_clean(['T5198dump/T5198.dump-simpl', 'T5198dump']),
373      run_command,
374      ['$MAKE -s --no-print-directory T5198'])
375 test('T7060',
376      extra_clean(['T7060dump/T7060.dump-rules',
377                   'T7060dump/T7060.dump-rule-firings',
378                   'T7060dump/T7060.dump-rule-rewrites',
379                   'T7060dump']),
380      run_command,
381      ['$MAKE -s --no-print-directory T7060'])
382 test('T7130', normal, compile_fail, ['-fflul-laziness'])
383 test('T7563', when(unregisterised(), skip), run_command,
384      ['$MAKE -s --no-print-directory T7563'])
385 test('T6037',
386      # The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X
387      [when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)],
388      run_command,
389      ['$MAKE -s --no-print-directory T6037'])
390 test('T2507',
391      # The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X
392      [when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)],
393      run_command,
394      ['$MAKE -s --no-print-directory T2507'])
395 test('T8959a',
396      # The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X
397      [when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)],
398      run_command,
399      ['$MAKE -s --no-print-directory T8959a'])
400
401 test('T703', normal, run_command, ['$MAKE -s --no-print-directory T703'])
402 test('T2182', normal, run_command, ['$MAKE -s --no-print-directory T2182'])
403 test('T8101', normal, compile, ['-Wall -fno-code'])
404 test('T8101b', expect_broken(10600), multimod_compile,
405      ['T8101b', '-Wall -fno-code'])
406
407 def build_T9050(name, way):
408      return simple_build(name + '.cmm', way, '-outputdir=. ', 0, '', 0, 0, 0)
409 test('T9050', normal, build_T9050, [])
410
411 test('write_interface_oneshot',
412      extra_clean(['write_interface_oneshot_hidir/*']),
413      run_command,
414      ['$MAKE -s --no-print-directory write_interface_oneshot'])
415
416 test('write_interface_make',
417      extra_clean(['write_interface_make_hidir/*']),
418      run_command,
419      ['$MAKE -s --no-print-directory write_interface_make'])
420
421 test('T9776', normal, compile_fail, ['-frule-check'])
422
423 test('T9938',
424      [ extra_clean(['T9938.hi', 'T9938.o', 'T9938']), normal ],
425      run_command,
426      ['$MAKE -s --no-print-directory T9938'])
427
428 test('T9938B',
429      [ extra_clean(['T9938B.hi', 'T9938B.o', 'T9938B']) ],
430      run_command,
431      ['$MAKE -s --no-print-directory T9938B'])
432
433 test('T9963', exit_code(1), run_command,
434      ['{compiler} --interactive -ignore-dot-ghci --print-libdir'])
435
436 test('T10219', normal, run_command,
437      # `-x hspp` in make mode should work.
438      # Note: need to specify `-x hspp` before the filename.
439      ['{compiler} --make -x hspp T10219.hspp -fno-code -v0'])
440
441 test('T10220', normal, run_command,
442      # Preprocessed T10220.hspp imports T10220B. Should work in --make mode.
443      ['{compiler} --make T10220.hspp -fno-code -v0'])
444
445 test('T10182',
446      extra_clean(['T10182.o', 'T10182a.o', 'T10182.o-boot', 'T10182.hi', 'T10182a.hi', 'T10182.hi-boot']),
447      run_command,
448      ['$MAKE -s --no-print-directory T10182'])
449      
450 test('T365',
451      [extra_clean(['test_preprocessor.txt']),
452       pre_cmd('touch test_preprocessor.txt'),
453       unless(opsys('mingw32'), skip)],
454       compile_fail,
455       [''])