Skip to content

Commit 6b7b05b

Browse files
committed
[lldb][test] Add --make argument to dotest.py (#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 ac4cca3 commit 6b7b05b

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
@@ -40,11 +40,6 @@ def getMake(self, test_subdir, test_name):
4040
"""Returns the invocation for GNU make.
4141
The first argument is a tuple of the relative path to the testcase
4242
and its filename stem."""
43-
if platform.system() == "FreeBSD" or platform.system() == "NetBSD":
44-
make = "gmake"
45-
else:
46-
make = "make"
47-
4843
# Construct the base make invocation.
4944
lldb_test = os.environ["LLDB_TEST"]
5045
if not (
@@ -62,7 +57,7 @@ def getMake(self, test_subdir, test_name):
6257
if not os.path.isfile(makefile):
6358
makefile = os.path.join(build_dir, "Makefile")
6459
return [
65-
make,
60+
configuration.make_path,
6661
"VPATH=" + src_dir,
6762
"-C",
6863
build_dir,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
compiler = None
4444
dsymutil = None
4545
sdkroot = None
46+
make_path = None
4647

4748
# The overriden dwarf verison.
4849
dwarf_version = 0

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,13 @@ def parseOptionsAndInitTestdirs():
266266
configuration.compiler = candidate
267267
break
268268

269+
if args.make:
270+
configuration.make_path = args.make
271+
elif platform_system == "FreeBSD" or platform_system == "NetBSD":
272+
configuration.make_path = "gmake"
273+
else:
274+
configuration.make_path = "make"
275+
269276
if args.dsymutil:
270277
configuration.dsymutil = args.dsymutil
271278
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
@@ -96,6 +96,12 @@ def create_parser():
9696
),
9797
)
9898

99+
group.add_argument(
100+
"--make",
101+
metavar="make",
102+
dest="make",
103+
help=textwrap.dedent("Specify which make to use."),
104+
)
99105
group.add_argument(
100106
"--dsymutil",
101107
metavar="dsymutil",

0 commit comments

Comments
 (0)