summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2019-06-27 11:46:20 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-09 22:58:48 -0400
commitd7423f1096b5415928ba1d1d621e066ef4e5b641 (patch)
treee2af0c2c313cc6601d671afd420d90316914dfea
parent7f8bf98ea5b726d3f874faf23d4934765ed1116b (diff)
downloadhaskell-d7423f1096b5415928ba1d1d621e066ef4e5b641.tar.gz
Testsuite tweaks and refactoring
- Rename requires_th to req_th for consistency with other req functions (e.g. req_interp, req_profiling etc.) - req_th (previously requires_th) now checks for interpreter (via req_interp). With this running TH tests are skipped when running the test suite with stage=1. - Test tweaks: - T9360a, T9360b: Use req_interp - recomp009, T13938, RAE_T32a: Use req_th - Fix check-makefiles linter: it now looks for Makefiles instead of .T files (which are actually Python files)
-rwxr-xr-x.gitlab/linters/check-makefiles.py2
-rw-r--r--testsuite/driver/testlib.py18
-rw-r--r--testsuite/tests/dependent/should_compile/all.T2
-rw-r--r--testsuite/tests/dependent/should_fail/all.T2
-rw-r--r--testsuite/tests/driver/all.T6
-rw-r--r--testsuite/tests/driver/recomp009/all.T2
-rw-r--r--testsuite/tests/parser/should_compile/all.T2
-rw-r--r--testsuite/tests/perf/compiler/all.T2
-rw-r--r--testsuite/tests/quotes/all.T2
-rw-r--r--testsuite/tests/roles/should_compile/all.T2
10 files changed, 21 insertions, 19 deletions
diff --git a/.gitlab/linters/check-makefiles.py b/.gitlab/linters/check-makefiles.py
index b647f6c1c5..19b7b56368 100755
--- a/.gitlab/linters/check-makefiles.py
+++ b/.gitlab/linters/check-makefiles.py
@@ -13,7 +13,7 @@ from linter import run_linters, RegexpLinter
linters = [
RegexpLinter(r'--interactive',
message = "Warning: Use `$(TEST_HC_OPTS_INTERACTIVE)` instead of `--interactive -ignore-dot-ghci -v0`."
- ).add_path_filter(lambda path: path.suffix == '.T')
+ ).add_path_filter(lambda path: path.name == 'Makefile')
]
if __name__ == '__main__':
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 2e87925fda..d220110a6b 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -184,6 +184,16 @@ def req_interp( name, opts ):
if not config.have_interp:
opts.expect = 'fail'
+def req_th( name, opts ):
+ """
+ Mark a test as requiring TemplateHaskell. In addition to having interpreter
+ support, 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.
+ """
+ req_interp(name, opts)
+ return when(ghc_dynamic(), omit_ways(['profasm']))
+
def req_smp( name, opts ):
if not config.have_smp:
opts.expect = 'fail'
@@ -453,14 +463,6 @@ def unless(b: bool, f):
def doing_ghci() -> bool:
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() -> bool:
return config.ghc_dynamic
diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T
index a3fc4aca6e..bbc32c8115 100644
--- a/testsuite/tests/dependent/should_compile/all.T
+++ b/testsuite/tests/dependent/should_compile/all.T
@@ -41,7 +41,7 @@ test('T12742', normal, compile, [''])
# (2) Build the program twice: once with -dynamic, and then
# with -prof using -osuf to set a different object file suffix.
test('T13910', [expect_broken_for(16537, ['optasm']), omit_ways(['profasm'])], compile, [''])
-test('T13938', [extra_files(['T13938a.hs'])], makefile_test, ['T13938'])
+test('T13938', [req_th, extra_files(['T13938a.hs'])], makefile_test, ['T13938'])
test('T14556', normal, compile, [''])
test('T14720', normal, compile, [''])
test('T14066a', normal, compile, [''])
diff --git a/testsuite/tests/dependent/should_fail/all.T b/testsuite/tests/dependent/should_fail/all.T
index 1e6ab40b09..97580ce1cd 100644
--- a/testsuite/tests/dependent/should_fail/all.T
+++ b/testsuite/tests/dependent/should_fail/all.T
@@ -1,5 +1,5 @@
test('DepFail1', normal, compile_fail, [''])
-test('RAE_T32a', normal, compile_fail, [''])
+test('RAE_T32a', req_th, compile_fail, [''])
test('TypeSkolEscape', normal, compile_fail, ['-fprint-explicit-runtime-reps'])
test('BadTelescope', normal, compile_fail, [''])
test('BadTelescope2', normal, compile_fail, [''])
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index a3f33c567f..b2187a2517 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -227,8 +227,8 @@ test('T365',
[pre_cmd('touch test_preprocessor.txt'), unless(opsys('mingw32'), skip)],
compile_fail, [''])
-test('T9360a', normal, run_command, ['{compiler} --interactive -e "" -ignore-dot-ghci'])
-test('T9360b', normal, run_command, ['{compiler} -e "" --interactive -ignore-dot-ghci'])
+test('T9360a', req_interp, run_command, ['{compiler} --interactive -e "" -ignore-dot-ghci'])
+test('T9360b', req_interp, run_command, ['{compiler} -e "" --interactive -ignore-dot-ghci'])
test('T10970', normal, compile_and_run, [''])
test('T4931', normal, compile_and_run, [''])
@@ -273,6 +273,6 @@ test('T14452', [], makefile_test, [])
test('T15396', normal, compile_and_run, ['-package ghc'])
test('T16737',
[extra_files(['T16737include/']),
- requires_th,
+ req_th,
expect_broken_for(16541, ['ghci'])],
compile_and_run, ['-optP=-isystem -optP=T16737include'])
diff --git a/testsuite/tests/driver/recomp009/all.T b/testsuite/tests/driver/recomp009/all.T
index 5e20e09110..33c36f7ea3 100644
--- a/testsuite/tests/driver/recomp009/all.T
+++ b/testsuite/tests/driver/recomp009/all.T
@@ -1,3 +1,3 @@
# Test for #481, a recompilation bug with Template Haskell
-test('recomp009', [extra_files(['Main.hs', 'Sub1.hs', 'Sub2.hs'])], makefile_test, [])
+test('recomp009', [req_th, extra_files(['Main.hs', 'Sub1.hs', 'Sub2.hs'])], makefile_test, [])
diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T
index ef76f3ac52..3d44e22510 100644
--- a/testsuite/tests/parser/should_compile/all.T
+++ b/testsuite/tests/parser/should_compile/all.T
@@ -142,6 +142,6 @@ test('T15457', normal, compile, [''])
test('T15675', normal, compile, [''])
test('T15781', normal, compile, [''])
test('T16339', normal, compile, [''])
-test('T16619', requires_th, multimod_compile, ['T16619', '-v0'])
+test('T16619', req_th, multimod_compile, ['T16619', '-v0'])
test('T504', normal, compile, [''])
test('T515', literate, compile, ['-Wall'])
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index 40b5e268f0..cfc860d0b0 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -404,7 +404,7 @@ test ('WWRec',
['-v0 -O'])
test('T16190',
- [requires_th, collect_stats()],
+ [req_th, collect_stats()],
multimod_compile,
['T16190.hs', '-v0'])
diff --git a/testsuite/tests/quotes/all.T b/testsuite/tests/quotes/all.T
index 18c4247ed1..feefc41433 100644
--- a/testsuite/tests/quotes/all.T
+++ b/testsuite/tests/quotes/all.T
@@ -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', requires_th, compile, [''])
+test('T16384', req_th, compile, [''])
test('TH_tf2', normal, compile, ['-v0'])
test('TH_ppr1', normal, compile_and_run, [''])
diff --git a/testsuite/tests/roles/should_compile/all.T b/testsuite/tests/roles/should_compile/all.T
index 1e8599eaf3..b74f704f23 100644
--- a/testsuite/tests/roles/should_compile/all.T
+++ b/testsuite/tests/roles/should_compile/all.T
@@ -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', requires_th, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
+test('T16718', req_th, compile, ['-v0 -ddump-splices -dsuppress-uniques'])