@@ -73,12 +73,15 @@ class SingleTestRunner(object):
73
73
""" Object wrapper for single test run which may involve multiple MUTs."""
74
74
75
75
re_detect_testcase_result = None
76
+ TEST_RESULT_OK = "OK"
77
+ TEST_RESULT_FAIL = "FAIL"
78
+ TEST_RESULT_ERROR = "ERROR"
76
79
TEST_RESULT_UNDEF = "UNDEF"
77
80
78
81
# mbed test suite -> SingleTestRunner
79
- TEST_RESULT_MAPPING = {"success" : "OK" ,
80
- "failure" : "FAIL" ,
81
- "error" : "ERROR" ,
82
+ TEST_RESULT_MAPPING = {"success" : TEST_RESULT_OK ,
83
+ "failure" : TEST_RESULT_FAIL ,
84
+ "error" : TEST_RESULT_ERROR ,
82
85
"end" : TEST_RESULT_UNDEF }
83
86
84
87
def __init__ (self ):
@@ -391,6 +394,11 @@ def get_json_data_from_file(json_spec_filename, verbose=False):
391
394
392
395
# Human readable summary
393
396
if not opts .suppress_summary :
397
+ result_dict = { single_test .TEST_RESULT_OK : 0 ,
398
+ single_test .TEST_RESULT_FAIL : 0 ,
399
+ single_test .TEST_RESULT_ERROR : 0 ,
400
+ single_test .TEST_RESULT_UNDEF : 0 }
401
+
394
402
print
395
403
print "Test summary:"
396
404
# Pretty table package is used to print results
@@ -404,6 +412,12 @@ def get_json_data_from_file(json_spec_filename, verbose=False):
404
412
pt .padding_width = 1 # One space between column edges and contents (default)
405
413
406
414
for test in test_summary :
415
+ if test [0 ] in result_dict :
416
+ result_dict [test [0 ]] += 1
407
417
pt .add_row (test )
408
418
print pt
419
+
420
+ # Print result count
421
+ print "Result: " + ' / ' .join (['%s %s' % (value , key ) for (key , value ) in {k : v for k , v in result_dict .items () if v != 0 }.iteritems ()])
422
+ #print result_dict
409
423
print "Completed in %d sec" % (time () - start )
0 commit comments