@@ -37,6 +37,12 @@ def compile_inwer(inwer_path: str, args: argparse.Namespace, weak_compilation_fl
37
37
return compile .compile_file (inwer_path , package_util .get_executable (inwer_path ), compilers , weak_compilation_flags )
38
38
39
39
40
+ def sort_tests (tests , task_id ):
41
+ # First sort by group, then by test name.
42
+ tests .sort (key = lambda test : [package_util .get_group (test , task_id ), test ])
43
+ return tests
44
+
45
+
40
46
def print_view (term_width , term_height , table_data : TableData ):
41
47
"""
42
48
Prints current results of test verification.
@@ -48,12 +54,12 @@ def print_view(term_width, term_height, table_data: TableData):
48
54
49
55
results = table_data .results
50
56
column_lengths = [0 , len ('Group' ) + 1 , len ('Status' ) + 1 , 0 ]
51
- sorted_test_paths = []
57
+ tests = []
52
58
for result in results .values ():
53
59
column_lengths [0 ] = max (column_lengths [0 ], len (result .test_name ))
54
60
column_lengths [1 ] = max (column_lengths [1 ], len (result .test_group ))
55
- sorted_test_paths .append (result .test_path )
56
- sorted_test_paths . sort ( )
61
+ tests .append (result .test_path )
62
+ tests = sort_tests ( tests , table_data . task_id )
57
63
58
64
column_lengths [3 ] = max (10 , term_width - column_lengths [0 ] - column_lengths [1 ] - column_lengths [2 ] - 9 - 3 ) # 9 is for " | " between columns, 3 for margin.
59
65
margin = " "
@@ -69,7 +75,7 @@ def print_line_separator():
69
75
" | " + "Output" )
70
76
print_line_separator ()
71
77
72
- for test_path in sorted_test_paths :
78
+ for test_path in tests :
73
79
result = results [test_path ]
74
80
print (margin + result .test_name .ljust (column_lengths [0 ]) + " | " , end = '' )
75
81
print (result .test_group .ljust (column_lengths [1 ] - 1 ) + " | " , end = '' )
0 commit comments