[PATCH 4/9] virpcitest: Show PCI device tested by each test

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

 



For example:

 ...
 5) testVirPCIDeviceIsAssignable(0005:90:01.0)      ... OK
 6) testVirPCIDeviceIsAssignable(0001:01:00.0)      ... OK

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 tests/virpcitest.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/virpcitest.c b/tests/virpcitest.c
index 82a173a..e96d7c0 100644
--- a/tests/virpcitest.c
+++ b/tests/virpcitest.c
@@ -237,8 +237,15 @@ mymain(void)
 # define DO_TEST_PCI(fnc, domain, bus, slot, function)                  \
     do {                                                                \
         struct testPCIDevData data = { domain, bus, slot, function };   \
-        if (virtTestRun(#fnc, fnc, &data) < 0)                          \
+        char *label = NULL;                                             \
+        if (virAsprintf(&label, "%s(%04x:%02x:%02x.%x)",                \
+                        #fnc, domain, bus, slot, function) < 0) {       \
             ret = -1;                                                   \
+            break;                                                      \
+        }                                                               \
+        if (virtTestRun(label, fnc, &data) < 0)                         \
+            ret = -1;                                                   \
+        VIR_FREE(label);                                                \
     } while (0)
 
     DO_TEST(testVirPCIDeviceNew);
-- 
1.8.5.3

--
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]