1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

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>
This commit is contained in:
Simon Glass
2017-05-29 15:31:31 -06:00
parent a44f4fb72b
commit 6e87ae1c07
7 changed files with 459 additions and 2 deletions

View File

@@ -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.