[16/21] tests: qemuxml2argv: centralize CAPS suffix building

Message ID bb7598014c1a118f8d40257f054d14d26a91bf68.1552574299.git.crobinso@redhat.com
State Accepted
Commit e911de2a3000e3da86a6bb87156a2573e78134b0
Headers show
Series
  • tests: qemuxml2argv: support optional arguments
Related show

Commit Message

Cole Robinson March 14, 2019, 2:44 p.m.
Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
 tests/qemuxml2argvtest.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Andrea Bolognani March 19, 2019, 2:17 p.m. | #1
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote:
> Signed-off-by: Cole Robinson <crobinso@redhat.com>

> ---

>  tests/qemuxml2argvtest.c | 14 +++++++-------

>  1 file changed, 7 insertions(+), 7 deletions(-)


Reviewed-by: Andrea Bolognani <abologna@redhat.com>


-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Patch

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index b1c18c6c09..4b34bbcb63 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -786,12 +786,12 @@  mymain(void)
  * the test cases should be forked using DO_TEST_CAPS_VER with the appropriate
  * version.
  */
-# define DO_TEST_CAPS_INTERNAL(_name, _suffix, \
-                               arch, capsfile, stripmachinealiases, ...) \
+# define DO_TEST_CAPS_INTERNAL(_name, arch, ver, \
+                               capsfile, stripmachinealiases, ...) \
     do { \
         static struct testInfo info = { \
             .name = _name, \
-            .suffix = "." _suffix, \
+            .suffix = "." arch "-" ver, \
         }; \
         if (!(info.qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(arch), \
                                                             capsfile))) \
@@ -801,7 +801,7 @@  mymain(void)
         if (testInfoSetArgs(&info, __VA_ARGS__, ARG_END) < 0) \
             return EXIT_FAILURE; \
         info.flags |= FLAG_REAL_CAPS; \
-        if (virTestRun("QEMU XML-2-ARGV " _name "." _suffix, \
+        if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \
                        testCompareXMLToArgv, &info) < 0) \
             ret = -1; \
         virObjectUnref(info.qemuCaps); \
@@ -810,8 +810,8 @@  mymain(void)
 # define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_"
 
 # define DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, ...) \
-    DO_TEST_CAPS_INTERNAL(name, arch "-" ver, \
-                          arch, TEST_CAPS_PATH ver "." arch ".xml", false, \
+    DO_TEST_CAPS_INTERNAL(name, arch, ver, \
+                          TEST_CAPS_PATH ver "." arch ".xml", false, \
                           __VA_ARGS__)
 
 # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \
@@ -821,7 +821,7 @@  mymain(void)
     DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
 
 # define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \
-    DO_TEST_CAPS_INTERNAL(name, arch "-latest", arch, \
+    DO_TEST_CAPS_INTERNAL(name, arch, "latest", \
                           virHashLookup(capslatest, arch), true, \
                           __VA_ARGS__)