From 6c7dcbb497b68bc1aac2d826a22178d51b43bbce Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Thu, 21 Dec 2023 00:05:52 +0100 Subject: [PATCH] Fix stats feature on 1.9 and later In v1.9, Base.cumulative_compile_time_ns() was changed to return a tuple of `(compile_time, recompile_time)`. We now use the sum of the two to show the total compilation time. --- src/testset.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/testset.jl b/src/testset.jl index 80b6e25..bd9b83f 100644 --- a/src/testset.jl +++ b/src/testset.jl @@ -672,9 +672,12 @@ macro stats(yes, ex) end end -cumulative_compile_time_ns() = - isdefined(Base, :cumulative_compile_time_ns) ? +@static if VERSION > v"1.9" + cumulative_compile_time_ns() = sum(Base.cumulative_compile_time_ns()) +else + cumulative_compile_time_ns() = isdefined(Base, :cumulative_compile_time_ns) ? Base.cumulative_compile_time_ns() : UInt(0) +end end # module