| 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 """A simple script to make building/testing Mojo components easier.""" | 6 """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 logging | 10 import logging |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 dry_run = config.values.get('dry_run') | 178 dry_run = config.values.get('dry_run') |
| 179 final_exit_code = 0 | 179 final_exit_code = 0 |
| 180 failure_list = [] | 180 failure_list = [] |
| 181 for entry in test_list: | 181 for entry in test_list: |
| 182 print 'Running: %s' % entry['name'] | 182 print 'Running: %s' % entry['name'] |
| 183 print 'Command: %s' % ' '.join(entry['command']) | 183 print 'Command: %s' % ' '.join(entry['command']) |
| 184 if dry_run: | 184 if dry_run: |
| 185 continue | 185 continue |
| 186 | 186 |
| 187 _logger.info('Starting: %s' % ' '.join(entry['command'])) | 187 _logger.info('Starting: %s' % ' '.join(entry['command'])) |
| 188 exit_code = subprocess.call(entry['command']) | 188 env = os.environ |
| 189 if 'env' in entry and entry['env'] is not None: |
| 190 env.update(entry['env']) |
| 191 exit_code = subprocess.call(entry['command'], env=env) |
| 189 _logger.info('Completed: %s' % ' '.join(entry['command'])) | 192 _logger.info('Completed: %s' % ' '.join(entry['command'])) |
| 190 if exit_code: | 193 if exit_code: |
| 191 if not final_exit_code: | 194 if not final_exit_code: |
| 192 final_exit_code = exit_code | 195 final_exit_code = exit_code |
| 193 failure_list.append(entry['name']) | 196 failure_list.append(entry['name']) |
| 194 | 197 |
| 195 print 72 * '=' | 198 print 72 * '=' |
| 196 print 'SUMMARY:', | 199 print 'SUMMARY:', |
| 197 if dry_run: | 200 if dry_run: |
| 198 print 'Dry run: no tests run' | 201 print 'Dry run: no tests run' |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 InitLogging(_verbose_count) | 361 InitLogging(_verbose_count) |
| 359 | 362 |
| 360 if args.simulator and not args.ios: | 363 if args.simulator and not args.ios: |
| 361 sys.exit("Currently, the simulator target is only configured for iOS") | 364 sys.exit("Currently, the simulator target is only configured for iOS") |
| 362 | 365 |
| 363 return args.func(_args_to_config(args)) | 366 return args.func(_args_to_config(args)) |
| 364 | 367 |
| 365 | 368 |
| 366 if __name__ == '__main__': | 369 if __name__ == '__main__': |
| 367 sys.exit(main()) | 370 sys.exit(main()) |
| OLD | NEW |