OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Top-level presubmit script for Chromium. | 5 """Top-level presubmit script for Chromium. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into gcl. | 8 for more details about the presubmit API built into gcl. |
9 """ | 9 """ |
10 | 10 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 input_api, output_api)) | 327 input_api, output_api)) |
328 results.extend(input_api.canned_checks.CheckChangeHasTestField( | 328 results.extend(input_api.canned_checks.CheckChangeHasTestField( |
329 input_api, output_api)) | 329 input_api, output_api)) |
330 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 330 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
331 input_api, output_api)) | 331 input_api, output_api)) |
332 results.extend(_CheckSubversionConfig(input_api, output_api)) | 332 results.extend(_CheckSubversionConfig(input_api, output_api)) |
333 return results | 333 return results |
334 | 334 |
335 | 335 |
336 def GetPreferredTrySlaves(project, change): | 336 def GetPreferredTrySlaves(project, change): |
337 only_objc_files = all( | 337 affected_files = change.LocalPaths() |
338 f.LocalPath().endswith(('.mm', '.m')) for f in change.AffectedFiles()) | 338 only_objc_files = all(f.endswith(('.mm', '.m')) for f in affected_files) |
339 if only_objc_files: | 339 if only_objc_files: |
340 return ['mac_rel'] | 340 return ['mac_rel'] |
341 preferred = ['win_rel', 'linux_rel', 'mac_rel'] | 341 preferred = ['win_rel', 'linux_rel', 'mac_rel'] |
| 342 if any(f.endswith(('.h', '.cc', '.cpp', '.cxx')) for f in affected_files): |
| 343 preferred.append('linux_clang') |
342 aura_re = '_aura[^/]*[.][^/]*' | 344 aura_re = '_aura[^/]*[.][^/]*' |
343 if any(re.search(aura_re, f.LocalPath()) for f in change.AffectedFiles()): | 345 if any(re.search(aura_re, f) for f in affected_files): |
344 preferred.append('linux_chromeos') | 346 preferred.append('linux_chromeos') |
345 # For bringup (staging of upstream work) we must be careful to not | 347 # For bringup (staging of upstream work) we must be careful to not |
346 # overload Android infrastructure. Keeping Android try decisions in a | 348 # overload Android infrastructure. Keeping Android try decisions in a |
347 # single location (instead of adding conditionals in base/, net/, ...) | 349 # single location (instead of adding conditionals in base/, net/, ...) |
348 # will help us avoid doing so. For example, we are starting off with | 350 # will help us avoid doing so. For example, we are starting off with |
349 # 2 trybots (compared against ~45 for Mac and Linux). | 351 # 2 trybots (compared against ~45 for Mac and Linux). |
350 # If any file matches something compiled on the main waterfall | 352 # If any file matches something compiled on the main waterfall |
351 # android builder, use the android try server. | 353 # android builder, use the android try server. |
352 android_re_list = ('^base/', '^ipc/', '^net/', '^sql/', '^jingle/', | 354 android_re_list = ('^base/', '^ipc/', '^net/', '^sql/', '^jingle/', |
353 '^build/common.gypi$') | 355 '^build/common.gypi$') |
354 for f in change.AffectedFiles(): | 356 for f in affected_files: |
355 if any(re.search(r, f.LocalPath()) for r in android_re_list): | 357 if any(re.search(r, f) for r in android_re_list): |
356 preferred.append('android') | 358 preferred.append('android') |
357 break | 359 break |
358 return preferred | 360 return preferred |
OLD | NEW |