Prevent GHC from silently dying when preprocessor is not found
[ghc.git] / testsuite / tests / driver / all.T
index f60dc41..cbfbd02 100644 (file)
@@ -1,5 +1,3 @@
-setTestOpts(only_compiler_types(['ghc']))
-
 test('driver011',
      extra_clean(['A011.hi', 'A011.o']),
      run_command,
@@ -142,6 +140,11 @@ test('driver042',
      run_command,
      ['$MAKE -s --no-print-directory test042'])
 
+test('driver042stub',
+     extra_clean(['B042stub/C.hi', 'obj042stub/B042stub/C.o', 'obj042stub/B042stub/', 'obj042stub/']),
+     run_command,
+     ['$MAKE -s --no-print-directory test042stub'])
+
 test('driver043',
      extra_clean(['B043/C.hi', 'B043/C.o',
                   'hi043/B043/C.hi', 'hi043/B043', 'hi043']),
@@ -282,15 +285,15 @@ test('driver200',
      run_command,
      ['$MAKE -s --no-print-directory test200'])
 
-test('2566',
+test('T2566',
      normalise_fun(normalise_errmsg),
      run_command,
-     ['$MAKE -s --no-print-directory 2566'])
+     ['$MAKE -s --no-print-directory T2566'])
 
 test('pragma001', normal, compile, [''])
 test('pragma002', normal, compile, [''])
 
-test('2499', normal, compile_fail, [''])
+test('T2499', normal, compile_fail, [''])
 
 test('mode001', normal, run_command,
      ['$MAKE -s --no-print-directory mode001'])
@@ -306,19 +309,33 @@ test('shared001',
      run_command,
      ['$MAKE -s --no-print-directory shared001'])
 
+if config.os == 'darwin':
+  only_darwin = normal
+else:
+  only_darwin = skip
+
+test('static001',
+     [only_darwin, expect_broken(8127),
+      extra_clean(['Static001.hi', 'Static001.o', 'liba.a', 'Static001_stub.h', 'Static001_stub.o'])],
+     run_command,
+     ['$MAKE -s --no-print-directory static001'])
+
 test('dynHelloWorld',
      only_ways(['dyn']),
      compile_and_run,
      [''])
 
-test('5313', extra_run_opts('"' + config.libdir + '"'), compile_and_run, ['-package ghc'])
+test('T5313',
+     extra_run_opts('"' + config.libdir + '"'),
+     compile_and_run,
+     ['-package ghc'])
 
-test('2464', normal, compile, [''])
-test('3674',
+test('T2464', normal, compile, [''])
+test('T3674',
      [ignore_output,
-      extra_clean(['3674_pre.hi', '3674_pre.o', '3674_pre', '3674_pre.exe'])],
+      extra_clean(['T3674_pre.hi', 'T3674_pre.o', 'T3674_pre', 'T3674_pre.exe'])],
      run_command, 
-     ['$MAKE -s --no-print-directory 3674'])
+     ['$MAKE -s --no-print-directory T3674'])
 
 test('rtsopts001',
      extra_clean(['rtsOpts.hi', 'rtsOpts.o', 'rtsOpts', 'rtsOpts.exe']),
@@ -349,8 +366,9 @@ test('spacesInArgs',
      compile_and_run,
      [''])
 
-test('T5584', normal, run_command,
-        ['$MAKE -s --no-print-directory T5584'])
+test('T5584',
+     extra_clean(['T5584_in/A.hi-boot', 'T5584_out/T5584/A.o-boot']),
+     run_command, ['$MAKE -s --no-print-directory T5584'])
 test('T5198', extra_clean(['T5198dump/T5198.dump-simpl', 'T5198dump']),
      run_command,
      ['$MAKE -s --no-print-directory T5198'])
@@ -362,6 +380,76 @@ test('T7060',
      run_command,
      ['$MAKE -s --no-print-directory T7060'])
 test('T7130', normal, compile_fail, ['-fflul-laziness'])
-test('T7563', if_unregisterised(skip), run_command,
+test('T7563', when(unregisterised(), skip), run_command,
      ['$MAKE -s --no-print-directory T7563'])
+test('T6037',
+     # The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X
+     [when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)],
+     run_command,
+     ['$MAKE -s --no-print-directory T6037'])
+test('T2507',
+     # The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X
+     [when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)],
+     run_command,
+     ['$MAKE -s --no-print-directory T2507'])
+test('T8959a',
+     # The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X
+     [when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)],
+     run_command,
+     ['$MAKE -s --no-print-directory T8959a'])
+
+test('T703', normal, run_command, ['$MAKE -s --no-print-directory T703'])
+test('T2182', normal, run_command, ['$MAKE -s --no-print-directory T2182'])
+test('T8101', normal, compile, ['-Wall -fno-code'])
+test('T8101b', expect_broken(10600), multimod_compile,
+     ['T8101b', '-Wall -fno-code'])
+
+def build_T9050(name, way):
+     return simple_build(name + '.cmm', way, '-outputdir=. ', 0, '', 0, 0, 0)
+test('T9050', normal, build_T9050, [])
 
+test('write_interface_oneshot',
+     extra_clean(['write_interface_oneshot_hidir/*']),
+     run_command,
+     ['$MAKE -s --no-print-directory write_interface_oneshot'])
+
+test('write_interface_make',
+     extra_clean(['write_interface_make_hidir/*']),
+     run_command,
+     ['$MAKE -s --no-print-directory write_interface_make'])
+
+test('T9776', normal, compile_fail, ['-frule-check'])
+
+test('T9938',
+     [ extra_clean(['T9938.hi', 'T9938.o', 'T9938']), normal ],
+     run_command,
+     ['$MAKE -s --no-print-directory T9938'])
+
+test('T9938B',
+     [ extra_clean(['T9938B.hi', 'T9938B.o', 'T9938B']) ],
+     run_command,
+     ['$MAKE -s --no-print-directory T9938B'])
+
+test('T9963', exit_code(1), run_command,
+     ['{compiler} --interactive -ignore-dot-ghci --print-libdir'])
+
+test('T10219', normal, run_command,
+     # `-x hspp` in make mode should work.
+     # Note: need to specify `-x hspp` before the filename.
+     ['{compiler} --make -x hspp T10219.hspp -fno-code -v0'])
+
+test('T10220', normal, run_command,
+     # Preprocessed T10220.hspp imports T10220B. Should work in --make mode.
+     ['{compiler} --make T10220.hspp -fno-code -v0'])
+
+test('T10182',
+     extra_clean(['T10182.o', 'T10182a.o', 'T10182.o-boot', 'T10182.hi', 'T10182a.hi', 'T10182.hi-boot']),
+     run_command,
+     ['$MAKE -s --no-print-directory T10182'])
+     
+test('T365',
+     [extra_clean(['test_preprocessor.txt']),
+      pre_cmd('touch test_preprocessor.txt'),
+      unless(opsys('mingw32'), skip)],
+      compile_fail,
+      [''])