From 6f4f64f876928e637ce38eeb986c22c8b6fccd7e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 6 Nov 2020 14:56:08 +0100 Subject: testrunner: Report the number of failed tests Change-Id: I0e5f73d7bf0bb404dc77d6d016a211e61c09da91 Reviewed-by: Christian Tismer --- testing/command.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'testing') diff --git a/testing/command.py b/testing/command.py index d21be492c..1279bb323 100644 --- a/testing/command.py +++ b/testing/command.py @@ -342,11 +342,15 @@ def main(): if fatal: raise ValueError("FATAL format error:", fatal) err_crit = "'FAIL! >= {}'".format(fail_crit) + fail_count = 0 for res in tot_res.values(): if res.count("FAIL!") >= fail_crit: - raise ValueError("At least one failure was not blacklisted " - "and met the criterion {}" - .format(err_crit)) + fail_count += 1 + if fail_count == 1: + raise ValueError(f"A test was not blacklisted and met the criterion {err_crit}") + elif fail_count > 1: + raise ValueError(f"{fail_count} failures were not blacklisted " + f"and met the criterion {err_crit}") print("No test met the error criterion {}".format(err_crit)) finally: print() -- cgit v1.2.3