borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright 2015 Google Inc. |
| 3 | # |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | # |
| 7 | |
| 8 | #!/usr/bin/env python |
| 9 | |
| 10 | usage = ''' |
| 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 |
| 13 | Or run self-tests: |
| 14 | $ python buildbot_spec.py test |
| 15 | ''' |
| 16 | |
| 17 | import inspect |
| 18 | import json |
| 19 | import os |
| 20 | import sys |
| 21 | |
| 22 | import builder_name_schema |
borenet | 2481b8b | 2015-07-29 11:43:07 -0700 | [diff] [blame] | 23 | import dm_flags |
| 24 | import nanobench_flags |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 25 | |
| 26 | |
rmistry | 43e8f67 | 2016-04-18 04:14:17 -0700 | [diff] [blame] | 27 | CONFIG_COVERAGE = 'Coverage' |
borenet | dbf9f01 | 2015-07-30 07:09:20 -0700 | [diff] [blame] | 28 | CONFIG_DEBUG = 'Debug' |
| 29 | CONFIG_RELEASE = 'Release' |
| 30 | |
| 31 | |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 32 | def lineno(): |
| 33 | caller = inspect.stack()[1] # Up one level to our caller. |
| 34 | return inspect.getframeinfo(caller[0]).lineno |
| 35 | |
| 36 | # Since we don't actually start coverage until we're in the self-test, |
| 37 | # some function def lines aren't reported as covered. Add them to this |
| 38 | # list so that we can ignore them. |
| 39 | cov_skip = [] |
| 40 | |
| 41 | cov_start = lineno()+1 # We care about coverage starting just past this def. |
| 42 | def gyp_defines(builder_dict): |
| 43 | gyp_defs = {} |
| 44 | |
| 45 | # skia_arch_type. |
| 46 | if builder_dict['role'] == builder_name_schema.BUILDER_ROLE_BUILD: |
| 47 | arch = builder_dict['target_arch'] |
| 48 | elif builder_dict['role'] == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: |
| 49 | arch = None |
| 50 | else: |
| 51 | arch = builder_dict['arch'] |
| 52 | |
| 53 | arch_types = { |
| 54 | 'x86': 'x86', |
| 55 | 'x86_64': 'x86_64', |
| 56 | 'Arm7': 'arm', |
| 57 | 'Arm64': 'arm64', |
| 58 | 'Mips': 'mips32', |
| 59 | 'Mips64': 'mips64', |
| 60 | 'MipsDSP2': 'mips32', |
| 61 | } |
| 62 | if arch in arch_types: |
| 63 | gyp_defs['skia_arch_type'] = arch_types[arch] |
| 64 | |
| 65 | # housekeeper: build shared lib. |
| 66 | if builder_dict['role'] == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: |
| 67 | gyp_defs['skia_shared_lib'] = '1' |
| 68 | |
| 69 | # skia_gpu. |
| 70 | if builder_dict.get('cpu_or_gpu') == 'CPU': |
| 71 | gyp_defs['skia_gpu'] = '0' |
| 72 | |
| 73 | # skia_warnings_as_errors. |
| 74 | werr = False |
| 75 | if builder_dict['role'] == builder_name_schema.BUILDER_ROLE_BUILD: |
| 76 | if 'Win' in builder_dict.get('os', ''): |
| 77 | if not ('GDI' in builder_dict.get('extra_config', '') or |
| 78 | 'Exceptions' in builder_dict.get('extra_config', '')): |
| 79 | werr = True |
| 80 | elif ('Mac' in builder_dict.get('os', '') and |
| 81 | 'Android' in builder_dict.get('extra_config', '')): |
| 82 | werr = False |
benjaminwagner | 31b8417 | 2016-05-06 09:30:08 -0700 | [diff] [blame] | 83 | elif 'Fast' in builder_dict.get('extra_config', ''): |
| 84 | # See https://bugs.chromium.org/p/skia/issues/detail?id=5257 |
| 85 | werr = False |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 86 | else: |
| 87 | werr = True |
| 88 | gyp_defs['skia_warnings_as_errors'] = str(int(werr)) # True/False -> '1'/'0' |
| 89 | |
| 90 | # Win debugger. |
| 91 | if 'Win' in builder_dict.get('os', ''): |
| 92 | gyp_defs['skia_win_debuggers_path'] = 'c:/DbgHelp' |
| 93 | |
| 94 | # Qt SDK (Win). |
| 95 | if 'Win' in builder_dict.get('os', ''): |
| 96 | if builder_dict.get('os') == 'Win8': |
| 97 | gyp_defs['qt_sdk'] = 'C:/Qt/Qt5.1.0/5.1.0/msvc2012_64/' |
| 98 | else: |
| 99 | gyp_defs['qt_sdk'] = 'C:/Qt/4.8.5/' |
| 100 | |
| 101 | # ANGLE. |
| 102 | if builder_dict.get('extra_config') == 'ANGLE': |
| 103 | gyp_defs['skia_angle'] = '1' |
borenet | 08d7747 | 2015-09-21 08:20:24 -0700 | [diff] [blame] | 104 | if builder_dict.get('os', '') in ('Ubuntu', 'Linux'): |
| 105 | gyp_defs['use_x11'] = '1' |
| 106 | gyp_defs['chromeos'] = '0' |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 107 | |
| 108 | # GDI. |
| 109 | if builder_dict.get('extra_config') == 'GDI': |
| 110 | gyp_defs['skia_gdi'] = '1' |
| 111 | |
| 112 | # Build with Exceptions on Windows. |
| 113 | if ('Win' in builder_dict.get('os', '') and |
| 114 | builder_dict.get('extra_config') == 'Exceptions'): |
| 115 | gyp_defs['skia_win_exceptions'] = '1' |
| 116 | |
| 117 | # iOS. |
| 118 | if (builder_dict.get('os') == 'iOS' or |
| 119 | builder_dict.get('extra_config') == 'iOS'): |
| 120 | gyp_defs['skia_os'] = 'ios' |
| 121 | |
| 122 | # Shared library build. |
| 123 | if builder_dict.get('extra_config') == 'Shared': |
| 124 | gyp_defs['skia_shared_lib'] = '1' |
| 125 | |
mtklein | 6f65957 | 2016-02-16 06:42:51 -0800 | [diff] [blame] | 126 | # Build fastest Skia possible. |
| 127 | if builder_dict.get('extra_config') == 'Fast': |
| 128 | gyp_defs['skia_fast'] = '1' |
| 129 | |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 130 | # PDF viewer in GM. |
| 131 | if (builder_dict.get('os') == 'Mac10.8' and |
| 132 | builder_dict.get('arch') == 'x86_64' and |
| 133 | builder_dict.get('configuration') == 'Release'): |
| 134 | gyp_defs['skia_run_pdfviewer_in_gm'] = '1' |
| 135 | |
| 136 | # Clang. |
| 137 | if builder_dict.get('compiler') == 'Clang': |
| 138 | gyp_defs['skia_clang_build'] = '1' |
| 139 | |
| 140 | # Valgrind. |
| 141 | if 'Valgrind' in builder_dict.get('extra_config', ''): |
| 142 | gyp_defs['skia_release_optimization_level'] = '1' |
| 143 | |
| 144 | # Link-time code generation just wastes time on compile-only bots. |
| 145 | if (builder_dict.get('role') == builder_name_schema.BUILDER_ROLE_BUILD and |
| 146 | builder_dict.get('compiler') == 'MSVC'): |
| 147 | gyp_defs['skia_win_ltcg'] = '0' |
| 148 | |
| 149 | # Mesa. |
| 150 | if (builder_dict.get('extra_config') == 'Mesa' or |
| 151 | builder_dict.get('cpu_or_gpu_value') == 'Mesa'): |
| 152 | gyp_defs['skia_mesa'] = '1' |
| 153 | |
joshualitt | 64673af | 2015-12-16 12:54:19 -0800 | [diff] [blame] | 154 | # VisualBench |
| 155 | if builder_dict.get('extra_config') == 'VisualBench': |
| 156 | gyp_defs['skia_use_sdl'] = '1' |
| 157 | |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 158 | # skia_use_android_framework_defines. |
| 159 | if builder_dict.get('extra_config') == 'Android_FrameworkDefs': |
| 160 | gyp_defs['skia_use_android_framework_defines'] = '1' |
| 161 | |
joshualitt | 7384d07 | 2015-12-02 14:04:46 -0800 | [diff] [blame] | 162 | # Skia dump stats for perf tests and gpu |
| 163 | if (builder_dict.get('cpu_or_gpu') == 'GPU' and |
| 164 | builder_dict.get('role') == 'Perf'): |
| 165 | gyp_defs['skia_dump_stats'] = '1' |
| 166 | |
borenet | 48b88cc | 2016-04-11 10:16:01 -0700 | [diff] [blame] | 167 | # CommandBuffer. |
| 168 | if builder_dict.get('extra_config') == 'CommandBuffer': |
| 169 | gyp_defs['skia_command_buffer'] = '1' |
| 170 | |
borenet | 71e185c | 2016-04-12 08:13:56 -0700 | [diff] [blame] | 171 | # Vulkan. |
| 172 | if builder_dict.get('extra_config') == 'Vulkan': |
| 173 | gyp_defs['skia_vulkan'] = '1' |
| 174 | |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 175 | return gyp_defs |
| 176 | |
| 177 | |
| 178 | cov_skip.extend([lineno(), lineno() + 1]) |
| 179 | def get_extra_env_vars(builder_dict): |
| 180 | env = {} |
rmistry | 43e8f67 | 2016-04-18 04:14:17 -0700 | [diff] [blame] | 181 | if builder_dict.get('configuration') == CONFIG_COVERAGE: |
borenet | dbf9f01 | 2015-07-30 07:09:20 -0700 | [diff] [blame] | 182 | # We have to use Clang 3.6 because earlier versions do not support the |
| 183 | # compile flags we use and 3.7 and 3.8 hit asserts during compilation. |
| 184 | env['CC'] = '/usr/bin/clang-3.6' |
| 185 | env['CXX'] = '/usr/bin/clang++-3.6' |
| 186 | elif builder_dict.get('compiler') == 'Clang': |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 187 | env['CC'] = '/usr/bin/clang' |
| 188 | env['CXX'] = '/usr/bin/clang++' |
borenet | 98f7e33 | 2015-08-24 12:50:59 -0700 | [diff] [blame] | 189 | |
mtklein | d0fff5b | 2015-09-18 06:15:55 -0700 | [diff] [blame] | 190 | # SKNX_NO_SIMD, SK_USE_DISCARDABLE_SCALEDIMAGECACHE, etc. |
| 191 | extra_config = builder_dict.get('extra_config', '') |
| 192 | if extra_config.startswith('SK') and extra_config.isupper(): |
| 193 | env['CPPFLAGS'] = '-D' + extra_config |
| 194 | |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 195 | return env |
| 196 | |
| 197 | |
| 198 | cov_skip.extend([lineno(), lineno() + 1]) |
borenet | b64b195 | 2015-10-21 07:50:57 -0700 | [diff] [blame] | 199 | def build_targets_from_builder_dict(builder_dict, do_test_steps, do_perf_steps): |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 200 | """Return a list of targets to build, depending on the builder type.""" |
| 201 | if builder_dict['role'] in ('Test', 'Perf') and builder_dict['os'] == 'iOS': |
| 202 | return ['iOSShell'] |
borenet | b64b195 | 2015-10-21 07:50:57 -0700 | [diff] [blame] | 203 | if builder_dict.get('extra_config') == 'Appurify': |
| 204 | return ['VisualBenchTest_APK'] |
benjaminwagner | ae5c01d | 2016-05-04 06:35:50 -0700 | [diff] [blame] | 205 | if 'SAN' in builder_dict.get('extra_config', ''): |
| 206 | # 'most' does not compile under MSAN. |
| 207 | return ['dm', 'nanobench'] |
borenet | b64b195 | 2015-10-21 07:50:57 -0700 | [diff] [blame] | 208 | t = [] |
| 209 | if do_test_steps: |
| 210 | t.append('dm') |
borenet | b55448b | 2016-05-17 10:26:15 -0700 | [diff] [blame] | 211 | if builder_dict.get('extra_config') == 'VisualBench': |
| 212 | t.append('visualbench') |
joshualitt | 64673af | 2015-12-16 12:54:19 -0800 | [diff] [blame] | 213 | elif do_perf_steps: |
borenet | b55448b | 2016-05-17 10:26:15 -0700 | [diff] [blame] | 214 | t.append('nanobench') |
borenet | b64b195 | 2015-10-21 07:50:57 -0700 | [diff] [blame] | 215 | if t: |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 216 | return t |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 217 | else: |
| 218 | return ['most'] |
| 219 | |
| 220 | |
| 221 | cov_skip.extend([lineno(), lineno() + 1]) |
borenet | 7bccca1 | 2015-07-29 11:15:42 -0700 | [diff] [blame] | 222 | def device_cfg(builder_dict): |
| 223 | # Android. |
| 224 | if 'Android' in builder_dict.get('extra_config', ''): |
| 225 | if 'NoNeon' in builder_dict['extra_config']: |
| 226 | return 'arm_v7' |
| 227 | return { |
| 228 | 'Arm64': 'arm64', |
| 229 | 'x86': 'x86', |
| 230 | 'x86_64': 'x86_64', |
| 231 | 'Mips': 'mips', |
| 232 | 'Mips64': 'mips64', |
| 233 | 'MipsDSP2': 'mips_dsp2', |
| 234 | }.get(builder_dict['target_arch'], 'arm_v7_neon') |
| 235 | elif builder_dict.get('os') == 'Android': |
| 236 | return { |
mtklein | 80fc19c | 2016-01-21 14:24:10 -0800 | [diff] [blame] | 237 | 'AndroidOne': 'arm_v7_neon', |
| 238 | 'GalaxyS3': 'arm_v7_neon', |
| 239 | 'GalaxyS4': 'arm_v7_neon', |
borenet | 7bccca1 | 2015-07-29 11:15:42 -0700 | [diff] [blame] | 240 | 'NVIDIA_Shield': 'arm64', |
mtklein | 80fc19c | 2016-01-21 14:24:10 -0800 | [diff] [blame] | 241 | 'Nexus10': 'arm_v7_neon', |
| 242 | 'Nexus5': 'arm_v7_neon', |
| 243 | 'Nexus6': 'arm_v7_neon', |
| 244 | 'Nexus7': 'arm_v7_neon', |
borenet | cafbfe6 | 2016-04-01 07:18:27 -0700 | [diff] [blame] | 245 | 'Nexus7v2': 'arm_v7_neon', |
mtklein | 80fc19c | 2016-01-21 14:24:10 -0800 | [diff] [blame] | 246 | 'Nexus9': 'arm64', |
| 247 | 'NexusPlayer': 'x86', |
borenet | 7bccca1 | 2015-07-29 11:15:42 -0700 | [diff] [blame] | 248 | }[builder_dict['model']] |
| 249 | |
borenet | d32eac2 | 2016-04-05 12:14:59 -0700 | [diff] [blame] | 250 | # iOS. |
| 251 | if 'iOS' in builder_dict.get('os', ''): |
| 252 | return { |
| 253 | 'iPad4': 'iPad4,1', |
| 254 | }[builder_dict['model']] |
| 255 | |
borenet | 7bccca1 | 2015-07-29 11:15:42 -0700 | [diff] [blame] | 256 | return None |
| 257 | |
| 258 | |
| 259 | cov_skip.extend([lineno(), lineno() + 1]) |
borenet | cafbfe6 | 2016-04-01 07:18:27 -0700 | [diff] [blame] | 260 | def product_board(builder_dict): |
| 261 | if 'Android' in builder_dict.get('os', ''): |
| 262 | return { |
| 263 | 'AndroidOne': None, # TODO(borenet,kjlubick) |
borenet | 649becd | 2016-05-26 11:21:02 -0700 | [diff] [blame] | 264 | 'GalaxyS3': 'm0', #'smdk4x12', Detected incorrectly by swarming? |
borenet | cafbfe6 | 2016-04-01 07:18:27 -0700 | [diff] [blame] | 265 | 'GalaxyS4': None, # TODO(borenet,kjlubick) |
borenet | 9d19cc6 | 2016-06-03 07:01:32 -0700 | [diff] [blame] | 266 | 'NVIDIA_Shield': 'foster', |
borenet | cafbfe6 | 2016-04-01 07:18:27 -0700 | [diff] [blame] | 267 | 'Nexus10': 'manta', |
| 268 | 'Nexus5': 'hammerhead', |
| 269 | 'Nexus6': 'shamu', |
| 270 | 'Nexus7': 'grouper', |
| 271 | 'Nexus7v2': 'flo', |
| 272 | 'Nexus9': 'flounder', |
| 273 | 'NexusPlayer': 'fugu', |
| 274 | }[builder_dict['model']] |
| 275 | return None |
| 276 | |
| 277 | |
| 278 | cov_skip.extend([lineno(), lineno() + 1]) |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 279 | def get_builder_spec(builder_name): |
| 280 | builder_dict = builder_name_schema.DictForBuilderName(builder_name) |
| 281 | env = get_extra_env_vars(builder_dict) |
| 282 | gyp_defs = gyp_defines(builder_dict) |
| 283 | gyp_defs_list = ['%s=%s' % (k, v) for k, v in gyp_defs.iteritems()] |
| 284 | gyp_defs_list.sort() |
| 285 | env['GYP_DEFINES'] = ' '.join(gyp_defs_list) |
borenet | 7bccca1 | 2015-07-29 11:15:42 -0700 | [diff] [blame] | 286 | rv = { |
borenet | 7bccca1 | 2015-07-29 11:15:42 -0700 | [diff] [blame] | 287 | 'builder_cfg': builder_dict, |
borenet | 2481b8b | 2015-07-29 11:43:07 -0700 | [diff] [blame] | 288 | 'dm_flags': dm_flags.get_args(builder_name), |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 289 | 'env': env, |
borenet | 2481b8b | 2015-07-29 11:43:07 -0700 | [diff] [blame] | 290 | 'nanobench_flags': nanobench_flags.get_args(builder_name), |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 291 | } |
borenet | 7bccca1 | 2015-07-29 11:15:42 -0700 | [diff] [blame] | 292 | device = device_cfg(builder_dict) |
| 293 | if device: |
| 294 | rv['device_cfg'] = device |
borenet | cafbfe6 | 2016-04-01 07:18:27 -0700 | [diff] [blame] | 295 | board = product_board(builder_dict) |
| 296 | if board: |
| 297 | rv['product.board'] = board |
borenet | dbf9f01 | 2015-07-30 07:09:20 -0700 | [diff] [blame] | 298 | |
| 299 | role = builder_dict['role'] |
| 300 | if role == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: |
| 301 | configuration = CONFIG_RELEASE |
| 302 | else: |
| 303 | configuration = builder_dict.get( |
| 304 | 'configuration', CONFIG_DEBUG) |
| 305 | arch = (builder_dict.get('arch') or builder_dict.get('target_arch')) |
| 306 | if ('Win' in builder_dict.get('os', '') and arch == 'x86_64'): |
| 307 | configuration += '_x64' |
| 308 | rv['configuration'] = configuration |
rmistry | 43e8f67 | 2016-04-18 04:14:17 -0700 | [diff] [blame] | 309 | if configuration == CONFIG_COVERAGE: |
| 310 | rv['do_compile_steps'] = False |
borenet | dbf9f01 | 2015-07-30 07:09:20 -0700 | [diff] [blame] | 311 | rv['do_test_steps'] = role == builder_name_schema.BUILDER_ROLE_TEST |
| 312 | rv['do_perf_steps'] = (role == builder_name_schema.BUILDER_ROLE_PERF or |
| 313 | (role == builder_name_schema.BUILDER_ROLE_TEST and |
borenet | 5eaaad2 | 2015-10-22 07:06:28 -0700 | [diff] [blame] | 314 | configuration == CONFIG_DEBUG)) |
rmistry | 0adac46 | 2016-04-05 08:24:29 -0700 | [diff] [blame] | 315 | if rv['do_test_steps'] and 'Valgrind' in builder_name: |
borenet | 5eaaad2 | 2015-10-22 07:06:28 -0700 | [diff] [blame] | 316 | rv['do_perf_steps'] = True |
| 317 | if 'GalaxyS4' in builder_name: |
| 318 | rv['do_perf_steps'] = False |
| 319 | |
borenet | b64b195 | 2015-10-21 07:50:57 -0700 | [diff] [blame] | 320 | rv['build_targets'] = build_targets_from_builder_dict( |
| 321 | builder_dict, rv['do_test_steps'], rv['do_perf_steps']) |
borenet | dbf9f01 | 2015-07-30 07:09:20 -0700 | [diff] [blame] | 322 | |
| 323 | # Do we upload perf results? |
| 324 | upload_perf_results = False |
| 325 | if role == builder_name_schema.BUILDER_ROLE_PERF: |
| 326 | upload_perf_results = True |
| 327 | rv['upload_perf_results'] = upload_perf_results |
| 328 | |
| 329 | # Do we upload correctness results? |
| 330 | skip_upload_bots = [ |
| 331 | 'ASAN', |
| 332 | 'Coverage', |
mtklein | 001cc1f | 2016-02-05 06:16:59 -0800 | [diff] [blame] | 333 | 'MSAN', |
borenet | dbf9f01 | 2015-07-30 07:09:20 -0700 | [diff] [blame] | 334 | 'TSAN', |
| 335 | 'UBSAN', |
| 336 | 'Valgrind', |
| 337 | ] |
| 338 | upload_dm_results = True |
| 339 | for s in skip_upload_bots: |
| 340 | if s in builder_name: |
| 341 | upload_dm_results = False |
| 342 | break |
| 343 | rv['upload_dm_results'] = upload_dm_results |
| 344 | |
borenet | 7bccca1 | 2015-07-29 11:15:42 -0700 | [diff] [blame] | 345 | return rv |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 346 | |
| 347 | |
| 348 | cov_end = lineno() # Don't care about code coverage past here. |
| 349 | |
| 350 | |
| 351 | def self_test(): |
| 352 | import coverage # This way the bots don't need coverage.py to be installed. |
| 353 | args = {} |
| 354 | cases = [ |
| 355 | 'Build-Mac10.8-Clang-Arm7-Debug-Android', |
| 356 | 'Build-Win-MSVC-x86-Debug', |
| 357 | 'Build-Win-MSVC-x86-Debug-GDI', |
| 358 | 'Build-Win-MSVC-x86-Debug-Exceptions', |
| 359 | 'Build-Ubuntu-GCC-Arm7-Debug-Android_FrameworkDefs', |
borenet | 7bccca1 | 2015-07-29 11:15:42 -0700 | [diff] [blame] | 360 | 'Build-Ubuntu-GCC-Arm7-Debug-Android_NoNeon', |
borenet | 08d7747 | 2015-09-21 08:20:24 -0700 | [diff] [blame] | 361 | 'Build-Ubuntu-GCC-x86_64-Release-ANGLE', |
borenet | b55448b | 2016-05-17 10:26:15 -0700 | [diff] [blame] | 362 | 'Build-Ubuntu-GCC-x64_64-Release-Fast', |
| 363 | 'Build-Ubuntu-GCC-x86_64-Release-Mesa', |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 364 | 'Housekeeper-PerCommit', |
| 365 | 'Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-Trybot', |
joshualitt | 64673af | 2015-12-16 12:54:19 -0800 | [diff] [blame] | 366 | 'Perf-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Release-VisualBench', |
borenet | 5eaaad2 | 2015-10-22 07:06:28 -0700 | [diff] [blame] | 367 | 'Test-Android-GCC-GalaxyS4-GPU-SGX544-Arm7-Debug', |
borenet | 98f7e33 | 2015-08-24 12:50:59 -0700 | [diff] [blame] | 368 | 'Perf-Android-GCC-Nexus5-GPU-Adreno330-Arm7-Release-Appurify', |
borenet | 7bccca1 | 2015-07-29 11:15:42 -0700 | [diff] [blame] | 369 | 'Test-Android-GCC-Nexus6-GPU-Adreno420-Arm7-Debug', |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 370 | 'Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug', |
borenet | 48b88cc | 2016-04-11 10:16:01 -0700 | [diff] [blame] | 371 | 'Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug-CommandBuffer', |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 372 | 'Test-Mac10.8-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Release', |
borenet | 98f7e33 | 2015-08-24 12:50:59 -0700 | [diff] [blame] | 373 | 'Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Coverage', |
borenet | b55448b | 2016-05-17 10:26:15 -0700 | [diff] [blame] | 374 | 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN', |
borenet | 9063e42 | 2015-09-18 06:37:14 -0700 | [diff] [blame] | 375 | ('Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-' |
| 376 | 'SK_USE_DISCARDABLE_SCALEDIMAGECACHE'), |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 377 | 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD', |
mtklein | 6f65957 | 2016-02-16 06:42:51 -0800 | [diff] [blame] | 378 | 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Fast', |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 379 | 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared', |
| 380 | 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind', |
borenet | 71e185c | 2016-04-12 08:13:56 -0700 | [diff] [blame] | 381 | 'Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan', |
borenet | b76c1f7 | 2015-07-29 07:38:49 -0700 | [diff] [blame] | 382 | 'Test-Win8-MSVC-ShuttleB-GPU-HD4600-x86-Release-ANGLE', |
| 383 | 'Test-Win8-MSVC-ShuttleA-CPU-AVX-x86_64-Debug', |
| 384 | ] |
| 385 | |
| 386 | cov = coverage.coverage() |
| 387 | cov.start() |
| 388 | for case in cases: |
| 389 | args[case] = get_builder_spec(case) |
| 390 | cov.stop() |
| 391 | |
| 392 | this_file = os.path.basename(__file__) |
| 393 | _, _, not_run, _ = cov.analysis(this_file) |
| 394 | filtered = [line for line in not_run if |
| 395 | line > cov_start and line < cov_end and line not in cov_skip] |
| 396 | if filtered: |
| 397 | print 'Lines not covered by test cases: ', filtered |
| 398 | sys.exit(1) |
| 399 | |
| 400 | golden = this_file.replace('.py', '.json') |
| 401 | with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f: |
| 402 | json.dump(args, f, indent=2, sort_keys=True) |
| 403 | |
| 404 | |
| 405 | if __name__ == '__main__': |
| 406 | if len(sys.argv) == 2 and sys.argv[1] == 'test': |
| 407 | self_test() |
| 408 | sys.exit(0) |
| 409 | |
| 410 | if len(sys.argv) != 3: |
| 411 | print usage |
| 412 | sys.exit(1) |
| 413 | |
| 414 | with open(sys.argv[1], 'w') as out: |
| 415 | json.dump(get_builder_spec(sys.argv[2]), out) |