From 7752c344d49fb5d56f11cfb74bb6ad90b517bf01 Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Tue, 10 Oct 2023 21:32:23 +0200 Subject: [PATCH] add timings + used memory to tests --- ReferenceTests/src/database.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ReferenceTests/src/database.jl b/ReferenceTests/src/database.jl index 7db2c8eafb7..ff5e5dfa865 100644 --- a/ReferenceTests/src/database.jl +++ b/ReferenceTests/src/database.jl @@ -29,6 +29,7 @@ macro reference_test(name, code) funcs = used_functions(code) skip = (title in SKIP_TITLES) || any(x-> x in funcs, SKIP_FUNCTIONS) return quote + t1 = time() @testset $(title) begin if $skip @test_broken false @@ -46,6 +47,11 @@ macro reference_test(name, code) push!($REGISTERED_TESTS, $title) end end + GC.gc(true) + elapsed = round(time() - t1; digits=3) + mem = (Sys.total_memory() - Sys.free_memory()) / 10^9 + # TODO, write to file and create an overview in the end, similar to the benchmark results! + println("Used RAM: $(mem), time: $(elapsed)s") end end