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_metadata_summary.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_metadata_summary.py')
-rw-r--r-- | meta/lib/patchtest/tests/test_metadata_summary.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/meta/lib/patchtest/tests/test_metadata_summary.py b/meta/lib/patchtest/tests/test_metadata_summary.py new file mode 100644 index 0000000000..931b26768e --- /dev/null +++ b/meta/lib/patchtest/tests/test_metadata_summary.py | |||
@@ -0,0 +1,32 @@ | |||
1 | # Checks related to the patch's summary metadata variable | ||
2 | # | ||
3 | # Copyright (C) 2016 Intel Corporation | ||
4 | # | ||
5 | # SPDX-License-Identifier: GPL-2.0 | ||
6 | |||
7 | import base | ||
8 | from data import PatchTestInput | ||
9 | |||
10 | class Summary(base.Metadata): | ||
11 | metadata = 'SUMMARY' | ||
12 | |||
13 | def setUp(self): | ||
14 | # these tests just make sense on patches that can be merged | ||
15 | if not PatchTestInput.repo.canbemerged: | ||
16 | self.skip('Patch cannot be merged') | ||
17 | |||
18 | def test_summary_presence(self): | ||
19 | if not self.added: | ||
20 | self.skip('No added recipes, skipping test') | ||
21 | |||
22 | for pn in self.added: | ||
23 | # we are not interested in images | ||
24 | if 'core-image' in pn: | ||
25 | continue | ||
26 | rd = self.tinfoil.parse_recipe(pn) | ||
27 | summary = rd.getVar(self.metadata) | ||
28 | |||
29 | # "${PN} version ${PN}-${PR}" is the default, so fail if default | ||
30 | if summary.startswith('%s version' % pn): | ||
31 | self.fail('%s is missing in newly added recipe' % self.metadata, | ||
32 | 'Specify the variable %s in %s' % (self.metadata, pn)) | ||