aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/patchstream.py
diff options
context:
space:
mode:
authorSimon Glass2017-05-29 15:31:31 -0600
committerSimon Glass2017-06-08 20:21:59 -0600
commit6e87ae1c0730ec99b6824c2a3dc8510813f92b98 (patch)
tree9c604a63b0fe8a2d9c6f475c98ad7ebffd7c1c81 /tools/patman/patchstream.py
parenta44f4fb72bcb954bf38385e2953f7320b9f25aa3 (diff)
patman: Add a functional test
The existing test (patman --test) only covers basic checkpatch output. We have had some problems with unicode processing and could use test coverage for the various tags patman supports. Add a new functional test which runs most of the patman flow on a few test commits and checks that the results are correct. See the documentation in the test for a description of what it does. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'tools/patman/patchstream.py')
-rw-r--r--tools/patman/patchstream.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 6098728aa11..1b9136aa5c2 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -424,6 +424,19 @@ def GetMetaData(start, count):
"""
return GetMetaDataForList('HEAD~%d' % start, None, count)
+def GetMetaDataForTest(text):
+ """Process metadata from a file containing a git log. Used for tests
+
+ Args:
+ text:
+ """
+ series = Series()
+ ps = PatchStream(series, is_log=True)
+ for line in text.splitlines():
+ ps.ProcessLine(line)
+ ps.Finalize()
+ return series
+
def FixPatch(backup_dir, fname, series, commit):
"""Fix up a patch file, by adding/removing as required.