[PATCH 05/17] qemuhotplugtest: Generate better output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Each test case label now contains more data useful to identify the test.
---
 tests/qemuhotplugtest.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index c7be5f6..4f48ee0 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -96,7 +96,7 @@ testQemuHotplugAttach(virDomainObjPtr vm,
         break;
     default:
         if (virTestGetVerbose())
-            fprintf(stderr, "device type '%s' cannot be attached",
+            fprintf(stderr, "device type '%s' cannot be attached\n",
                     virDomainDeviceTypeToString(dev->type));
         break;
     }
@@ -116,7 +116,7 @@ testQemuHotplugDetach(virDomainObjPtr vm,
         break;
     default:
         if (virTestGetVerbose())
-            fprintf(stderr, "device type '%s' cannot be attached",
+            fprintf(stderr, "device type '%s' cannot be detached\n",
                     virDomainDeviceTypeToString(dev->type));
         break;
     }
@@ -141,7 +141,7 @@ testQemuHotplugUpdate(virDomainObjPtr vm,
         break;
     default:
         if (virTestGetVerbose())
-            fprintf(stderr, "device type '%s' cannot be updated",
+            fprintf(stderr, "device type '%s' cannot be updated\n",
                     virDomainDeviceTypeToString(dev->type));
         break;
     }
@@ -276,33 +276,28 @@ mymain(void)
     if (VIR_STRDUP_QUIET(driver.config->spicePassword, "123456") < 0)
         return EXIT_FAILURE;
 
-#define DO_TEST(file, dev, fial, kep, ...)                                  \
+#define DO_TEST(file, ACTION, dev, fial, kep, ...)                          \
+    do {                                                                    \
         const char *my_mon[] = { __VA_ARGS__, NULL};                        \
+        const char *name = file " " #ACTION " " dev;                        \
+        data.action = ACTION;                                               \
         data.domain_filename = file;                                        \
         data.device_filename = dev;                                         \
         data.fail = fial;                                                   \
         data.mon = my_mon;                                                  \
         data.keep = kep;                                                    \
-        if (virtTestRun(#file, 1, testQemuHotplug, &data) < 0)              \
+        if (virtTestRun(name, 1, testQemuHotplug, &data) < 0)               \
             ret = -1;                                                       \
+    } while (0)
 
 #define DO_TEST_ATTACH(file, dev, fial, kep, ...)                           \
-    do {                                                                    \
-        data.action = ATTACH;                                               \
-        DO_TEST(file, dev, fial, kep, __VA_ARGS__)                          \
-    } while (0)
+    DO_TEST(file, ATTACH, dev, fial, kep, __VA_ARGS__)
 
 #define DO_TEST_DETACH(file, dev, fial, kep, ...)                           \
-    do {                                                                    \
-        data.action = DETACH;                                               \
-        DO_TEST(file, dev, fial, kep, __VA_ARGS__)                          \
-    } while (0)
+    DO_TEST(file, DETACH, dev, fial, kep, __VA_ARGS__)
 
 #define DO_TEST_UPDATE(file, dev, fial, kep, ...)                           \
-    do {                                                                    \
-        data.action = UPDATE;                                               \
-        DO_TEST(file, dev, fial, kep, __VA_ARGS__)                          \
-    } while (0)
+    DO_TEST(file, UPDATE, dev, fial, kep, __VA_ARGS__)
 
     DO_TEST_UPDATE("graphics-spice", "graphics-spice-nochange", false, false, NULL);
     DO_TEST_UPDATE("graphics-spice-timeout", "graphics-spice-timeout-nochange", false, false,
-- 
1.8.3.2

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]