Put results.xml failure text in own child attribute (bug 1269458); r=gps draft
authorRob Wood <rwood@mozilla.com>
Mon, 02 May 2016 15:35:40 -0400
changeset 362632 cb90207baaa4c6cd6d732754759aaea0d0aefdb8
parent 362631 4a9ae7dc3f1325f651476a1c217a512bd5e35268
child 519845 82bfb727c1a95f6b919e7c7ed519b86bc078b55e
push id16998
push userrwood@mozilla.com
push dateMon, 02 May 2016 19:42:03 +0000
reviewersgps
bugs1269458
Put results.xml failure text in own child attribute (bug 1269458); r=gps MozReview-Commit-ID: E9mW8F7Nu9Q
pylib/mercurial-support/run-tests.py
--- a/pylib/mercurial-support/run-tests.py
+++ b/pylib/mercurial-support/run-tests.py
@@ -1740,17 +1740,20 @@ class TextTestRunner(unittest.TextTestRu
                         t = doc.createElement('testcase')
                         t.setAttribute('name', tc)
                         t.setAttribute('time', '%.3f' % timesd[tc])
                         # createCDATASection expects a unicode or it will
                         # convert using default conversion rules, which will
                         # fail if string isn't ASCII.
                         err = cdatasafe(err).decode('utf-8', 'replace')
                         cd = doc.createCDATASection(err)
-                        t.appendChild(cd)
+                        f = doc.createElement('failure')
+                        f.setAttribute('message', 'test failure')
+                        f.appendChild(cd)
+                        t.appendChild(f)
                         s.appendChild(t)
                     xuf.write(doc.toprettyxml(indent='  ', encoding='utf-8'))
 
             if self._runner.options.json:
                 jsonpath = os.path.join(self._runner._testdir, b'report.json')
                 with open(jsonpath, 'w') as fp:
                     timesd = {}
                     for tdata in result.times: