From: Jason Ish Date: Thu, 6 Jan 2022 17:09:35 +0000 (-0600) Subject: runner: convert runtime exceptions to TestError X-Git-Tag: suricata-6.0.5~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F646%2Fhead;p=thirdparty%2Fsuricata-verify.git runner: convert runtime exceptions to TestError Convert exceptions from code errors (well, any unexpected exception) into a TestError. This allows the test to be reported as failed. I think because tests are run in separate processes, its harder to catch these sorts of errors. --- diff --git a/run.py b/run.py index d5440343d..91f628cd6 100755 --- a/run.py +++ b/run.py @@ -163,6 +163,8 @@ def handle_exceptions(func): if args and not args[0].quiet: print("===> {}: Sub test #{}: SKIPPED : {}".format(kwargs["test_name"], kwargs["test_num"], ue)) kwargs["count"]["skipped"] += 1 + except Exception as err: + raise TestError("Internal runtime error: {}".format(err)) else: if result: kwargs["count"]["success"] += 1