Commit b4d34260 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Merge branch 'master' of mac:ghc/git/val64/testsuite

parents eaae2a0c 2a24c3c1
......@@ -195,8 +195,8 @@ class TestOptions:
# ('bytes allocated',
# 9300000000,
# 9400000000)
self.compiler_stats_num_fields = []
self.stats_num_fields = []
self.compiler_stats_num_fields = {}
self.stats_num_fields = {}
# should we run this test alone, i.e. not run it in parallel with
# any other threads
......
......@@ -224,13 +224,17 @@ def stats_num_field( field, min, max ):
return lambda opts, f=field, x=min, y=max: _stats_num_field(opts, f, x, y);
def _stats_num_field( opts, f, x, y ):
opts.stats_num_fields = opts.stats_num_fields + [(f, x, y)]
# copy the dictionary, as the config gets shared between all tests
opts.stats_num_fields = opts.stats_num_fields.copy()
opts.stats_num_fields[f] = (x, y)
def compiler_stats_num_field( field, min, max ):
return lambda opts, f=field, x=min, y=max: _compiler_stats_num_field(opts, f, x, y);
def _compiler_stats_num_field( opts, f, x, y ):
opts.compiler_stats_num_fields = opts.compiler_stats_num_fields + [(f, x, y)]
# copy the dictionary, as the config gets shared between all tests
opts.compiler_stats_num_fields = opts.compiler_stats_num_fields.copy()
opts.compiler_stats_num_fields[f] = (x, y)
# -----
......@@ -907,12 +911,12 @@ def multi_compile_and_run( name, way, top_mod, extra_mods, extra_hc_opts ):
def checkStats(stats_file, num_fields):
result = passed()
if num_fields != []:
if len(num_fields) > 0:
f = open(in_testdir(stats_file))
contents = f.read()
f.close()
for (field, min, max) in num_fields:
for (field, (min, max)) in num_fields.items():
m = re.search('\("' + field + '", "([0-9]+)"\)', contents)
if m == None:
print 'Failed to find field: ', field
......@@ -978,7 +982,7 @@ def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link, addsuf,
to_do = '-c' # just compile
stats_file = name + '.comp.stats'
if opts.compiler_stats_num_fields != []:
if len(opts.compiler_stats_num_fields) > 0:
extra_hc_opts += ' +RTS -V0 -t' + stats_file + ' --machine-readable -RTS'
if getTestOpts().compile_cmd_prefix == '':
......@@ -1054,7 +1058,7 @@ def simple_run( name, way, prog, args ):
my_rts_flags = rts_flags(way)
stats_file = name + '.stats'
if opts.stats_num_fields != []:
if len(opts.stats_num_fields) > 0:
args += ' +RTS -V0 -t' + stats_file + ' --machine-readable -RTS'
if opts.no_stdin:
......
......@@ -82,27 +82,35 @@ test('T4801',
if_wordsize(32,
compiler_stats_num_field('peak_megabytes_allocated', 30, 40)),
# expected value: 52 (amd64/Linux):
# expected value: 72 (out of date) (amd64/OS X):
if_wordsize(64,
compiler_stats_num_field('peak_megabytes_allocated', 50, 60)),
compiler_stats_num_field('peak_megabytes_allocated', 50, 54)),
# expected value: 64 (amd64/OS X):
if_platform('x86_64-apple-darwin',
compiler_stats_num_field('peak_megabytes_allocated', 62, 66)),
# expected value: 353463196 (x86/Windows)
if_wordsize(32,
compiler_stats_num_field('bytes allocated', 330000000,
370000000)),
# expected value: 458700632 (amd64/Linux):
# expected value: 813714032 (out of date) (amd64/OS X):
if_wordsize(64,
compiler_stats_num_field('bytes allocated', 400000000,
500000000)),
compiler_stats_num_field('bytes allocated', 440000000,
480000000)),
# expected value: 510938976 (amd64/OS X):
if_platform('x86_64-apple-darwin',
compiler_stats_num_field('bytes allocated', 490000000,
530000000)),
# expected value: 14181360 (x86/Linux)
if_wordsize(32,
compiler_stats_num_field('max_bytes_used', 11000000,
14000000)),
# expected value: 18188272 (amd64/Linux, bindist)
# expected value: 7189848 (wrong?) (amd64/Linux, intree):
# expected value: 18188272 (amd64/Linux)
if_wordsize(64,
compiler_stats_num_field('max_bytes_used', 15000000,
20000000)),
# expected value: 23097936 (amd64/OS X):
if_platform('x86_64-apple-darwin',
compiler_stats_num_field('max_bytes_used', 21000000,
25000000)),
only_ways(['normal'])
],
compile,
......
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