This is an archive of the discontinued LLVM Phabricator instance.

Allow external projects to run tests via llvm-lit
ClosedPublic

Authored by garious on Apr 18 2014, 10:36 AM.

Details

Reviewers
garious
chapuni
Summary

With this patch, the user can set CMAKE_PREFIX_PATH=<llvm_install_dir>. CMake's find_program() will find llvm-lit.

Diff Detail

Event Timeline

garious updated this revision to Diff 8898.Apr 28 2014, 3:04 PM
garious retitled this revision from Allow users of the llvm install directory to specify a path to lit. to Allow external projects to run tests via llvm-lit.
garious updated this object.
garious edited edge metadata.

This version uses the lit.py in the llvm source directory unless it is unavailable.

Ping. Nothing controversial here. Can I get a +1?

This file "cmake/modules/AddLLVM.cmake" ends up in the LLVM install directory. But from that location, the user cannot use the lit macros unless they set LLVM_MAIN_SRC_DIR. Reaching into the source directory is not necessary because the freshly built 'llvm-lit' is also in the LLVM install directory. This patch allows the build to find llvm-lit.

I asked some questions about this change in my previous mail.

Sorry, my last reply intended to answer your question, but I see how it wasn't too clear. Take 2:

Is the idea here to support lit testing of an external project or to enable some unusual build configuration of the standard LLVM modules?

The idea here is to support lit testing of both standard LLVM projects as well as external ones. llvm-lit is in the install directory but it is currently inaccessible via the CMake files in the install directory.

garious updated this revision to Diff 9648.May 20 2014, 5:42 PM

test if variable is set instead of testing if directory exists

garious accepted this revision.May 21 2014, 9:55 AM
garious added a reviewer: garious.

Fixed in r209308

This revision is now accepted and ready to land.May 21 2014, 9:55 AM
garious closed this revision.May 21 2014, 9:56 AM