testsuite: Show both test name and way in JUnit output
authorBen Gamari <ben@smart-cactus.org>
Thu, 10 Jan 2019 16:45:32 +0000 (11:45 -0500)
committerBen Gamari <ben@well-typed.com>
Mon, 14 Jan 2019 14:30:40 +0000 (09:30 -0500)
testsuite/driver/junit.py

index f2dbebb..f5daec1 100644 (file)
@@ -15,24 +15,24 @@ def junit(t):
                           ('unexpected failure', t.unexpected_failures)]:
         for (directory, testname, reason, way) in group:
             testcase = ET.SubElement(testsuite, 'testcase',
-                                     classname = testname,
-                                     name = way)
+                                     classname = way,
+                                     name = '%s(%s)' % (testname, way))
             result = ET.SubElement(testcase, 'failure',
                                    type = res_type,
                                    message = reason)
 
     for (directory, testname, reason, way) in t.framework_failures:
         testcase = ET.SubElement(testsuite, 'testcase',
-                                 classname = testname,
-                                 name = way)
+                                 classname = way,
+                                 name = '%s(%s)' % (testname, way))
         result = ET.SubElement(testcase, 'error',
                                type = "framework failure",
                                message = reason)
 
     for (directory, testname, way) in t.expected_passes:
         testcase = ET.SubElement(testsuite, 'testcase',
-                                 classname = testname,
-                                 name = way)
+                                 classname = way,
+                                 name = '%s(%s)' % (testname, way))
 
     return ET.ElementTree(testsuites)