[Piglit] [PATCH] framework: not display whole test result in sub test case

Homer Hsing homer.xing at intel.com
Tue Aug 27 19:23:43 PDT 2013


result['result'] is sub-test-case result in framework/core.py,

   json_writer.write_dict_item(path + '/' + test, result)

then result['result'] is again used as whole test result.

Therefore whole test result is used for sub-test-case.

This patch uses "final_result" to keep whole test result, and fixes the bug.

Signed-off-by: Homer Hsing <homer.xing at intel.com>
---
 framework/core.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/framework/core.py b/framework/core.py
index b1a5726..dbc9b3c 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -473,10 +473,14 @@ class Test:
                 def serious_level(result):
                     return {'skip':0, 'pass':1, 'warn':2, 'fail':3, 'crash':4}.get(result, 0)
 
+                final_result = 'skip'
                 for test in result['subtest'].keys():
-                    if serious_level(result['subtest'][test]) >= serious_level(result['result']):
-                        result['result'] = result['subtest'][test]
+                    sub_result = result['subtest'][test]
+                    result['result'] = sub_result
                     json_writer.write_dict_item(path + '/' + test, result)
+                    if serious_level(sub_result) > serious_level(final_result):
+                        final_result = sub_result
+                result['result'] = final_result
             else:
                 json_writer.write_dict_item(path, result)
         else:
-- 
1.8.1.2



More information about the Piglit mailing list