Record memory in kbytest, not bytes.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 10 Dec 2009 13:36:10 +0000 (13:36 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 10 Dec 2009 13:36:10 +0000 (13:36 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@4543 fdb21ef1-2011-0410-befe-b5e4ea1792b1

QMTest/TestSCons.py

index c172632521070e52af269e98e089526147c1163d..8ecc8b2df82543e8c4880e02e1fcd0c0ccd51846 100644 (file)
@@ -958,23 +958,29 @@ print py_ver
 
 
 class Graph:
-    def __init__(self, name, units, expression, sort=None):
+    def __init__(self, name, units, expression, sort=None, convert=None):
+        if convert is None:
+            convert = lambda x: x
         self.name = name
         self.units = units
         self.expression = re.compile(expression)
         self.sort = sort
+        self.convert = convert
 
 GraphList = [
     Graph('TimeSCons-elapsed', 'seconds',
           r'TimeSCons elapsed time:\s+([\d.]+)',
           sort=0),
 
-    Graph('memory-initial', 'bytes',
-          r'Memory before reading SConscript files:\s+(\d+)'),
-    Graph('memory-prebuild', 'bytes',
-          r'Memory before building targets:\s+(\d+)'),
-    Graph('memory-final', 'bytes',
-          r'Memory after building targets:\s+(\d+)'),
+    Graph('memory-initial', 'kbytes',
+          r'Memory before reading SConscript files:\s+(\d+)',
+          convert=lambda s: int(s) / 1024),
+    Graph('memory-prebuild', 'kbytes',
+          r'Memory before building targets:\s+(\d+)',
+          convert=lambda s: int(s) / 1024),
+    Graph('memory-final', 'kbytes',
+          r'Memory after building targets:\s+(\d+)',
+          convert=lambda s: int(s) / 1024),
 
     Graph('time-sconscript', 'seconds',
           r'Total SConscript file execution time:\s+([\d.]+) seconds'),
@@ -1081,7 +1087,10 @@ class TimeSCons(TestSCons):
         for graph in GraphList:
             m = graph.expression.search(input)
             if m:
-                self.trace(graph.name, trace, m.group(1), graph.units)
+                self.trace(graph.name,
+                           trace,
+                           graph.convert(m.group(1)),
+                           graph.units)
 
     def help(self, *args, **kw):
         """