[lit][test] Attempt fix when paths include symlink
authorJames Henderson <james.henderson@sony.com>
Fri, 7 May 2021 08:20:50 +0000 (09:20 +0100)
committerJames Henderson <james.henderson@sony.com>
Fri, 7 May 2021 08:21:58 +0000 (09:21 +0100)
Example of failure:
https://lab.llvm.org/staging/#/builders/126/builds/345/steps/5/logs/FAIL__lit___use-tool-search-env_py

llvm/utils/lit/tests/Inputs/use-tool-search-env/lit.cfg

index 7e61bb3..a64d3f7 100644 (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')