mirror of https://github.com/ARMmbed/mbed-os.git
Added result print below table
parent
bca4f4e0e4
commit
fb3bf48a2a
|
|
@ -73,12 +73,15 @@ class SingleTestRunner(object):
|
||||||
""" Object wrapper for single test run which may involve multiple MUTs."""
|
""" Object wrapper for single test run which may involve multiple MUTs."""
|
||||||
|
|
||||||
re_detect_testcase_result = None
|
re_detect_testcase_result = None
|
||||||
|
TEST_RESULT_OK = "OK"
|
||||||
|
TEST_RESULT_FAIL = "FAIL"
|
||||||
|
TEST_RESULT_ERROR = "ERROR"
|
||||||
TEST_RESULT_UNDEF = "UNDEF"
|
TEST_RESULT_UNDEF = "UNDEF"
|
||||||
|
|
||||||
# mbed test suite -> SingleTestRunner
|
# mbed test suite -> SingleTestRunner
|
||||||
TEST_RESULT_MAPPING = {"success" : "OK",
|
TEST_RESULT_MAPPING = {"success" : TEST_RESULT_OK,
|
||||||
"failure" : "FAIL",
|
"failure" : TEST_RESULT_FAIL,
|
||||||
"error" : "ERROR",
|
"error" : TEST_RESULT_ERROR,
|
||||||
"end" : TEST_RESULT_UNDEF}
|
"end" : TEST_RESULT_UNDEF}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
@ -391,6 +394,11 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
# Human readable summary
|
# Human readable summary
|
||||||
if not opts.suppress_summary:
|
if not opts.suppress_summary:
|
||||||
|
result_dict = { single_test.TEST_RESULT_OK : 0,
|
||||||
|
single_test.TEST_RESULT_FAIL : 0,
|
||||||
|
single_test.TEST_RESULT_ERROR : 0,
|
||||||
|
single_test.TEST_RESULT_UNDEF : 0 }
|
||||||
|
|
||||||
print
|
print
|
||||||
print "Test summary:"
|
print "Test summary:"
|
||||||
# Pretty table package is used to print results
|
# Pretty table package is used to print results
|
||||||
|
|
@ -404,6 +412,12 @@ if __name__ == '__main__':
|
||||||
pt.padding_width = 1 # One space between column edges and contents (default)
|
pt.padding_width = 1 # One space between column edges and contents (default)
|
||||||
|
|
||||||
for test in test_summary:
|
for test in test_summary:
|
||||||
|
if test[0] in result_dict:
|
||||||
|
result_dict[test[0]] += 1
|
||||||
pt.add_row(test)
|
pt.add_row(test)
|
||||||
print pt
|
print pt
|
||||||
|
|
||||||
|
# Print result count
|
||||||
|
print "Result: " + ' / '.join(['%s %s' % (value, key) for (key, value) in {k: v for k, v in result_dict.items() if v != 0}.iteritems()])
|
||||||
|
#print result_dict
|
||||||
print "Completed in %d sec" % (time() - start)
|
print "Completed in %d sec" % (time() - start)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue