This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [lit] Set LD_LIBRARY_PATH or alike for Suite tests
ClosedPublic

Authored by mgorny on Feb 25 2019, 5:07 AM.

Details

Summary

Set LD_LIBRARY_PATH or local platform's equivalent of it when running
the 'Suite' tests. This is necessary when running tests inside build
tree with BUILD_SHARED_LIBS enabled, in order to make the LLDB modules
load freshly built LLVM libraries.

The code is copied from clang (test/Unit/lit.cfg). SHLIBDIR
substitution is added to site-config (already present in top-level LLDB
site-config) to future-proof this into supporting stand-alone builds
with shared LLDB libraries.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

mgorny created this revision.Feb 25 2019, 5:07 AM
labath accepted this revision.Feb 26 2019, 5:20 AM

Doesn't seem particularly elegant, but it seems clang is doing the same thing, so probably best to follow suit.

This revision is now accepted and ready to land.Feb 26 2019, 5:20 AM
mgorny updated this revision to Diff 188399.Feb 26 2019, 9:50 AM
mgorny edited the summary of this revision. (Show Details)

While working on other patches, I've noticed top-level lit.site.cfg* has SHLIBDIR which serves the same purpose as in clang. I've updated this patch to include it for Suite tests, and therefore future-proof it for stand-alone builds with shared LLDB libraries. This is also what clang does, exactly.

I've also fixed indentation to match LLDB style.

labath accepted this revision.Feb 26 2019, 11:35 AM

Thank you for the review. When I find some more time, I'll try to convert this into utility function somewhere in lit.

This revision was automatically updated to reflect the committed changes.