summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT_test.py
diff options
context:
space:
mode:
authorb.kelemen@samsung.com <b.kelemen@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 23:19:54 +0000
committerb.kelemen@samsung.com <b.kelemen@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 23:19:54 +0000
commit4436c9e4f278db827b4e0b392f214ed81f837d79 (patch)
tree4d55a169974ebe74cd6c4f16127761229b000e2a /PRESUBMIT_test.py
parentac91eda402ff923c04f5f4c5b606e4f4452e1de4 (diff)
downloadchromium_src-4436c9e4f278db827b4e0b392f214ed81f837d79.zip
chromium_src-4436c9e4f278db827b4e0b392f214ed81f837d79.tar.gz
chromium_src-4436c9e4f278db827b4e0b392f214ed81f837d79.tar.bz2
Include order check should work better for files containing uncheckable includes
Currently as soon as we see an uncheckable include (like ipc/*macros.h or windows.h) we stop checking the file. Instead we should just skip that line and continue checking. Review URL: https://codereview.chromium.org/105633012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT_test.py')
-rwxr-xr-xPRESUBMIT_test.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index 1c7990c..c6b280a 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -280,36 +280,36 @@ class IncludeOrderTest(unittest.TestCase):
def testUncheckableIncludes(self):
mock_input_api = MockInputApi()
contents = ['#include <windows.h>',
- '#include "b.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))
+ self.assertEqual(1, len(warnings))
contents = ['#include "gpu/command_buffer/gles_autogen.h"',
- '#include "b.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))
+ self.assertEqual(1, len(warnings))
contents = ['#include "gl_mock_autogen.h"',
- '#include "b.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))
+ self.assertEqual(1, len(warnings))
contents = ['#include "ipc/some_macros.h"',
- '#include "b.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))
+ self.assertEqual(1, len(warnings))
class VersionControlConflictsTest(unittest.TestCase):