Skip to content

Commit 69ebba0

Browse files
committed
Don't include compile time on 1.10
1 parent 505d8c9 commit 69ebba0

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/ParallelTestRunner.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,16 @@ function print_header(ctx::TestIOContext, testgroupheader, workerheader)
141141
# header top
142142
printstyled(ctx.stdout, " "^(ctx.name_align + textwidth(testgroupheader) - 3), "")
143143
printstyled(ctx.stdout, " Test |", color = :white)
144-
ctx.debug_timing && printstyled(ctx.stdout, " Init │ Compile │", color = :white)
144+
ctx.debug_timing && printstyled(ctx.stdout, " Init │", color = :white)
145+
VERSION >= v"1.11" && ctx.debug_timing && printstyled(ctx.stdout, " Compile │", color = :white)
145146
printstyled(ctx.stdout, " ──────────────── CPU ──────────────── │\n", color = :white)
146147

147148
# header bottom
148149
printstyled(ctx.stdout, testgroupheader, color = :white)
149150
printstyled(ctx.stdout, lpad(workerheader, ctx.name_align - textwidth(testgroupheader) + 1), "", color = :white)
150151
printstyled(ctx.stdout, "time (s) │", color = :white)
151-
ctx.debug_timing && printstyled(ctx.stdout, " time (s) │ (%) │", color = :white)
152+
ctx.debug_timing && printstyled(ctx.stdout, " time (s) │", color = :white)
153+
VERSION >= v"1.11" && ctx.debug_timing && printstyled(ctx.stdout, " (%) │", color = :white)
152154
printstyled(ctx.stdout, " GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │\n", color = :white)
153155
flush(ctx.stdout)
154156
finally
@@ -185,8 +187,10 @@ function print_test_finished(record::TestRecord, wrkr, test, ctx::TestIOContext)
185187
printstyled(ctx.stdout, lpad(init_time_str, ctx.elapsed_align, " "), "", color = :white)
186188

187189
# compilation time
188-
init_time_str = @sprintf("%7.2f", Float64(100*record.compile_time/time))
189-
printstyled(ctx.stdout, lpad(init_time_str, ctx.compile_align, " "), "", color = :white)
190+
if VERSION >= v"1.11"
191+
init_time_str = @sprintf("%7.2f", Float64(100*record.compile_time/time))
192+
printstyled(ctx.stdout, lpad(init_time_str, ctx.compile_align, " "), "", color = :white)
193+
end
190194
end
191195

192196
gc_str = @sprintf("%5.2f", record.gctime)
@@ -328,7 +332,9 @@ function runtest(f, name, init_code, start_time)
328332
$f
329333
end
330334
end
331-
(; testset=stats.value, stats.time, stats.bytes, stats.gctime, stats.compile_time)
335+
336+
compile_time = @static VERSION >= v"1.11" ? stats.compile_time : 0.0
337+
(; testset=stats.value, stats.time, stats.bytes, stats.gctime, compile_time)
332338
end
333339

334340
# process results

test/runtests.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ end
3333
@test contains(str, "time (s)") # timing
3434

3535
@test contains(str, "Init") # debug timing
36-
@test contains(str, "Compile") # debug timing
37-
@test contains(str, "(%)") # debug timing
36+
if VERSION >= v"1.11" # compile time as part of the struct not available before 1.11
37+
@test contains(str, "Compile") # debug timing
38+
@test contains(str, "(%)") # debug timing
39+
end
3840
end
3941

4042
@testset "subdir use" begin

0 commit comments

Comments
 (0)