@@ -1056,7 +1056,7 @@ class RecipetoolAppendsrcBase(RecipetoolBase):
if p.scheme == 'file':
return p.netloc + p.path
- def _test_appendsrcfile(self, testrecipe, filename=None, destdir=None, has_src_uri=True, srcdir=None, newfile=None, options=''):
+ def _test_appendsrcfile(self, testrecipe, filename=None, destdir=None, has_src_uri=True, srcdir=None, newfile=None, machine=None, options=''):
if newfile is None:
newfile = self.testfile
@@ -1084,12 +1084,26 @@ class RecipetoolAppendsrcBase(RecipetoolBase):
expectedlines = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
'\n']
+ override = ""
+ if machine:
+ options += ' -m %s' % machine
+ override = ':append:%s' % machine
+ expectedlines.extend(['PACKAGE_ARCH = "${MACHINE_ARCH}"\n',
+ '\n'])
+
if has_src_uri:
uri = 'file://%s' % filename
if expected_subdir:
uri += ';subdir=%s' % expected_subdir
- expectedlines.extend(['SRC_URI += "%s"\n' % uri,
- '\n'])
+ if machine:
+ src_uri_line = 'SRC_URI%s = " %s"\n' % (override, uri)
+ else:
+ src_uri_line = 'SRC_URI += "%s"\n' % uri
+
+ expectedlines.extend([src_uri_line, '\n'])
+
+ if machine:
+ filename = '%s/%s' % (machine, filename)
return self._try_recipetool_appendsrcfile(testrecipe, newfile, destpath, options, expectedlines, [filename])
@@ -1162,6 +1176,9 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
output = self._test_appendsrcfile(testrecipe, filepath, subdir, has_src_uri=False)
self.assertTrue(any('with different parameters' in l for l in output))
+ def test_recipetool_appendsrcfile_machine(self):
+ self._test_appendsrcfile('base-files', 'a-file', machine='mymachine')
+
def test_recipetool_appendsrcfile_replace_file_srcdir(self):
testrecipe = 'bash'
filepath = 'Makefile.in'
Add a new test for machine specific bbappend override Signed-off-by: Julien Stephan <jstephan@baylibre.com> --- meta/lib/oeqa/selftest/cases/recipetool.py | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)