Commit 57b71848 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

testsuite: Add assertions that way lists are in fact lists

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.
parent ca721193
Pipeline #7191 passed with stages
in 335 minutes and 6 seconds
......@@ -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, [''])
......@@ -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, [''])
......@@ -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 ):
......
......@@ -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',
......
......@@ -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']),
......
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, [''])
......
......@@ -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, [''])
......
......@@ -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, [''])
......
......@@ -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'])
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, [''])
......
......@@ -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, [''])
......
......@@ -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, [''])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment