From a9d2012f50b0c50c985c6dae184c8c19ace3b965 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Thu, 17 Mar 2022 15:51:28 -0700 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/tests/codeparser.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bitbake/lib/bb/tests') 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): 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): -- cgit v1.2.3-54-g00ecf