summaryrefslogtreecommitdiff
path: root/tools/patman/test.py
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-04-12 22:07:57 +0200
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-04-12 22:07:57 +0200
commit18122019972ca639ee3b581257e3a63ff7c8efeb (patch)
tree52f7223e7c63f43322f3eee4722743e12190a19f /tools/patman/test.py
parent90639feaa0d66a204f9d03a325ab14e2f97f6cbb (diff)
parent785881f775252940185e10fbb2d5299c9ffa6bce (diff)
downloadu-boot-imx-18122019972ca639ee3b581257e3a63ff7c8efeb.zip
u-boot-imx-18122019972ca639ee3b581257e3a63ff7c8efeb.tar.gz
u-boot-imx-18122019972ca639ee3b581257e3a63ff7c8efeb.tar.bz2
Merge branch 'u-boot/master' into 'u-boot-arm/master'
Conflicts: drivers/video/exynos_fb.c
Diffstat (limited to 'tools/patman/test.py')
-rw-r--r--tools/patman/test.py64
1 files changed, 44 insertions, 20 deletions
diff --git a/tools/patman/test.py b/tools/patman/test.py
index f801ced..8cd2647 100644
--- a/tools/patman/test.py
+++ b/tools/patman/test.py
@@ -190,6 +190,11 @@ index 0000000..2234c87
+ rec->time_us = (uint32_t)timer_get_us();
+ rec->name = name;
+ }
++ if (!rec->name &&
++ %ssomething_else) {
++ rec->time_us = (uint32_t)timer_get_us();
++ rec->name = name;
++ }
+%sreturn rec->time_us;
+}
--
@@ -197,15 +202,18 @@ index 0000000..2234c87
'''
signoff = 'Signed-off-by: Simon Glass <sjg@chromium.org>\n'
tab = ' '
+ indent = ' '
if data_type == 'good':
pass
elif data_type == 'no-signoff':
signoff = ''
elif data_type == 'spaces':
tab = ' '
+ elif data_type == 'indent':
+ indent = tab
else:
print 'not implemented'
- return data % (signoff, tab, tab)
+ return data % (signoff, tab, indent, tab)
def SetupData(self, data_type):
inhandle, inname = tempfile.mkstemp()
@@ -215,33 +223,49 @@ index 0000000..2234c87
infd.close()
return inname
- def testCheckpatch(self):
+ def testGood(self):
"""Test checkpatch operation"""
inf = self.SetupData('good')
- result, problems, err, warn, lines, stdout = checkpatch.CheckPatch(inf)
- self.assertEqual(result, True)
- self.assertEqual(problems, [])
- self.assertEqual(err, 0)
- self.assertEqual(warn, 0)
- self.assertEqual(lines, 67)
+ result = checkpatch.CheckPatch(inf)
+ self.assertEqual(result.ok, True)
+ self.assertEqual(result.problems, [])
+ self.assertEqual(result.errors, 0)
+ self.assertEqual(result.warnings, 0)
+ self.assertEqual(result.checks, 0)
+ self.assertEqual(result.lines, 67)
os.remove(inf)
+ def testNoSignoff(self):
inf = self.SetupData('no-signoff')
- result, problems, err, warn, lines, stdout = checkpatch.CheckPatch(inf)
- self.assertEqual(result, False)
- self.assertEqual(len(problems), 1)
- self.assertEqual(err, 1)
- self.assertEqual(warn, 0)
- self.assertEqual(lines, 67)
+ result = checkpatch.CheckPatch(inf)
+ self.assertEqual(result.ok, False)
+ self.assertEqual(len(result.problems), 1)
+ self.assertEqual(result.errors, 1)
+ self.assertEqual(result.warnings, 0)
+ self.assertEqual(result.checks, 0)
+ self.assertEqual(result.lines, 67)
os.remove(inf)
+ def testSpaces(self):
inf = self.SetupData('spaces')
- result, problems, err, warn, lines, stdout = checkpatch.CheckPatch(inf)
- self.assertEqual(result, False)
- self.assertEqual(len(problems), 2)
- self.assertEqual(err, 0)
- self.assertEqual(warn, 2)
- self.assertEqual(lines, 67)
+ result = checkpatch.CheckPatch(inf)
+ self.assertEqual(result.ok, False)
+ self.assertEqual(len(result.problems), 1)
+ self.assertEqual(result.errors, 0)
+ self.assertEqual(result.warnings, 1)
+ self.assertEqual(result.checks, 0)
+ self.assertEqual(result.lines, 67)
+ os.remove(inf)
+
+ def testIndent(self):
+ inf = self.SetupData('indent')
+ result = checkpatch.CheckPatch(inf)
+ self.assertEqual(result.ok, False)
+ self.assertEqual(len(result.problems), 1)
+ self.assertEqual(result.errors, 0)
+ self.assertEqual(result.warnings, 0)
+ self.assertEqual(result.checks, 1)
+ self.assertEqual(result.lines, 67)
os.remove(inf)