summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT_test.py
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-09 22:32:33 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-09 22:32:33 +0000
commit3e83618c9c1254dc0a76929dcc98a44cb1ba809b (patch)
treec4a315f3e8fb5f3f9cb8c32633bb469ee93c9c91 /PRESUBMIT_test.py
parentcf6f8e717efe681d0c9e8e9b1af36e1cf4b2ad6b (diff)
downloadchromium_src-3e83618c9c1254dc0a76929dcc98a44cb1ba809b.zip
chromium_src-3e83618c9c1254dc0a76929dcc98a44cb1ba809b.tar.gz
chromium_src-3e83618c9c1254dc0a76929dcc98a44cb1ba809b.tar.bz2
Implement presubmit support for _unittest_win includes, etc.
Without this change, xxx_unittest_win.cc would cause an erroneous presubmit error by including xxx_win.h as its first 'special' include. BUG=None Review URL: https://codereview.chromium.org/26486003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT_test.py')
-rwxr-xr-xPRESUBMIT_test.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index 63500a5..1c7990c 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -180,6 +180,16 @@ class IncludeOrderTest(unittest.TestCase):
mock_input_api, mock_file, range(1, len(contents) + 1))
self.assertEqual(0, len(warnings))
+ def testSpecialFirstInclude6(self):
+ mock_input_api = MockInputApi()
+ contents = ['#include "some/other/path/foo_win.h"',
+ '#include <set>',
+ '#include "a/header.h"']
+ mock_file = MockFile('some/path/foo_unittest_win.h', contents)
+ warnings = PRESUBMIT._CheckIncludeOrderInFile(
+ mock_input_api, mock_file, range(1, len(contents) + 1))
+ self.assertEqual(0, len(warnings))
+
def testOrderAlreadyWrong(self):
scope = [(1, '#include "b.h"'),
(2, '#include "a.h"'),