diff options
author | Trevor Gamblin <tgamblin@baylibre.com> | 2023-09-13 13:00:46 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-14 15:20:08 +0100 |
commit | 4a6f38c5327b40a45c340af49fee9a0d5cc890bd (patch) | |
tree | 669ae555ecc031990579baa207d40f38ab7e1335 /meta/lib/patchtest/tests/test_mbox_merge.py | |
parent | e12e6d94ecbea6e0dafc080f2f196e12228730eb (diff) | |
download | poky-4a6f38c5327b40a45c340af49fee9a0d5cc890bd.tar.gz |
patchtest: Add tests from patchtest oe repo
Copy the core components of the patchtest-oe repo into
meta/lib/patchtest in oe-core.
(From OE-Core rev: 257f64f4e4414b78981104aec132b067beb5a92a)
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/patchtest/tests/test_mbox_merge.py')
-rw-r--r-- | meta/lib/patchtest/tests/test_mbox_merge.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/lib/patchtest/tests/test_mbox_merge.py b/meta/lib/patchtest/tests/test_mbox_merge.py new file mode 100644 index 0000000000..c8b6718d15 --- /dev/null +++ b/meta/lib/patchtest/tests/test_mbox_merge.py | |||
@@ -0,0 +1,25 @@ | |||
1 | # Check if mbox was merged by patchtest | ||
2 | # | ||
3 | # Copyright (C) 2016 Intel Corporation | ||
4 | # | ||
5 | # SPDX-License-Identifier: GPL-2.0 | ||
6 | |||
7 | import subprocess | ||
8 | import base | ||
9 | from data import PatchTestInput | ||
10 | |||
11 | def headlog(): | ||
12 | output = subprocess.check_output( | ||
13 | "cd %s; git log --pretty='%%h#%%aN#%%cD:#%%s' -1" % PatchTestInput.repodir, | ||
14 | universal_newlines=True, | ||
15 | shell=True | ||
16 | ) | ||
17 | return output.split('#') | ||
18 | |||
19 | class Merge(base.Base): | ||
20 | def test_series_merge_on_head(self): | ||
21 | if not PatchTestInput.repo.ismerged: | ||
22 | commithash, author, date, shortlog = headlog() | ||
23 | self.fail('Series does not apply on top of target branch', | ||
24 | 'Rebase your series on top of targeted branch', | ||
25 | data=[('Targeted branch', '%s (currently at %s)' % (PatchTestInput.repo.branch, commithash))]) | ||