[lldb/test] Do a better job at setting (DY)LD_LIBRARY_PATH
authorPavel Labath <pavel@labath.sk>
Fri, 10 Jul 2020 12:58:29 +0000 (14:58 +0200)
committerPavel Labath <pavel@labath.sk>
Wed, 22 Jul 2020 09:37:02 +0000 (11:37 +0200)
commit5f4c850e7b4f100a8c779ea52b492c87af076136
tree4a170cff86b25d29541c865c7cda059be69a4c78
parente0a372ff10c8cc076cfd44e540629b7d09000d5e
[lldb/test] Do a better job at setting (DY)LD_LIBRARY_PATH

Summary:
registerSharedLibrariesWithTarget was setting the library path
environment variable to the process build directory, but the function is
also accepting libraries in other directories (in which case they won't
be found automatically).

This patch makes the function set the path variable correctly for these
libraries too. This enables us to remove the code for setting the path
variable in TestWeakSymbols.py, which was working only accidentally --
it was relying on the fact that
  launch_info.SetEnvironmentEntries(..., append=True)
would not overwrite the path variable it has set, but that is going to
change with D83306.

Reviewers: davide, jingham

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D83552
lldb/packages/Python/lldbsuite/test/lldbtest.py
lldb/test/API/commands/expression/weak_symbols/TestWeakSymbols.py