From 235018290123d0804859dc283bf43de171ca405c Mon Sep 17 00:00:00 2001 From: "oshima@chromium.org" Date: Wed, 14 May 2014 02:06:09 +0000 Subject: 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 --- PRESUBMIT.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'PRESUBMIT.py') 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)) -- cgit v1.1