[commit: testsuite] master: Replace 'if_platform' and 'unless_platform' with 'platform' (22951cd)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[commit: testsuite] master: Replace 'if_platform' and 'unless_platform' with 'platform' (22951cd)

Johan Tibell-2
I think you might have missed some cases:

====> Scanning ../../libraries/directory/tests/all.T
*** framework failure: found an error while executing
 ../../libraries/directory/tests/all.T :
Traceback (most recent call last):
  File "../driver/runtests.py", line 251, in <module>
    execfile(file)
  File "../../libraries/directory/tests/all.T", line 27, in <module>
    test('T4113', if_platform('i386-apple-darwin', expect_broken(7604)),
compile_and_run, [''])
NameError: name 'if_platform' is not defined
====> Scanning ../../libraries/base/tests/all.T
*** framework failure: found an error while executing
 ../../libraries/base/tests/all.T :
Traceback (most recent call last):
  File "../driver/runtests.py", line 251, in <module>
    execfile(file)
  File "../../libraries/base/tests/all.T", line 12, in <module>
    if_platform('i386-unknown-openbsd', expect_fail),
NameError: name 'if_platform' is not defined
====> Scanning ../../libraries/base/tests/IO/all.T
*** framework failure: found an error while executing
 ../../libraries/base/tests/IO/all.T :
Traceback (most recent call last):
  File "../driver/runtests.py", line 251, in <module>
    execfile(file)
  File "../../libraries/base/tests/IO/all.T", line 107, in <module>
    expect_fail_if_windows)), compile_and_run, ['-package unix'])
  File "/Users/tibbe/src/ghc/testsuite/driver/testlib.py", line 651, in test
    setup(name, myTestOpts)
  File "/Users/tibbe/src/ghc/testsuite/driver/testlib.py", line 587, in
<lambda>
    return lambda name, opts, f=f, g=g: _compose(name, opts, f, g)
  File "/Users/tibbe/src/ghc/testsuite/driver/testlib.py", line 591, in
_compose
    g(name, opts)
  File "/Users/tibbe/src/ghc/testsuite/driver/testlib.py", line 587, in
<lambda>
    return lambda name, opts, f=f, g=g: _compose(name, opts, f, g)
  File "/Users/tibbe/src/ghc/testsuite/driver/testlib.py", line 591, in
_compose
    g(name, opts)
  File "/Users/tibbe/src/ghc/testsuite/driver/testlib.py", line 587, in
<lambda>
    return lambda name, opts, f=f, g=g: _compose(name, opts, f, g)
  File "/Users/tibbe/src/ghc/testsuite/driver/testlib.py", line 591, in
_compose
    g(name, opts)
TypeError: expect_fail_if_windows() takes exactly 1 argument (2 given)
====> Scanning ../../libraries/base/tests/Numeric/all.T
*** framework failure: found an error while executing
 ../../libraries/base/tests/Numeric/all.T :
Traceback (most recent call last):
  File "../driver/runtests.py", line 251, in <module>
    execfile(file)
  File "../../libraries/base/tests/Numeric/all.T", line 10, in <module>
    , if_platform('i386-apple-darwin', expect_broken(2370))
NameError: name 'if_platform' is not defined


On Fri, Feb 8, 2013 at 6:19 AM, Ian Lynagh <igloo at earth.li> wrote:

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

Reply | Threaded
Open this post in threaded view
|

[commit: testsuite] master: Replace 'if_platform' and 'unless_platform' with 'platform' (22951cd)

Ian Lynagh-2
On Fri, Feb 08, 2013 at 05:04:04PM -0800, Johan Tibell wrote:
> I think you might have missed some cases:
>
> ====> Scanning ../../libraries/directory/tests/all.T
> *** framework failure: found an error while executing
>  ../../libraries/directory/tests/all.T :

These should already be fixed, e.g. by

    commit 35f024f8b99590b525166f770fab328522f7a610
    Author: Ian Lynagh <ian at well-typed.com>
    Date:   Fri Feb 8 19:55:52 2013 +0000

    Follow testsuite changes

If you have that patch and are still having problems, please let me
know.


Thanks
Ian