]> git.ipfire.org Git - thirdparty/libvirt.git/commit
meson: Disable all tests when tests are disabled
authorAndrea Bolognani <abologna@redhat.com>
Tue, 3 Oct 2023 12:58:56 +0000 (14:58 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 26 Oct 2023 09:31:24 +0000 (11:31 +0200)
commit87f14badd0354432d245455cd706676de5ebcc30
treee98d33312ec41d8ed29110e8950e4d13d8255ae1
parent8ce0decc372051d616018f57ae268e2f03082eec
meson: Disable all tests when tests are disabled

Currently, passing -Dtests=disabled only disables a subset of
tests: those that are written in C and thus require compilation.
Other tests, such as the syntax-check ones and those that are
implemented as scripts, are always enabled.

There's a potentially dangerous consequence of this behavior:
when tests are disabled, 'meson test' will succeed as if they
had been enabled. No indication of this will be shown, so the
user will likely make the reasonable assumption that everything
is fine when in fact the significantly reduced coverage might
be hiding failures.

To solve this issues, disable *all* tests when asked to do so,
and inject an intentionally failing test to ensure that 'meson
test' doesn't succeed.

Best viewed with 'git show -w'.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
build-aux/meson.build
docs/html/meson.build
docs/meson.build
meson.build
src/access/meson.build
src/meson.build