summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/tests')
-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")