This is an archive of the discontinued LLVM Phabricator instance.

[Test Suite] Properly respect --framework option
ClosedPublic

Authored by beanz on Oct 21 2016, 4:29 PM.

Details

Summary

dotest.py has a framework option that is not respected. This patch makes the framework path properly configurable via the --framework option.

This patch also adds a function to the lldbtest.Base class named "hasDarwinFramework" which allows us to not rely on the host platform to determine if a framework is present. If running on Darwin, and not building a framework, this will follow the *nix code paths which are appropriate for Darwin.

Event Timeline

beanz updated this revision to Diff 75505.Oct 21 2016, 4:29 PM
beanz retitled this revision from to [Test Suite] Properly respect --framework option.
beanz updated this object.
beanz added a reviewer: tfiala.
beanz added a subscriber: lldb-commits.

Maybe put that function lldbplatformutil?

tfiala accepted this revision.Oct 21 2016, 5:25 PM
tfiala edited edge metadata.

Looks good.

I do wonder if we should have a general helper for lines like this:

sys.platform.rstrip('0123456789') in ('freebsd', 'linux', 'netbsd', 'darwin')

but that doesn't have to be looked at here.

This revision is now accepted and ready to land.Oct 21 2016, 5:25 PM
This revision was automatically updated to reflect the committed changes.
fjricci added inline comments.
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
1418 ↗(On Diff #76351)

Why do we need to make this -L$(lib_dir)/../lib instead of the original -L$(lib_dir)? This breaks cases where lib_dir is lib64 and not lib

beanz added inline comments.May 8 2017, 11:39 AM
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
1418 ↗(On Diff #76351)

Basically because this is hack on top of hack on top of hack...

Confusingly lib_dir is actually set to the bin dir not the correct setting for lib/lib64. Except if lldb supports the -P flag, and your host is FreeBSD or Linux, in which case we construct the lib path from the python path...

So this change was needed to make Darwin or NetBSD work, but broke FreeBSD and Linux in lib64 configurations... great...

We *really* need to clean up all of this because the garbled mess of platform-specific hacks is a really big problem.