浏览代码

codeparser: Fix var_execs to append to execs, not references

When using the "execs" information in new code, it became clear that
the returned data was incorrect and there were missing exec'd functions.
This corrects the error and changes one of the test results to match
the correct behaviour.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 10 年之前
父节点
当前提交
8a24f2d3b7
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 1
      lib/bb/codeparser.py
  2. 2 1
      lib/bb/tests/codeparser.py

+ 1 - 1
lib/bb/codeparser.py

@@ -186,7 +186,7 @@ class PythonParser():
             if n.__class__.__name__ == "Call":
                 self.visit_Call(n)
 
-        self.references.update(self.var_execs)
+        self.execs.update(self.var_execs)
 
         codeparsercache.pythoncacheextras[h] = {}
         codeparsercache.pythoncacheextras[h]["refs"] = self.references

+ 2 - 1
lib/bb/tests/codeparser.py

@@ -236,7 +236,8 @@ be. These unit tests are testing snippets."""
             self.d.setVar("do_something", "echo 'hi mom! ${FOO}'")
             self.d.setVarFlag("do_something", etype, True)
             self.parseExpression("bb.build.exec_func('do_something', d)")
-            self.assertReferences(set(["do_something"]))
+            self.assertReferences(set([]))
+            self.assertExecs(set(["do_something"]))
 
     def test_function_reference(self):
         self.context["testfunc"] = lambda msg: bb.msg.note(1, None, msg)