diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/compatlayer/__init__.py | 16 | ||||
-rw-r--r-- | scripts/lib/compatlayer/cases/bsp.py | 26 |
2 files changed, 40 insertions, 2 deletions
diff --git a/scripts/lib/compatlayer/__init__.py b/scripts/lib/compatlayer/__init__.py index 0d6f4e9c3b..e35f8c0d32 100644 --- a/scripts/lib/compatlayer/__init__.py +++ b/scripts/lib/compatlayer/__init__.py | |||
@@ -233,9 +233,21 @@ def get_signatures(builddir, failsafe=False, machine=None): | |||
233 | if failsafe: | 233 | if failsafe: |
234 | cmd += '-k ' | 234 | cmd += '-k ' |
235 | cmd += '-S none world' | 235 | cmd += '-S none world' |
236 | check_command('Generating signatures failed. This might be due to some parse error and/or general layer incompatibilities.', | ||
237 | cmd) | ||
238 | sigs_file = os.path.join(builddir, 'locked-sigs.inc') | 236 | sigs_file = os.path.join(builddir, 'locked-sigs.inc') |
237 | if os.path.exists(sigs_file): | ||
238 | os.unlink(sigs_file) | ||
239 | try: | ||
240 | check_command('Generating signatures failed. This might be due to some parse error and/or general layer incompatibilities.', | ||
241 | cmd) | ||
242 | except RuntimeError as ex: | ||
243 | if failsafe and os.path.exists(sigs_file): | ||
244 | # Ignore the error here. Most likely some recipes active | ||
245 | # in a world build lack some dependencies. There is a | ||
246 | # separate test_machine_world_build which exposes the | ||
247 | # failure. | ||
248 | pass | ||
249 | else: | ||
250 | raise | ||
239 | 251 | ||
240 | sig_regex = re.compile("^(?P<task>.*:.*):(?P<hash>.*) .$") | 252 | sig_regex = re.compile("^(?P<task>.*:.*):(?P<hash>.*) .$") |
241 | tune_regex = re.compile("(^|\s)SIGGEN_LOCKEDSIGS_t-(?P<tune>\S*)\s*=\s*") | 253 | tune_regex = re.compile("(^|\s)SIGGEN_LOCKEDSIGS_t-(?P<tune>\S*)\s*=\s*") |
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 |