[all-commits] [llvm/llvm-project] 5c96e7: [lldb] Don't rely on ScriptInterpreterPythonImpl::...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Sat Feb 17 20:55:45 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5c96e71d0d49dd55711ccdb57a22d033fe7a8fae
      https://github.com/llvm/llvm-project/commit/5c96e71d0d49dd55711ccdb57a22d033fe7a8fae
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2024-02-17 (Sat, 17 Feb 2024)

  Changed paths:
    M lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp

  Log Message:
  -----------
  [lldb] Don't rely on ScriptInterpreterPythonImpl::Initialize in the unit tests (#82096)

The unit tests only test the Python objects and don't actually use
anything from the LLDB module. That means that all the additional
complexity in ScriptInterpreterPythonImpl::Initialize is overkill.

By doing the initialization by hand, we avoid the annoying
ModuleNotFoundError.

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  ModuleNotFoundError: No module named 'lldb'

The error is the result of us stubbing out the SWIG (specifically
`PyInit__lldb`) because we cannot link against libLLDB from the unit
tests.

The downside of doing the initialization manually is that we do lose a
bit of test coverage. For example, issue #70453 also manifested itself
in the unit tests.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list