From ad89c3254cc6c06026f1bebe23ec3717c1546633 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Wed, 7 Oct 2020 19:21:51 +0100 Subject: 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. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/devtool.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'meta/lib/oeqa/selftest') diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 2c9ff7a95a..0185e670ad 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -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): -- cgit 1.2.3-korg