This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi] Add lit configs for libcxxabi tests.
ClosedPublic

Authored by danalbert on Jul 7 2014, 5:31 PM.

Details

Reviewers
compnerd
Summary

This makes running libcxxabi tests on Linux _much_ easier.
Adds a check-libcxxabi target to cmake.

Also defaults to building a dynamic libc++abi. This is so that the
default options still test the libc++abi that is being built. There are
two problems with testing a static libc++abi. In the case of a
standalone build, the tests will link the system's libc++, which might
not have been built against our libc++abi. In the case of an in tree
build, libc++ will prefer a dynamic libc++abi from the system over a
static libc++abi from the output directory.

Diff Detail

Event Timeline

danalbert updated this revision to Diff 11136.Jul 7 2014, 5:31 PM
danalbert retitled this revision from to [libcxxabi] Add lit configs for libcxxabi tests..
danalbert updated this object.
danalbert edited the test plan for this revision. (Show Details)
danalbert added a subscriber: Unknown Object (MLST).
danalbert added inline comments.Jul 7 2014, 5:33 PM
test/CMakeLists.txt
42

The only thing this conditional is doing is adding an additional dependency on libc++ if we're building in tree... is there a way to add a dependency to a custom target after add_custom_target has been called?

compnerd added inline comments.
CMakeLists.txt
104

Did you intend to make this shared by default?

110

I think that you should use a separate variable (LIBCXX_INCLUDE_DIR perhaps?) that is set to ${CMAKE_CURRENT_BINARY_DIR}/include rather than relying on LLVM's variable.

I realize that this is a standalone build, and therefore LLVM_INCLUDE_DIR *should* point to the same location, but it makes it something that you need to reason out (at least, I had to think about it for a moment).

test/lit.cfg
2

Is this the format that the rest of the python code in LLVM uses? I don't really care at the end of the day, just curious.

danalbert added inline comments.Jul 7 2014, 7:31 PM
CMakeLists.txt
104

Yes. See the long part of the summary. I'm willing to change this back to the way it was if people think that's better.

110

I don't understand. ${CMAKE_CURRENT_BINARY_DIR}/include won't contain the libcxx headers...

test/lit.cfg
2

I assumed it was. I copied it from libcxx/test/lit.cfg. I'll look in to it.

As a somewhat related note, there's a lot of redundancy between here and the lit.cfg in libcxx. It'd be nice to factor that out at some point...

compnerd added inline comments.Jul 7 2014, 8:36 PM
CMakeLists.txt
104

I think moving the comment here would be better.

110

AIUI, thats what it will be set to. It does actually get the headers copied there (at least, it did in my local tree).

test/lit.cfg
2

WFM. As I said, it was more that I was just surprised. Sharing that would be *great*.

danalbert added inline comments.Jul 7 2014, 10:20 PM
CMakeLists.txt
110

Hmm. They aren't for mine. Not for a standalone build, anyway. I'm running exactly the command from the docs.

danalbert updated this revision to Diff 11166.Jul 8 2014, 11:35 AM

Some cleanup: now uses add_lit_testsuiite(), use find_path() to determine libcxx include directories (which also fixes a bug caused by relative paths).
Address some review comments.

compnerd accepted this revision.Jul 9 2014, 7:11 PM
compnerd added a reviewer: compnerd.

Under the assumption that lit.cfg is simply copied as I didn't look at that carefully based on your previous comment, LGTM. This should definitely help with testing, so I think that getting this in earlier is better.

This revision is now accepted and ready to land.Jul 9 2014, 7:11 PM
danalbert closed this revision.Jul 9 2014, 7:29 PM

Committed as r212672.