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

Allow a simpler form of stats_num_field where all platforms use the same value

parent fba66334
......@@ -258,12 +258,16 @@ def _stats_num_field( name, opts, field, expecteds ):
if field in opts.stats_range_fields:
framework_fail(name, 'duplicate-numfield', 'Duplicate ' + field + ' num_field check')
for (b, expected, dev) in expecteds:
if b:
opts.stats_range_fields[field] = (expected, dev)
return
if type(expecteds) is types.ListType:
for (b, expected, dev) in expecteds:
if b:
opts.stats_range_fields[field] = (expected, dev)
return
framework_fail(name, 'numfield-no-expected', 'No expected value found for ' + field + ' in num_field check')
framework_fail(name, 'numfield-no-expected', 'No expected value found for ' + field + ' in num_field check')
else:
(expected, dev) = expecteds
opts.stats_range_fields[field] = (expected, dev)
def stats_range_field( field, expected, dev ):
return stats_num_field( field, [(True, expected, dev)] )
......
......@@ -57,8 +57,8 @@ test('T3736',
['$MAKE -s --no-print-directory T3736'])
test('T3738',
[extra_clean(['T3738a.hi', 'T3738a.o']),
stats_range_field('peak_megabytes_allocated', 1, 0),
# expected value: 1 (amd64/Linux)
stats_num_field('peak_megabytes_allocated', (1, 0)),
# expected value: 1 (amd64/Linux)
stats_num_field('bytes allocated',
[(wordsize(32), 45648, 5),
# expected value: 45648 (x86/Linux)
......
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