Commit 240da006 authored by ian@well-typed.com's avatar ian@well-typed.com

Replace 'if_os' and 'unless_os' with 'opsys'

The name 'os' clashes with a python library
parent 3d94d01a
......@@ -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:
......
......@@ -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,
......
......@@ -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,
......
......@@ -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'])
......
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'])
......@@ -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'])
],
......
......@@ -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,
......
......@@ -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'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment