Testsuite: Introduce req_rts_linker
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Wed, 30 Oct 2019 15:42:30 +0000 (16:42 +0100)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Fri, 8 Nov 2019 10:36:54 +0000 (05:36 -0500)
Some tests depend on the RTS linker. Introduce a modifier to skip such
tests, in case the RTS linker is not available.

16 files changed:
testsuite/driver/testlib.py
testsuite/tests/driver/all.T
testsuite/tests/driver/linkwhole/all.T
testsuite/tests/ghc-api/T10052/all.T
testsuite/tests/ghc-api/all.T
testsuite/tests/ghc-api/dynCompileExpr/all.T
testsuite/tests/ghci/T16392/all.T
testsuite/tests/ghci/linking/all.T
testsuite/tests/ghci/linking/dyn/all.T
testsuite/tests/ghci/prog001/prog001.T
testsuite/tests/ghci/scripts/all.T
testsuite/tests/printer/all.T
testsuite/tests/quasiquotation/all.T
testsuite/tests/rts/all.T
testsuite/tests/rts/linker/all.T
testsuite/tests/rts/linker/unload_multiple_objs/all.T

index 4177a2a..3ee9a8a 100644 (file)
@@ -192,6 +192,10 @@ def req_interp( name, opts ):
     if not config.have_interp:
         opts.expect = 'fail'
 
+def req_rts_linker( name, opts ):
+    if not config.have_RTS_linker:
+        opts.expect = 'fail'
+
 def req_th( name, opts ):
     """
     Mark a test as requiring TemplateHaskell. In addition to having interpreter
index 3df5ca3..1179695 100644 (file)
@@ -130,8 +130,7 @@ test('dynHelloWorld',
      [''])
 
 test('T5313',
-     [ unless(config.have_RTS_linker, skip),
-       extra_run_opts('"' + config.libdir + '"')],
+     [ req_rts_linker, extra_run_opts('"' + config.libdir + '"')],
      compile_and_run,
      ['-package ghc'])
 
index e4881bb..3703052 100644 (file)
@@ -1,6 +1,6 @@
 test('linkwhole',
      [extra_files(['Types.hs','Main.hs','MyCode.hs','Handles.hs']),
-      unless(config.have_RTS_linker, skip),
+      req_rts_linker,
       when(opsys('freebsd'), expect_broken(16035)),
       when(opsys('mingw32'), skip)],
      makefile_test, [])
index 0e0f3bc..a3b7040 100644 (file)
@@ -1,3 +1,2 @@
-test('T10052', [unless(config.have_RTS_linker, skip),
-               req_interp],
+test('T10052', [req_rts_linker, req_interp],
      makefile_test, ['T10052'])
index 8df85e0..fa7f7a9 100644 (file)
@@ -1,14 +1,14 @@
 test('ghcApi', normal, compile_and_run, ['-package ghc'])
 test('T6145', normal, makefile_test, ['T6145'])
-test('T8639_api', unless (config.have_RTS_linker, skip),
+test('T8639_api', req_rts_linker,
               makefile_test, ['T8639_api'])
-test('T8628', unless(config.have_RTS_linker, skip),
+test('T8628', req_rts_linker,
               makefile_test, ['T8628'])
 test('T9595', extra_run_opts('"' + config.libdir + '"'),
               compile_and_run,
               ['-package ghc'])
 test('T10508_api', [ extra_run_opts('"' + config.libdir + '"'),
-                     unless(config.have_RTS_linker, skip)],
+                     req_rts_linker ],
                    compile_and_run,
                    ['-package ghc'])
 test('T10942', extra_run_opts('"' + config.libdir + '"'),
index fd47e95..d067e69 100644 (file)
@@ -1,6 +1,5 @@
 test('dynCompileExpr',
      [ extra_run_opts('"' + config.libdir + '"'),
        when(opsys('mingw32'), expect_broken_for(5987, ['dyn'])),
-       unless(config.have_RTS_linker, skip),
-       omit_ways(prof_ways) ], # cannot run interpreted code with -prof
+       req_rts_linker, omit_ways(prof_ways) ], # cannot run interpreted code with -prof
      compile_and_run, ['-package ghc'])
index 7b9bd4b..fa16e2d 100644 (file)
@@ -1,4 +1,5 @@
 test('T16392',
      [extra_files(['A.hs']),
-      when(config.have_ext_interp, extra_ways(['ghci-ext']))],
+      extra_ways(['ghci-ext']),
+      req_rts_linker],
      ghci_script, ['T16392.script'])
index a049df3..c537066 100644 (file)
@@ -15,7 +15,7 @@ test('ghcilink003', [unless(doing_ghci, skip)], makefile_test, ['ghcilink003'])
 test('ghcilink004',
      [extra_files(['TestLink.hs', 'f.c']),
       unless(doing_ghci, skip),
-      unless(config.have_RTS_linker, skip)],
+      req_rts_linker],
      makefile_test, ['ghcilink004'])
 
 test('ghcilink005',
index 550ae1b..9a54670 100644 (file)
@@ -47,6 +47,7 @@ test('big-obj', [extra_files(['big-obj-c.c', 'big-obj.hs']),
 
 test('T3372',
      [unless(doing_ghci, skip),
+      req_rts_linker,
       extra_run_opts('"' + config.libdir + '"'),
       unless(config.have_RTS_linker, skip),
       # Concurrent GHC sessions is fragile on Windows since we must lock the
index 7cd60c0..3f2d1be 100644 (file)
@@ -1,5 +1,6 @@
 test('prog001',
      [extra_files(['../shell.hs', 'A.hs', 'B.hs', 'C1.hs', 'D1.hs', 'D2.hs']),
       cmd_prefix('ghciWayFlags=' + config.ghci_way_flags),
-      unless(opsys('mingw32') or (not config.have_ext_interp), extra_ways(['ghci-ext']))],
+      req_rts_linker,
+      unless(opsys('mingw32'), extra_ways(['ghci-ext']))],
      ghci_script, ['prog001.script'])
index 0a2b2f1..ae0e38c 100755 (executable)
 test('ghci001', combined_output, ghci_script, ['ghci001.script'])
 test('ghci002', combined_output, ghci_script, ['ghci002.script'])
 test('ghci003', combined_output, ghci_script, ['ghci003.script'])
-test('ghci004', [ combined_output,
-                  unless(opsys('mingw32') or (not config.have_ext_interp),extra_ways(['ghci-ext'])) ],
+test('ghci004', [ combined_output, req_rts_linker,
+                  unless(opsys('mingw32'),extra_ways(['ghci-ext'])) ],
                 ghci_script, ['ghci004.script'])
 test('ghci005', combined_output, ghci_script, ['ghci005.script'])
-test('ghci006', [ combined_output,
-                  unless(opsys('mingw32') or (not config.have_ext_interp),extra_ways(['ghci-ext'])) ],
+test('ghci006', [ combined_output, req_rts_linker,
+                  unless(opsys('mingw32'),extra_ways(['ghci-ext'])) ],
                 ghci_script, ['ghci006.script'])
 test('ghci007', combined_output, ghci_script, ['ghci007.script'])
 test('ghci008', [ combined_output,
index 879d2aa..3440f57 100644 (file)
@@ -24,7 +24,7 @@ test('Ppr023', ignore_stderr, makefile_test, ['ppr023'])
 test('Ppr024', ignore_stderr, makefile_test, ['ppr024'])
 test('Ppr025', ignore_stderr, makefile_test, ['ppr025'])
 test('Ppr026', ignore_stderr, makefile_test, ['ppr026'])
-test('Ppr027', ignore_stderr, makefile_test, ['ppr027'])
+test('Ppr027', [ignore_stderr, req_rts_linker], makefile_test, ['ppr027'])
 test('Ppr028', ignore_stderr, makefile_test, ['ppr028'])
 test('Ppr029', ignore_stderr, makefile_test, ['ppr029'])
 test('Ppr030', ignore_stderr, makefile_test, ['ppr030'])
@@ -37,22 +37,22 @@ test('Ppr036', ignore_stderr, makefile_test, ['ppr036'])
 test('Ppr037', ignore_stderr, makefile_test, ['ppr037'])
 test('Ppr038', ignore_stderr, makefile_test, ['ppr038'])
 test('Ppr039', ignore_stderr, makefile_test, ['ppr039'])
-test('Ppr040', ignore_stderr, makefile_test, ['ppr040'])
+test('Ppr040', [ignore_stderr, req_rts_linker], makefile_test, ['ppr040'])
 test('Ppr041', ignore_stderr, makefile_test, ['ppr041'])
 test('Ppr042', ignore_stderr, makefile_test, ['ppr042'])
-test('Ppr043', ignore_stderr, makefile_test, ['ppr043'])
+test('Ppr043', [ignore_stderr, req_rts_linker], makefile_test, ['ppr043'])
 test('Ppr044', ignore_stderr, makefile_test, ['ppr044'])
 test('Ppr045', ignore_stderr, makefile_test, ['ppr045'])
 test('Ppr046', ignore_stderr, makefile_test, ['ppr046'])
 test('Ppr047', expect_fail, makefile_test, ['ppr047'])
 test('Ppr048', ignore_stderr, makefile_test, ['ppr048'])
-test('T13199', ignore_stderr, makefile_test, ['T13199'])
+test('T13199', [ignore_stderr, req_rts_linker], makefile_test, ['T13199'])
 test('T13050p', ignore_stderr, makefile_test, ['T13050p'])
-test('T13550', ignore_stderr, makefile_test, ['T13550'])
-test('T13942', ignore_stderr, makefile_test, ['T13942'])
-test('T14289', ignore_stderr, makefile_test, ['T14289'])
-test('T14289b', ignore_stderr, makefile_test, ['T14289b'])
-test('T14289c', ignore_stderr, makefile_test, ['T14289c'])
+test('T13550', [ignore_stderr, req_rts_linker], makefile_test, ['T13550'])
+test('T13942', [ignore_stderr, req_rts_linker], makefile_test, ['T13942'])
+test('T14289', [ignore_stderr, req_rts_linker], makefile_test, ['T14289'])
+test('T14289b', [ignore_stderr, req_rts_linker], makefile_test, ['T14289b'])
+test('T14289c', [ignore_stderr, req_rts_linker], makefile_test, ['T14289c'])
 test('T14306', ignore_stderr, makefile_test, ['T14306'])
 test('T14343', normal, compile_fail, [''])
 test('T14343b', normal, compile_fail, [''])
index 331f7c1..23263d9 100644 (file)
@@ -6,7 +6,7 @@ test('T7918',
       only_ways([config.ghc_th_way]), unless(have_dynamic(), skip)],
      compile_and_run, ['-package ghc ' + config.ghc_th_way_flags])
 test('T14028',
-     [req_interp,
+     [req_interp, req_rts_linker,
       only_ways([config.ghc_th_way]),
       unless(config.have_ext_interp, skip),
       when(opsys('linux') and arch('x86_64'), expect_broken_for(17300, ['dyn']))],
index 36f63c5..33853dc 100644 (file)
@@ -395,6 +395,7 @@ test('keep-cafs',
     when(opsys('mingw32'), expect_broken (5987)),
     when(platform('powerpc64le-unknown-linux'), expect_broken(11261)),
     when(opsys('freebsd'), expect_broken(16035)),
+    req_rts_linker
   ],
   makefile_test, ['KeepCafs'])
 
index 2f1bb2b..d2bb589 100644 (file)
@@ -56,17 +56,14 @@ def checkDynAsm(actual_file, normaliser):
 # separately now.
 # These should have extra_clean() arguments, but I need
 # to somehow extract out the name of DLLs to do that
-test('T5435_v_asm_a', [extra_files(['T5435.hs', 'T5435_asm.c']),
-                       unless(config.have_RTS_linker, skip)],
+test('T5435_v_asm_a', [extra_files(['T5435.hs', 'T5435_asm.c']), req_rts_linker],
      makefile_test, ['T5435_v_asm_a'])
 # this one just needs to run on linux, as darwin/mingw32 are covered
 # by the _a test already.
-test('T5435_v_asm_b', [extra_files(['T5435.hs', 'T5435_asm.c']),
-                       unless(config.have_RTS_linker, skip),
-                      when(opsys('darwin') or opsys('mingw32'), skip)],
+test('T5435_v_asm_b', [extra_files(['T5435.hs', 'T5435_asm.c']), req_rts_linker,
+                       when(opsys('darwin') or opsys('mingw32'), skip)],
      makefile_test, ['T5435_v_asm_b'])
-test('T5435_v_gcc', [extra_files(['T5435.hs', 'T5435_gcc.c']),
-                     unless(config.have_RTS_linker, skip)],
+test('T5435_v_gcc', [extra_files(['T5435.hs', 'T5435_gcc.c']), req_rts_linker],
      makefile_test, ['T5435_v_gcc'])
 test('T5435_dyn_asm', [extra_files(['T5435.hs', 'T5435_asm.c']),
                        check_stdout(checkDynAsm)],
@@ -75,8 +72,7 @@ test('T5435_dyn_gcc', extra_files(['T5435.hs', 'T5435_gcc.c']) , makefile_test,
 
 ######################################
 test('linker_unload',
-     [extra_files(['LinkerUnload.hs', 'Test.hs']),
-      unless(config.have_RTS_linker, skip)],
+     [extra_files(['LinkerUnload.hs', 'Test.hs']), req_rts_linker],
      makefile_test, ['linker_unload'])
 
 ######################################
index 378177c..52f35b4 100644 (file)
@@ -1,4 +1,4 @@
 test('linker_unload_multiple_objs',
      [extra_files(['../LinkerUnload.hs', 'A.hs', 'B.hs', 'C.hs', 'D.hs',]),
-      unless(config.have_RTS_linker, skip)],
+      req_rts_linker],
      run_command, ['$MAKE -s --no-print-directory linker_unload_multiple_objs'])