tests: Fix up test numbering in qemuxml2argvtest

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>
This commit is contained in:
Martin Kletzander 2018-04-17 11:42:55 +02:00
parent fd247f8fe7
commit 70255fa596

View File

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