OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Finds all the annotated tests from proguard dump""" | 6 """Finds all the annotated tests from proguard dump""" |
7 | 7 |
8 import argparse | 8 import argparse |
9 import datetime | 9 import datetime |
10 import json | 10 import json |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 help='INFO verbosity') | 155 help='INFO verbosity') |
156 | 156 |
157 arguments = parser.parse_args(sys.argv[1:]) | 157 arguments = parser.parse_args(sys.argv[1:]) |
158 logging.basicConfig( | 158 logging.basicConfig( |
159 level=logging.INFO if arguments.verbose else logging.WARNING) | 159 level=logging.INFO if arguments.verbose else logging.WARNING) |
160 | 160 |
161 if arguments.timestamp_string is None: | 161 if arguments.timestamp_string is None: |
162 script_runtime = datetime.datetime.utcnow() | 162 script_runtime = datetime.datetime.utcnow() |
163 script_runtime_string = script_runtime.strftime(_EXPORT_TIME_FORMAT) | 163 script_runtime_string = script_runtime.strftime(_EXPORT_TIME_FORMAT) |
164 else: | 164 else: |
165 script_runtime = arguments.timestamp_string | 165 script_runtime_string = arguments.timestamp_string |
166 logging.info('Build time is %s', script_runtime_string) | 166 logging.info('Build time is %s', script_runtime_string) |
167 apk_output_dir = os.path.abspath(os.path.join( | 167 apk_output_dir = os.path.abspath(os.path.join( |
168 constants.DIR_SOURCE_ROOT, arguments.apk_output_dir)) | 168 constants.DIR_SOURCE_ROOT, arguments.apk_output_dir)) |
169 report_data = _GetReport( | 169 report_data = _GetReport( |
170 arguments.test_apks, script_runtime_string, apk_output_dir) | 170 arguments.test_apks, script_runtime_string, apk_output_dir) |
171 | 171 |
172 json_output_path = os.path.join( | 172 json_output_path = os.path.join( |
173 arguments.json_output_dir, | 173 arguments.json_output_dir, |
174 '%s-android-chrome.json' % script_runtime_string) | 174 '%s-android-chrome.json' % script_runtime_string) |
175 with open(json_output_path, 'w') as f: | 175 with open(json_output_path, 'w') as f: |
176 json.dump(report_data, f, sort_keys=True, separators=(',',': ')) | 176 json.dump(report_data, f, sort_keys=True, separators=(',',': ')) |
177 logging.info('Saved json output file to %s', json_output_path) | 177 logging.info('Saved json output file to %s', json_output_path) |
178 | 178 |
179 | 179 |
180 if __name__ == '__main__': | 180 if __name__ == '__main__': |
181 sys.exit(main()) | 181 sys.exit(main()) |
OLD | NEW |