| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 from slave import recipe_api | 5 from slave import recipe_api |
| 6 | 6 |
| 7 class ChromiumApi(recipe_api.RecipeApi): | 7 class ChromiumApi(recipe_api.RecipeApi): |
| 8 def get_config_defaults(self): | 8 def get_config_defaults(self): |
| 9 return { | 9 return { |
| 10 'HOST_PLATFORM': self.m.platform.name, | 10 'HOST_PLATFORM': self.m.platform.name, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 if self.c.compile_py.build_tool: | 34 if self.c.compile_py.build_tool: |
| 35 args += ['--build-tool', self.c.compile_py.build_tool] | 35 args += ['--build-tool', self.c.compile_py.build_tool] |
| 36 if self.c.compile_py.compiler: | 36 if self.c.compile_py.compiler: |
| 37 args += ['--compiler', self.c.compile_py.compiler] | 37 args += ['--compiler', self.c.compile_py.compiler] |
| 38 if self.m.properties.get('clobber') is not None: | 38 if self.m.properties.get('clobber') is not None: |
| 39 args.append('--clobber') | 39 args.append('--clobber') |
| 40 args.append('--') | 40 args.append('--') |
| 41 args.extend(targets) | 41 args.extend(targets) |
| 42 return self.m.python(name or 'compile', | 42 return self.m.python(name or 'compile', |
| 43 self.m.path.build('scripts', 'slave', 'compile.py'), | 43 self.m.path.build('scripts', 'slave', 'compile.py'), |
| 44 args, **kwargs) | 44 args, abort_on_failure=True, **kwargs) |
| 45 | 45 |
| 46 def runtests(self, test, args=None, xvfb=False, name=None, annotate=None, | 46 def runtests(self, test, args=None, xvfb=False, name=None, annotate=None, |
| 47 results_url=None, perf_dashboard_id=None, test_type=None, | 47 results_url=None, perf_dashboard_id=None, test_type=None, |
| 48 generate_json_file=False, results_directory=None, | 48 generate_json_file=False, results_directory=None, |
| 49 build_number=None, builder_name=None, **kwargs): | 49 build_number=None, builder_name=None, **kwargs): |
| 50 """Return a runtest.py invocation.""" | 50 """Return a runtest.py invocation.""" |
| 51 args = args or [] | 51 args = args or [] |
| 52 assert isinstance(args, list) | 52 assert isinstance(args, list) |
| 53 | 53 |
| 54 t_name, ext = self.m.path.splitext(self.m.path.basename(test)) | 54 t_name, ext = self.m.path.splitext(self.m.path.basename(test)) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 78 full_args.append('--results-directory=%s' % results_directory) | 78 full_args.append('--results-directory=%s' % results_directory) |
| 79 if build_number: | 79 if build_number: |
| 80 full_args.append('--build-number=%s' % build_number) | 80 full_args.append('--build-number=%s' % build_number) |
| 81 if builder_name: | 81 if builder_name: |
| 82 full_args.append('--builder-name=%s' % builder_name) | 82 full_args.append('--builder-name=%s' % builder_name) |
| 83 if ext == '.py': | 83 if ext == '.py': |
| 84 full_args.append('--run-python-script') | 84 full_args.append('--run-python-script') |
| 85 full_args.append(test) | 85 full_args.append(test) |
| 86 full_args.extend(args) | 86 full_args.extend(args) |
| 87 | 87 |
| 88 # By default, don't abort the recipe for a single test failure. | 88 # By default, always run the tests. |
| 89 kwargs.setdefault('can_fail_build', False) | 89 kwargs.setdefault('always_run', True) |
| 90 | 90 |
| 91 return self.m.python( | 91 return self.m.python( |
| 92 name or t_name, | 92 name or t_name, |
| 93 self.m.path.build('scripts', 'slave', 'runtest.py'), | 93 self.m.path.build('scripts', 'slave', 'runtest.py'), |
| 94 full_args, | 94 full_args, |
| 95 **kwargs | 95 **kwargs |
| 96 ) | 96 ) |
| 97 | 97 |
| 98 def runhooks(self, **kwargs): | 98 def runhooks(self, **kwargs): |
| 99 """Run the build-configuration hooks for chromium.""" | 99 """Run the build-configuration hooks for chromium.""" |
| 100 env = kwargs.get('env', {}) | 100 env = kwargs.get('env', {}) |
| 101 env.update(self.c.gyp_env.as_jsonish()) | 101 env.update(self.c.gyp_env.as_jsonish()) |
| 102 kwargs['env'] = env | 102 kwargs['env'] = env |
| 103 return self.m.gclient.runhooks(**kwargs) | 103 return self.m.gclient.runhooks(**kwargs) |
| 104 | 104 |
| OLD | NEW |