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 from slave import recipe_test_api | 5 from slave import recipe_test_api |
6 | 6 |
7 from . import builders | 7 from . import builders |
8 | 8 |
9 | 9 |
10 class ChromiumTestApi(recipe_test_api.RecipeTestApi): | 10 class ChromiumTestApi(recipe_test_api.RecipeTestApi): |
11 @property | 11 @property |
12 def builders(self): | 12 def builders(self): |
13 return builders.BUILDERS | 13 return builders.BUILDERS |
14 | |
15 def gen_tests_for_builders(self, builder_dict): | |
16 # TODO: crbug.com/354674. Figure out where to put "simulation" | |
17 # tests. Is this really the right place? | |
iannucci
2014/12/12 23:45:19
this is an OK place... the test api can contain wh
| |
18 | |
19 def _sanitize_nonalpha(text): | |
20 return ''.join(c if c.isalnum() else '_' for c in text) | |
21 | |
22 for mastername in builder_dict: | |
23 for buildername in builder_dict[mastername]['builders']: | |
24 if 'mac' in buildername or 'Mac' in buildername: | |
25 platform_name = 'mac' | |
26 elif 'win' in buildername or 'Win' in buildername: | |
27 platform_name = 'win' | |
28 else: | |
29 platform_name = 'linux' | |
30 test = ( | |
31 self.test('full_%s_%s' % (_sanitize_nonalpha(mastername), | |
32 _sanitize_nonalpha(buildername))) + | |
33 self.m.platform.name(platform_name) | |
34 ) | |
35 if mastername.startswith('tryserver'): | |
36 test += self.m.properties.tryserver(buildername=buildername, | |
37 mastername=mastername) | |
38 else: | |
39 test += self.m.properties.generic(buildername=buildername, | |
40 mastername=mastername) | |
41 yield test | |
OLD | NEW |