[llvm-dev] Cannot run LLVM unit tests doe to python error in lit

Sergej Jaskiewicz via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 21 08:52:05 PDT 2019


Hello, LLVM community.

I've built a cross-toolchain on Windows and I'm now trying to run unit tests for the LLVM libraries.

I used Ninja as a build system and MSVC as host compiler without an issue, but when I try to run 'ninja check-llvm-unit', I get the following error:

llvm-lit.py: C:/Users/sergej/Developer/llvm-project/llvm\utils\lit\lit\TestingConfig.py:102: fatal: unable to parse config file 'C:\\Users\\sergej\\Developer\\llvm-project\\llvm\\test\\Unit\\lit.cfg.py', traceback: Traceback (most recent call last):
  File "C:/Users/sergej/Developer/llvm-project/llvm\utils\lit\lit\TestingConfig.py", line 89, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "C:\Users\sergej\Developer\llvm-project\llvm\test\Unit\lit.cfg.py", line 24, in <module>
    config.test_exec_root = os.path.join(config.llvm_obj_root, 'unittests')
AttributeError: 'TestingConfig' object has no attribute 'llvm_obj_root'
FAILED: test/CMakeFiles/check-llvm-unit

From what I can see, the TestingConfig class (which can be found in llvm/utils/lit/lit/TestingConfig.py) doesn't have this 'llvm_obj_root' indeed. Also I can't spot any Python magic here like __getattr__. How is this supposed to work?

Reproducible with both Python 2 and 3.

Maybe anyone has an idea? I’d really appreciate any help



More information about the llvm-dev mailing list