diff options
author | Dylan Baker <dylanx.c.baker@intel.com> | 2014-10-02 14:51:23 -0700 |
---|---|---|
committer | Dylan Baker <dylanx.c.baker@intel.com> | 2014-12-12 09:32:28 -0800 |
commit | c1cf7865e742666ba46197827af1a854215cbd17 (patch) | |
tree | 7663dbdea43468c11b8b2e836a0a3226382d426b /framework | |
parent | add514e5a988201927cf69028b0dfb03d7244979 (diff) |
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 <jfonseca@vmware.com>
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/backends/junit.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/framework/backends/junit.py b/framework/backends/junit.py index 9a5a550ab..de8fd7126 100644 --- a/framework/backends/junit.py +++ b/framework/backends/junit.py @@ -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 |