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