[lit][test] Attempt fix when paths include symlink

Example of failure:
https://lab.llvm.org/staging/#/builders/126/builds/345/steps/5/logs/FAIL__lit___use-tool-search-env_py
This commit is contained in:
James Henderson 2021-05-07 09:20:50 +01:00
parent dafbfb1d1d
commit d2b2ad32b7
1 changed files with 2 additions and 1 deletions

View File

@ -7,5 +7,6 @@ config.test_exec_root = None
import lit.llvm
lit.llvm.initialize(lit_config, config)
import os.path
lit.llvm.llvm_config.with_environment('TOOL_LOCATION', os.path.dirname(__file__) + '/test.tool')
path = os.path.realpath(os.path.join(os.path.dirname(__file__), 'test.tool'))
lit.llvm.llvm_config.with_environment('TOOL_LOCATION', path)
lit.llvm.llvm_config.use_llvm_tool('test-tool', search_env='TOOL_LOCATION')