| 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, _config_name): | 8 def get_config_defaults(self, _config_name): |
| 9 return { | 9 return { |
| 10 'HOST_PLATFORM': self.m.platform.name, | 10 'HOST_PLATFORM': self.m.platform.name, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 if self.c.compile_py.compiler: | 27 if self.c.compile_py.compiler: |
| 28 args += ['--compiler', self.c.compile_py.compiler] | 28 args += ['--compiler', self.c.compile_py.compiler] |
| 29 args.append('--') | 29 args.append('--') |
| 30 args.extend(targets) | 30 args.extend(targets) |
| 31 return self.m.step('compile', args) | 31 return self.m.step('compile', args) |
| 32 | 32 |
| 33 def runtests(self, test, args=None, xvfb=False, name=None, **kwargs): | 33 def runtests(self, test, args=None, xvfb=False, name=None, **kwargs): |
| 34 """Return a runtest.py invocation.""" | 34 """Return a runtest.py invocation.""" |
| 35 args = args or [] | 35 args = args or [] |
| 36 assert isinstance(args, list) | 36 assert isinstance(args, list) |
| 37 test_args = [test] + args | |
| 38 | 37 |
| 39 python_arg = [] | 38 python_arg = [] |
| 40 t_name, ext = self.m.path.splitext(self.m.path.basename(test)) | 39 t_name, ext = self.m.path.splitext(self.m.path.basename(test)) |
| 41 if ext == '.py': | 40 if ext == '.py': |
| 42 python_arg = ['--run-python-script'] | 41 python_arg = ['--run-python-script'] |
| 42 elif self.m.platform.is_win and ext == '': |
| 43 test += '.exe' |
| 44 |
| 45 test_args = [test] + args |
| 43 | 46 |
| 44 return self.m.step(name or t_name, [ | 47 return self.m.step(name or t_name, [ |
| 45 'python', self.m.path.build('scripts', 'slave', 'runtest.py'), | 48 'python', self.m.path.build('scripts', 'slave', 'runtest.py'), |
| 46 '--target', self.c.BUILD_CONFIG, | 49 '--target', self.c.BUILD_CONFIG, |
| 47 '--build-dir', self.m.path.checkout(self.c.build_dir), | 50 '--build-dir', self.m.path.checkout(self.c.build_dir), |
| 48 ('--xvfb' if xvfb else '--no-xvfb')] | 51 ('--xvfb' if xvfb else '--no-xvfb')] |
| 49 + self.m.json.property_args() | 52 + self.m.json.property_args() |
| 50 + python_arg | 53 + python_arg |
| 51 + test_args, | 54 + test_args, |
| 52 **kwargs | 55 **kwargs |
| 53 ) | 56 ) |
| 54 | 57 |
| 55 def runhooks(self): | 58 def runhooks(self): |
| 56 """Run the build-configuration hooks for chromium.""" | 59 """Run the build-configuration hooks for chromium.""" |
| 57 return self.m.step( | 60 return self.m.step( |
| 58 'gclient runhooks', | 61 'gclient runhooks', |
| 59 [self.m.path.depot_tools('gclient', wrapper=True), 'runhooks'], | 62 [self.m.path.depot_tools('gclient', wrapper=True), 'runhooks'], |
| 60 env=self.c.gyp_env.as_jsonish(), | 63 env=self.c.gyp_env.as_jsonish(), |
| 61 ) | 64 ) |
| 62 | 65 |
| OLD | NEW |