[llvm-dev] [clang] Running a single testcase

Sedat Dilek via llvm-dev llvm-dev at lists.llvm.org
Sun May 6 05:10:33 PDT 2018


Hi,

while experimenting with llvmlinux on Debian/testing AMD64 I wanted to
run some x86-64 ASM tests.

I fell over [1] and wanted to run it.

So, I cloned clang from Git...

$ git clone https://github.com/llvm-mirror/clang.git

I looked through some docs where I have seen I need "llvm-lit" or "lit.py".
The Debian package llvm-7-tools from <apt.llvm.org> does ship "lit.py".
Furthermore, I have installed llvm-7 and clang-7 packages.
The version is 1:7~svn330207-1~exp1+0~20180417201234.1709~1.gbp6fb10d.

[5,6] have some examples on running a single testcase:

For example:

  python C:\Tools\llvm\utils\lit\lit.py -sv
  --param=build_mode=Win32 --param=build_config=Debug
  --param=clang_site_config=C:\Tools\build\tools\clang\test\lit.site.cfg
  C:\Tools\llvm\tools\clang\test\Sema\wchar.c

I transformed this...

$ python /usr/lib/llvm-7/build/utils/lit/lit.py -sv
/home/sdi/src/linux-kernel/clang/test/Sema/asm.c
lit.py: /usr/lib/llvm-7/build/utils/lit/lit/TestingConfig.py:101:
fatal: unable to parse config file
'/home/sdi/src/linux-kernel/clang/test/lit.cfg.py', traceback:
Traceback (most recent call last):
  File "/usr/lib/llvm-7/build/utils/lit/lit/TestingConfig.py", line
88, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/home/sdi/src/linux-kernel/clang/test/lit.cfg.py", line 25, in <module>
    config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
AttributeError: 'NoneType' object has no attribute 'use_lit_shell'

Yes, I have a lit.cfg.py.

$ LC_ALL=C ll clang/test/lit.*
-rw-r--r-- 1 sdi sdi 5979 Apr 25 12:14 clang/test/lit.cfg.py
-rw-r--r-- 1 sdi sdi 1906 Apr 25 12:14 clang/test/lit.site.cfg.py.in

How can I create a lit.site.cfg.py to pass it as
--param=clang_site_config=/path/to/lit.site.cfg.py?

I have attached TestingConfig.py from llvm-7-tools and lit.cfg.py and
lit.site.cfg.py.in from clang-git.

What am I missing?
What do I need to run a single clang testcase?

Thanks in advance.

Regards,
- Sedat -

[1] https://github.com/llvm-mirror/clang/raw/master/test/Sema/asm.c
[2] https://llvm.org/docs/CommandGuide/lit.html
[3] https://llvm.org/docs/TestingGuide.html
[4] https://llvm.org/docs/TestSuiteMakefileGuide.html
[5] http://clang.llvm.org/hacking.html
[6] http://clang.llvm.org/hacking.html#testingCommands
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestingConfig.py
Type: text/x-python
Size: 6537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180506/935d1dce/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lit.cfg.py
Type: text/x-python
Size: 5979 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180506/935d1dce/attachment-0001.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lit.site.cfg.py.in
Type: application/octet-stream
Size: 1906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180506/935d1dce/attachment.obj>


More information about the llvm-dev mailing list