[Piglit] [PATCH 3/3] framework: On exception set the result to exception.

Dylan Baker dylan at pnwbakers.com
Sat Oct 1 00:43:55 UTC 2016


---
 framework/backends/junit.py | 2 ++
 framework/test/base.py      | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/framework/backends/junit.py b/framework/backends/junit.py
index 4c9b7af..0cb48fa 100644
--- a/framework/backends/junit.py
+++ b/framework/backends/junit.py
@@ -112,6 +112,8 @@ class JUnitWriter(object):
         if result == 'incomplete':
             res = etree.SubElement(element, 'failure',
                                    message='Incomplete run.')
+        elif result == 'exception':
+            res = tree.SubElement(element, 'error', message='Framework error.')
         elif result in ['fail', 'dmesg-warn', 'dmesg-fail']:
             if expected_result == "failure":
                 res = etree.SubElement(element, 'skipped',
diff --git a/framework/test/base.py b/framework/test/base.py
index 191ecbc..75970fd 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -39,7 +39,9 @@ import warnings
 import six
 from six.moves import range
 
-from framework import exceptions, options
+from framework import exceptions
+from framework import options
+from framework import status
 from framework.results import TestResult
 
 # We're doing some special crazy here to make timeouts work on python 2. pylint
@@ -212,7 +214,7 @@ class Test(object):
             except Exception:  # pylint: disable=broad-except
                 exc_type, exc_value, exc_traceback = sys.exc_info()
                 traceback.print_exc(file=sys.stderr)
-                self.result.result = 'fail'
+                self.result.result = status.EXCEPTION
                 self.result.exception = "{}{}".format(exc_type, exc_value)
                 self.result.traceback = "".join(
                     traceback.format_tb(exc_traceback))
-- 
2.10.0



More information about the Piglit mailing list