selftest: add test for recipes with patches in overrides

devtool doesn't quite behave right when a recipe has patches applied in overrides, so
add a test case to exercise that behaviour.

(From OE-Core rev: ad89c3254cc6c06026f1bebe23ec3717c1546633)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2020-10-07 19:21:51 +01:00
committed by Richard Purdie
parent 961de02fd1
commit d6bc178f33
5 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
SUMMARY = "devtool test for overrides and patches"
LICENSE = "CLOSED"
INHIBIT_DEFAULT_DEPS = "1"
EXCLUDE_FROM_WORLD = "1"
SRC_URI = "file://source;subdir=${BP}"
SRC_URI_append_qemuarm = " file://arm.patch;striplevel=0"
SRC_URI_append_qemux86 = " file://x86.patch;striplevel=0"

View File

@@ -0,0 +1,5 @@
--- source.orig 2020-10-06 13:26:10.792688630 +0100
+++ source 2020-10-06 13:26:18.853424694 +0100
@@ -1 +1 @@
-This is a test for something
+This is a test for qemuarm

View File

@@ -0,0 +1,5 @@
--- source.orig 2020-10-06 13:26:10.792688630 +0100
+++ source 2020-10-06 13:26:18.853424694 +0100
@@ -1 +1 @@
-This is a test for something
+This is a test for qemux86

View File

@@ -0,0 +1 @@
This is a test for something

View File

@@ -784,6 +784,26 @@ class DevtoolModifyTests(DevtoolBase):
self._check_src_repo(tempdir)
# This is probably sufficient
def test_devtool_modify_overrides(self):
# Try modifying a recipe with patches in overrides
tempdir = tempfile.mkdtemp(prefix='devtoolqa')
self.track_for_cleanup(tempdir)
self.track_for_cleanup(self.workspacedir)
self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
result = runCmd('devtool modify devtool-patch-overrides -x %s' % (tempdir))
self._check_src_repo(tempdir)
source = os.path.join(tempdir, "source")
def check(branch, expected):
runCmd('git -C %s checkout %s' % (tempdir, branch))
with open(source, "rt") as f:
content = f.read()
self.assertEquals(content, expected)
check('devtool', 'This is a test for something\n')
check('devtool-no-overrides', 'This is a test for something\n')
check('devtool-override-qemuarm', 'This is a test for qemuarm\n')
check('devtool-override-qemux86', 'This is a test for qemux86\n')
class DevtoolUpdateTests(DevtoolBase):
def test_devtool_update_recipe(self):