OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 # This a simple script to make building/testing Mojo components easier. | 6 # This a simple script to make building/testing Mojo components easier. |
7 | 7 |
8 import argparse | 8 import argparse |
9 from copy import deepcopy | 9 from copy import deepcopy |
10 import os | 10 import os |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 # Use the configured goma directory. | 133 # Use the configured goma directory. |
134 local_goma_dir = _get_gn_arg_value(out_dir, 'goma_dir') | 134 local_goma_dir = _get_gn_arg_value(out_dir, 'goma_dir') |
135 print 'Ensuring goma (in %s) started ...' % local_goma_dir | 135 print 'Ensuring goma (in %s) started ...' % local_goma_dir |
136 command = ['python', | 136 command = ['python', |
137 os.path.join(local_goma_dir, 'goma_ctl.py'), | 137 os.path.join(local_goma_dir, 'goma_ctl.py'), |
138 'ensure_start'] | 138 'ensure_start'] |
139 exit_code = subprocess.call(command) | 139 exit_code = subprocess.call(command) |
140 if exit_code: | 140 if exit_code: |
141 return exit_code | 141 return exit_code |
142 | 142 |
143 return subprocess.call(['ninja', '-j', '1000', '-l', '100', '-C', out_dir, | 143 return subprocess.call(['ninja', '-j', '1000', '-l', '100', '-C', out_dir]) |
144 'root']) | |
145 else: | 144 else: |
146 return subprocess.call(['ninja', '-C', out_dir, 'root']) | 145 return subprocess.call(['ninja', '-C', out_dir]) |
147 | 146 |
148 | 147 |
149 def _run_tests(config, test_types): | 148 def _run_tests(config, test_types): |
150 """Runs the tests of the given type(s) for the given config.""" | 149 """Runs the tests of the given type(s) for the given config.""" |
151 | 150 |
152 assert isinstance(test_types, list) | 151 assert isinstance(test_types, list) |
153 config = deepcopy(config) | 152 config = deepcopy(config) |
154 config.values['test_types'] = test_types | 153 config.values['test_types'] = test_types |
155 | 154 |
156 test_list = GetTestList(config) | 155 test_list = GetTestList(config) |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 help='Run Dart unit tests (does not build).') | 264 help='Run Dart unit tests (does not build).') |
266 darttest_parser.set_defaults(func=darttest) | 265 darttest_parser.set_defaults(func=darttest) |
267 | 266 |
268 args = parser.parse_args() | 267 args = parser.parse_args() |
269 config = _args_to_config(args) | 268 config = _args_to_config(args) |
270 return args.func(config) | 269 return args.func(config) |
271 | 270 |
272 | 271 |
273 if __name__ == '__main__': | 272 if __name__ == '__main__': |
274 sys.exit(main()) | 273 sys.exit(main()) |
OLD | NEW |