I figured out how to not redirect stderr, but I can't figure out how to
not catch the exceptions for the life of me.
There's not a single exception handler, but many. I identified some as
drafted in the attached, but there are apparently more.
They are hidden inside accessors and function decorators, and who knows
what more...
Jose
diff --git a/framework/exceptions.py b/framework/exceptions.py
index fdd1f1f..f93dda8 100644
--- a/framework/exceptions.py
+++ b/framework/exceptions.py
@@ -32,43 +32,9 @@ __all__ = [
'handler',
]
-_DEBUG = bool(os.environ.get('PIGLIT_DEBUG', False))
-
def handler(func):
- """Decorator function for handling errors in an entry point.
-
- This will handle expected errors (PiglitFatalError), and unexpected errors,
- either PiglitInternalErrors or PiglitExceptions, as well as handling
- generic Exceptions
-
- """
-
- @functools.wraps(func)
- def _inner(*args, **kwargs):
- try:
- func(*args, **kwargs)
- except PiglitFatalError as e:
- print('Fatal Error: {}'.format(str(e)), file=sys.stderr)
- sys.exit(1)
- except (PiglitInternalError, PiglitException) as e:
- print('Warning: An internal exception that should have '
- 'been handled was not. This is bug and should be reported.\n'
- 'BUG: {}'.format(str(e)),
- file=sys.stderr)
- if _DEBUG:
- raise
- sys.exit(1)
- except Exception as e: # pylint: disable=broad-except
- print('Warning: A python exception that should have '
- 'been handled was not. This is bug and should be reported.\n'
- 'BUG: {}'.format(str(e)),
- file=sys.stderr)
- if _DEBUG:
- raise
- sys.exit(1)
-
- return _inner
+ return func
class PiglitException(Exception):
diff --git a/framework/test/base.py b/framework/test/base.py
index 378f185..2653491 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -175,21 +175,23 @@ class Test(object):
log.start(path)
# Run the test
if options.OPTIONS.execute:
- try:
+ #try:
+ if 1:
self.result.time.start = time.time()
dmesg.update_dmesg()
self.run()
self.result.time.end = time.time()
self.result = dmesg.update_result(self.result)
- # This is a rare case where a bare exception is okay, since we're
- # using it to log exceptions
- except:
- exc_type, exc_value, exc_traceback = sys.exc_info()
- traceback.print_exc(file=sys.stderr)
- self.result.result = 'fail'
- self.result.exception = "{}{}".format(exc_type, exc_value)
- self.result.traceback = "".join(
- traceback.format_tb(exc_traceback))
+ ## This is a rare case where a bare exception is okay, since we're
+ ## using it to log exceptions
+ #except:
+ # exc_type, exc_value, exc_traceback = sys.exc_info()
+ # traceback.print_exc(file=sys.stderr)
+ # self.result.result = 'fail'
+ # self.result.exception = "{}{}".format(exc_type, exc_value)
+ # self.result.traceback = "".join(
+ # traceback.format_tb(exc_traceback))
+ # raise
log.log(self.result.result)
else:
diff --git a/framework/test/opengl.py b/framework/test/opengl.py
index 0a7b2d7..8590f5b 100644
--- a/framework/test/opengl.py
+++ b/framework/test/opengl.py
@@ -83,6 +83,7 @@ class WflInfo(object):
# FIXME: The version parsing below is full of bugs. Disable all
# wflinfo invocation until they are addressed
+ raise ValueError
raise StopWflinfo('OSError')
with open(os.devnull, 'w') as d:
_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit