aboutsummaryrefslogtreecommitdiffstats
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:36:44 +0100
commitee22d3d51c60db2da97422b2be1e42239b7a2324 (patch)
treed716422ae18eb19f09521008144a9908500b41b3
parent9f7cb22febd557817c164e25a93f5660e9c06358 (diff)
downloadbitbake-contrib-ee22d3d51c60db2da97422b2be1e42239b7a2324.tar.gz
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. Signed-off-by: Christopher Larson <kergoth@gmail.com>
-rw-r--r--lib/bb/tests/codeparser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bb/tests/codeparser.py b/lib/bb/tests/codeparser.py
index 7f5d59ca7..a64c614b0 100644
--- a/lib/bb/tests/codeparser.py
+++ b/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):