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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 that ignores header files and may have some false positives. A | 57 that ignores header files and may have some false positives. A |
58 better implementation would probably need a proper C++ parser. | 58 better implementation would probably need a proper C++ parser. |
59 """ | 59 """ |
60 # We only scan .cc files and the like, as the declaration of | 60 # We only scan .cc files and the like, as the declaration of |
61 # for-testing functions in header files are hard to distinguish from | 61 # for-testing functions in header files are hard to distinguish from |
62 # calls to such functions without a proper C++ parser. | 62 # calls to such functions without a proper C++ parser. |
63 source_extensions = r'\.(cc|cpp|cxx|mm)$' | 63 source_extensions = r'\.(cc|cpp|cxx|mm)$' |
64 file_inclusion_pattern = r'.+%s' % source_extensions | 64 file_inclusion_pattern = r'.+%s' % source_extensions |
65 file_exclusion_patterns = ( | 65 file_exclusion_patterns = ( |
66 r'.*[/\\](test_|mock_).+%s' % source_extensions, | 66 r'.*[/\\](test_|mock_).+%s' % source_extensions, |
67 r'.+_test_(support|base)%s' % source_extensions, | 67 r'.+_test_(base|support|util)%s' % source_extensions, |
68 r'.+_(api|browser|perf|unit|ui)?test%s' % source_extensions, | 68 r'.+_(api|browser|perf|unit|ui)?test%s' % source_extensions, |
69 r'.+profile_sync_service_harness%s' % source_extensions, | 69 r'.+profile_sync_service_harness%s' % source_extensions, |
70 ) | 70 ) |
71 path_exclusion_patterns = ( | 71 path_exclusion_patterns = ( |
72 r'.*[/\\](test|tool(s)?)[/\\].*', | 72 r'.*[/\\](test|tool(s)?)[/\\].*', |
73 # At request of folks maintaining this folder. | 73 # At request of folks maintaining this folder. |
74 r'chrome[/\\]browser[/\\]automation[/\\].*', | 74 r'chrome[/\\]browser[/\\]automation[/\\].*', |
75 ) | 75 ) |
76 | 76 |
77 base_function_pattern = r'ForTest(ing)?|for_test(ing)?' | 77 base_function_pattern = r'ForTest(ing)?|for_test(ing)?' |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 # 2 trybots (compared against ~45 for Mac and Linux). | 321 # 2 trybots (compared against ~45 for Mac and Linux). |
322 # If any file matches something compiled on the main waterfall | 322 # If any file matches something compiled on the main waterfall |
323 # android builder, use the android try server. | 323 # android builder, use the android try server. |
324 android_re_list = ('^base/', '^ipc/', '^net/', '^sql/', '^jingle/', | 324 android_re_list = ('^base/', '^ipc/', '^net/', '^sql/', '^jingle/', |
325 '^build/common.gypi$') | 325 '^build/common.gypi$') |
326 for f in affected_files: | 326 for f in affected_files: |
327 if any(re.search(r, f) for r in android_re_list): | 327 if any(re.search(r, f) for r in android_re_list): |
328 preferred.append('android') | 328 preferred.append('android') |
329 break | 329 break |
330 return preferred | 330 return preferred |
OLD | NEW |