]> xenbits.xensource.com Git - libvirt.git/commitdiff
virpcitest: Show PCI device tested by each test
authorJiri Denemark <jdenemar@redhat.com>
Tue, 14 Jan 2014 13:59:37 +0000 (14:59 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 20 Jan 2014 12:58:04 +0000 (13:58 +0100)
For example:

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
tests/virpcitest.c

index 82a173af5605135c460d2ebc8a6a3bad17b9e084..e96d7c01a6936bc54243e67d929793e50088269d 100644 (file)
@@ -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);