| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import argparse | 5 import argparse |
| 6 import contextlib | 6 import contextlib |
| 7 import json | 7 import json |
| 8 import os | 8 import os |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 def run_script(argv, funcs): | 25 def run_script(argv, funcs): |
| 26 def parse_json(path): | 26 def parse_json(path): |
| 27 with open(path) as f: | 27 with open(path) as f: |
| 28 return json.load(f) | 28 return json.load(f) |
| 29 parser = argparse.ArgumentParser() | 29 parser = argparse.ArgumentParser() |
| 30 # TODO(phajdan.jr): Make build-config-fs required after passing it in recipe. | 30 # TODO(phajdan.jr): Make build-config-fs required after passing it in recipe. |
| 31 parser.add_argument('--build-config-fs') | 31 parser.add_argument('--build-config-fs') |
| 32 parser.add_argument('--paths', type=parse_json, default={}) | 32 parser.add_argument('--paths', type=parse_json, default={}) |
| 33 parser.add_argument('--properties', type=parse_json, default={}) | 33 parser.add_argument('--properties', type=parse_json, default={}) |
| 34 parser.add_argument('--args', type=parse_json, default=[]) |
| 34 | 35 |
| 35 subparsers = parser.add_subparsers() | 36 subparsers = parser.add_subparsers() |
| 36 | 37 |
| 37 run_parser = subparsers.add_parser('run') | 38 run_parser = subparsers.add_parser('run') |
| 38 run_parser.add_argument( | 39 run_parser.add_argument( |
| 39 '--output', type=argparse.FileType('w'), required=True) | 40 '--output', type=argparse.FileType('w'), required=True) |
| 40 run_parser.add_argument('--filter-file', type=argparse.FileType('r')) | 41 run_parser.add_argument('--filter-file', type=argparse.FileType('r')) |
| 41 run_parser.set_defaults(func=funcs['run']) | 42 run_parser.set_defaults(func=funcs['run']) |
| 42 | 43 |
| 43 run_parser = subparsers.add_parser('compile_targets') | 44 run_parser = subparsers.add_parser('compile_targets') |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 key += 'passes' | 126 key += 'passes' |
| 126 # TODO(dpranke): crbug.com/357867 ... Why are we assigning result | 127 # TODO(dpranke): crbug.com/357867 ... Why are we assigning result |
| 127 # instead of actual_result here. Do we even need these things to be | 128 # instead of actual_result here. Do we even need these things to be |
| 128 # hashes, or just lists? | 129 # hashes, or just lists? |
| 129 data = result | 130 data = result |
| 130 else: | 131 else: |
| 131 key += 'failures' | 132 key += 'failures' |
| 132 results[key][test] = data | 133 results[key][test] = data |
| 133 | 134 |
| 134 return results | 135 return results |
| OLD | NEW |