]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - tools/patman/test.py
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / tools / patman / test.py
index cf42480a6508e267df6df3ca34efe9ee3847de57..8cd26471c3c9854e433e63ae18495d395d123e05 100644 (file)
@@ -119,8 +119,8 @@ index 6f3748d..f9e4e65 100644
 --- a/README
 +++ b/README
 @@ -2026,6 +2026,17 @@ The following options need to be configured:
-               example, some LED's) on your board. At the moment,
-               the following checkpoints are implemented:
+               example, some LED's) on your board. At the moment,
+               the following checkpoints are implemented:
 
 +- Time boot progress
 +              CONFIG_BOOTSTAGE
@@ -134,7 +134,7 @@ index 6f3748d..f9e4e65 100644
 +              You can add calls to bootstage_mark() to set time markers.
 +
  - Standalone program support:
-               CONFIG_STANDALONE_LOAD_ADDR
+               CONFIG_STANDALONE_LOAD_ADDR
 
 diff --git a/common/bootstage.c b/common/bootstage.c
 new file mode 100644
@@ -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)