Commit 27df8a62 authored by Ian Lynagh's avatar Ian Lynagh

Add an if_compiler_profiled helper

and use it to skip the th, ghci and debugger tests when GHC is profiled.
parent 82aa866a
......@@ -120,12 +120,22 @@ threaded_ways = filter(lambda x: x in config.run_ways,
def get_compiler_info():
# This should really not go through the shell
h = os.popen('"' + config.compiler + '" --numeric-version', 'r')
v = h.read()
h = os.popen('"' + config.compiler + '" --info', 'r')
s = h.read()
h.close()
v = re.sub('[\r\n]', '', v)
v = v.split('-')
compilerInfoDict = dict(eval(s))
h = os.popen('"' + config.compiler + '" +RTS --info', 'r')
s = h.read()
h.close()
rtsInfoDict = dict(eval(s))
v = compilerInfoDict["Project version"].split('-')
config.compiler_version = v[0]
config.compiler_maj_version = re.sub('^([0-9]+\.[0-9]+).*',r'\1', v[0])
config.compiler_tags = v[1:]
if re.match(".*_p(_.*|$)", rtsInfoDict["RTS way"]):
config.compiler_profiled = True
else:
config.compiler_profiled = False
......@@ -292,6 +292,12 @@ def if_compiler_type( compiler, f ):
else:
return normal
def if_compiler_profiled( f ):
if config.compiler_profiled:
return f
else:
return normal
def if_compiler_lt( compiler, version, f ):
if config.compiler_type == compiler and \
version_lt(config.compiler_version, version):
......
setTestOpts(composes([extra_run_opts('-ignore-dot-ghci'), normalise_slashes]))
setTestOpts(composes([extra_run_opts('-ignore-dot-ghci'),
if_compiler_profiled(skip),
normalise_slashes]))
test('print001', normal, ghci_script, ['print001.script'])
test('print002', normal, ghci_script, ['print002.script'])
......
setTestOpts(extra_run_opts('-ignore-dot-ghci'))
setTestOpts(extra_run_opts('-ignore-dot-ghci'), if_compiler_profiled(skip))
test('break022', normal, ghci_script, ['break022.script'])
setTestOpts(extra_run_opts('-ignore-dot-ghci'))
setTestOpts(extra_run_opts('-ignore-dot-ghci'), if_compiler_profiled(skip))
test('break023', normal, ghci_script, ['break023.script'])
setTestOpts(if_compiler_profiled(skip))
test('ghci001', normal, ghci_script, ['ghci001.script'])
test('ghci002', normal, ghci_script, ['ghci002.script'])
test('ghci003', normal, ghci_script, ['ghci003.script'])
......
setTestOpts(if_compiler_profiled(skip))
test('2014',
extra_clean(['A.hi-boot','A.hi','A.o','A.o-boot',
'B.hi', 'B.o', 'C.hi', 'C.o']),
......
setTestOpts(if_compiler_profiled(skip))
test('TH_import_loop', expect_broken(1012), multimod_compile_and_run, ['Main', '-v0'])
......@@ -6,6 +6,7 @@ def f(opts):
setTestOpts(f)
setTestOpts(only_compiler_types(['ghc']))
setTestOpts(only_ways(['normal']));
setTestOpts(if_compiler_profiled(skip))
test('TH_recompile',
[expect_broken(481),
......
......@@ -6,6 +6,7 @@ def f(opts):
setTestOpts(f)
setTestOpts(only_compiler_types(['ghc']))
setTestOpts(only_ways(['normal','ghci']))
setTestOpts(if_compiler_profiled(skip))
test('TH_mkName', normal, compile, ['-v0'])
test('TH_1tuple', normal, compile_fail, ['-v0'])
......
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