Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: PRESUBMIT_test.py

Issue 11607019: PRESUBMIT #include check: exclude known cases which need a non-standard order. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« PRESUBMIT.py ('K') | « PRESUBMIT.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT_test.py
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index a8bbc8088b14f56a8f43c5a64f5b5b23631fc0f6..979ad892f1a58278ef1f248fd462ffc67b7824ee 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):
« PRESUBMIT.py ('K') | « PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698