More conversions
authorIan Lynagh <ian@well-typed.com>
Mon, 11 Feb 2013 15:47:02 +0000 (15:47 +0000)
committerIan Lynagh <ian@well-typed.com>
Mon, 11 Feb 2013 15:47:02 +0000 (15:47 +0000)
testsuite/driver/testlib.py
testsuite/tests/ghci/linking/all.T
testsuite/tests/rename/should_fail/all.T

index 89d6c2e..8a627f4 100644 (file)
@@ -293,12 +293,6 @@ def _compiler_stats_num_field( name, opts, field, expecteds ):
 
 # -----
 
-def skip_if_no_ghci(name, opts):
-    if not ('ghci' in config.run_ways):
-        opts.skip = 1
-
-# ----
-
 def when(b, f):
     # When list_brokens is on, we want to see all expect_broken calls,
     # so we always do f
@@ -313,6 +307,9 @@ def unless(b, f):
 def fast():
     return config.fast
 
+def doing_ghci():
+    return 'ghci' in config.run_ways
+
 def platform( plat ):
     return config.platform == plat
 
index ce00b3e..2360030 100644 (file)
@@ -1,12 +1,12 @@
 test('ghcilink001',
      [when(ghci_dynamic(), expect_fail), # dynamic ghci can't load '.a's
-      skip_if_no_ghci,
+      unless(doing_ghci, skip),
       extra_clean(['dir001/*','dir001'])],
      run_command,
      ['$MAKE -s --no-print-directory ghcilink001'])
 
 test('ghcilink002',
-     [skip_if_no_ghci, extra_clean(['dir002/*','dir002'])],
+     [unless(doing_ghci, skip), extra_clean(['dir002/*','dir002'])],
      run_command,
      ['$MAKE -s --no-print-directory ghcilink002'])
 
@@ -14,7 +14,7 @@ test('ghcilink003',
      [
        # still cannot load libstdc++ on Windows.  See also #4468.
        when(opsys('mingw32'), expect_broken(5289)),
-       skip_if_no_ghci,
+       unless(doing_ghci, skip),
        extra_clean(['dir003/*','dir003'])
      ],
      run_command,
@@ -22,13 +22,13 @@ test('ghcilink003',
 
 test('ghcilink004',
      [when(ghci_dynamic(), expect_fail), # dynamic ghci can't load '.a's
-      skip_if_no_ghci,
+      unless(doing_ghci, skip),
       extra_clean(['dir004/*','dir004'])],
      run_command,
      ['$MAKE -s --no-print-directory ghcilink004'])
 
 test('ghcilink005',
-     [skip_if_no_ghci, extra_clean(['dir005/*','dir005'])],
+     [unless(doing_ghci, skip), extra_clean(['dir005/*','dir005'])],
      run_command,
      ['$MAKE -s --no-print-directory ghcilink005'])
 
@@ -36,7 +36,7 @@ test('ghcilink006',
      [
        # still cannot load libstdc++ on Windows.  See also #4468.
        when(opsys('mingw32'), expect_broken(5289)),
-       skip_if_no_ghci,
+       unless(doing_ghci, skip),
        extra_clean(['dir006/*','dir006'])
      ],
      run_command,
index 4ced172..c05662b 100644 (file)
@@ -44,7 +44,7 @@ test('rnfail040',
 test('rnfail041', normal, compile_fail, [''])
 test('rnfail042', normal, compile_fail, [''])
 
-test('rnfail043', skip_if_no_ghci, compile_fail, ['-v0'])
+test('rnfail043', unless(doing_ghci, skip), compile_fail, ['-v0'])
 test('rnfail044', normal, compile_fail, [''])
 test('rnfail045', normal, compile_fail, [''])
 test('rnfail046', normal, compile_fail, [''])