[commit: testsuite] master: More conversions (4bcc9b9)

Ian Lynagh igloo at earth.li
Mon Feb 11 17:34:52 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/4bcc9b96b65dd6e8937187aeb00be545fd613894

>---------------------------------------------------------------

commit 4bcc9b96b65dd6e8937187aeb00be545fd613894
Author: Ian Lynagh <ian at well-typed.com>
Date:   Mon Feb 11 15:47:02 2013 +0000

    More conversions

>---------------------------------------------------------------

 driver/testlib.py              |    9 +++------
 tests/ghci/linking/all.T       |   12 ++++++------
 tests/rename/should_fail/all.T |    2 +-
 3 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/driver/testlib.py b/driver/testlib.py
index 89d6c2e..8a627f4 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -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
 
diff --git a/tests/ghci/linking/all.T b/tests/ghci/linking/all.T
index ce00b3e..2360030 100644
--- a/tests/ghci/linking/all.T
+++ b/tests/ghci/linking/all.T
@@ -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,
diff --git a/tests/rename/should_fail/all.T b/tests/rename/should_fail/all.T
index 4ced172..c05662b 100644
--- a/tests/rename/should_fail/all.T
+++ b/tests/rename/should_fail/all.T
@@ -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, [''])





More information about the ghc-commits mailing list