@@ -44,6 +44,16 @@ cd(dirname(@__FILE__)) do
44
44
end
45
45
46
46
@everywhere include (" testdefs.jl" )
47
+
48
+ # pretty print the information about gc and mem usage
49
+ name_align = max (length (" Test (Worker)" ), maximum (map (x -> length (x) + 3 + ndigits (nworkers ()), tests)))
50
+ elapsed_align = length (" Time (s)" )
51
+ gc_align = length (" GC (s)" )
52
+ percent_align = length (" GC %" )
53
+ alloc_align = length (" Alloc (MB)" )
54
+ rss_align = length (" RSS (MB)" )
55
+ print_with_color (:white , rpad (" Test (Worker)" ,name_align," " ), " | " )
56
+ print_with_color (:white , " Time (s) | GC (s) | GC % | Alloc (MB) | RSS (MB)\n " )
47
57
results= []
48
58
@sync begin
49
59
for p in workers ()
@@ -67,6 +77,22 @@ cd(dirname(@__FILE__)) do
67
77
isa (resp, Exception) ? rethrow (resp) : error (" Halting tests. Memory limit reached : $resp > $max_worker_rss " )
68
78
end
69
79
end
80
+ if ! isa (resp[1 ], Exception)
81
+ print_with_color (:white , rpad (test* " ($p )" , name_align, " " ), " | " )
82
+ time_str = @sprintf (" %7.2f" ,resp[2 ])
83
+ print_with_color (:white , rpad (time_str,elapsed_align," " ), " | " )
84
+ gc_str = @sprintf (" %5.2f" ,resp[5 ]. total_time/ 10 ^ 9 )
85
+ print_with_color (:white , rpad (gc_str,gc_align," " ), " | " )
86
+
87
+ # since there may be quite a few digits in the percentage,
88
+ # the left-padding here is less to make sure everything fits
89
+ percent_str = @sprintf (" %4.1f" ,100 * resp[5 ]. total_time/ (10 ^ 9 * resp[2 ]))
90
+ print_with_color (:white , rpad (percent_str,percent_align," " ), " | " )
91
+ alloc_str = @sprintf (" %5.2f" ,resp[3 ]/ 2 ^ 20 )
92
+ print_with_color (:white , rpad (alloc_str,alloc_align," " ), " | " )
93
+ rss_str = @sprintf (" %5.2f" ,resp[6 ]/ 2 ^ 20 )
94
+ print_with_color (:white , rpad (rss_str,rss_align," " ), " \n " )
95
+ end
70
96
end
71
97
end
72
98
end
@@ -161,31 +187,6 @@ cd(dirname(@__FILE__)) do
161
187
end
162
188
println ()
163
189
Base. Test. print_test_results (o_ts,1 )
164
- # pretty print the information about gc and mem usage
165
- name_align = maximum (map (x -> length (x[1 ]), results))
166
- elapsed_align = length (" Total time (s):" )
167
- gc_align = length (" GC time (s):" )
168
- percent_align = length (" Percent in gc:" )
169
- alloc_align = length (" Allocated (MB):" )
170
- rss_align = length (" RSS (MB):" )
171
- print_with_color (:white , rpad (" Test:" ,name_align," " ), " | " )
172
- print_with_color (:white , " Total time (s): | GC time (s): | Percent in gc: | Allocated (MB): | RSS (MB):\n " )
173
- for res in results
174
- if ! isa (res[2 ][1 ], Exception)
175
- print_with_color (:white , rpad (" $(res[1 ]) " ,name_align," " ), " | " )
176
- time_str = @sprintf (" %7.2f" ,res[2 ][2 ])
177
- print_with_color (:white , rpad (time_str,elapsed_align," " ), " | " )
178
- gc_str = @sprintf (" %7.2f" ,res[2 ][5 ]. total_time/ 10 ^ 9 )
179
- print_with_color (:white , rpad (gc_str,gc_align," " ), " | " )
180
- percent_str = @sprintf (" %7.2f" ,100 * res[2 ][5 ]. total_time/ (10 ^ 9 * res[2 ][2 ]))
181
- print_with_color (:white , rpad (percent_str,percent_align," " ), " | " )
182
- alloc_str = @sprintf (" %7.2f" ,res[2 ][3 ]/ 2 ^ 20 )
183
- print_with_color (:white , rpad (alloc_str,alloc_align," " ), " | " )
184
- rss_str = @sprintf (" %7.2f" ,res[2 ][6 ]/ 2 ^ 20 )
185
- print_with_color (:white , rpad (rss_str,rss_align," " ), " \n " )
186
- end
187
- end
188
-
189
190
if ! o_ts. anynonpass
190
191
println (" \0 33[32;1mSUCCESS\0 33[0m" )
191
192
else
0 commit comments