summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-02-11 13:48:59 +0000
committerIan Lynagh <ian@well-typed.com>2013-02-11 13:48:59 +0000
commit240da00652d50fcd10f3062629cb561b04d19646 (patch)
tree0b063a86e0c41a642478a4a16adf5b5f88508988 /testsuite
parent3d94d01a9e6618e4ad82b1ad6386b0620538683d (diff)
downloadhaskell-240da00652d50fcd10f3062629cb561b04d19646.tar.gz
Replace 'if_os' and 'unless_os' with 'opsys'
The name 'os' clashes with a python library
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/driver/testlib.py13
-rw-r--r--testsuite/tests/concurrent/should_run/all.T4
-rw-r--r--testsuite/tests/driver/dynamicToo/all.T2
-rw-r--r--testsuite/tests/dynlibs/all.T4
-rw-r--r--testsuite/tests/ghc-api/dynCompileExpr/all.T2
-rw-r--r--testsuite/tests/ghci/linking/all.T8
-rw-r--r--testsuite/tests/ghci/should_run/all.T2
-rw-r--r--testsuite/tests/rts/all.T18
8 files changed, 22 insertions, 31 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 985a7b3b4f..08df6319f9 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -313,17 +313,8 @@ def unless(b, f):
def platform( plat ):
return config.platform == plat
-def if_os( os, f ):
- if config.os == os:
- return f
- else:
- return normal
-
-def unless_os( os, f ):
- if config.os == os:
- return normal
- else:
- return f
+def opsys( os ):
+ return config.os == os
def if_arch( arch, f ):
if config.arch == arch:
diff --git a/testsuite/tests/concurrent/should_run/all.T b/testsuite/tests/concurrent/should_run/all.T
index 97dc4b13a1..f0a68dea41 100644
--- a/testsuite/tests/concurrent/should_run/all.T
+++ b/testsuite/tests/concurrent/should_run/all.T
@@ -52,7 +52,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_os('linux',skip),
+ unless(opsys('linux'),skip),
if_compiler_lt('ghc', '7.1', expect_fail) ],
compile_and_run, [''])
@@ -171,7 +171,7 @@ test('conc036', skip, compile_and_run, [''])
# Interrupting foreign calls only makes sense if we are threaded
test('foreignInterruptible', [skip_if_fast,
- if_os('mingw32',expect_fail),
+ when(opsys('mingw32'),expect_fail),
# I don't think we support interrupting Sleep()
# on Windows. --SDM
only_threaded_ways,
diff --git a/testsuite/tests/driver/dynamicToo/all.T b/testsuite/tests/driver/dynamicToo/all.T
index b85ff318ec..25d48b05fb 100644
--- a/testsuite/tests/driver/dynamicToo/all.T
+++ b/testsuite/tests/driver/dynamicToo/all.T
@@ -6,7 +6,7 @@ test('dynamicToo001',
'A001.dyn_o', 'B001.dyn_o', 'C001.dyn_o',
'A001.dyn_hi', 'B001.dyn_hi', 'C001.dyn_hi',
's001', 'd001']),
- if_os('mingw32', expect_broken(7665)),
+ when(opsys('mingw32'), expect_broken(7665)),
unless_have_vanilla(skip),
unless_have_dynamic(skip)],
run_command,
diff --git a/testsuite/tests/dynlibs/all.T b/testsuite/tests/dynlibs/all.T
index 2877c50e19..6a9dfd9655 100644
--- a/testsuite/tests/dynlibs/all.T
+++ b/testsuite/tests/dynlibs/all.T
@@ -7,7 +7,7 @@ test('T3807',
'T3807-export.o', 'T3807-load.o',
'T3807test.so',
'T3807-load']),
- if_os('mingw32', skip)],
+ when(opsys('mingw32'), skip)],
run_command,
['$MAKE --no-print-directory -s T3807'])
@@ -16,7 +16,7 @@ test('T4464',
extra_clean(['T4464B.o', 'T4464C.o', 'T4464H.hi', 'T4464H.o',
'T4464H_stub.c', 'T4464H_stub.h', 'T4464H_stub.o',
'HS4464.dll', 'HS4464.dll.a', 't4464.exe']),
- unless_os('mingw32', skip)],
+ unless(opsys('mingw32'), skip)],
run_command,
['$MAKE --no-print-directory -s T4464'])
diff --git a/testsuite/tests/ghc-api/dynCompileExpr/all.T b/testsuite/tests/ghc-api/dynCompileExpr/all.T
index b466a3a59c..c6034eab6b 100644
--- a/testsuite/tests/ghc-api/dynCompileExpr/all.T
+++ b/testsuite/tests/ghc-api/dynCompileExpr/all.T
@@ -1,5 +1,5 @@
test('dynCompileExpr',
[ extra_run_opts('"' + config.libdir + '"'),
- if_os('mingw32', expect_broken_for(5987, ['dyn'])),
+ when(opsys('mingw32'), expect_broken_for(5987, ['dyn'])),
omit_ways(prof_ways) ], # cannot run interpreted code with -prof
compile_and_run, ['-package ghc'])
diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T
index bd87173c84..d4724ca1ee 100644
--- a/testsuite/tests/ghci/linking/all.T
+++ b/testsuite/tests/ghci/linking/all.T
@@ -12,8 +12,8 @@ test('ghcilink002',
test('ghcilink003',
[
- if_os('mingw32', expect_broken(5289)), # still cannot load libstdc++
- # on Windows. See also #4468.
+ # still cannot load libstdc++ on Windows. See also #4468.
+ when(opsys('mingw32'), expect_broken(5289)),
skip_if_no_ghci,
extra_clean(['dir003/*','dir003'])
],
@@ -34,8 +34,8 @@ test('ghcilink005',
test('ghcilink006',
[
- if_os('mingw32', expect_broken(5289)), # still cannot load libstdc++
- # on Windows. See also #4468.
+ # still cannot load libstdc++ on Windows. See also #4468.
+ when(opsys('mingw32'), expect_broken(5289)),
skip_if_no_ghci,
extra_clean(['dir006/*','dir006'])
],
diff --git a/testsuite/tests/ghci/should_run/all.T b/testsuite/tests/ghci/should_run/all.T
index a2552f6f93..fa03ac1167 100644
--- a/testsuite/tests/ghci/should_run/all.T
+++ b/testsuite/tests/ghci/should_run/all.T
@@ -12,7 +12,7 @@ test('T2589', just_ghci, compile_and_run, [''])
test('T2881', just_ghci, compile_and_run, [''])
test('T3171',
- [if_os('mingw32',skip),
+ [when(opsys('mingw32'),skip),
req_interp,
combined_output],
run_command,
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index 380ce85c9e..2276d3587d 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -19,11 +19,11 @@ test('derefnull',
# Apparently the output can be different on different
# Linux setups, so just ignore it. As long as we get
# the right exit code we're OK.
- if_os('linux', ignore_output),
+ when(opsys('linux'), ignore_output),
# SIGBUS on OX X (PPC and x86 only; amd64 gives SEGV)
when(platform('i386-apple-darwin'), exit_code(138)),
when(platform('powerpc-apple-darwin'), exit_code(138)),
- if_os('mingw32', exit_code(1))]),
+ when(opsys('mingw32'), exit_code(1))]),
compile_and_run, [''])
test('divbyzero',
composes([
@@ -33,11 +33,11 @@ test('divbyzero',
# Apparently the output can be different on different
# Linux setups, so just ignore it. As long as we get
# the right exit code we're OK.
- if_os('linux', ignore_output),
- if_os('mingw32', exit_code(1))]),
+ when(opsys('linux'), ignore_output),
+ when(opsys('mingw32'), exit_code(1))]),
compile_and_run, [''])
-test('outofmem', if_os('darwin', skip),
+test('outofmem', when(opsys('darwin'), skip),
run_command, ['$MAKE -s --no-print-directory outofmem'])
test('outofmem2', extra_run_opts('+RTS -M5m -RTS'),
run_command, ['$MAKE -s --no-print-directory outofmem2'])
@@ -80,11 +80,11 @@ test('rtsflags002', [ only_ways(['normal']) ], compile_and_run, ['-with-rtsopts=
# Test to see if linker scripts link properly to real ELF files
test('T2615',
- [ if_os('mingw32', skip),
+ [ when(opsys('mingw32'), skip),
# OS X doesn't seem to support linker scripts
- if_os('darwin', skip),
+ when(opsys('darwin'), skip),
# Solaris' linker does not support GNUish linker scripts
- if_os('solaris2', skip),
+ when(opsys('solaris2'), skip),
pre_cmd('$MAKE -s --no-print-directory T2615-prep'),
# Add current directory to dlopen search path
cmd_prefix('LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. '),
@@ -105,7 +105,7 @@ test('T4059',
# Test for #4274
test('exec_signals', [
- if_os('mingw32', skip),
+ when(opsys('mingw32'), skip),
pre_cmd('$MAKE -s --no-print-directory exec_signals-prep'),
cmd_prefix('./exec_signals_prepare'),
extra_clean(['exec_signals_child', 'exec_signals_prepare'])