mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2024-12-29 00:17:49 +00:00
code_size_compare: handle deleted files and new files properly
'Removed' and 'NotCreated' should be displayed in new and old column respectively. The value of delta is reflected on change column. This commit handles the corner cases properly. Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
parent
8a25e6fdb2
commit
bc775c48c9
@ -644,13 +644,15 @@ class CodeSizeGeneratorWithSize(CodeSizeGenerator):
|
||||
delta = new_attr - old_attr
|
||||
change_attr = '{0:{1}}'.format(delta, '+' if delta else '')
|
||||
elif old_size:
|
||||
new_attr = - old_size.__dict__[sect]
|
||||
new_attr = 'Removed'
|
||||
old_attr = old_size.__dict__[sect]
|
||||
change_attr = 'Removed'
|
||||
delta = - old_attr
|
||||
change_attr = '{0:{1}}'.format(delta, '+' if delta else '')
|
||||
elif new_size:
|
||||
new_attr = new_size.__dict__[sect]
|
||||
old_attr = 'NotCreated'
|
||||
change_attr = 'None'
|
||||
delta = new_attr
|
||||
change_attr = '{0:{1}}'.format(delta, '+' if delta else '')
|
||||
else:
|
||||
# Should never happen
|
||||
new_attr = 'Error'
|
||||
|
Loading…
Reference in New Issue
Block a user