Skip to content

Commit 11b8842

Browse files
authored
Add --cmake-toolchain and --remote-host flags for test-suite (#35)
When cross-compiling LLVM test-suite to run on another machine, you usually need to pass a toolchain file and -DTEST_SUITE_REMOTE_HOST to CMake. This adds two flags to the CLI to make it more convenient to configure these (as opposed to passing in -DCMAKE_TOOLCHAIN_FILE/-DTEST_SUITE_REMOTE_HOST)
1 parent 37a5ba2 commit 11b8842

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lnt/tests/test_suite.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@ def _configure(self, path, extra_cmake_defs=[], execute=True):
454454
else:
455455
cmake_flags = []
456456

457+
if self.opts.cmake_toolchain:
458+
cmake_flags += ['--toolchain', self.opts.cmake_toolchain]
459+
457460
cmake_build_types = ('DEBUG', 'MINSIZEREL', 'RELEASE',
458461
'RELWITHDEBINFO')
459462
if self.opts.cppflags or self.opts.cflags:
@@ -493,6 +496,8 @@ def _configure(self, path, extra_cmake_defs=[], execute=True):
493496
defs['TEST_SUITE_PROFILE_GENERATE'] = "Off"
494497
if 'TEST_SUITE_RUN_TYPE' not in defs:
495498
defs['TEST_SUITE_RUN_TYPE'] = 'ref'
499+
if self.opts.remote_host:
500+
defs['TEST_SUITE_REMOTE_HOST'] = self.opts.remote_host
496501

497502
for item in tuple(self.opts.cmake_defines) + tuple(extra_cmake_defs):
498503
k, v = item.split('=', 1)
@@ -1066,6 +1071,9 @@ def diagnose(self):
10661071
default=[],
10671072
help="Use one of the test-suite's cmake configurations."
10681073
" Ex: Release, Debug")
1074+
@click.option("--cmake-toolchain", metavar="PATH", type=click.UNPROCESSED,
1075+
default=None,
1076+
help="Path to a CMake toolchain file to use")
10691077
# Test compiler
10701078
@click.option("--cc", "cc", metavar="CC", type=click.UNPROCESSED,
10711079
default=None,
@@ -1137,6 +1145,8 @@ def diagnose(self):
11371145
" collect PGO data, then rerun with that training "
11381146
"data.",
11391147
is_flag=True, default=False,)
1148+
@click.option("--remote-host", metavar="HOST",
1149+
help="Run tests on a remote machine")
11401150
# Output Options
11411151
@click.option("--no-auto-name", "auto_name",
11421152
help="Don't automatically derive submission name",

0 commit comments

Comments
 (0)