3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

auto-t: do away with -1 test results

This can result in strange test results since there was no less
than zero checks before subtracting the total tests from failed
tests. In case of an internal exception we can just set all values
to zero. This will be handled specially as we do for timeout
errors.
This commit is contained in:
James Prestwood 2020-11-16 14:25:13 -08:00 committed by Denis Kenzior
parent 1eb82d661f
commit 423f9a4e60

View File

@ -973,16 +973,20 @@ def print_results(results):
total_time = 0 total_time = 0
for test, result in results.items(): for test, result in results.items():
if result.time != TEST_MAX_TIMEOUT:
if result.time == TEST_MAX_TIMEOUT:
failed = "Timed out"
passed = "Timed out"
elif result.time == 0:
failed = "Exception"
passed = "Exception"
else:
failed = result.failures + result.errors failed = result.failures + result.errors
passed = result.run - failed passed = result.run - failed
total_pass += passed total_pass += passed
total_fail += failed total_fail += failed
total_skip += result.skipped total_skip += result.skipped
else:
failed = "Timed out"
passed = "Timed out"
total_time += result.time total_time += result.time
@ -1046,8 +1050,8 @@ def run_auto_tests(ctx, args):
except Exception as ex: except Exception as ex:
print(ex) print(ex)
print("Uncaught exception thrown for %s" % test) print("Uncaught exception thrown for %s" % test)
ctx.results[os.path.basename(test)] = SimpleResult(run=-1, failures=-1, ctx.results[os.path.basename(test)] = SimpleResult(run=0, failures=0,
errors=-1, skipped=-1, time=-1) errors=0, skipped=0, time=0)
finally: finally:
post_test(ctx, copied) post_test(ctx, copied)