aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/builders/builder.py12
-rw-r--r--lldb/packages/Python/lldbsuite/test/configuration.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py1
3 files changed, 14 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index 564918c..e309921 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -110,6 +110,10 @@ class Builder:
if not cc:
return []
+ exe_ext = ""
+ if lldbplatformutil.getHostPlatform() == "windows":
+ exe_ext = ".exe"
+
cc = cc.strip()
cc_path = pathlib.Path(cc)
@@ -149,9 +153,9 @@ class Builder:
cc_dir = cc_path.parent
def getToolchainUtil(util_name):
- return cc_dir / (cc_prefix + util_name + cc_ext)
+ return os.path.join(configuration.llvm_tools_dir, util_name + exe_ext)
- cxx = getToolchainUtil(cxx_type)
+ cxx = cc_dir / (cc_prefix + cxx_type + cc_ext)
util_names = {
"OBJCOPY": "objcopy",
@@ -161,6 +165,10 @@ class Builder:
}
utils = []
+ # Required by API TestBSDArchives.py tests.
+ if not os.getenv("LLVM_AR"):
+ utils.extend(["LLVM_AR=%s" % getToolchainUtil("llvm-ar")])
+
if not lldbplatformutil.platformIsDarwin():
if cc_type in ["clang", "cc", "gcc"]:
util_paths = {}
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index 27eef04..1bacd74 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -118,6 +118,9 @@ test_result = None
# same base name.
all_tests = set()
+# Path to LLVM tools to be used by tests.
+llvm_tools_dir = None
+
# LLDB library directory.
lldb_libs_dir = None
lldb_obj_root = None
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index f14a00a..b1ae896 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -280,6 +280,7 @@ def parseOptionsAndInitTestdirs():
"xcrun -find -toolchain default dsymutil"
)
if args.llvm_tools_dir:
+ configuration.llvm_tools_dir = args.llvm_tools_dir
configuration.filecheck = shutil.which("FileCheck", path=args.llvm_tools_dir)
configuration.yaml2obj = shutil.which("yaml2obj", path=args.llvm_tools_dir)