[PATCH] D61598: lnt runtest test-suite: add --qemu-user-mode support
Kristof Beyls via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 6 07:06:56 PDT 2019
kristof.beyls created this revision.
kristof.beyls added reviewers: vdelvecc, cmatthews, leandron, MatzeB.
Herald added a subscriber: javed.absar.
kristof.beyls added a parent revision: D61597: [test-suite] Fix support for user mode emulation when using cmake/lit..
To make user more emulation with qemu work well, a specific cmake option
needs to be set when running the test suite under it.
This introduces the --qemu-user-mode option to make this straightforward
from a lnt runtest test-suite command line.
An example command line using this:
lnt runtest test-suite --sandbox lnt_sandbox \
--test-suite ~/dev/llvm.org/test-suite -j40 \
--qemu-user-mode=$HOME/dev/aarch64-emu/aarch64-qemu.sh \
--cppflags="-O3" \
--use-lit llvm-lit \
--cmake-define=CMAKE_TOOLCHAIN_FILE:FILEPATH=$HOME/dev/llvm.org/clang_aarch64_linux.cmake
Note that I haven't written regression tests yet for this - I thought I'd first ask for review on the general design before implementing tests.
https://reviews.llvm.org/D61598
Files:
lnt/tests/test_suite.py
Index: lnt/tests/test_suite.py
===================================================================
--- lnt/tests/test_suite.py
+++ lnt/tests/test_suite.py
@@ -234,6 +234,15 @@
if not isexecfile(split[0]):
self._fatal("Run under wrapper not found (looked for %s)" %
opts.run_under)
+ if opts.qemu_user_mode and opts.run_under:
+ self._fatal("do not specify --run-under when using " +
+ "--qemu-user-mode")
+ if opts.qemu_user_mode:
+ split = shlex.split(opts.qemu_user_mode)
+ split[0] = resolve_command_path(split[0])
+ if not isexecfile(split[0]):
+ self._fatal("Qemu user mode wrapper not found (looked for %s)" %
+ opts.qemu_user_mode)
if opts.single_result:
# --single-result implies --only-test
@@ -462,6 +471,10 @@
if self.opts.run_under:
defs['TEST_SUITE_RUN_UNDER'] = \
self._unix_quote_args(self.opts.run_under)
+ if self.opts.qemu_user_mode:
+ defs['TEST_SUITE_USER_MODE_EMULATION'] = '1'
+ defs['TEST_SUITE_RUN_UNDER'] = \
+ self._unix_quote_args(self.opts.qemu_user_mode)
if self.opts.benchmarking_only:
defs['TEST_SUITE_BENCHMARKING_ONLY'] = 'ON'
if self.opts.only_compile:
@@ -1078,6 +1091,9 @@
type=click.UNPROCESSED, default=None)
@click.option("--run-under", "run_under", default="",
help="Wrapper to run tests under", type=click.UNPROCESSED)
+ at click.option("--qemu-user-mode", "qemu_user_mode", default="",
+ help="Enable qemu user mode emulation using this qemu executable",
+ type=click.UNPROCESSED)
@click.option("--exec-multisample", "exec_multisample",
help="Accumulate execution test data from multiple runs",
type=int, default=1, metavar="N")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61598.198272.patch
Type: text/x-patch
Size: 1976 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190506/c00f22e0/attachment.bin>
More information about the llvm-commits
mailing list