Testing using MSYS + CMake

Hello,

Until now I hadn’t written any test, so I would just play them all using the following command on MSYS:

$ cd ${BUILD_DIR}
$ make clang-test

I’ve written one test though, and I’d like to check it out before submitting it in a patch… and I’d like to test by itself instead of running the whole test suite.

I’ve tried to invoke lit.py directly, following the Hacking on Clang commands, unfortunately it complains about missing site configuration, and I am quite at a loss.

How does one play a single test on MSYS, using lit.py either directly or via the CMake Makefiles ?

Thanks,
Matthieu

Matthieu Monrocq
<matthieu.monrocq@gmail.com> writes:

Until now I hadn't written any test, so I would just play them all using the
following command on MSYS:

$ cd ${BUILD_DIR}
$ make clang-test

I've written one test though, and I'd like to check it out before submitting
it in a patch... and I'd like to test *by itself* instead of running the
whole test suite.

I've tried to invoke lit.py directly, following the Hacking on Clang
commands, unfortunately it complains about missing site configuration, and I
am quite at a loss.

How does one play a single test on MSYS, using lit.py either directly or via
the CMake Makefiles ?

After some fight I was successful with

$ python ../llvm/utils/lit/lit.py -sv --no-progress-bar --param=llvm_site_config=test/lit.site.cfg --param=build_config= ../llvm/test/Bitcode/null-type.ll

(for LLVM)

$ python ../llvm/utils/lit/lit.py -sv --no-progress-bar --param=llvm_site_config=test/lit.site.cfg --param=build_config= --param=clang_site_config=tools/clang/test/lit.site.cfg ../llvm/tools/clang/test/Sema/annotate.c

(for Clang)

The commands are executed from the root of the build directory. The
build directory is at the same level as the sources:

llvm/
build/

Matthieu and Oscar,

Is llvm-lit available?

$ python bin/llvm-lit /path/to/your/test.ll

("python" may be omitted)

...Takumi

NAKAMURA Takumi <geek4civic@gmail.com> writes:

Is llvm-lit available?

$ python bin/llvm-lit /path/to/your/test.ll

("python" may be omitted)

Yes, and using it instead of lit.py makes things much simpler:

python bin/llvm-lit -sv --no-progress-bar ../llvm/tools/clang/test/Sema/annotate.c

llvm-lit needs some advertising :wink: