diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-23 12:57:12 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-23 12:57:12 +0000 |
commit | e2d7e6f2d60c5fb8f0981cf0bfc91e1657117356 (patch) | |
tree | a35d21a550c8ca99c4b2748c35a6e45a6925fb2b /PRESUBMIT.py | |
parent | 379ee7f525e4cdca4a0d24d355c1c59458c1afa5 (diff) | |
download | chromium_src-e2d7e6f2d60c5fb8f0981cf0bfc91e1657117356.zip chromium_src-e2d7e6f2d60c5fb8f0981cf0bfc91e1657117356.tar.gz chromium_src-e2d7e6f2d60c5fb8f0981cf0bfc91e1657117356.tar.bz2 |
Allow test files to use non-platform suffixes for PRESUBMIT checks.
The current check for deciding if a file is a unittest allows
a strict whitelist of platforms as suffixes. However, when a
unittest file becomes too large, it is useful to split it on
other axes than by platform. This allows a _suffix for a topic
to be used without failing production-only presubmit checks.
In other words, it considers foo_bar_unittest_baz.cc to be a
unittest.
There are many examples of foo_unittest_utils.cc which are used
only by unit tests throughout chromium, but they have been lucky
to avoid using FunctionForTesting type functions. In cc/ we have
run into this problem, so allowing our unittests to be considered
non-production code prevents false positive warnings about our
test files.
NOTRY=true
R=maruel@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/14317011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195780 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 6feebd0..9e7bd99 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -27,10 +27,6 @@ _EXCLUDED_PATHS = ( r".+[\\\/]pnacl_shim\.c$", ) -# Fragment of a regular expression that matches file name suffixes -# used to indicate different platforms. -_PLATFORM_SPECIFIERS = r'(_(android|chromeos|gtk|mac|posix|win))?' - # Fragment of a regular expression that matches C++ and Objective-C++ # implementation files. _IMPLEMENTATION_EXTENSIONS = r'\.(cc|cpp|cxx|mm)$' @@ -40,8 +36,8 @@ _IMPLEMENTATION_EXTENSIONS = r'\.(cc|cpp|cxx|mm)$' _TEST_CODE_EXCLUDED_PATHS = ( r'.*[/\\](fake_|test_|mock_).+%s' % _IMPLEMENTATION_EXTENSIONS, r'.+_test_(base|support|util)%s' % _IMPLEMENTATION_EXTENSIONS, - r'.+_(api|browser|perf|unit|ui)?test%s%s' % (_PLATFORM_SPECIFIERS, - _IMPLEMENTATION_EXTENSIONS), + r'.+_(api|browser|perf|unit|ui)?test(_[a-z]+)?%s' % + _IMPLEMENTATION_EXTENSIONS, r'.+profile_sync_service_harness%s' % _IMPLEMENTATION_EXTENSIONS, r'.*[/\\](test|tool(s)?)[/\\].*', # At request of folks maintaining this folder. |