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>
This commit is contained in:
Christopher Larson
2022-03-17 15:51:28 -07:00
committed by Richard Purdie
parent fc8468024c
commit a9d2012f50

View File

@@ -44,6 +44,7 @@ class VariableReferenceTest(ReferenceTest):
def parseExpression(self, exp):
parsedvar = self.d.expandWithRefs(exp, None)
self.references = parsedvar.references
self.execs = parsedvar.execs
def test_simple_reference(self):
self.setEmptyVars(["FOO"])
@@ -61,6 +62,11 @@ class VariableReferenceTest(ReferenceTest):
self.parseExpression("${@d.getVar('BAR') + 'foo'}")
self.assertReferences(set(["BAR"]))
def test_python_exec_reference(self):
self.parseExpression("${@eval('3 * 5')}")
self.assertReferences(set())
self.assertExecs(set(["eval"]))
class ShellReferenceTest(ReferenceTest):
def parseExpression(self, exp):