Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ macro test_trixi_include_base(elixir, args...)
# Note: The variables below are just Symbols, not actual errors/types
local l2 = get_kwarg(args, :l2, nothing)
local linf = get_kwarg(args, :linf, nothing)
local RealT_symbol = get_kwarg(args, :RealT, :Float64)
RealT = getfield(@__MODULE__, RealT_symbol)
atol_default = 500 * eps(RealT)
rtol_default = sqrt(eps(RealT))
local RealT_symbol = get_kwarg(args, :RealT_for_test_tolerances, :Float64)
RealT_for_test_tolerances = getfield(@__MODULE__, RealT_symbol)
atol_default = 500 * eps(RealT_for_test_tolerances)
rtol_default = sqrt(eps(RealT_for_test_tolerances))
local atol = get_kwarg(args, :atol, atol_default)
local rtol = get_kwarg(args, :rtol, rtol_default)

Expand Down
20 changes: 18 additions & 2 deletions test/test_test_trixi_include.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,24 @@ end
end
end

@trixi_testset "l2 and linf with RealT_for_test_tolerances" begin
example = """
function analysis_callback(sol)
@show sol
return sol[1], sol[2]
end
sol = [1.2345678901234567, 7.6543210987654321]
"""

mktemp() do path, io
write(io, example)
close(io)

@test_trixi_include_base(path, l2=1.2345, linf=7.6543,
RealT_for_test_tolerances=Float32)
end
end

@trixi_testset "maxiters" begin
example = """
maxiters = 4
Expand All @@ -208,8 +226,6 @@ end
end
end

# RealT is used internally to compute error tolerances when l2 or linf are used
# However, it should also be forwarded as a keyword argument to trixi_include
@trixi_testset "RealT" begin
example = """
RealT = Float64
Expand Down