diff options
author | marja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 20:17:11 +0000 |
---|---|---|
committer | marja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 20:17:11 +0000 |
commit | 0e5c185616221930126116017b66d577067c78ae (patch) | |
tree | 8ffee7b789c4ccb2647b8aef13185236aede2246 /PRESUBMIT_test.py | |
parent | 083c02368d175e7fdd8a1b31568875ab77f616d7 (diff) | |
download | chromium_src-0e5c185616221930126116017b66d577067c78ae.zip chromium_src-0e5c185616221930126116017b66d577067c78ae.tar.gz chromium_src-0e5c185616221930126116017b66d577067c78ae.tar.bz2 |
PRESUBMIT #include check: exclude known cases which need a non-standard order.
BUG=NONE
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11607019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173773 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT_test.py')
-rwxr-xr-x | PRESUBMIT_test.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py index a8bbc80..979ad89 100755 --- a/PRESUBMIT_test.py +++ b/PRESUBMIT_test.py @@ -252,6 +252,40 @@ class IncludeOrderTest(unittest.TestCase): self.assertEqual(1, len(warnings[0].items)) self.assertEqual('notify', warnings[0].type) + def testUncheckableIncludes(self): + mock_input_api = MockInputApi() + contents = ['#include <windows.h>', + '#include "b.h"' + '#include "a.h"'] + mock_file = MockFile('', contents) + warnings = PRESUBMIT._CheckIncludeOrderInFile( + mock_input_api, mock_file, range(1, len(contents) + 1)) + self.assertEqual(0, len(warnings)) + + contents = ['#include "gpu/command_buffer/gles_autogen.h"', + '#include "b.h"' + '#include "a.h"'] + mock_file = MockFile('', contents) + warnings = PRESUBMIT._CheckIncludeOrderInFile( + mock_input_api, mock_file, range(1, len(contents) + 1)) + self.assertEqual(0, len(warnings)) + + contents = ['#include "gl_mock_autogen.h"', + '#include "b.h"' + '#include "a.h"'] + mock_file = MockFile('', contents) + warnings = PRESUBMIT._CheckIncludeOrderInFile( + mock_input_api, mock_file, range(1, len(contents) + 1)) + self.assertEqual(0, len(warnings)) + + contents = ['#include "ipc/some_macros.h"', + '#include "b.h"' + '#include "a.h"'] + mock_file = MockFile('', contents) + warnings = PRESUBMIT._CheckIncludeOrderInFile( + mock_input_api, mock_file, range(1, len(contents) + 1)) + self.assertEqual(0, len(warnings)) + class VersionControlerConflictsTest(unittest.TestCase): def testTypicalConflict(self): |