Skip to content

Commit

Permalink
update tests and use coverage override to avoid redundancy
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwinters5000 committed Mar 13, 2024
1 parent 099050d commit d81b79e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
10 changes: 0 additions & 10 deletions test/test_unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -616,16 +616,6 @@ end
@test_nowarn show(stdout, time_series)
@test_throws ArgumentError TimeSeriesCallback(semi, [(1.0, 1.0)]; interval = -1)
@test_throws ArgumentError TimeSeriesCallback(semi, [1.0 1.0 1.0; 2.0 2.0 2.0])
# Test the 2D unstructured mesh version of the callback
@test_nowarn_mod trixi_include(@__MODULE__,
joinpath(examples_dir(), "unstructured_2d_dgsem",
"elixir_euler_time_series.jl"),
tspan = (0.0, 0.2))

point_data_1 = time_series.affect!.point_data[1]
@test all(isapprox.(point_data_1[1:4],
[1.9546882708551676, 1.9547149531788077,
1.9547142161310154, 3.821066781119142]))
end

@timed_testset "Consistency check for single point flux: CEMCE" begin
Expand Down
26 changes: 17 additions & 9 deletions test/test_unstructured_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,26 @@ end
@trixi_testset "elixir_euler_time_series.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_time_series.jl"),
l2=[
9.860036213913957e-5,
7.767842271271052e-5,
8.956109781622046e-5,
0.0001771544151538529,
6.984024099236519e-5,
6.289022520363763e-5,
6.550951878107466e-5,
0.00016222767700879948,
],
linf=[
0.000656954971669732,
0.000494381111073805,
0.0006563610876975101,
0.0011651838899400246,
0.0005367823248620951,
0.000671293180158461,
0.0005656680962440319,
0.0013910024779804075,
],
tspan=(0.0, 0.5))
tspan=(0.0, 0.2),
# With the default `maxiters = 1` in coverage tests,
# there would be no time series to check against.
coverage_override=(maxiters = 20,))
# Extra test that the `TimeSeries` callback creates reasonable data
point_data_1 = time_series.affect!.point_data[1]
@test all(isapprox.(point_data_1[1:4],
[1.9546882708551676, 1.9547149531788077,
1.9547142161310154, 3.821066781119142]))
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down

0 comments on commit d81b79e

Please sign in to comment.