diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-14 02:06:09 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-14 02:06:09 +0000 |
commit | 235018290123d0804859dc283bf43de171ca405c (patch) | |
tree | c9a56b1378adc647d4e3c5b7f70a8a93d99e4330 /PRESUBMIT.py | |
parent | 8847049d4984ccf76e942eabb7d5b8ec7548feca (diff) | |
download | chromium_src-235018290123d0804859dc283bf43de171ca405c.zip chromium_src-235018290123d0804859dc283bf43de171ca405c.tar.gz chromium_src-235018290123d0804859dc283bf43de171ca405c.tar.bz2 |
Add check to make sure to make surethe production code is not calling a function in test namespace
BUG=None
NOTRY=true
Review URL: https://codereview.chromium.org/285623004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270300 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index b3d3d15..281a04a 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -279,9 +279,9 @@ def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api): # calls to such functions without a proper C++ parser. file_inclusion_pattern = r'.+%s' % _IMPLEMENTATION_EXTENSIONS - base_function_pattern = r'ForTest(ing)?|for_test(ing)?' + base_function_pattern = r'[ :]test::[^\s]+|ForTest(ing)?|for_test(ing)?' inclusion_pattern = input_api.re.compile(r'(%s)\s*\(' % base_function_pattern) - comment_pattern = input_api.re.compile(r'//.*%s' % base_function_pattern) + comment_pattern = input_api.re.compile(r'//.*(%s)' % base_function_pattern) exclusion_pattern = input_api.re.compile( r'::[A-Za-z0-9_]+(%s)|(%s)[^;]+\{' % ( base_function_pattern, base_function_pattern)) |