Convert more helper functions
authorIan Lynagh <ian@well-typed.com>
Mon, 11 Feb 2013 15:07:12 +0000 (15:07 +0000)
committerIan Lynagh <ian@well-typed.com>
Mon, 11 Feb 2013 15:07:12 +0000 (15:07 +0000)
35 files changed:
testsuite/driver/testlib.py
testsuite/tests/annotations/should_compile/all.T
testsuite/tests/annotations/should_run/all.T
testsuite/tests/arrows/should_fail/all.T
testsuite/tests/concurrent/should_run/all.T
testsuite/tests/deSugar/should_compile/all.T
testsuite/tests/deSugar/should_run/all.T
testsuite/tests/gadt/all.T
testsuite/tests/ghc-e/should_run/all.T
testsuite/tests/ghci.debugger/scripts/all.T
testsuite/tests/ghci.debugger/scripts/break022/all.T
testsuite/tests/ghci.debugger/scripts/break023/all.T
testsuite/tests/ghci/linking/all.T
testsuite/tests/ghci/scripts/all.T
testsuite/tests/ghci/should_run/all.T
testsuite/tests/indexed-types/should_compile/all.T
testsuite/tests/indexed-types/should_fail/all.T
testsuite/tests/layout/all.T
testsuite/tests/module/all.T
testsuite/tests/module/base01/all.T
testsuite/tests/parser/should_compile/all.T
testsuite/tests/parser/should_fail/all.T
testsuite/tests/parser/should_run/all.T
testsuite/tests/perf/haddock/all.T
testsuite/tests/plugins/all.T
testsuite/tests/programs/life_space_leak/test.T
testsuite/tests/rename/should_compile/all.T
testsuite/tests/rts/all.T
testsuite/tests/simplCore/should_compile/all.T
testsuite/tests/th/T2014/all.T
testsuite/tests/th/TH_import_loop/TH_import_loop.T
testsuite/tests/th/TH_spliceViewPat/test.T
testsuite/tests/th/all.T
testsuite/tests/typecheck/should_compile/all.T
testsuite/tests/typecheck/should_fail/all.T

index 6f6ab4a..942a722 100644 (file)
@@ -348,75 +348,36 @@ def have_profiling( ):
 
 # ---
 
-def if_ghci_dynamic( f ):
-    if config.ghc_dynamic_by_default:
-        return f
-    else:
-        return normal
+def ghci_dynamic( ):
+    return config.ghc_dynamic_by_default
 
-def if_in_tree_compiler( f ):
-    if config.in_tree_compiler:
-        return f
-    else:
-        return normal
+def in_tree_compiler( ):
+    return config.in_tree_compiler
 
-def unless_in_tree_compiler( f ):
-    if config.in_tree_compiler:
-        return normal
-    else:
-        return f
+def compiler_type( compiler ):
+    return config.compiler_type == compiler
 
-def if_compiler_type( compiler, f ):
-    if config.compiler_type == compiler:
-        return f
-    else:
-        return normal
+def compiler_profiled( ):
+    return config.compiler_profiled
 
-def if_compiler_profiled( f ):
-    if config.compiler_profiled:
-        return f
-    else:
-        return normal
+def compiler_lt( compiler, version ):
+    return config.compiler_type == compiler and \
+           version_lt(config.compiler_version, version)
 
-def unless_compiler_profiled( f ):
-    if config.compiler_profiled:
-        return normal
-    else:
-        return f
+def compiler_le( compiler, version ):
+    return config.compiler_type == compiler and \
+           version_le(config.compiler_version, version)
 
-def if_compiler_lt( compiler, version, f ):
-    if config.compiler_type == compiler and \
-       version_lt(config.compiler_version, version):
-        return f
-    else:
-        return normal
+def compiler_gt( compiler, version ):
+    return config.compiler_type == compiler and \
+           version_gt(config.compiler_version, version)
 
-def if_compiler_le( compiler, version, f ):
-    if config.compiler_type == compiler and \
-       version_le(config.compiler_version, version):
-        return f
-    else:
-        return normal
+def compiler_ge( compiler, version ):
+    return config.compiler_type == compiler and \
+           version_ge(config.compiler_version, version)
 
-def if_compiler_gt( compiler, version, f ):
-    if config.compiler_type == compiler and \
-       version_gt(config.compiler_version, version):
-        return f
-    else:
-        return normal
-
-def if_compiler_ge( compiler, version, f ):
-    if config.compiler_type == compiler and \
-       version_ge(config.compiler_version, version):
-        return f
-    else:
-        return normal
-
-def if_compiler_debugged( f ):
-    if config.compiler_debugged:
-        return f
-    else:
-        return normal
+def compiler_debugged( ):
+    return config.compiler_debugged
 
 def namebase( nb ):
    return lambda opts, nb=nb: _namebase(opts, nb)
index e13c24e..1c6690b 100644 (file)
@@ -1,5 +1,5 @@
 
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 
 # Annotations, like Template Haskell, require runtime evaluation.  In
 # order for this to work with profiling, we would have to build the
index 871b409..6616de5 100644 (file)
@@ -1,4 +1,4 @@
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 # These tests are very slow due to their use of package GHC
 setTestOpts(skip_if_fast)
 
index 5579294..6b7920d 100644 (file)
@@ -1,7 +1,7 @@
 setTestOpts(only_compiler_types(['ghc']))
 
 test('arrowfail001',
-     if_compiler_debugged(expect_broken(5267)),
+     when(compiler_debugged(), expect_broken(5267)),
      compile_fail,
      [''])
  # arrowfail001 gets an ASSERT error in the stage1 compiler
index f0a68de..d5ceb72 100644 (file)
@@ -53,7 +53,7 @@ test('numsparks001', only_ways(['threaded1']), compile_and_run, [''])
 test('T4262', [ skip, # skip for now, it doesn't give reliable results
                 only_ways(['threaded1']),
                 unless(opsys('linux'),skip),
-                if_compiler_lt('ghc', '7.1', expect_fail) ],
+                when(compiler_lt('ghc', '7.1'), expect_fail) ],
               compile_and_run, [''])
 
 test('T4813', normal, compile_and_run, [''])
index 979b1e7..6328b30 100644 (file)
@@ -76,7 +76,7 @@ test('GadtOverlap', normal, compile, ['-Wall'])
 test('T2395', normal, compile, [''])
 test('T4371', normal, compile, [''])
 test('T4439', normal, compile, [''])
-test('T4488', if_compiler_lt('ghc', '7.1', expect_fail), compile, [''])
+test('T4488', when(compiler_lt('ghc', '7.1'), expect_fail), compile, [''])
 test('T4870',
      [only_ways(['optasm']),
       only_compiler_types(['ghc']),
index 7f0df9c..90d76a9 100644 (file)
@@ -38,5 +38,5 @@ test('mc06', normal, compile_and_run, [''])
 test('mc07', normal, compile_and_run, [''])
 test('mc08', normal, compile_and_run, [''])
 test('T5742', normal, compile_and_run, [''])
-test('DsLambdaCase', if_compiler_lt('ghc', '7.5', skip), compile_and_run, [''])
-test('DsMultiWayIf', if_compiler_lt('ghc', '7.5', skip), compile_and_run, [''])
+test('DsLambdaCase', when(compiler_lt('ghc', '7.5'), skip), compile_and_run, [''])
+test('DsMultiWayIf', when(compiler_lt('ghc', '7.5'), skip), compile_and_run, [''])
index 1b46565..d55aef6 100644 (file)
@@ -102,10 +102,10 @@ test('gadt25', normal, compile, [''])
 test('T3651', normal, compile_fail, [''])
 test('T3638', normal, compile, [''])
 
-test('gadtSyntax001', if_compiler_lt('ghc', '7.1', expect_fail), compile, [''])
-test('gadtSyntaxFail001', if_compiler_lt('ghc', '7.1', expect_fail), compile_fail, [''])
-test('gadtSyntaxFail002', if_compiler_lt('ghc', '7.1', expect_fail), compile_fail, [''])
-test('gadtSyntaxFail003', if_compiler_lt('ghc', '7.1', expect_fail), compile_fail, [''])
+test('gadtSyntax001', when(compiler_lt('ghc', '7.1'), expect_fail), compile, [''])
+test('gadtSyntaxFail001', when(compiler_lt('ghc', '7.1'), expect_fail), compile_fail, [''])
+test('gadtSyntaxFail002', when(compiler_lt('ghc', '7.1'), expect_fail), compile_fail, [''])
+test('gadtSyntaxFail003', when(compiler_lt('ghc', '7.1'), expect_fail), compile_fail, [''])
 test('T3169', normal, compile_fail, [''])
 test('T5424',
      extra_clean(['T5424a.hi', 'T5424a.o']),
index da14b70..4ab7567 100644 (file)
@@ -1,5 +1,5 @@
 
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 
 test('ghc-e001', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e001'])
 test('ghc-e002', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e002'])
@@ -8,7 +8,7 @@ test('ghc-e004', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e0
 test('ghc-e005', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e005'])
 
 test('T2228',
-     [req_interp, if_ghci_dynamic(expect_broken(7298))],
+     [req_interp, when(ghci_dynamic(), expect_broken(7298))],
      run_command,
      ['$MAKE --no-print-directory -s T2228'])
 test('T2636', req_interp, run_command, ['$MAKE --no-print-directory -s T2636'])
index 9eef1f6..76a8f0f 100644 (file)
@@ -1,5 +1,5 @@
 setTestOpts(composes([extra_run_opts('-ignore-dot-ghci'),
-                     if_compiler_profiled(skip),
+                     when(compiler_profiled(), skip),
                      normalise_slashes]))
 
 test('print001', normal, ghci_script, ['print001.script'])
@@ -36,7 +36,7 @@ test('print032', normal, ghci_script, ['print032.script'])
 test('print033', normal, ghci_script, ['print033.script'])
 test('print034', normal, ghci_script, ['print034.script'])
 test('print035',
-     if_ghci_dynamic(expect_broken(7326)),
+     when(ghci_dynamic(), expect_broken(7326)),
      ghci_script,
      ['print035.script'])
 
index d8cf081..497ad7e 100644 (file)
@@ -1,4 +1,4 @@
 setTestOpts(extra_run_opts('-ignore-dot-ghci'))
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 
 test('break022', extra_clean(['A.hs']), ghci_script, ['break022.script'])
index 0c33302..22b608e 100644 (file)
@@ -1,4 +1,4 @@
 setTestOpts(extra_run_opts('-ignore-dot-ghci'))
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 
 test('break023', extra_clean(['A.hs']), ghci_script, ['break023.script'])
index d4724ca..ce00b3e 100644 (file)
@@ -1,5 +1,5 @@
 test('ghcilink001',
-     [if_ghci_dynamic(expect_fail), # dynamic ghci can't load '.a's
+     [when(ghci_dynamic(), expect_fail), # dynamic ghci can't load '.a's
       skip_if_no_ghci,
       extra_clean(['dir001/*','dir001'])],
      run_command,
@@ -21,7 +21,7 @@ test('ghcilink003',
      ['$MAKE -s --no-print-directory ghcilink003'])
 
 test('ghcilink004',
-     [if_ghci_dynamic(expect_fail), # dynamic ghci can't load '.a's
+     [when(ghci_dynamic(), expect_fail), # dynamic ghci can't load '.a's
       skip_if_no_ghci,
       extra_clean(['dir004/*','dir004'])],
      run_command,
index 0b8f62e..e558bf6 100755 (executable)
@@ -1,6 +1,6 @@
 # coding=utf8
 
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 
 test('ghci001', combined_output, ghci_script, ['ghci001.script'])
 test('ghci002', combined_output, ghci_script, ['ghci002.script'])
index fa03ac1..f4d06a6 100644 (file)
@@ -1,5 +1,5 @@
 
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 
 # We only want to run these tests with GHCi
 def just_ghci( name, opts ):
index 019c5ac..a73f5fd 100644 (file)
@@ -159,7 +159,7 @@ test('T4484', normal, compile, [''])
 test('T4492', normal, compile, [''])
 test('T4494', normal, compile, [''])
 test('DataFamDeriv', normal, compile, [''])
-test('T1769', if_compiler_lt('ghc', '7.1', expect_fail), compile, [''])
+test('T1769', when(compiler_lt('ghc', '7.1'), expect_fail), compile, [''])
 test('T4497', normal, compile, [''])
 test('T3484', normal, compile, [''])
 test('T3460', normal, compile, [''])
index 19b05e6..e99b796 100644 (file)
@@ -65,7 +65,7 @@ test('T2239', normal, compile_fail, [''])
 test('T3440', normal, compile_fail, [''])
 test('T4485', normal, compile_fail, [''])
 test('T4174', normal, compile_fail, [''])
-test('DerivUnsatFam', if_compiler_lt('ghc', '7.1', expect_fail), compile_fail, [''])
+test('DerivUnsatFam', when(compiler_lt('ghc', '7.1'), expect_fail), compile_fail, [''])
 test('T2664', normal, compile_fail, [''])
 test('T2664a', normal, compile, [''])
 test('T2544', normal, compile_fail, [''])
index 026ad46..e8ed2fe 100644 (file)
@@ -39,7 +39,7 @@ test('layout007',
      [req_interp,
       extra_clean(['layout007.hi', 'layout007.o']),
       only_compiler_types(['ghc']),
-      if_compiler_profiled(skip)],
+      when(compiler_profiled(), skip)],
      run_command,
      ['$MAKE -s --no-print-directory layout007'])
 
index b8a5355..8eaa1d5 100644 (file)
@@ -251,7 +251,7 @@ test('mod150', normal, compile_fail, [''])
 test('mod151', normal, compile_fail, [''])
 test('mod152', normal, compile_fail, [''])
 test('mod153', normal, compile_fail, [''])
-test('mod154', if_compiler_type('hugs', expect_fail), compile, [''])
+test('mod154', when(compiler_type('hugs'), expect_fail), compile, [''])
 test('mod155', normal, compile_fail, [''])
 test('mod156', normal, compile, [''])
 test('mod157', 
index d0dbb29..6fa3e5c 100644 (file)
@@ -1,7 +1,7 @@
 setTestOpts(only_compiler_types(['ghc']))
 
 test('base01',
-     [if_compiler_lt('ghc', '7.1', expect_fail),
+     [when(compiler_lt('ghc', '7.1'), expect_fail),
       normalise_slashes,
       clean_cmd('$MAKE -s clean')],
      run_command,
index 9d3b4e6..b10cd2c 100644 (file)
@@ -45,8 +45,8 @@ test('read029', normal, compile, [''])
 test('read030', normal, compile, [''])
 test('read031', normal, compile, [''])
 test('read032', normal, compile, [''])
-test('read033', if_compiler_type('hugs', expect_fail), compile, [''])
-test('read034', if_compiler_type('hugs', expect_fail), compile, [''])
+test('read033', when(compiler_type('hugs'), expect_fail), compile, [''])
+test('read034', when(compiler_type('hugs'), expect_fail), compile, [''])
 test('read036', normal, compile, [''])
 test('read037', normal, compile, [''])
 test('read038', normal, compile, [''])
@@ -90,7 +90,7 @@ test('NondecreasingIndentation', normal, compile, [''])
 test('mc15', normal, compile, [''])
 test('mc16', normal, compile, [''])
 test('EmptyDecls', normal, compile, [''])
-test('ParserLambdaCase', if_compiler_lt('ghc', '7.5', skip), compile, [''])
+test('ParserLambdaCase', when(compiler_lt('ghc', '7.5'), skip), compile, [''])
 
 test('T5243', extra_clean(['T5243A.hi', 'T5243A.o']),
      multimod_compile, ['T5243',''])
index 114524a..a09b76d 100644 (file)
@@ -23,7 +23,7 @@ test('readFail020', normal, compile_fail, [''])
 # empty file (length zero) is not a legal Haskell module.  It fails to compile
 # because it doesn't contain a definition of Main.main.  GHC 5.02 crashed
 # on this example.
-test('readFail021', if_compiler_type('hugs', expect_fail), compile_fail, [''])
+test('readFail021', when(compiler_type('hugs'), expect_fail), compile_fail, [''])
 
 test('readFail022', normal, compile_fail, [''])
 test('readFail023', normal, compile_fail, [''])
@@ -72,8 +72,8 @@ test('NondecreasingIndentationFail', normal, compile_fail, [''])
 test('readFailTraditionalRecords1', normal, compile_fail, [''])
 test('readFailTraditionalRecords2', normal, compile_fail, [''])
 test('readFailTraditionalRecords3', normal, compile_fail, [''])
-test('ParserNoLambdaCase', if_compiler_lt('ghc', '7.5', skip), compile_fail, [''])
-test('ParserNoMultiWayIf', if_compiler_lt('ghc', '7.5', skip), compile_fail, [''])
+test('ParserNoLambdaCase', when(compiler_lt('ghc', '7.5'), skip), compile_fail, [''])
+test('ParserNoMultiWayIf', when(compiler_lt('ghc', '7.5'), skip), compile_fail, [''])
 
 test('T5425', normal, compile_fail, [''])
 test('T984', normal, compile_fail, [''])
index 03951a1..eee0330 100644 (file)
@@ -5,4 +5,4 @@ test('readRun004', normal, compile_and_run, ['-fobject-code'])
 test('T1344', normal, compile_and_run, [''])
 test('operator', normal, compile_and_run, [''])
 test('operator2', normal, compile_and_run, [''])
-test('ParserMultiWayIf', if_compiler_lt('ghc', '7.5', skip), compile_and_run, [''])
+test('ParserMultiWayIf', when(compiler_lt('ghc', '7.5'), skip), compile_and_run, [''])
index baeb180..f8238df 100644 (file)
@@ -1,6 +1,6 @@
 
 test('haddock.base',
-     [unless_in_tree_compiler(skip)
+     [unless(in_tree_compiler(), skip)
      ,stats_num_field('peak_megabytes_allocated',
           [(wordsize(64), 274, 10)
             # 2012-08-14: 240 (amd64/Linux)
@@ -41,7 +41,7 @@ test('haddock.base',
      ['../../../../libraries/base/dist-install/doc/html/base/base.haddock.t'])
 
 test('haddock.Cabal',
-     [unless_in_tree_compiler(skip)
+     [unless(in_tree_compiler(), skip)
      ,stats_num_field('peak_megabytes_allocated',
           [(wordsize(64), 217, 10)
             # 2012-08-14: 202 (amd64/Linux)
@@ -80,7 +80,7 @@ test('haddock.Cabal',
      ['../../../../libraries/Cabal/Cabal/dist-install/doc/html/Cabal/Cabal.haddock.t'])
 
 test('haddock.compiler',
-     [unless_in_tree_compiler(skip)
+     [unless(in_tree_compiler(), skip)
      ,stats_num_field('peak_megabytes_allocated',
           [(wordsize(64), 1240, 10)
             # 2012-08-14: 1203 (amd64/Linux)
index 2f0fc44..874fcdb 100644 (file)
@@ -3,7 +3,7 @@ def f(name, opts):
        opts.skip = 1
 
 setTestOpts(f)
-setTestOpts(if_compiler_lt('ghc', '7.1', skip))
+setTestOpts(when(compiler_lt('ghc', '7.1'), skip))
 
 test('plugins01',
      [pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01'),
index 417342f..a0cdc2c 100644 (file)
@@ -2,7 +2,7 @@
 test('life_space_leak',
      [skip_if_fast,
       extra_clean(['Main.hi', 'Main.o']),
-      if_compiler_type('hugs', expect_fail)],
+      when(compiler_type('hugs'), expect_fail)],
      multimod_compile_and_run,
      ['Main', ''])
 
index a1f1965..db1f491 100644 (file)
@@ -161,7 +161,7 @@ test('T4240',
      ['$MAKE -s --no-print-directory T4240'])
 
 test('T4489', normal, compile, [''])
-test('T4478', if_compiler_lt('ghc', '7.1', expect_fail), compile, [''])
+test('T4478', when(compiler_lt('ghc', '7.1'), expect_fail), compile, [''])
 test('T4534', normal, compile, [''])
 
 test('mc09', normal, compile, [''])
index 2276d35..8da87aa 100644 (file)
@@ -51,7 +51,7 @@ test('T2783', [ omit_ways(['ghci']), exit_code(1) ], compile_and_run, [''])
 
 # Test the work-stealing deque implementation.  We run this test in
 # both threaded1 (-threaded -debug) and threaded2 (-threaded) ways.
-test('testwsdeque', [unless_in_tree_compiler(skip),
+test('testwsdeque', [unless(in_tree_compiler(), skip),
                     c_src, only_ways(['threaded1', 'threaded2'])],
                     compile_and_run, ['-I../../../rts'])
 
index 5787149..765a128 100644 (file)
@@ -64,7 +64,7 @@ test('T4908', only_ways(['optasm']),
               compile,
               ['-O2 -ddump-simpl -dsuppress-uniques'])
 
-test('T4930', [if_compiler_lt('ghc', '7.1', expect_fail),
+test('T4930', [when(compiler_lt('ghc', '7.1'), expect_fail),
                only_ways(['optasm'])],
               compile,
               ['-O -ddump-simpl -dsuppress-uniques'])
@@ -109,7 +109,7 @@ test('T4918',
      ['$MAKE -s --no-print-directory T4918'])
 
 test('T4945',
-     if_compiler_lt('ghc', '7.1', expect_fail),
+     when(compiler_lt('ghc', '7.1'), expect_fail),
      run_command,
      ['$MAKE -s --no-print-directory T4945'])
 
index 212690d..77709c2 100644 (file)
@@ -1,4 +1,4 @@
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 
 test('T2014',
      [req_interp,
index 37059e1..8a4a180 100644 (file)
@@ -1,5 +1,5 @@
 
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 
 test('TH_import_loop',
      [extra_clean(['ModuleA.o-boot', 'ModuleA.hi-boot',
index b177c07..23b4f6a 100644 (file)
@@ -6,7 +6,7 @@ def f(name, opts):
 setTestOpts(f)
 setTestOpts(only_compiler_types(['ghc']))
 setTestOpts(only_ways(['normal','ghci']))
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 
 test('TH_spliceViewPat',
      extra_clean(['Main.o', 'Main.hi', 'A.o', 'A.hi']),
index e9c6c08..caaa3df 100644 (file)
@@ -1,7 +1,7 @@
 
 # This test needs to come before the setTestOpts calls below, as we want
-# to run it !if_compiler_profiled
-test('T4255', unless_compiler_profiled(skip), compile_fail, ['-v0'])
+# to run it if !compiler_profiled
+test('T4255', unless(compiler_profiled(), skip), compile_fail, ['-v0'])
 
 def f(name, opts):
   opts.extra_hc_opts = '-XTemplateHaskell -package template-haskell'
@@ -11,7 +11,7 @@ def f(name, opts):
 setTestOpts(f)
 setTestOpts(only_compiler_types(['ghc']))
 setTestOpts(only_ways(['normal','ghci']))
-setTestOpts(if_compiler_profiled(skip))
+setTestOpts(when(compiler_profiled(), skip))
 
 test('TH_mkName', normal, compile, ['-v0'])
 test('TH_1tuple', normal, compile_fail, ['-v0'])
index da91233..0fdb2ad 100644 (file)
@@ -84,7 +84,7 @@ test('tc079', normal, compile, [''])
 test('tc080', normal, compile, [''])
 test('tc081', normal, compile, [''])
 test('tc082', normal, compile, [''])
-test('tc084', if_compiler_type('hugs', expect_fail), compile, [''])
+test('tc084', when(compiler_type('hugs'), expect_fail), compile, [''])
 test('tc085', only_compiler_types(['ghc']), compile, [''])
 test('tc086', normal, compile, [''])
 test('tc087', normal, compile, [''])
@@ -96,7 +96,7 @@ test('tc092', normal, compile, [''])
 test('tc093', normal, compile, [''])
 test('tc094', normal, compile, [''])
 test('tc095', normal, compile, [''])
-test('tc096', if_compiler_type('hugs', expect_fail), compile, [''])
+test('tc096', when(compiler_type('hugs'), expect_fail), compile, [''])
 test('tc097', normal, compile, [''])
 test('tc098', normal, compile, [''])
 test('tc099', normal, compile, [''])
@@ -380,7 +380,7 @@ test('T6055', normal, compile, [''])
 test('DfltProb1', normal, compile, [''])
 test('DfltProb2', normal, compile, [''])
 test('T6134', normal, compile, [''])
-test('TcLambdaCase', if_compiler_lt('ghc', '7.5', skip), compile, [''])
+test('TcLambdaCase', when(compiler_lt('ghc', '7.5'), skip), compile, [''])
 test('T7147', normal, compile, [''])
 test('T7171',normal,run_command,
      ['$MAKE -s --no-print-directory T7171'])
index 1241e58..9cffd3d 100644 (file)
@@ -24,7 +24,7 @@ test('tcfail023', normal, compile_fail, [''])
 test('tcfail027', normal, compile_fail, [''])
 test('tcfail028', normal, compile_fail, [''])
 test('tcfail029', normal, compile_fail, [''])
-test('tcfail030', if_compiler_type('hugs', expect_fail), compile_fail, [''])
+test('tcfail030', when(compiler_type('hugs'), expect_fail), compile_fail, [''])
 test('tcfail031', normal, compile_fail, [''])
 test('tcfail032', normal, compile_fail, [''])
 test('tcfail033', normal, compile_fail, [''])
@@ -278,7 +278,7 @@ test('FDsFromGivens', normal, compile_fail, [''])
 test('T7019', normal, compile_fail,[''])
 test('T7019a', normal, compile_fail,[''])
 test('T5978', normal, compile_fail, [''])
-test('TcMultiWayIfFail', if_compiler_lt('ghc', '7.5', skip), compile_fail, [''])
+test('TcMultiWayIfFail', when(compiler_lt('ghc', '7.5'), skip), compile_fail, [''])
 test('T2534', normal, compile_fail, [''])
 test('T7175', normal, compile_fail, [''])
 test('T7210', normal, compile_fail, [''])