summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests
diff options
context:
space:
mode:
authorChristopher Larson <kergoth@gmail.com>2022-03-17 15:51:28 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-04 11:37:55 +0100
commita9d2012f50b0c50c985c6dae184c8c19ace3b965 (patch)
treeafe2d485407186a9e6907613bf8d3c3ff01d8d68 /bitbake/lib/bb/tests
parentfc8468024cf47cb7019e0167e7e07f24131c85b1 (diff)
downloadpoky-a9d2012f50b0c50c985c6dae184c8c19ace3b965.tar.gz
bitbake: tests.codeparser: add test for exec of builtin from inline python
This ensures that any change to the presence of builtins in inline python execs will be noticed. (Bitbake rev: ee22d3d51c60db2da97422b2be1e42239b7a2324) Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests')
-rw-r--r--bitbake/lib/bb/tests/codeparser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/codeparser.py b/bitbake/lib/bb/tests/codeparser.py
index 7f5d59ca74..a64c614b0b 100644
--- a/bitbake/lib/bb/tests/codeparser.py
+++ b/bitbake/lib/bb/tests/codeparser.py
@@ -44,6 +44,7 @@ class VariableReferenceTest(ReferenceTest):
44 def parseExpression(self, exp): 44 def parseExpression(self, exp):
45 parsedvar = self.d.expandWithRefs(exp, None) 45 parsedvar = self.d.expandWithRefs(exp, None)
46 self.references = parsedvar.references 46 self.references = parsedvar.references
47 self.execs = parsedvar.execs
47 48
48 def test_simple_reference(self): 49 def test_simple_reference(self):
49 self.setEmptyVars(["FOO"]) 50 self.setEmptyVars(["FOO"])
@@ -61,6 +62,11 @@ class VariableReferenceTest(ReferenceTest):
61 self.parseExpression("${@d.getVar('BAR') + 'foo'}") 62 self.parseExpression("${@d.getVar('BAR') + 'foo'}")
62 self.assertReferences(set(["BAR"])) 63 self.assertReferences(set(["BAR"]))
63 64
65 def test_python_exec_reference(self):
66 self.parseExpression("${@eval('3 * 5')}")
67 self.assertReferences(set())
68 self.assertExecs(set(["eval"]))
69
64class ShellReferenceTest(ReferenceTest): 70class ShellReferenceTest(ReferenceTest):
65 71
66 def parseExpression(self, exp): 72 def parseExpression(self, exp):