summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-06-13 20:21:03 -0400
committerBen Gamari <ben@smart-cactus.org>2019-06-14 12:57:31 -0400
commit0336d838882bd07ceca8a2024a3f1f8009021890 (patch)
treee9f0bb77b178b8676c57a9767f76fee94c95b3aa
parentb4ff741e3d6419695f369b722f9be890f1ff237c (diff)
downloadhaskell-wip/check-testsuite-modifiers.tar.gz
testsuite: Add assertions that way lists are in fact listswip/check-testsuite-modifiers
Previously there were a few cases where operations like `omit_ways` were incorrectly passed a single way (e.g. `omit_ways('threaded2')`). This won't work as the author expected.
-rw-r--r--libraries/base/tests/Numeric/all.T2
-rw-r--r--libraries/base/tests/all.T2
-rw-r--r--testsuite/driver/testlib.py6
-rw-r--r--testsuite/tests/codeGen/should_compile/all.T2
-rw-r--r--testsuite/tests/concurrent/should_run/all.T2
-rw-r--r--testsuite/tests/dependent/should_compile/all.T14
-rw-r--r--testsuite/tests/numeric/should_run/all.T2
-rw-r--r--testsuite/tests/primops/should_run/all.T2
-rw-r--r--testsuite/tests/quasiquotation/all.T4
-rw-r--r--testsuite/tests/roles/should_compile/all.T14
-rw-r--r--testsuite/tests/rts/all.T2
-rw-r--r--testsuite/tests/simplCore/should_run/all.T2
12 files changed, 30 insertions, 24 deletions
diff --git a/libraries/base/tests/Numeric/all.T b/libraries/base/tests/Numeric/all.T
index 9969a5552a..74d4c06514 100644
--- a/libraries/base/tests/Numeric/all.T
+++ b/libraries/base/tests/Numeric/all.T
@@ -13,7 +13,7 @@ test('num009', [ when(fast(), skip)
, when(platform('powerpc64le-unknown-linux'), expect_broken(13634))],
compile_and_run, [opts])
test('num010',
- when(platform('i386-apple-darwin'), expect_broken_for(7043, 'ghci')),
+ when(platform('i386-apple-darwin'), expect_broken_for(7043, ['ghci'])),
compile_and_run,
[''])
test('sqrt', normal, compile_and_run, [''])
diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T
index 0fd97610d0..3345f76a9d 100644
--- a/libraries/base/tests/all.T
+++ b/libraries/base/tests/all.T
@@ -249,5 +249,5 @@ test('T14425', normal, compile_and_run, [''])
test('T10412', normal, compile_and_run, [''])
test('T13896', normal, compile_and_run, [''])
test('T13167', fragile_for(16536, ['threaded2']), compile_and_run, [''])
-test('T15349', [exit_code(1), expect_broken_for(15349, 'ghci')], compile_and_run, [''])
+test('T15349', [exit_code(1), expect_broken_for(15349, ['ghci'])], compile_and_run, [''])
test('T16111', exit_code(1), compile_and_run, [''])
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 9ec39267d6..e37bf5d49b 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -204,6 +204,7 @@ def use_specs( specs ):
['A B', '-O -prof -fno-prof-count-entries -v0'])
"""
+ assert isinstance(specs, dict)
return lambda name, opts, s=specs: _use_specs( name, opts, s )
def _use_specs( name, opts, specs ):
@@ -213,6 +214,7 @@ def _use_specs( name, opts, specs ):
# -----
def expect_fail_for( ways ):
+ assert isinstance(ways, list)
return lambda name, opts, w=ways: _expect_fail_for( name, opts, w )
def _expect_fail_for( name, opts, ways ):
@@ -228,6 +230,7 @@ def _expect_broken( name, opts, bug ):
opts.expect = 'fail';
def expect_broken_for( bug, ways ):
+ assert isinstance(ways, list)
return lambda name, opts, b=bug, w=ways: _expect_broken_for( name, opts, b, w )
def _expect_broken_for( name, opts, bug, ways ):
@@ -271,6 +274,7 @@ def fragile_for( bug, ways ):
# -----
def omit_ways( ways ):
+ assert isinstance(ways, list)
return lambda name, opts, w=ways: _omit_ways( name, opts, w )
def _omit_ways( name, opts, ways ):
@@ -280,6 +284,7 @@ def _omit_ways( name, opts, ways ):
# -----
def only_ways( ways ):
+ assert isinstance(ways, list)
return lambda name, opts, w=ways: _only_ways( name, opts, w )
def _only_ways( name, opts, ways ):
@@ -288,6 +293,7 @@ def _only_ways( name, opts, ways ):
# -----
def extra_ways( ways ):
+ assert isinstance(ways, list)
return lambda name, opts, w=ways: _extra_ways( name, opts, w )
def _extra_ways( name, opts, ways ):
diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T
index ed7f5f3699..5f5b8a208f 100644
--- a/testsuite/tests/codeGen/should_compile/all.T
+++ b/testsuite/tests/codeGen/should_compile/all.T
@@ -45,7 +45,7 @@ test('T14999',
# Verify that we optimize away redundant jumps for unordered comparisons.
test('T15196',
[ unless(arch('x86_64'), skip),
- only_ways('normal'),
+ only_ways(['normal']),
], makefile_test, [])
test('T15723',
diff --git a/testsuite/tests/concurrent/should_run/all.T b/testsuite/tests/concurrent/should_run/all.T
index d770b4d593..b548f57f5a 100644
--- a/testsuite/tests/concurrent/should_run/all.T
+++ b/testsuite/tests/concurrent/should_run/all.T
@@ -239,7 +239,7 @@ test('conc067', ignore_stdout, compile_and_run, [''])
# omit threaded2, the behaviour of this test is non-deterministic with more
# than one CPU.
-test('conc068', [ omit_ways(['threaded2']), exit_code(1) ], compile_and_run, [''])
+test('conc068', [ omit_ways(concurrent_ways), exit_code(1) ], compile_and_run, [''])
test('setnumcapabilities001',
[ only_ways(['threaded1','threaded2']),
diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T
index 6a848cfc3d..a3fc4aca6e 100644
--- a/testsuite/tests/dependent/should_compile/all.T
+++ b/testsuite/tests/dependent/should_compile/all.T
@@ -1,10 +1,10 @@
-test('Dep1', only_ways('normal'), compile, [''])
-test('Dep2', only_ways('normal'), compile, [''])
-test('Dep3', only_ways('normal'), compile, [''])
-test('KindEqualities', only_ways('normal'), compile, [''])
-test('KindEqualities2', only_ways('normal'), compile, [''])
-test('Rae31', only_ways('normal'), compile, [''])
-test('RAE_T32b', only_ways('normal'), compile, [''])
+test('Dep1', only_ways(['normal']), compile, [''])
+test('Dep2', only_ways(['normal']), compile, [''])
+test('Dep3', only_ways(['normal']), compile, [''])
+test('KindEqualities', only_ways(['normal']), compile, [''])
+test('KindEqualities2', only_ways(['normal']), compile, [''])
+test('Rae31', only_ways(['normal']), compile, [''])
+test('RAE_T32b', only_ways(['normal']), compile, [''])
test('KindLevels', normal, compile, [''])
test('RaeBlogPost', normal, compile, [''])
test('mkGADTVars', normal, compile, [''])
diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T
index cf2e2ea8d6..de1f5bef14 100644
--- a/testsuite/tests/numeric/should_run/all.T
+++ b/testsuite/tests/numeric/should_run/all.T
@@ -7,7 +7,7 @@ test('arith001', normal, compile_and_run, [''])
test('arith002', normal, compile_and_run, [''])
test('arith003', normal, compile_and_run, [''])
test('arith004', normal, compile_and_run, [''])
-test('arith005', when(platform('i386-apple-darwin'), expect_broken_for(7043, 'ghci')), compile_and_run, [''])
+test('arith005', when(platform('i386-apple-darwin'), expect_broken_for(7043, ['ghci'])), compile_and_run, [''])
test('arith006', normal, compile_and_run, [''])
test('arith007', normal, compile_and_run, [''])
diff --git a/testsuite/tests/primops/should_run/all.T b/testsuite/tests/primops/should_run/all.T
index e03cfd8a97..6f5a04c5ed 100644
--- a/testsuite/tests/primops/should_run/all.T
+++ b/testsuite/tests/primops/should_run/all.T
@@ -8,7 +8,7 @@ test('T4442',
test('T10481', exit_code(1), compile_and_run, [''])
test('T10678',
[ collect_stats('bytes allocated',5),
- only_ways('normal')
+ only_ways(['normal'])
],
compile_and_run, ['-O'])
test('T11296', normal, compile_and_run, [''])
diff --git a/testsuite/tests/quasiquotation/all.T b/testsuite/tests/quasiquotation/all.T
index 96471f50fc..a48b0f102f 100644
--- a/testsuite/tests/quasiquotation/all.T
+++ b/testsuite/tests/quasiquotation/all.T
@@ -3,8 +3,8 @@ test('T4150', [expect_broken(4150)], makefile_test, ['T4150'])
test('T5204', req_interp, compile_fail, [''])
test('T7918',
[req_interp, extra_run_opts('"' + config.libdir + '"'),
- only_ways(config.ghc_th_way), unless(have_dynamic(), skip)],
+ only_ways([config.ghc_th_way]), unless(have_dynamic(), skip)],
compile_and_run, ['-package ghc ' + config.ghc_th_way_flags])
test('T14028',
- [req_interp, only_ways(config.ghc_th_way)],
+ [req_interp, only_ways([config.ghc_th_way])],
makefile_test, ['T14028'])
diff --git a/testsuite/tests/roles/should_compile/all.T b/testsuite/tests/roles/should_compile/all.T
index 064202e73f..1e8599eaf3 100644
--- a/testsuite/tests/roles/should_compile/all.T
+++ b/testsuite/tests/roles/should_compile/all.T
@@ -1,12 +1,12 @@
setTestOpts(normalise_version('base','ghc-prim'))
-test('Roles1', only_ways('normal'), compile, ['-ddump-tc -fprint-explicit-foralls -dsuppress-uniques'])
-test('Roles2', only_ways('normal'), compile, ['-ddump-tc -fprint-explicit-foralls -dsuppress-uniques'])
-test('Roles3', only_ways('normal'), compile, ['-ddump-tc -dsuppress-uniques'])
-test('Roles4', only_ways('normal'), compile, ['-ddump-tc -dsuppress-uniques'])
-test('Roles13', only_ways('normal'), compile, ['-ddump-simpl -dsuppress-uniques'])
-test('Roles14', only_ways('normal'), compile, ['-ddump-tc -dsuppress-uniques'])
-test('T8958', [normalise_fun(normalise_errmsg), only_ways('normal')], compile, ['-ddump-tc -dsuppress-uniques -fprint-typechecker-elaboration'])
+test('Roles1', only_ways(['normal']), compile, ['-ddump-tc -fprint-explicit-foralls -dsuppress-uniques'])
+test('Roles2', only_ways(['normal']), compile, ['-ddump-tc -fprint-explicit-foralls -dsuppress-uniques'])
+test('Roles3', only_ways(['normal']), compile, ['-ddump-tc -dsuppress-uniques'])
+test('Roles4', only_ways(['normal']), compile, ['-ddump-tc -dsuppress-uniques'])
+test('Roles13', only_ways(['normal']), compile, ['-ddump-simpl -dsuppress-uniques'])
+test('Roles14', only_ways(['normal']), compile, ['-ddump-tc -dsuppress-uniques'])
+test('T8958', [normalise_fun(normalise_errmsg), only_ways(['normal'])], compile, ['-ddump-tc -dsuppress-uniques -fprint-typechecker-elaboration'])
test('T10263', normal, compile, [''])
test('T9204b', [], multimod_compile, ['T9204b', '-v0'])
test('T14101', normal, compile, [''])
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index 173ed7c601..9f2c064f9b 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -316,7 +316,7 @@ test('T11788', when(ghc_dynamic(), skip),
test('T10296a', [req_smp], makefile_test, ['T10296a'])
-test('T10296b', [only_ways('threaded2')], compile_and_run, [''])
+test('T10296b', [only_ways(['threaded2'])], compile_and_run, [''])
test('numa001', [ extra_run_opts('8'), unless(unregisterised(), extra_ways(['debug_numa'])) ]
, compile_and_run, [''])
diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T
index 9ec45e05b0..0d27d11d7f 100644
--- a/testsuite/tests/simplCore/should_run/all.T
+++ b/testsuite/tests/simplCore/should_run/all.T
@@ -86,7 +86,7 @@ test('T14868',
compile_and_run, [''])
test('T14894', [when((arch('powerpc64') or arch('powerpc64le')), expect_broken(11261))], compile_and_run, [''])
test('T14965', normal, compile_and_run, [''])
-test('T15114', only_ways('optasm'), compile_and_run, [''])
+test('T15114', only_ways(['optasm']), compile_and_run, [''])
test('T15436', normal, compile_and_run, [''])
test('T15840', normal, compile_and_run, [''])
test('T15840a', normal, compile_and_run, [''])