mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
sizediff: look for actual 'tinygo build' line
This commit is contained in:
committed by
Ron Evans
parent
9b83acffe6
commit
54ecf74261
+5
-3
@@ -23,17 +23,19 @@ class Comparison:
|
||||
def readSizes(path):
|
||||
sizes = []
|
||||
lines = open(path).readlines()
|
||||
command = None
|
||||
for i in range(len(lines)):
|
||||
if not lines[i].strip().startswith('code '):
|
||||
continue
|
||||
if lines[i].strip().startswith('tinygo build'):
|
||||
command = lines[i].strip()
|
||||
elif lines[i].strip().startswith('code '):
|
||||
# found a size header
|
||||
code, data, bss, flash, ram = map(int, lines[i+1].replace("|", "").split())
|
||||
command = lines[i-1].strip()
|
||||
sizes.append({
|
||||
'command': command,
|
||||
'flash': flash,
|
||||
'ram': ram
|
||||
})
|
||||
command = None # make sure we don't accidentally miss a 'tinygo build' line
|
||||
return sizes
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user