Unable to run clang tests using llvm-lit

Hi,

I'm trying to run clang tests to test my changes. I have referred the
docs at Hacking on clang
Currently I'm facing the issue below:

$ ./bin/llvm-lit -sv --param=build_config=RelWithDebInfo
--param=clang_site_config=/home/parallels/llvm-avr/build/tools/clang/test/lit.site.cfg
/home/parallels/code/llvm-project.git/clang/test/
llvm-lit: /home/parallels/llvm-avr/build/bin/../../../code/llvm-project.git/llvm/utils/lit/lit/TestingConfig.py:101:
fatal: unable to parse config file
'/home/parallels/code/llvm-project.git/clang/test/lit.cfg.py',
traceback: Traceback (most recent call last):
  File "/home/parallels/llvm-avr/build/bin/../../../code/llvm-project.git/llvm/utils/lit/lit/TestingConfig.py",
line 88, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/home/parallels/code/llvm-project.git/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'

$ ./bin/llvm-lit --show-tests ~/code/llvm-project.git/clang/test/
llvm-lit: /home/parallels/llvm-avr/build/bin/../../../code/llvm-project.git/llvm/utils/lit/lit/TestingConfig.py:101:
fatal: unable to parse config file
'/home/parallels/code/llvm-project.git/clang/test/lit.cfg.py',
traceback: Traceback (most recent call last):
  File "/home/parallels/llvm-avr/build/bin/../../../code/llvm-project.git/llvm/utils/lit/lit/TestingConfig.py",
line 88, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/home/parallels/code/llvm-project.git/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'

Whereas the show-tests for llvm (./bin/llvm-lit --show-tests
~/code/llvm-project.git/clang/test/) works fine.

Someone already mentioned similar issue in one of code review:
https://reviews.llvm.org/D61798?id=

Source: https://github.com/llvm/llvm-project.git, up to date with
31-Jul-2020 commits.

Am I missing anything to set up the environment?
Please suggest any workarounds if any.

Regards,
Pitchumani

1 Like

Hi! were you able to resolve the issue?

You might not have much luck getting a reply on an old thread, unfortunately. I’d recommend making a new thread containing the commands you’re running and their output to get help.

1 Like

I’m no longer using this project, I don’t remember the solution or workaround I used.

1 Like