diff options
| author | Dimitrios Apostolou <[email protected]> | 2025-12-08 16:49:52 +0100 |
|---|---|---|
| committer | Dimitrios Apostolou <[email protected]> | 2025-12-12 00:11:10 +0100 |
| commit | 7c636a22a8d7c5229f15fdd4120ddfc973e1f8fa (patch) | |
| tree | 8f6c624c1cc5f095ec242ff4984907cfd5779c1f /util/testrunner/qt-testrunner.py | |
| parent | de899ca972712e1e41e8f5319f2043e22966422f (diff) | |
qt-testrunner: exit(1) instead of exit(3) when asserts trigger
Asserts triggering signify programming errors in the testrunner.
For the same reason, change also a pre-existing AssertionError exception
raised with bad XML input file to a dedicated exception.
Pick-to: 6.11 6.10 6.8
Change-Id: I5e5cc746df60075e02964efd97d1a37dc401925f
Reviewed-by: Axel Spoerl <[email protected]>
Reviewed-by: Frederic Lefebvre <[email protected]>
Diffstat (limited to 'util/testrunner/qt-testrunner.py')
| -rwxr-xr-x | util/testrunner/qt-testrunner.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/util/testrunner/qt-testrunner.py b/util/testrunner/qt-testrunner.py index 7928cd5f487..1573534cee9 100755 --- a/util/testrunner/qt-testrunner.py +++ b/util/testrunner/qt-testrunner.py @@ -91,6 +91,8 @@ class WhatFailed(NamedTuple): class ReRunCrash(Exception): pass +class BadXMLCrash(Exception): + pass # In the last test re-run, we add special verbosity arguments, in an attempt @@ -254,7 +256,7 @@ def parse_log(results_file) -> WhatFailed: root = tree.getroot() if root.tag != "TestCase": - raise AssertionError( + raise BadXMLCrash( f"The XML test log must have <TestCase> as root tag, but has: <{root.tag}>") failures = [] @@ -467,6 +469,8 @@ def main(): assert len(failed_functions) > 0 and retcode != 0 break # all is fine, goto re-running individual failed testcases + except AssertionError: + raise except Exception as e: L.error("exception:%s %s", type(e).__name__, e) L.error("The test executable probably crashed, see above for details") @@ -482,6 +486,8 @@ def main(): ret = rerun_failed_testcase(args.test_basename, args.testargs, args.log_dir, test_result, args.max_repeats, args.passes_needed, dryrun=args.dry_run, timeout=args.timeout) + except AssertionError: + raise except Exception as e: L.error("exception:%s", e) L.error("The testcase re-run probably crashed, giving up") |
