Fix presubmit check to account for e.g. fooblat_unittest_android.cc
being allowed to call test-only code.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/10535106
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141558 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 71342f19..d4d00ed 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -61,12 +61,14 @@
# We only scan .cc files and the like, as the declaration of
# for-testing functions in header files are hard to distinguish from
# calls to such functions without a proper C++ parser.
+ platform_specifiers = r'(_(android|chromeos|gtk|mac|posix|win))?'
source_extensions = r'\.(cc|cpp|cxx|mm)$'
file_inclusion_pattern = r'.+%s' % source_extensions
file_exclusion_patterns = (
r'.*[/\\](test_|mock_).+%s' % source_extensions,
r'.+_test_(base|support|util)%s' % source_extensions,
- r'.+_(api|browser|perf|unit|ui)?test%s' % source_extensions,
+ r'.+_(api|browser|perf|unit|ui)?test%s%s' % (platform_specifiers,
+ source_extensions),
r'.+profile_sync_service_harness%s' % source_extensions,
)
path_exclusion_patterns = (