From 91116e35b6b9be9ae84e572465933f4682664a9a Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 3 Jan 2024 13:03:24 +0100 Subject: [PATCH] qemuxml2argvtest: Mark 'nbdkit' tests as skipped if nbdkit is not compiled in Rather than completely compiling out the tests mark them as skipped. This will allow us to add a checker that all input files are accounted for. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tests/qemuxml2argvtest.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index fbb363dcae..9a93fd8990 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -629,6 +629,15 @@ testCompareXMLToArgv(const void *data) if (testInfoCheckDuplicate(info) < 0) goto cleanup; +# if !WITH_NBDKIT + /* when compiled without nbdkit support we want to skip the test after + * marking it as used */ + if (info->args.fakeNbdkitCaps) { + ret = EXIT_AM_SKIP; + goto cleanup; + } +# endif /* !WITH_NBDKIT */ + if (info->arch != VIR_ARCH_NONE && info->arch != VIR_ARCH_X86_64) qemuTestSetHostArch(&driver, info->arch); @@ -908,12 +917,8 @@ mymain(void) # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, ARG_END) -# if WITH_NBDKIT -# define DO_TEST_CAPS_LATEST_NBDKIT(name, ...) \ +# define DO_TEST_CAPS_LATEST_NBDKIT(name, ...) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", ARG_NBDKIT_CAPS, __VA_ARGS__, QEMU_NBDKIT_CAPS_LAST, ARG_END) -# else -# define DO_TEST_CAPS_LATEST_NBDKIT(name, ...) -# endif /* WITH_NBDKIT */ # define DO_TEST_CAPS_LATEST(name) \ DO_TEST_CAPS_ARCH_LATEST(name, "x86_64")