Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: tools/binary_size/libsupersize/main.py

Issue 2817813003: supersize: Add "diff" command (Closed)
Patch Set: review commetns Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/binary_size/libsupersize/integration_test.py ('k') | tools/binary_size/libsupersize/models.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/libsupersize/main.py
diff --git a/tools/binary_size/libsupersize/main.py b/tools/binary_size/libsupersize/main.py
index 4eeb89497332b35b96a7104dff0ca83a317a7e79..33b82f0301e4456f3811f2760cd8e207f84e7004 100755
--- a/tools/binary_size/libsupersize/main.py
+++ b/tools/binary_size/libsupersize/main.py
@@ -36,6 +36,23 @@ def _AddCommonArguments(parser):
help='Verbose level (multiple times for more)')
+class _DiffAction(object):
+ @staticmethod
+ def AddArguments(parser):
+ parser.add_argument('before', help='Before-patch .size file.')
+ parser.add_argument('after', help='After-patch .size file.')
+ parser.add_argument('--all', action='store_true', help='Verbose diff')
+
+ @staticmethod
+ def Run(args, parser):
+ args.output_directory = None
+ args.tool_prefix = None
+ args.inputs = [args.before, args.after]
+ args.query = ('Print(Diff(size_info1, size_info2), verbose=%s)' %
+ bool(args.all))
+ console.Run(args, parser)
+
+
def main():
parser = argparse.ArgumentParser(description=__doc__)
sub_parsers = parser.add_subparsers()
@@ -46,6 +63,9 @@ def main():
actions['console'] = (
console,
'Starts an interactive Python console for analyzing .size files.')
+ actions['diff'] = (
+ _DiffAction(),
+ 'Shorthand for console --query "Print(Diff(size_info1, size_info2))"')
for name, tup in actions.iteritems():
sub_parser = sub_parsers.add_parser(name, help=tup[1])
« no previous file with comments | « tools/binary_size/libsupersize/integration_test.py ('k') | tools/binary_size/libsupersize/models.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698