[Git][ghc/ghc][master] testsuite: Add assertions that way lists are in fact lists

Marge Bot gitlab at gitlab.haskell.org
Sun Jun 16 03:34:29 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
57b71848 by Ben Gamari at 2019-06-16T03:34:25Z
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.

- - - - -


12 changed files:

- libraries/base/tests/Numeric/all.T
- libraries/base/tests/all.T
- testsuite/driver/testlib.py
- testsuite/tests/codeGen/should_compile/all.T
- testsuite/tests/concurrent/should_run/all.T
- testsuite/tests/dependent/should_compile/all.T
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/primops/should_run/all.T
- testsuite/tests/quasiquotation/all.T
- testsuite/tests/roles/should_compile/all.T
- testsuite/tests/rts/all.T
- testsuite/tests/simplCore/should_run/all.T


Changes:

=====================================
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, [''])


=====================================
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, [''])


=====================================
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 ):


=====================================
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',


=====================================
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']),


=====================================
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, [''])


=====================================
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, [''])
 


=====================================
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, [''])


=====================================
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'])


=====================================
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, [''])


=====================================
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, [''])


=====================================
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, [''])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/57b718481d5363ab33df4c7814f74897418f79d7

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/57b718481d5363ab33df4c7814f74897418f79d7
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190615/b25ddf0b/attachment-0001.html>


More information about the ghc-commits mailing list