tests/vm: add --build-target option

This allows us to invoke the build with a custom target (for the VMs
that use the {target} format string specifier). Currently OpenBSD is
still hardwired due to problems running check.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
Alex Bennée 2019-01-21 16:48:15 +00:00
parent a4cefbcd9b
commit 5c2ec9b61f
4 changed files with 6 additions and 3 deletions

View File

@ -228,6 +228,8 @@ def parse_args(vmcls):
help="build image")
parser.add_option("--build-qemu",
help="build QEMU from source in guest")
parser.add_option("--build-target",
help="QEMU build target", default="check")
parser.add_option("--interactive", "-I", action="store_true",
help="Interactively run command")
parser.add_option("--snapshot", "-s", action="store_true",
@ -255,6 +257,7 @@ def main(vmcls):
cmd = [vm.BUILD_SCRIPT.format(
configure_opts = " ".join(argv),
jobs=args.jobs,
target=args.build_target,
verbose = "V=1" if args.verbose else "")]
else:
cmd = argv

View File

@ -25,7 +25,7 @@ class FreeBSDVM(basevm.BaseVM):
cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
tar -xf /dev/vtbd1;
./configure {configure_opts};
gmake --output-sync -j{jobs} check {verbose};
gmake --output-sync -j{jobs} {target} {verbose};
"""
def build_image(self, img):

View File

@ -25,7 +25,7 @@ class NetBSDVM(basevm.BaseVM):
cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
tar -xf /dev/rld1a;
./configure --python=python2.7 {configure_opts};
gmake --output-sync -j{jobs} check {verbose};
gmake --output-sync -j{jobs} {target} {verbose};
"""
def build_image(self, img):

View File

@ -26,7 +26,7 @@ class UbuntuX86VM(basevm.BaseVM):
sudo chmod a+r /dev/vdb;
tar -xf /dev/vdb;
./configure {configure_opts};
make --output-sync check -j{jobs} {verbose};
make --output-sync {target} -j{jobs} {verbose};
"""
def _gen_cloud_init_iso(self):