diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-06 14:56:08 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-06 14:01:37 +0000 |
commit | 6f4f64f876928e637ce38eeb986c22c8b6fccd7e (patch) | |
tree | 917a2996eebe4976d974820110df275a4a605467 /testing | |
parent | 562edc619787d83b2d4418fa7a69c597a7b6945c (diff) |
testrunner: Report the number of failed tests
Change-Id: I0e5f73d7bf0bb404dc77d6d016a211e61c09da91
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'testing')
-rw-r--r-- | testing/command.py | 10 |
1 files changed, 7 insertions, 3 deletions
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() |