1import lit.formats 2import lit.util 3 4config.name = "use-llvm-tool" 5config.suffixes = [".txt"] 6config.test_format = lit.formats.ShTest() 7config.test_source_root = None 8config.test_exec_root = None 9import os.path 10 11this_dir = os.path.dirname(lit.util.abs_path_preserve_drive(__file__)) 12config.llvm_tools_dir = os.path.join(this_dir, "build") 13import lit.llvm 14 15lit.llvm.initialize(lit_config, config) 16lit.llvm.llvm_config.with_environment("CASE1", os.path.join(this_dir, "env-case1")) 17lit.llvm.llvm_config.with_environment("CASE6", os.path.join(this_dir, "env-case6")) 18lit.llvm.llvm_config.with_environment( 19 "PATH", os.path.join(this_dir, "path"), append_path=True 20) 21lit.llvm.llvm_config.use_llvm_tool("case1", search_env="CASE1") 22lit.llvm.llvm_config.use_llvm_tool("case2", search_env="CASE2") 23lit.llvm.llvm_config.use_llvm_tool("case3") 24lit.llvm.llvm_config.use_llvm_tool("case4", use_installed=True) 25lit.llvm.llvm_config.use_llvm_tool("case5") 26lit.llvm.llvm_config.use_llvm_tool("case6", search_env="CASE6", use_installed=True) 27lit.llvm.llvm_config.use_llvm_tool("case7", use_installed=True) 28lit.llvm.llvm_config.use_llvm_tool("case8", use_installed=True) 29paths = [ 30 os.path.join(this_dir, "search1"), 31 os.path.join(this_dir, "search2"), 32 os.path.join(this_dir, "search3"), 33] 34lit.llvm.llvm_config.use_llvm_tool("case9", search_paths=paths) 35lit.llvm.llvm_config.use_llvm_tool("case10", search_paths=paths, use_installed=True) 36