Skip to content

Commit 8e4971c

Browse files
dzhidzhoevweliveindetail
authored andcommitted
[lldb][test] Add --make argument to dotest.py (llvm#93883)
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;..." ... ```
1 parent 95f3fb0 commit 8e4971c

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

lldb/packages/Python/lldbsuite/test/builders/builder.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ def getMake(self, test_subdir, test_name):
4444
"""Returns the invocation for GNU make.
4545
The first argument is a tuple of the relative path to the testcase
4646
and its filename stem."""
47-
if platform.system() == "FreeBSD" or platform.system() == "NetBSD":
48-
make = "gmake"
49-
else:
50-
make = "make"
51-
5247
# Construct the base make invocation.
5348
lldb_test = os.environ["LLDB_TEST"]
5449
if not (
@@ -66,7 +61,7 @@ def getMake(self, test_subdir, test_name):
6661
if not os.path.isfile(makefile):
6762
makefile = os.path.join(build_dir, "Makefile")
6863
return [
69-
make,
64+
configuration.make_path,
7065
"VPATH=" + src_dir,
7166
"-C",
7267
build_dir,

lldb/packages/Python/lldbsuite/test/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
compiler = None
5050
dsymutil = None
5151
sdkroot = None
52+
make_path = None
5253
swiftCompiler = None
5354
swiftLibrary = None
5455
python = sys.executable

lldb/packages/Python/lldbsuite/test/dotest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,13 @@ def parseOptionsAndInitTestdirs():
269269
configuration.compiler = candidate
270270
break
271271

272+
if args.make:
273+
configuration.make_path = args.make
274+
elif platform_system == "FreeBSD" or platform_system == "NetBSD":
275+
configuration.make_path = "gmake"
276+
else:
277+
configuration.make_path = "make"
278+
272279
if args.dsymutil:
273280
configuration.dsymutil = args.dsymutil
274281
elif platform_system == "Darwin":

lldb/packages/Python/lldbsuite/test/dotest_args.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ def create_parser():
9494
),
9595
)
9696

97+
group.add_argument(
98+
"--make",
99+
metavar="make",
100+
dest="make",
101+
help=textwrap.dedent("Specify which make to use."),
102+
)
97103
group.add_argument(
98104
"--dsymutil",
99105
metavar="dsymutil",

0 commit comments

Comments
 (0)