From 1576454b8066cd248bdaf0f9c513a21e07c69264 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Thu, 10 Dec 2009 13:36:10 +0000 Subject: [PATCH] Record memory in kbytest, not bytes. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4543 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- QMTest/TestSCons.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index c1726325..8ecc8b2d 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -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): """ -- 2.26.2