mirror of https://github.com/ARMmbed/mbed-os.git
Small testing script refactoring
parent
46902264d5
commit
62469bd680
|
@ -424,10 +424,7 @@ def get_result_summary_table():
|
|||
for unique_id in unique_test_id:
|
||||
# print "\t\t%s: %d / %d" % (unique_id, counter_dict_test_id_types[unique_id], counter_dict_test_id_types_all[unique_id])
|
||||
percent_progress = round(100.0 * counter_dict_test_id_types[unique_id] / float(counter_dict_test_id_types_all[unique_id]), 2)
|
||||
step = int(percent_progress / 2)
|
||||
str_progress = '#' * step + '.' * int(50 - step)
|
||||
c = '!' if str_progress[38] == '.' else '|'
|
||||
str_progress = str_progress[:38] + c + str_progress[38:]
|
||||
str_progress = progress_bar(percent_progress, 75)
|
||||
row = [unique_id,
|
||||
counter_dict_test_id_types[unique_id],
|
||||
counter_dict_test_id_types_all[unique_id],
|
||||
|
@ -437,6 +434,17 @@ def get_result_summary_table():
|
|||
print pt
|
||||
|
||||
|
||||
def progress_bar(percent_progress, saturation=0):
|
||||
""" This function creates progress bar with optional simple saturation mark"""
|
||||
step = int(percent_progress / 2) # Scale by to (scale: 1 - 50)
|
||||
str_progress = '#' * step + '.' * int(50 - step)
|
||||
c = '!' if str_progress[38] == '.' else '|'
|
||||
if (saturation > 0):
|
||||
saturation = saturation / 2
|
||||
str_progress = str_progress[:saturation] + c + str_progress[saturation:]
|
||||
return str_progress
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Command line options
|
||||
parser = optparse.OptionParser()
|
||||
|
@ -487,7 +495,7 @@ if __name__ == '__main__':
|
|||
help='Verbose mode (pronts some extra information)')
|
||||
|
||||
parser.description = """This script allows you to run mbed defined test cases for particular MCU(s) and corresponding toolchain(s)."""
|
||||
parser.epilog = """Example: singletest.py -i test_spec.json [-M muts_all.json]"""
|
||||
parser.epilog = """Example: singletest.py -i test_spec.json -M muts_all.json"""
|
||||
|
||||
(opts, args) = parser.parse_args()
|
||||
|
||||
|
|
Loading…
Reference in New Issue