summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT_test.py
diff options
context:
space:
mode:
authormarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-22 18:11:56 +0000
committermarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-22 18:11:56 +0000
commit962f117eb5ebc365e06c815a897885c4f683dafe (patch)
treed9653107e12b0b748a452b47347a96b46eb19965 /PRESUBMIT_test.py
parentbb40acf60c4caeb534bf091cbd44091b699043bd (diff)
downloadchromium_src-962f117eb5ebc365e06c815a897885c4f683dafe.zip
chromium_src-962f117eb5ebc365e06c815a897885c4f683dafe.tar.gz
chromium_src-962f117eb5ebc365e06c815a897885c4f683dafe.tar.bz2
PRESUBMIT #include check enhancement: <sys/..> includes can be in any order.
E.g., need to be in this order, since the latter uses definitions from the former. BUG=NONE Review URL: https://codereview.chromium.org/11418128 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169290 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 80c1756..183ec6e 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -175,6 +175,16 @@ class IncludeOrderTest(unittest.TestCase):
mock_input_api, mock_file, True, range(1, len(contents) + 1))
self.assertEqual(0, len(warnings))
+ def testSysIncludes(self):
+ # #include <sys/...>'s can appear in any order.
+ mock_input_api = MockInputApi()
+ contents = ['#include <sys/b.h>',
+ '#include <sys/a.h>']
+ mock_file = MockFile('', contents)
+ warnings = PRESUBMIT._CheckIncludeOrderInFile(
+ mock_input_api, mock_file, True, range(1, len(contents) + 1))
+ self.assertEqual(0, len(warnings))
+
class VersionControlerConflictsTest(unittest.TestCase):
def testTypicalConflict(self):