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

Side by Side Diff: tools/llvm_coverage_run.py

Issue 1242023002: Coverage script: fix missing data (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2015 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 6
7 """Run the given command through LLVM's coverage tools.""" 7 """Run the given command through LLVM's coverage tools."""
8 8
9 9
10 import argparse 10 import argparse
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 # Parse args. 155 # Parse args.
156 parser = argparse.ArgumentParser() 156 parser = argparse.ArgumentParser()
157 parser.add_argument('--outResultsFile') 157 parser.add_argument('--outResultsFile')
158 parser.add_argument( 158 parser.add_argument(
159 '--key', metavar='key_or_value', nargs='+', 159 '--key', metavar='key_or_value', nargs='+',
160 help='key/value pairs identifying this bot.') 160 help='key/value pairs identifying this bot.')
161 parser.add_argument( 161 parser.add_argument(
162 '--properties', metavar='key_or_value', nargs='+', 162 '--properties', metavar='key_or_value', nargs='+',
163 help='key/value pairs representing properties of this build.') 163 help='key/value pairs representing properties of this build.')
164 args, cmd = parser.parse_known_args() 164 args, cmd = parser.parse_known_args()
165
166 # We still need to pass the args we stripped out to DM.
167 cmd.append('--key')
168 cmd.extend(args.key)
169 cmd.append('--properties')
170 cmd.extend(args.properties)
171
172 # Parse the key and properties for use in the nanobench JSON output.
165 key = _parse_key_value(args.key) 173 key = _parse_key_value(args.key)
166 properties = _parse_key_value(args.properties) 174 properties = _parse_key_value(args.properties)
167 175
168 # Run coverage. 176 # Run coverage.
169 results = run_coverage(cmd) 177 results = run_coverage(cmd)
170 178
171 # Write results. 179 # Write results.
172 format_results = _nanobench_json(results, properties, key) 180 format_results = _nanobench_json(results, properties, key)
173 if args.outResultsFile: 181 if args.outResultsFile:
174 with open(args.outResultsFile, 'w') as f: 182 with open(args.outResultsFile, 'w') as f:
175 json.dump(format_results, f) 183 json.dump(format_results, f)
176 else: 184 else:
177 print json.dumps(format_results, indent=4, sort_keys=True) 185 print json.dumps(format_results, indent=4, sort_keys=True)
178 186
179 187
180 if __name__ == '__main__': 188 if __name__ == '__main__':
181 main() 189 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698