Commit c1cf7865 authored by Dylan Baker's avatar Dylan Baker
Browse files

junit.py: Add piglit failure to junit ouput



This makes use of the result type field in the junit to add the piglit
failure type (crash, warn, fail, etc)
Reviewed-by: Jose Fonseca's avatarJose Fonseca <jfonseca@vmware.com>
Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
parent add514e5
......@@ -123,6 +123,7 @@ class JUnitBackend(FileBackend):
if lname in self._expected_crashes:
expected_result = "error"
res = None
# Add relevant result value, if the result is pass then it doesn't
# need one of these statuses
if data['result'] == 'skip':
......@@ -132,18 +133,22 @@ class JUnitBackend(FileBackend):
if expected_result == "failure":
err.text += "\n\nWARN: passing test as an expected failure"
else:
etree.SubElement(element, 'failure')
res = etree.SubElement(element, 'failure')
elif data['result'] == 'crash':
if expected_result == "error":
err.text += "\n\nWARN: passing test as an expected crash"
else:
etree.SubElement(element, 'error')
res = etree.SubElement(element, 'error')
elif expected_result != "pass":
err.text += "\n\nERROR: This test passed when it "\
"expected {0}".format(expected_result)
etree.SubElement(element, 'failure')
res = etree.SubElement(element, 'failure')
# Add the piglit type to the failure result
if res is not None:
res.attrib['type'] = str(data['result'])
# Split the name of the test and the group (what junit refers to as
# classname), and replace piglits '/' separated groups with '.', after
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment