]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuxml2argvtest: Mark 'nbdkit' tests as skipped if nbdkit is not compiled in
authorPeter Krempa <pkrempa@redhat.com>
Wed, 3 Jan 2024 12:03:24 +0000 (13:03 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 4 Jan 2024 21:26:10 +0000 (22:26 +0100)
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 <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemuxml2argvtest.c

index fbb363dcaee82b6554b5f92e21a445d0c409f659..9a93fd8990c1bbb0f766835e5f63f938fdeb482a 100644 (file)
@@ -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")