[Lldb-commits] [lldb] [lldb][test] Add --make argument to dotest.py (PR #93883)
Vladislav Dzhidzhoev via lldb-commits
lldb-commits at lists.llvm.org
Fri May 31 09:05:42 PDT 2024
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/93883
>From 01fb7af6eabac1df410e117e5a0ccafb149dc2cb Mon Sep 17 00:00:00 2001
From: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: Sat, 13 Apr 2024 23:55:25 +0000
Subject: [PATCH 1/2] [lldb][test] Add --make argument to dotest.py
This argument allows to specify the path to make which is used by
LLDB API tests to compile test programs.
It might come in handy for setting up cross-platform remote runs of API tests on Windows host.
It can be used to override the make path of LLDB API tests using `LLDB_TEST_USER_ARGS` argument:
```
cmake ...
-DLLDB_TEST_USER_ARGS="...;--make;C:\\Path\\to\\make.exe;..."
...
```
---
lldb/packages/Python/lldbsuite/test/builders/builder.py | 4 +++-
lldb/packages/Python/lldbsuite/test/configuration.py | 1 +
lldb/packages/Python/lldbsuite/test/dotest.py | 2 ++
lldb/packages/Python/lldbsuite/test/dotest_args.py | 6 ++++++
4 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index 21ea3530e24fc..178ce8bc3c490 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -40,7 +40,9 @@ def getMake(self, test_subdir, test_name):
"""Returns the invocation for GNU make.
The first argument is a tuple of the relative path to the testcase
and its filename stem."""
- if platform.system() == "FreeBSD" or platform.system() == "NetBSD":
+ if configuration.make_path is not None:
+ make = configuration.make_path
+ elif platform.system() == "FreeBSD" or platform.system() == "NetBSD":
make = "gmake"
else:
make = "make"
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index dbd4a2d72a15d..27eef040497d1 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -43,6 +43,7 @@
compiler = None
dsymutil = None
sdkroot = None
+make_path = None
# The overriden dwarf verison.
dwarf_version = 0
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index 2e537e3fd3ce0..42b39bc6e2f7b 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -266,6 +266,8 @@ def parseOptionsAndInitTestdirs():
configuration.compiler = candidate
break
+ if args.make:
+ configuration.make_path = args.make
if args.dsymutil:
configuration.dsymutil = args.dsymutil
elif platform_system == "Darwin":
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index 8b00c7a4d56e7..a0a840416c567 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -87,6 +87,12 @@ def create_parser():
),
)
+ group.add_argument(
+ "--make",
+ metavar="make",
+ dest="make",
+ help=textwrap.dedent("Specify which make to use."),
+ )
group.add_argument(
"--dsymutil",
metavar="dsymutil",
>From 60032f8510b7086e36a86172fbaa090e4d7ef66f Mon Sep 17 00:00:00 2001
From: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: Fri, 31 May 2024 18:05:25 +0200
Subject: [PATCH 2/2] Moved make detection to dotest.py
---
lldb/packages/Python/lldbsuite/test/builders/builder.py | 9 +--------
lldb/packages/Python/lldbsuite/test/dotest.py | 5 +++++
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index 178ce8bc3c490..4ea9a86c1d5fc 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -40,13 +40,6 @@ def getMake(self, test_subdir, test_name):
"""Returns the invocation for GNU make.
The first argument is a tuple of the relative path to the testcase
and its filename stem."""
- if configuration.make_path is not None:
- make = configuration.make_path
- elif platform.system() == "FreeBSD" or platform.system() == "NetBSD":
- make = "gmake"
- else:
- make = "make"
-
# Construct the base make invocation.
lldb_test = os.environ["LLDB_TEST"]
if not (
@@ -64,7 +57,7 @@ def getMake(self, test_subdir, test_name):
if not os.path.isfile(makefile):
makefile = os.path.join(build_dir, "Makefile")
return [
- make,
+ configuration.make_path,
"VPATH=" + src_dir,
"-C",
build_dir,
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index 42b39bc6e2f7b..4f186171aa34b 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -268,6 +268,11 @@ def parseOptionsAndInitTestdirs():
if args.make:
configuration.make_path = args.make
+ elif platform_system == "FreeBSD" or platform_system == "NetBSD":
+ configuration.make_path = "gmake"
+ else:
+ configuration.make_path = "make"
+
if args.dsymutil:
configuration.dsymutil = args.dsymutil
elif platform_system == "Darwin":
More information about the lldb-commits
mailing list