OLD | NEW |
1 # | 1 # |
2 # Copyright 2015 Google Inc. | 2 # Copyright 2015 Google Inc. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 #!/usr/bin/env python | 8 #!/usr/bin/env python |
9 | 9 |
10 usage = ''' | 10 usage = ''' |
11 Write buildbot spec to outfile based on the bot name: | 11 Write buildbot spec to outfile based on the bot name: |
12 $ python buildbot_spec.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug | 12 $ python buildbot_spec.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug |
13 Or run self-tests: | 13 Or run self-tests: |
14 $ python buildbot_spec.py test | 14 $ python buildbot_spec.py test |
15 ''' | 15 ''' |
16 | 16 |
17 import inspect | 17 import inspect |
18 import json | 18 import json |
19 import os | 19 import os |
20 import sys | 20 import sys |
21 | 21 |
22 import builder_name_schema | 22 import builder_name_schema |
23 import dm_flags | 23 import dm_flags |
24 import nanobench_flags | 24 import nanobench_flags |
25 | 25 |
26 | 26 |
| 27 CONFIG_COVERAGE = 'Coverage' |
27 CONFIG_DEBUG = 'Debug' | 28 CONFIG_DEBUG = 'Debug' |
28 CONFIG_RELEASE = 'Release' | 29 CONFIG_RELEASE = 'Release' |
29 | 30 |
30 | 31 |
31 def lineno(): | 32 def lineno(): |
32 caller = inspect.stack()[1] # Up one level to our caller. | 33 caller = inspect.stack()[1] # Up one level to our caller. |
33 return inspect.getframeinfo(caller[0]).lineno | 34 return inspect.getframeinfo(caller[0]).lineno |
34 | 35 |
35 # Since we don't actually start coverage until we're in the self-test, | 36 # Since we don't actually start coverage until we're in the self-test, |
36 # some function def lines aren't reported as covered. Add them to this | 37 # some function def lines aren't reported as covered. Add them to this |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 # Vulkan. | 168 # Vulkan. |
168 if builder_dict.get('extra_config') == 'Vulkan': | 169 if builder_dict.get('extra_config') == 'Vulkan': |
169 gyp_defs['skia_vulkan'] = '1' | 170 gyp_defs['skia_vulkan'] = '1' |
170 | 171 |
171 return gyp_defs | 172 return gyp_defs |
172 | 173 |
173 | 174 |
174 cov_skip.extend([lineno(), lineno() + 1]) | 175 cov_skip.extend([lineno(), lineno() + 1]) |
175 def get_extra_env_vars(builder_dict): | 176 def get_extra_env_vars(builder_dict): |
176 env = {} | 177 env = {} |
177 if builder_dict.get('configuration') == 'Coverage': | 178 if builder_dict.get('configuration') == CONFIG_COVERAGE: |
178 # We have to use Clang 3.6 because earlier versions do not support the | 179 # We have to use Clang 3.6 because earlier versions do not support the |
179 # compile flags we use and 3.7 and 3.8 hit asserts during compilation. | 180 # compile flags we use and 3.7 and 3.8 hit asserts during compilation. |
180 env['CC'] = '/usr/bin/clang-3.6' | 181 env['CC'] = '/usr/bin/clang-3.6' |
181 env['CXX'] = '/usr/bin/clang++-3.6' | 182 env['CXX'] = '/usr/bin/clang++-3.6' |
182 elif builder_dict.get('compiler') == 'Clang': | 183 elif builder_dict.get('compiler') == 'Clang': |
183 env['CC'] = '/usr/bin/clang' | 184 env['CC'] = '/usr/bin/clang' |
184 env['CXX'] = '/usr/bin/clang++' | 185 env['CXX'] = '/usr/bin/clang++' |
185 | 186 |
186 # SKNX_NO_SIMD, SK_USE_DISCARDABLE_SCALEDIMAGECACHE, etc. | 187 # SKNX_NO_SIMD, SK_USE_DISCARDABLE_SCALEDIMAGECACHE, etc. |
187 extra_config = builder_dict.get('extra_config', '') | 188 extra_config = builder_dict.get('extra_config', '') |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 role = builder_dict['role'] | 305 role = builder_dict['role'] |
305 if role == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: | 306 if role == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: |
306 configuration = CONFIG_RELEASE | 307 configuration = CONFIG_RELEASE |
307 else: | 308 else: |
308 configuration = builder_dict.get( | 309 configuration = builder_dict.get( |
309 'configuration', CONFIG_DEBUG) | 310 'configuration', CONFIG_DEBUG) |
310 arch = (builder_dict.get('arch') or builder_dict.get('target_arch')) | 311 arch = (builder_dict.get('arch') or builder_dict.get('target_arch')) |
311 if ('Win' in builder_dict.get('os', '') and arch == 'x86_64'): | 312 if ('Win' in builder_dict.get('os', '') and arch == 'x86_64'): |
312 configuration += '_x64' | 313 configuration += '_x64' |
313 rv['configuration'] = configuration | 314 rv['configuration'] = configuration |
| 315 if configuration == CONFIG_COVERAGE: |
| 316 rv['do_compile_steps'] = False |
314 rv['do_test_steps'] = role == builder_name_schema.BUILDER_ROLE_TEST | 317 rv['do_test_steps'] = role == builder_name_schema.BUILDER_ROLE_TEST |
315 rv['do_perf_steps'] = (role == builder_name_schema.BUILDER_ROLE_PERF or | 318 rv['do_perf_steps'] = (role == builder_name_schema.BUILDER_ROLE_PERF or |
316 (role == builder_name_schema.BUILDER_ROLE_TEST and | 319 (role == builder_name_schema.BUILDER_ROLE_TEST and |
317 configuration == CONFIG_DEBUG)) | 320 configuration == CONFIG_DEBUG)) |
318 if rv['do_test_steps'] and 'Valgrind' in builder_name: | 321 if rv['do_test_steps'] and 'Valgrind' in builder_name: |
319 rv['do_perf_steps'] = True | 322 rv['do_perf_steps'] = True |
320 if 'GalaxyS4' in builder_name: | 323 if 'GalaxyS4' in builder_name: |
321 rv['do_perf_steps'] = False | 324 rv['do_perf_steps'] = False |
322 | 325 |
323 rv['build_targets'] = build_targets_from_builder_dict( | 326 rv['build_targets'] = build_targets_from_builder_dict( |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 if len(sys.argv) == 2 and sys.argv[1] == 'test': | 413 if len(sys.argv) == 2 and sys.argv[1] == 'test': |
411 self_test() | 414 self_test() |
412 sys.exit(0) | 415 sys.exit(0) |
413 | 416 |
414 if len(sys.argv) != 3: | 417 if len(sys.argv) != 3: |
415 print usage | 418 print usage |
416 sys.exit(1) | 419 sys.exit(1) |
417 | 420 |
418 with open(sys.argv[1], 'w') as out: | 421 with open(sys.argv[1], 'w') as out: |
419 json.dump(get_builder_spec(sys.argv[2]), out) | 422 json.dump(get_builder_spec(sys.argv[2]), out) |
OLD | NEW |