summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/codeparser.py
diff options
context:
space:
mode:
authorInsu Park <insu0.park@gmail.com>2023-09-19 15:59:38 +0900
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-20 08:57:41 +0100
commit6ad45f110e2249c7e3c372462aff101e43c9c0a3 (patch)
tree4612613ba5eb50d1a0dfc081207476e72613643a /bitbake/lib/bb/tests/codeparser.py
parentc603849494f240870937564cc47d27ad044e2188 (diff)
downloadpoky-6ad45f110e2249c7e3c372462aff101e43c9c0a3.tar.gz
bitbake: data: Add missing dependency handling of remove operator
A recipe variable handles its dependencies even on the "contains" variables within the "inline Python expressions" like bb.utils.filter(). And it also handles those in the append operator correctly, but the problem is that it does not so in the remove operator. Fix it by adding the missing dependencies every time the remove operator has been handled. Also add a test case to check if the override operators handle dependencies correctly. (Bitbake rev: b90520eedb1dbc7f6a3928d089fe74fafb864eb5) Signed-off-by: Insu Park <insu0.park@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/codeparser.py')
-rw-r--r--bitbake/lib/bb/tests/codeparser.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/codeparser.py b/bitbake/lib/bb/tests/codeparser.py
index a64c614b0b..b6f2b77ee3 100644
--- a/bitbake/lib/bb/tests/codeparser.py
+++ b/bitbake/lib/bb/tests/codeparser.py
@@ -436,6 +436,32 @@ esac
436 self.assertEqual(deps, set(["TESTVAR2"])) 436 self.assertEqual(deps, set(["TESTVAR2"]))
437 self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['testval3', 'anothervalue']) 437 self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['testval3', 'anothervalue'])
438 438
439 def test_contains_vardeps_override_operators(self):
440 # Check override operators handle dependencies correctly with the contains functionality
441 expr_plain = 'testval'
442 expr_prepend = '${@bb.utils.filter("TESTVAR1", "testval1", d)} '
443 expr_append = ' ${@bb.utils.filter("TESTVAR2", "testval2", d)}'
444 expr_remove = '${@bb.utils.contains("TESTVAR3", "no-testval", "testval", "", d)}'
445 # Check dependencies
446 self.d.setVar('ANOTHERVAR', expr_plain)
447 self.d.prependVar('ANOTHERVAR', expr_prepend)
448 self.d.appendVar('ANOTHERVAR', expr_append)
449 self.d.setVar('ANOTHERVAR:remove', expr_remove)
450 self.d.setVar('TESTVAR1', 'blah')
451 self.d.setVar('TESTVAR2', 'testval2')
452 self.d.setVar('TESTVAR3', 'no-testval')
453 deps, values = bb.data.build_dependencies("ANOTHERVAR", set(self.d.keys()), set(), set(), set(), set(), self.d, self.d)
454 self.assertEqual(sorted(values.splitlines()),
455 sorted([
456 expr_prepend + expr_plain + expr_append,
457 '_remove of ' + expr_remove,
458 'TESTVAR1{testval1} = Unset',
459 'TESTVAR2{testval2} = Set',
460 'TESTVAR3{no-testval} = Set',
461 ]))
462 # Check final value
463 self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['testval2'])
464
439 #Currently no wildcard support 465 #Currently no wildcard support
440 #def test_vardeps_wildcards(self): 466 #def test_vardeps_wildcards(self):
441 # self.d.setVar("oe_libinstall", "echo test") 467 # self.d.setVar("oe_libinstall", "echo test")