testsuite: Don't run tests requiring TH in profasm way when GhcDynamic
authorBen Gamari <ben@smart-cactus.org>
Tue, 11 Jun 2019 19:56:07 +0000 (15:56 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 12 Jun 2019 12:27:25 +0000 (08:27 -0400)
Since we can't load profiled objects when GhcDynamic==YES. Affects:

* T16737
* T16384
* T16718
* T16619
* T16190

testsuite/driver/testlib.py
testsuite/tests/driver/all.T
testsuite/tests/parser/should_compile/all.T
testsuite/tests/perf/compiler/all.T
testsuite/tests/quotes/all.T
testsuite/tests/roles/should_compile/all.T

index 442d90d..9ec3926 100644 (file)
@@ -434,6 +434,14 @@ def unless(b, f):
 def doing_ghci():
     return 'ghci' in config.run_ways
 
+def requires_th(name, opts):
+    """
+    Mark a test as requiring TemplateHaskell. Currently this means
+    that we don't run the test in the profasm when when GHC is
+    dynamically-linked since we can't load profiled objects in this case.
+    """
+    return when(ghc_dynamic(), omit_ways(['profasm']))
+
 def ghc_dynamic():
     return config.ghc_dynamic
 
index d1e74a9..a3f33c5 100644 (file)
@@ -272,5 +272,7 @@ test('inline-check', omit_ways(['hpc', 'profasm'])
 test('T14452', [], makefile_test, [])
 test('T15396', normal, compile_and_run, ['-package ghc'])
 test('T16737',
-     [extra_files(['T16737include/']), expect_broken_for(16541, ['ghci'])],
+     [extra_files(['T16737include/']),
+      requires_th,
+      expect_broken_for(16541, ['ghci'])],
      compile_and_run, ['-optP=-isystem -optP=T16737include'])
index fdb35c4..8ea9cce 100644 (file)
@@ -142,5 +142,5 @@ test('T15457', normal, compile, [''])
 test('T15675', normal, compile, [''])
 test('T15781', normal, compile, [''])
 test('T16339', normal, compile, [''])
-test('T16619', [], multimod_compile, ['T16619', '-v0'])
+test('T16619', requires_th, multimod_compile, ['T16619', '-v0'])
 test('T504', normal, compile, [''])
index 39aed75..40b5e26 100644 (file)
@@ -404,7 +404,7 @@ test ('WWRec',
       ['-v0 -O'])
 
 test('T16190',
-      collect_stats(),
+      [requires_th, collect_stats()],
       multimod_compile,
       ['T16190.hs', '-v0'])
 
index d5bdda0..18c4247 100644 (file)
@@ -15,7 +15,7 @@ test('T8633', normal, compile_and_run, [''])
 test('T8759a', normal, compile, ['-v0'])
 test('T9824', normal, compile, ['-v0'])
 test('T10384', normal, compile_fail, [''])
-test('T16384', normal, compile, [''])
+test('T16384', requires_th, compile, [''])
 
 test('TH_tf2', normal, compile, ['-v0'])
 test('TH_ppr1', normal, compile_and_run, [''])
index ae4a490..064202e 100644 (file)
@@ -10,4 +10,4 @@ test('T8958', [normalise_fun(normalise_errmsg), only_ways('normal')], compile, [
 test('T10263', normal, compile, [''])
 test('T9204b', [], multimod_compile, ['T9204b', '-v0'])
 test('T14101', normal, compile, [''])
-test('T16718', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
+test('T16718', requires_th, compile, ['-v0 -ddump-splices -dsuppress-uniques'])