summaryrefslogtreecommitdiffstats
path: root/scripts/lib/compatlayer/cases/bsp.py
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-04-12 17:44:26 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-13 10:54:10 +0100
commit68079d0f873b1aaf747828a6d464157384dd00b9 (patch)
tree128c69b02f2cf339cc185754ab8dbb1f2bb41a88 /scripts/lib/compatlayer/cases/bsp.py
parentde76d1cc94c5a59000fbca9d5e53a5917f4e3041 (diff)
downloadpoky-68079d0f873b1aaf747828a6d464157384dd00b9.tar.gz
yocto-compat-layer: better handling of per-machine world build breakage
It is fairly common that BSP layers enable recipes when choosing machines from that layer without checking whether the recipe actually builds in the current distro. That breaks "bitbake world", retrieving signatures and thus the test_machine_signatures test. It's better to let that test continue with the signatures that can be retrieved and report the broken world build separately. Right now, the new test_machine_world iterates over all machines. More elegant and useful in combination with a (currently missing) selection of which tests to run would be to generate one test instance per machine. But that is not straightforward and has to wait. The "-k" argument alone was not enough to proceed despite failures, because bitbake then still returns a non-zero exit code. The existance of the output file is taken as sign that the bitbake execution managed was not fatally broken. (From OE-Core rev: 02f5d7836b726e40fef82b50b8145acc839b360b) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/compatlayer/cases/bsp.py')
-rw-r--r--scripts/lib/compatlayer/cases/bsp.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/lib/compatlayer/cases/bsp.py b/scripts/lib/compatlayer/cases/bsp.py
index 90256750af..43efae406f 100644
--- a/scripts/lib/compatlayer/cases/bsp.py
+++ b/scripts/lib/compatlayer/cases/bsp.py
@@ -25,6 +25,32 @@ class BSPCompatLayer(OECompatLayerTestCase):
25 msg="Layer %s modified machine %s -> %s" % \ 25 msg="Layer %s modified machine %s -> %s" % \
26 (self.tc.layer['name'], self.td['bbvars']['MACHINE'], machine)) 26 (self.tc.layer['name'], self.td['bbvars']['MACHINE'], machine))
27 27
28
29 def test_machine_world(self):
30 '''
31 "bitbake world" is expected to work regardless which machine is selected.
32 BSP layers sometimes break that by enabling a recipe for a certain machine
33 without checking whether that recipe actually can be built in the current
34 distro configuration (for example, OpenGL might not enabled).
35
36 This test iterates over all machines. It would be nicer to instantiate
37 it once per machine. It merely checks for errors during parse
38 time. It does not actually attempt to build anything.
39 '''
40
41 if not self.td['machines']:
42 self.skipTest('No machines set with --machines.')
43 msg = []
44 for machine in self.td['machines']:
45 # In contrast to test_machine_signatures() below, errors are fatal here.
46 try:
47 get_signatures(self.td['builddir'], failsafe=False, machine=machine)
48 except RuntimeError as ex:
49 msg.append(str(ex))
50 if msg:
51 msg.insert(0, 'The following machines broke a world build:')
52 self.fail('\n'.join(msg))
53
28 def test_machine_signatures(self): 54 def test_machine_signatures(self):
29 ''' 55 '''
30 Selecting a machine may only affect the signature of tasks that are specific 56 Selecting a machine may only affect the signature of tasks that are specific