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

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 21 11:41:56 PDT 2019


llvm_obj_root is supposed to be assigned in lit.site.cfg.py.in

config.llvm_obj_root = "@LLVM_BINARY_DIR@"

(which will `configure_file`ed by cmake). I can run ninja
check-llvm-unit on my Windows machine without problems. Maybe look for
lit.site.cfg.py in your build dir
(${CMAKE_BINARY_DIR}/tests/Unit/lit.site.cfg.py).

Michael





Am Mi., 21. Aug. 2019 um 10:52 Uhr schrieb Sergej Jaskiewicz via
llvm-dev <llvm-dev at lists.llvm.org>:
>
> 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
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list