I think you might have missed some cases:<div><br></div><div><div>====&gt; Scanning ../../libraries/directory/tests/all.T</div><div>*** framework failure: found an error while executing  ../../libraries/directory/tests/all.T :</div>

<div>Traceback (most recent call last):</div><div>  File &quot;../driver/runtests.py&quot;, line 251, in &lt;module&gt;</div><div>    execfile(file)</div><div>  File &quot;../../libraries/directory/tests/all.T&quot;, line 27, in &lt;module&gt;</div>

<div>    test(&#39;T4113&#39;, if_platform(&#39;i386-apple-darwin&#39;, expect_broken(7604)), compile_and_run, [&#39;&#39;])</div><div>NameError: name &#39;if_platform&#39; is not defined</div><div>====&gt; Scanning ../../libraries/base/tests/all.T</div>

<div>*** framework failure: found an error while executing  ../../libraries/base/tests/all.T :</div><div>Traceback (most recent call last):</div><div>  File &quot;../driver/runtests.py&quot;, line 251, in &lt;module&gt;</div>

<div>    execfile(file)</div><div>  File &quot;../../libraries/base/tests/all.T&quot;, line 12, in &lt;module&gt;</div><div>    if_platform(&#39;i386-unknown-openbsd&#39;, expect_fail),</div><div>NameError: name &#39;if_platform&#39; is not defined</div>

<div>====&gt; Scanning ../../libraries/base/tests/IO/all.T</div><div>*** framework failure: found an error while executing  ../../libraries/base/tests/IO/all.T :</div><div>Traceback (most recent call last):</div><div>  File &quot;../driver/runtests.py&quot;, line 251, in &lt;module&gt;</div>

<div>    execfile(file)</div><div>  File &quot;../../libraries/base/tests/IO/all.T&quot;, line 107, in &lt;module&gt;</div><div>    expect_fail_if_windows)), compile_and_run, [&#39;-package unix&#39;])</div><div>  File &quot;/Users/tibbe/src/ghc/testsuite/driver/testlib.py&quot;, line 651, in test</div>

<div>    setup(name, myTestOpts)</div><div>  File &quot;/Users/tibbe/src/ghc/testsuite/driver/testlib.py&quot;, line 587, in &lt;lambda&gt;</div><div>    return lambda name, opts, f=f, g=g: _compose(name, opts, f, g)</div>

<div>  File &quot;/Users/tibbe/src/ghc/testsuite/driver/testlib.py&quot;, line 591, in _compose</div><div>    g(name, opts)</div><div>  File &quot;/Users/tibbe/src/ghc/testsuite/driver/testlib.py&quot;, line 587, in &lt;lambda&gt;</div>

<div>    return lambda name, opts, f=f, g=g: _compose(name, opts, f, g)</div><div>  File &quot;/Users/tibbe/src/ghc/testsuite/driver/testlib.py&quot;, line 591, in _compose</div><div>    g(name, opts)</div><div>  File &quot;/Users/tibbe/src/ghc/testsuite/driver/testlib.py&quot;, line 587, in &lt;lambda&gt;</div>

<div>    return lambda name, opts, f=f, g=g: _compose(name, opts, f, g)</div><div>  File &quot;/Users/tibbe/src/ghc/testsuite/driver/testlib.py&quot;, line 591, in _compose</div><div>    g(name, opts)</div><div>TypeError: expect_fail_if_windows() takes exactly 1 argument (2 given)</div>

<div>====&gt; Scanning ../../libraries/base/tests/Numeric/all.T</div><div>*** framework failure: found an error while executing  ../../libraries/base/tests/Numeric/all.T :</div><div>Traceback (most recent call last):</div>

<div>  File &quot;../driver/runtests.py&quot;, line 251, in &lt;module&gt;</div><div>    execfile(file)</div><div>  File &quot;../../libraries/base/tests/Numeric/all.T&quot;, line 10, in &lt;module&gt;</div><div>    , if_platform(&#39;i386-apple-darwin&#39;, expect_broken(2370))</div>

<div>NameError: name &#39;if_platform&#39; is not defined</div><div><br></div><br><div class="gmail_quote">On Fri, Feb 8, 2013 at 6:19 AM, Ian Lynagh <span dir="ltr">&lt;<a href="mailto:igloo@earth.li" target="_blank">igloo@earth.li</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Repository : ssh://<a href="http://darcs.haskell.org//srv/darcs/testsuite" target="_blank">darcs.haskell.org//srv/darcs/testsuite</a><br>


<br>
On branch  : master<br>
<br>
<a href="http://hackage.haskell.org/trac/ghc/changeset/22951cdab93ab21dab9fe5597954b922c9c89a48" target="_blank">http://hackage.haskell.org/trac/ghc/changeset/22951cdab93ab21dab9fe5597954b922c9c89a48</a><br>
<br>
&gt;---------------------------------------------------------------<br>
<br>
commit 22951cdab93ab21dab9fe5597954b922c9c89a48<br>
Author: Ian Lynagh &lt;<a href="mailto:ian@well-typed.com">ian@well-typed.com</a>&gt;<br>
Date:   Fri Feb 8 00:38:42 2013 +0000<br>
<br>
    Replace &#39;if_platform&#39; and &#39;unless_platform&#39; with &#39;platform&#39;<br>
<br>
&gt;---------------------------------------------------------------<br>
<br>
 driver/testlib.py                  |   13 ++-----------<br>
 tests/codeGen/should_gen_asm/all.T |    6 +++---<br>
 tests/ffi/should_run/all.T         |    2 +-<br>
 tests/ghci/scripts/all.T           |    2 +-<br>
 tests/numeric/should_run/all.T     |    2 +-<br>
 tests/perf/compiler/all.T          |    6 +++---<br>
 tests/rts/all.T                    |   12 ++++++------<br>
 7 files changed, 17 insertions(+), 26 deletions(-)<br>
<br>
diff --git a/driver/testlib.py b/driver/testlib.py<br>
index 4c9b2c2..aa601f7 100644<br>
--- a/driver/testlib.py<br>
+++ b/driver/testlib.py<br>
@@ -312,17 +312,8 @@ def when(b, f):<br>
 def unless(b, f):<br>
     return when(not b, f)<br>
<br>
-def if_platform( plat, f ):<br>
-    if config.platform == plat:<br>
-        return f<br>
-    else:<br>
-        return normal<br>
-<br>
-def unless_platform( plat, f ):<br>
-    if config.platform != plat:<br>
-        return f<br>
-    else:<br>
-        return normal<br>
+def platform( plat ):<br>
+    return config.platform == plat<br>
<br>
 def if_os( os, f ):<br>
     if config.os == os:<br>
diff --git a/tests/codeGen/should_gen_asm/all.T b/tests/codeGen/should_gen_asm/all.T<br>
index a24ae31..be30d5f 100644<br>
--- a/tests/codeGen/should_gen_asm/all.T<br>
+++ b/tests/codeGen/should_gen_asm/all.T<br>
@@ -1,6 +1,6 @@<br>
 test(&#39;memcpy&#39;,<br>
-     unless_platform(&#39;x86_64-unknown-linux&#39;,skip), compile_cmp_asm, [&#39;&#39;])<br>
+     unless(platform(&#39;x86_64-unknown-linux&#39;),skip), compile_cmp_asm, [&#39;&#39;])<br>
 test(&#39;memcpy-unroll&#39;,<br>
-     unless_platform(&#39;x86_64-unknown-linux&#39;,skip), compile_cmp_asm, [&#39;&#39;])<br>
+     unless(platform(&#39;x86_64-unknown-linux&#39;),skip), compile_cmp_asm, [&#39;&#39;])<br>
 test(&#39;memcpy-unroll-conprop&#39;,<br>
-     unless_platform(&#39;x86_64-unknown-linux&#39;,skip), compile_cmp_asm, [&#39;&#39;])<br>
+     unless(platform(&#39;x86_64-unknown-linux&#39;),skip), compile_cmp_asm, [&#39;&#39;])<br>
diff --git a/tests/ffi/should_run/all.T b/tests/ffi/should_run/all.T<br>
index 1811f42..09e6944 100644<br>
--- a/tests/ffi/should_run/all.T<br>
+++ b/tests/ffi/should_run/all.T<br>
@@ -33,7 +33,7 @@ test(&#39;ffi004&#39;, skip, compile_and_run, [&#39;&#39;])<br>
 #<br>
 test(&#39;ffi005&#39;, [ omit_ways(prof_ways),<br>
                  if_arch(&#39;i386&#39;, skip),<br>
-                 if_platform(&#39;i386-apple-darwin&#39;, expect_broken(4105)),<br>
+                 when(platform(&#39;i386-apple-darwin&#39;), expect_broken(4105)),<br>
                  exit_code(3) ],<br>
                compile_and_run, [&#39;&#39;])<br>
<br>
diff --git a/tests/ghci/scripts/all.T b/tests/ghci/scripts/all.T<br>
index f204af7..0b8f62e 100755<br>
--- a/tests/ghci/scripts/all.T<br>
+++ b/tests/ghci/scripts/all.T<br>
@@ -38,7 +38,7 @@ test(&#39;ghci022&#39;, normal, ghci_script, [&#39;ghci022.script&#39;])<br>
 test(&#39;ghci023&#39;, normal, ghci_script, [&#39;ghci023.script&#39;])<br>
 test(&#39;ghci024&#39;,<br>
      [skip_if_fast,<br>
-      if_platform(&quot;powerpc-apple-darwin&quot;, expect_broken(1845))],<br>
+      when(platform(&quot;powerpc-apple-darwin&quot;), expect_broken(1845))],<br>
      run_command,<br>
      [&#39;$MAKE -s --no-print-directory ghci024&#39;])<br>
 test(&#39;ghci025&#39;, normal, ghci_script, [&#39;ghci025.script&#39;])<br>
diff --git a/tests/numeric/should_run/all.T b/tests/numeric/should_run/all.T<br>
index b2109de..d2f017a 100644<br>
--- a/tests/numeric/should_run/all.T<br>
+++ b/tests/numeric/should_run/all.T<br>
@@ -7,7 +7,7 @@ test(&#39;arith001&#39;, normal, compile_and_run, [&#39;&#39;])<br>
 test(&#39;arith002&#39;, normal, compile_and_run, [&#39;&#39;])<br>
 test(&#39;arith003&#39;, normal, compile_and_run, [&#39;&#39;])<br>
 test(&#39;arith004&#39;, normal, compile_and_run, [&#39;&#39;])<br>
-test(&#39;arith005&#39;, if_platform(&#39;i386-apple-darwin&#39;, expect_broken_for(7043, &#39;ghci&#39;)), compile_and_run, [&#39;&#39;])<br>
+test(&#39;arith005&#39;, when(platform(&#39;i386-apple-darwin&#39;), expect_broken_for(7043, &#39;ghci&#39;)), compile_and_run, [&#39;&#39;])<br>
 test(&#39;arith006&#39;, normal, compile_and_run, [&#39;&#39;])<br>
 test(&#39;arith007&#39;, normal, compile_and_run, [&#39;&#39;])<br>
<br>
diff --git a/tests/perf/compiler/all.T b/tests/perf/compiler/all.T<br>
index 09a0297..1ba4c15 100644<br>
--- a/tests/perf/compiler/all.T<br>
+++ b/tests/perf/compiler/all.T<br>
@@ -117,7 +117,7 @@ test(&#39;T4801&#39;,<br>
                    # 12/11/2012: 49 (amd64/Linux) (REASON UNKNOWN!)<br>
<br>
       # expected value: 58 (amd64/OS X):<br>
-      if_platform(&#39;x86_64-apple-darwin&#39;,<br>
+      when(platform(&#39;x86_64-apple-darwin&#39;),<br>
           compiler_stats_range_field(&#39;peak_megabytes_allocated&#39;, 58, 1)),<br>
       # expected value: 228286660 (x86/OS X)<br>
       when(wordsize(32),<br>
@@ -130,7 +130,7 @@ test(&#39;T4801&#39;,<br>
                    # 19/10/2012: 392409984 (amd64/Linux) (-fPIC turned off)<br>
<br>
       # expected value: 510938976 (amd64/OS X):<br>
-      if_platform(&#39;x86_64-apple-darwin&#39;,<br>
+      when(platform(&#39;x86_64-apple-darwin&#39;),<br>
           compiler_stats_range_field(&#39;bytes allocated&#39;, 510938976, 5)),<br>
<br>
       when(wordsize(32),<br>
@@ -144,7 +144,7 @@ test(&#39;T4801&#39;,<br>
                 # 19/10/2012: 26882576 (-fPIC turned on)<br>
                 # 19/10/2012: 18619912 (-fPIC turned off)<br>
                 # 24/12/2012: 21657520 (perhaps gc sampling time wibbles?)<br>
-      if_platform(&#39;x86_64-apple-darwin&#39;,<br>
+      when(platform(&#39;x86_64-apple-darwin&#39;),<br>
           compiler_stats_range_field(&#39;max_bytes_used&#39;, 21657520, 5)),<br>
        only_ways([&#39;normal&#39;]),<br>
        extra_hc_opts(&#39;-static&#39;)<br>
diff --git a/tests/rts/all.T b/tests/rts/all.T<br>
index 05510e9..380ce85 100644<br>
--- a/tests/rts/all.T<br>
+++ b/tests/rts/all.T<br>
@@ -9,7 +9,7 @@ test(&#39;testblockalloc&#39;, compose(c_src,<br>
 test(&#39;bug1010&#39;, normal, compile_and_run, [&#39;+RTS -c -RTS&#39;])<br>
 test(&#39;derefnull&#39;,<br>
      composes([<br>
-             if_platform(&#39;x86_64-unknown-mingw32&#39;, expect_broken(6079)),<br>
+             when(platform(&#39;x86_64-unknown-mingw32&#39;), expect_broken(6079)),<br>
              # LLVM Optimiser considers dereference of a null pointer<br>
              # undefined and marks the code as unreachable which means<br>
              # that later optimisations remove it altogether.<br>
@@ -21,13 +21,13 @@ test(&#39;derefnull&#39;,<br>
              # the right exit code we&#39;re OK.<br>
              if_os(&#39;linux&#39;, ignore_output),<br>
              # SIGBUS on OX X (PPC and x86 only; amd64 gives SEGV)<br>
-             if_platform(&#39;i386-apple-darwin&#39;, exit_code(138)),<br>
-             if_platform(&#39;powerpc-apple-darwin&#39;, exit_code(138)),<br>
+             when(platform(&#39;i386-apple-darwin&#39;), exit_code(138)),<br>
+             when(platform(&#39;powerpc-apple-darwin&#39;), exit_code(138)),<br>
              if_os(&#39;mingw32&#39;, exit_code(1))]),<br>
      compile_and_run, [&#39;&#39;])<br>
 test(&#39;divbyzero&#39;,<br>
      composes([<br>
-             if_platform(&#39;x86_64-unknown-mingw32&#39;, expect_broken(6079)),<br>
+             when(platform(&#39;x86_64-unknown-mingw32&#39;), expect_broken(6079)),<br>
              # SIGFPE on Linux<br>
              exit_code(136),<br>
              # Apparently the output can be different on different<br>
@@ -121,8 +121,8 @@ def config_T5250(name, opts):<br>
<br>
 test(&#39;T5250&#39;, [ config_T5250,<br>
                 # stack ptr is not 16-byte aligned on 32-bit Windows<br>
-                if_platform(&#39;i386-unknown-mingw32&#39;, expect_fail),<br>
-                if_platform(&#39;i386-unknown-linux&#39;,<br>
+                when(platform(&#39;i386-unknown-mingw32&#39;), expect_fail),<br>
+                when(platform(&#39;i386-unknown-linux&#39;),<br>
                             expect_broken_for(4211,[&#39;llvm&#39;])),<br>
                 extra_clean([&#39;spalign.o&#39;]),<br>
                 omit_ways([&#39;ghci&#39;]) ],<br>
<br>
<br>
<br>
_______________________________________________<br>
ghc-commits mailing list<br>
<a href="mailto:ghc-commits@haskell.org">ghc-commits@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-commits" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-commits</a><br>
</blockquote></div><br></div>