[cfe-dev] Unable to run clang tests using llvm-lit

Pitchumani via cfe-dev cfe-dev at lists.llvm.org
Sat Aug 1 01:09:47 PDT 2020


Hi,

I'm trying to run clang tests to test my changes. I have referred the
docs at http://clang.llvm.org/hacking.html#testingCommands
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


More information about the cfe-dev mailing list