From 2b441720265f2e1f530394ac072169a7960cd96b Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Thu, 4 Jul 2013 19:59:26 +0400 Subject: [PATCH] xls-report.py: make behaviour more intelligent in case of repeated results --- modules/ts/misc/xls-report.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/ts/misc/xls-report.py b/modules/ts/misc/xls-report.py index 0aeb1c3..131f3fa 100755 --- a/modules/ts/misc/xls-report.py +++ b/modules/ts/misc/xls-report.py @@ -163,7 +163,13 @@ class Collector(object): for test in run.tests: test_results = module_tests.setdefault((test.shortName(), test.param()), {}) - test_results[configuration] = test.get("gmean") if test.status == 'run' else test.status + new_result = test.get("gmean") if test.status == 'run' else test.status + test_results[configuration] = min( + test_results.get(configuration), new_result, + key=lambda r: (1, r) if isinstance(r, numbers.Number) else + (2,) if r is not None else + (3,) + ) # prefer lower result; prefer numbers to errors and errors to nothing def make_match_func(matchers): def match_func(properties): -- 2.7.4