[llvm-dev] Running LIT based testcases outside of llvm source

Tejas Joshi via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 31 03:02:43 PDT 2021


Hi,

> Hi, I'm the author of that blog post.

Great. That blog post is really helpful.

> Without knowing the details of your issue, my guess is that somehow LIT didn't execute the correct config file.
> Long story short, there are two LIT config files: The one you put in source directory (lit.cfg.py) and the other one (lit.site.cfg.py), which is generated from a template file (lit.site.cfg.py.in), in the build direcotry
> The latter one is the config file LIT should execute first, because it's actually a trampoline that sets up some environment -- the my_obj_root is one of them -- before executing the real config file, lit.cfg.py in the source directory.

Let me explain. Consider the following directory structure (the ones
with -- prefix are subdirs to the upper one):

llvm-project
build-dir (llvm is built here)
install-dir (llvm is installed here)
test-suite
-- tests
---- filename.ll

Now, I want to run test cases (which uses opt, clang, etc) inside the
tests directory using llvm-lit from build-dir or install-dir. After
running llvm-lit on them, the tests should refer to build-dir/bin/ or
install-dir/bin/ binaries to run.
Can you suggest changes from the above blog post for lit.cfg.py,
lit.site.cfg.py.in because I am confused for which file should reside
in what directory in my particular case.

Thanks,
Tejas


More information about the llvm-dev mailing list