]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Fix up test numbering in qemuxml2argvtest
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 17 Apr 2018 09:42:55 +0000 (11:42 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 17 Apr 2018 11:50:20 +0000 (13:50 +0200)
Due to conditional execution of virTestRun(), the testCounter was incremented
only if all the cases were run.  When using VIR_TEST_RANGE=x-y, first x/2 of the
increments were skipped and that made figuring out a precise case a PITA.
Moving the condition into the test function makes it way nicer to find out the
test numbers to use in VIR_TEST_RANGE.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
tests/qemuxml2argvtest.c

index 152e0d2c18fe9fce2a7ec7871aa32594b8b17e4c..43f07efc1fe7834872b39e827e87688e94ed295b 100644 (file)
@@ -410,6 +410,9 @@ testCompareXMLToStartupXML(const void *data)
     char *actual = NULL;
     int ret = -1;
 
+    if (!info->vm)
+        return EXIT_AM_SKIP;
+
     if (virAsprintf(&xml, "%s/qemuxml2startupxmloutdata/%s.xml",
                     abs_srcdir, info->name) < 0)
         goto cleanup;
@@ -664,8 +667,8 @@ mymain(void)
         if (virTestRun("QEMU XML-2-ARGV " name, \
                        testCompareXMLToArgv, &info) < 0) \
             ret = -1; \
-        if (info.vm && virTestRun("QEMU XML-2-startup-XML " name, \
-                                  testCompareXMLToStartupXML, &info) < 0) \
+        if (virTestRun("QEMU XML-2-startup-XML " name, \
+                       testCompareXMLToStartupXML, &info) < 0)  \
             ret = -1; \
         virObjectUnref(info.qemuCaps); \
         virObjectUnref(info.vm); \