[commit: testsuite] master: Allow a simpler form of stats_num_field where all platforms use the same value (6259d78)

Ian Lynagh igloo at earth.li
Fri Feb 8 01:08:59 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/6259d78582773a8fabae0f6edccc475e6921b013

>---------------------------------------------------------------

commit 6259d78582773a8fabae0f6edccc475e6921b013
Author: Ian Lynagh <ian at well-typed.com>
Date:   Thu Feb 7 23:36:55 2013 +0000

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

>---------------------------------------------------------------

 driver/testlib.py           |   14 +++++++++-----
 tests/perf/should_run/all.T |    4 ++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/driver/testlib.py b/driver/testlib.py
index c988434..4c9b2c2 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -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)] )
diff --git a/tests/perf/should_run/all.T b/tests/perf/should_run/all.T
index 6ec8523..4f45a70 100644
--- a/tests/perf/should_run/all.T
+++ b/tests/perf/should_run/all.T
@@ -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)





More information about the ghc-commits mailing list