From d4a3e4ba570f37372184d04bce3f784928d7629c Mon Sep 17 00:00:00 2001 From: bennibolm Date: Thu, 1 Feb 2024 14:37:16 +0100 Subject: [PATCH] Fix test for saving errors with coverage --- test/test_tree_2d_euler.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/test_tree_2d_euler.jl b/test/test_tree_2d_euler.jl index 08fe04e7248..3159a1fbf3d 100644 --- a/test/test_tree_2d_euler.jl +++ b/test/test_tree_2d_euler.jl @@ -390,7 +390,13 @@ end output_directory="out") lines = readlines("out/deviations.txt") @test lines[1] == "# iter, simu_time, rho_min, rho_max" - @test startswith(lines[end], "1") + cmd = string(Base.julia_cmd()) + coverage = occursin("--code-coverage", cmd) && + !occursin("--code-coverage=none", cmd) + if !coverage + # Run without coverage takes 96 time steps. + @test startswith(lines[end], "96") + end # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let