Hi, "make check" in libguestfs takes very long (especially when it's run after every patch in a series). How can I run only those tests that are, for example, in "tests/luks/"? Thanks, Laszlo
On Mon, Feb 21, 2022 at 03:10:02PM +0100, Laszlo Ersek wrote:> Hi, > > "make check" in libguestfs takes very long (especially when it's run > after every patch in a series). > > How can I run only those tests that are, for example, in "tests/luks/"?Disclaimer: The following advice works for libnbd and nbdkit, but I have not tested it on libguestfs: For automake-based projects that still use directory recursion, 'make -C tests/luks check' will run the tests in just one subdirectory, and 'make -C path/to/dir check TESTS=name_of_test' will run just one test. If we ever switch to non-recursive automake, or even to a different build system (qemu and libvirt both switched to meson), then I'll have to relearn tricks. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Richard W.M. Jones
2022-Feb-21 15:56 UTC
[Libguestfs] how can I run a subset of the tests?
On Mon, Feb 21, 2022 at 03:10:02PM +0100, Laszlo Ersek wrote:> Hi, > > "make check" in libguestfs takes very long (especially when it's run > after every patch in a series). > > How can I run only those tests that are, for example, in "tests/luks/"?This used to be possible before: commit 6d32773e811882f78dbd8c2a39a2b7a9c3cfca7c Author: Richard W.M. Jones <rjones at redhat.com> Date: Thu Mar 18 11:15:06 2021 +0000 tests: Run the tests in parallel. As far as I know it's no longer possible to run just tests from a single directory. However - a bit clumsy - if you know the exact list of tests you want to run then this works: $ make -C tests check TESTS=" luks/test-luks.sh luks/test-luks-list.sh luks/test-key-option.sh luks/test-key-option-inspect.sh " ... make[3]: Entering directory '/home/rjones/d/libguestfs/tests' SKIP: luks/test-key-option-inspect.sh PASS: luks/test-luks-list.sh PASS: luks/test-key-option.sh PASS: luks/test-luks.sh ===========================================================================Testsuite summary for libguestfs 1.47.2 ===========================================================================# TOTAL: 4 # PASS: 3 # SKIP: 1 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ===========================================================================make[3]: Leaving directory '/home/rjones/d/libguestfs/tests' make[2]: Leaving directory '/home/rjones/d/libguestfs/tests' make[1]: Leaving directory '/home/rjones/d/libguestfs/tests' make: Leaving directory '/home/rjones/d/libguestfs/tests' Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/