mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-15 02:05:50 +00:00
Add an option to the logger to immediately fatal on first error
* This is mostly useful for some of the tests that want to be able to run and accumulate multiple errors, but while debugging we want an exception to catch.
This commit is contained in:
@@ -32,6 +32,7 @@ class TestLogger:
|
||||
self.ctx_callback: Callable[[], None] | None = None
|
||||
self.outputs: List[IO[str]] = [sys.stdout]
|
||||
self.failed = False
|
||||
self.fast_fail = False
|
||||
self.section_failed = False
|
||||
self.logged_exception = False
|
||||
self.mutex = threading.Lock()
|
||||
@@ -158,6 +159,9 @@ class TestLogger:
|
||||
|
||||
self.rawprint("!! " + message)
|
||||
|
||||
if self.fast_fail:
|
||||
raise TestFailureException("Forcing failure")
|
||||
|
||||
def failure(self, ex: Exception):
|
||||
if self.logged_exception:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user