@@ -379,11 +379,17 @@ function print_counts(ts::ReTestSet, fmt::Format, depth, align,
379
379
time_str = hide_zero (@sprintf (" %6.2f" , timed. time), " s" )
380
380
printstyled (" | " , time_str, " " , color= :white )
381
381
if VERSION >= v " 1.6-"
382
- compile_str = hide_zero (@sprintf (" %5.1f" , timed. compile_time / 10 ^ 7 / timed. time), " %" )
382
+ compile_str = all (== (' ' ), time_str) ?
383
+ ' ' ^ 6 : # print percentages only if time itself is shown!
384
+ # (also, this can result in weird things, like "30663.3%",
385
+ # if e.g. there was no @test in the @testset)
386
+ hide_zero (@sprintf (" %5.1f" , timed. compile_time / 10 ^ 7 / timed. time), " %" )
383
387
# can be >= 100% !?
384
388
printstyled (compile_str, " " , color= :white )
385
389
end
386
- gc_str = hide_zero (@sprintf (" %4.1f" , 100 * timed. gctime / timed. time), " %" )
390
+ gc_str = all (== (' ' ), time_str) ?
391
+ ' ' ^ 5 :
392
+ hide_zero (@sprintf (" %4.1f" , 100 * timed. gctime / timed. time), " %" )
387
393
printstyled (gc_str, " | " , color= :white )
388
394
389
395
alloc_str = hide_zero (@sprintf (" %6.1f" , timed. bytes / 2 ^ 20 ), " M" )
0 commit comments