Commit 62319115 authored by Vincent Stehlé's avatar Vincent Stehlé
Browse files

parser.py: fix dict_2_md printing



dict_2_md implicitly relies on the tests all having the same order for
their dict keys during printing. This works well with all the tests read
from the .ekl log file but does not work with the "artificial" SPURIOUS
test entries, which end up having their keys in a different order.

Fix the keys order to fix .md printing.
Signed-off-by: Vincent Stehlé's avatarVincent Stehlé <vincent.stehle@arm.com>
parent 5435cca9
......@@ -215,16 +215,17 @@ def key_tree_2_md(input_list, file):
def dict_2_md(input_list, file):
if len(input_list) > 0:
file.write("\n\n")
k = input_list[0].keys()
# create header for MD table using dict keys
temp_string1, temp_string2 = "|", "|"
for x in (input_list[0].keys()):
for x in k:
temp_string1 += (x + "|")
temp_string2 += ("---|")
file.write(temp_string1 + "\n" + temp_string2 + "\n")
# print each item from the dict into the table
for x in input_list:
test_string = "|"
for y in x.keys():
for y in k:
test_string += (x[y] + "|")
file.write(test_string + '\n')
# seprate table from other items in MD
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment