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 = ''' |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 # SKNX_NO_SIMD, SK_USE_DISCARDABLE_SCALEDIMAGECACHE, etc. | 165 # SKNX_NO_SIMD, SK_USE_DISCARDABLE_SCALEDIMAGECACHE, etc. |
166 extra_config = builder_dict.get('extra_config', '') | 166 extra_config = builder_dict.get('extra_config', '') |
167 if extra_config.startswith('SK') and extra_config.isupper(): | 167 if extra_config.startswith('SK') and extra_config.isupper(): |
168 env['CPPFLAGS'] = '-D' + extra_config | 168 env['CPPFLAGS'] = '-D' + extra_config |
169 | 169 |
170 return env | 170 return env |
171 | 171 |
172 | 172 |
173 cov_skip.extend([lineno(), lineno() + 1]) | 173 cov_skip.extend([lineno(), lineno() + 1]) |
174 def build_targets_from_builder_dict(builder_dict): | 174 def build_targets_from_builder_dict(builder_dict, do_test_steps, do_perf_steps): |
175 """Return a list of targets to build, depending on the builder type.""" | 175 """Return a list of targets to build, depending on the builder type.""" |
176 if builder_dict['role'] in ('Test', 'Perf') and builder_dict['os'] == 'iOS': | 176 if builder_dict['role'] in ('Test', 'Perf') and builder_dict['os'] == 'iOS': |
177 return ['iOSShell'] | 177 return ['iOSShell'] |
178 elif builder_dict['role'] == builder_name_schema.BUILDER_ROLE_TEST: | 178 if builder_dict.get('extra_config') == 'Appurify': |
179 t = ['dm'] | 179 return ['VisualBenchTest_APK'] |
180 if builder_dict.get('configuration') == 'Debug': | 180 t = [] |
181 t.append('nanobench') | 181 if do_test_steps: |
| 182 t.append('dm') |
| 183 if do_perf_steps: |
| 184 t.append('nanobench') |
| 185 if t: |
182 return t | 186 return t |
183 elif builder_dict['role'] == builder_name_schema.BUILDER_ROLE_PERF: | |
184 if builder_dict.get('extra_config') == 'Appurify': | |
185 return ['VisualBenchTest_APK'] | |
186 else: | |
187 return ['nanobench'] | |
188 else: | 187 else: |
189 return ['most'] | 188 return ['most'] |
190 | 189 |
191 | 190 |
192 cov_skip.extend([lineno(), lineno() + 1]) | 191 cov_skip.extend([lineno(), lineno() + 1]) |
193 def device_cfg(builder_dict): | 192 def device_cfg(builder_dict): |
194 # Android. | 193 # Android. |
195 if 'Android' in builder_dict.get('extra_config', ''): | 194 if 'Android' in builder_dict.get('extra_config', ''): |
196 if 'NoNeon' in builder_dict['extra_config']: | 195 if 'NoNeon' in builder_dict['extra_config']: |
197 return 'arm_v7' | 196 return 'arm_v7' |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 232 |
234 cov_skip.extend([lineno(), lineno() + 1]) | 233 cov_skip.extend([lineno(), lineno() + 1]) |
235 def get_builder_spec(builder_name): | 234 def get_builder_spec(builder_name): |
236 builder_dict = builder_name_schema.DictForBuilderName(builder_name) | 235 builder_dict = builder_name_schema.DictForBuilderName(builder_name) |
237 env = get_extra_env_vars(builder_dict) | 236 env = get_extra_env_vars(builder_dict) |
238 gyp_defs = gyp_defines(builder_dict) | 237 gyp_defs = gyp_defines(builder_dict) |
239 gyp_defs_list = ['%s=%s' % (k, v) for k, v in gyp_defs.iteritems()] | 238 gyp_defs_list = ['%s=%s' % (k, v) for k, v in gyp_defs.iteritems()] |
240 gyp_defs_list.sort() | 239 gyp_defs_list.sort() |
241 env['GYP_DEFINES'] = ' '.join(gyp_defs_list) | 240 env['GYP_DEFINES'] = ' '.join(gyp_defs_list) |
242 rv = { | 241 rv = { |
243 'build_targets': build_targets_from_builder_dict(builder_dict), | |
244 'builder_cfg': builder_dict, | 242 'builder_cfg': builder_dict, |
245 'dm_flags': dm_flags.get_args(builder_name), | 243 'dm_flags': dm_flags.get_args(builder_name), |
246 'env': env, | 244 'env': env, |
247 'nanobench_flags': nanobench_flags.get_args(builder_name), | 245 'nanobench_flags': nanobench_flags.get_args(builder_name), |
248 } | 246 } |
249 device = device_cfg(builder_dict) | 247 device = device_cfg(builder_dict) |
250 if device: | 248 if device: |
251 rv['device_cfg'] = device | 249 rv['device_cfg'] = device |
252 | 250 |
253 role = builder_dict['role'] | 251 role = builder_dict['role'] |
254 if role == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: | 252 if role == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: |
255 configuration = CONFIG_RELEASE | 253 configuration = CONFIG_RELEASE |
256 else: | 254 else: |
257 configuration = builder_dict.get( | 255 configuration = builder_dict.get( |
258 'configuration', CONFIG_DEBUG) | 256 'configuration', CONFIG_DEBUG) |
259 arch = (builder_dict.get('arch') or builder_dict.get('target_arch')) | 257 arch = (builder_dict.get('arch') or builder_dict.get('target_arch')) |
260 if ('Win' in builder_dict.get('os', '') and arch == 'x86_64'): | 258 if ('Win' in builder_dict.get('os', '') and arch == 'x86_64'): |
261 configuration += '_x64' | 259 configuration += '_x64' |
262 rv['configuration'] = configuration | 260 rv['configuration'] = configuration |
263 rv['do_test_steps'] = role == builder_name_schema.BUILDER_ROLE_TEST | 261 rv['do_test_steps'] = role == builder_name_schema.BUILDER_ROLE_TEST |
264 rv['do_perf_steps'] = (role == builder_name_schema.BUILDER_ROLE_PERF or | 262 rv['do_perf_steps'] = (role == builder_name_schema.BUILDER_ROLE_PERF or |
265 (role == builder_name_schema.BUILDER_ROLE_TEST and | 263 (role == builder_name_schema.BUILDER_ROLE_TEST and |
266 configuration == CONFIG_DEBUG) or | 264 configuration == CONFIG_DEBUG) or |
267 'Valgrind' in builder_name) | 265 'Valgrind' in builder_name) |
| 266 rv['build_targets'] = build_targets_from_builder_dict( |
| 267 builder_dict, rv['do_test_steps'], rv['do_perf_steps']) |
268 | 268 |
269 # Do we upload perf results? | 269 # Do we upload perf results? |
270 upload_perf_results = False | 270 upload_perf_results = False |
271 if role == builder_name_schema.BUILDER_ROLE_PERF: | 271 if role == builder_name_schema.BUILDER_ROLE_PERF: |
272 upload_perf_results = True | 272 upload_perf_results = True |
273 rv['upload_perf_results'] = upload_perf_results | 273 rv['upload_perf_results'] = upload_perf_results |
274 | 274 |
275 # Do we upload correctness results? | 275 # Do we upload correctness results? |
276 skip_upload_bots = [ | 276 skip_upload_bots = [ |
277 'ASAN', | 277 'ASAN', |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 if len(sys.argv) == 2 and sys.argv[1] == 'test': | 347 if len(sys.argv) == 2 and sys.argv[1] == 'test': |
348 self_test() | 348 self_test() |
349 sys.exit(0) | 349 sys.exit(0) |
350 | 350 |
351 if len(sys.argv) != 3: | 351 if len(sys.argv) != 3: |
352 print usage | 352 print usage |
353 sys.exit(1) | 353 sys.exit(1) |
354 | 354 |
355 with open(sys.argv[1], 'w') as out: | 355 with open(sys.argv[1], 'w') as out: |
356 json.dump(get_builder_spec(sys.argv[2]), out) | 356 json.dump(get_builder_spec(sys.argv[2]), out) |
OLD | NEW |