summaryrefslogtreecommitdiffstats
path: root/meta/lib/patchtest/tests/test_metadata_summary.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/patchtest/tests/test_metadata_summary.py')
-rw-r--r--meta/lib/patchtest/tests/test_metadata_summary.py32
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
7import base
8from data import PatchTestInput
9
10class 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))