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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ SparseArrays = "1"
StaticArrays = "1.9.8"
SummationByPartsOperators = "0.5.79"
TimerOutputs = "0.5.25, 1"
TrixiBase = "0.1.6"
TrixiBase = "0.1.6, 0.2"
julia = "1.10"
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Plots = "1.9"
Printf = "1"
SparseArrays = "1"
SummationByPartsOperators = "0.5.41"
TrixiBase = "0.1.1"
TrixiBase = "0.1.6, 0.2"
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ SummationByPartsOperators = "0.5.79"
Test = "1"
TestItemRunner = "1"
TestItems = "1"
TrixiTest = "0.1.3, 0.2"
TrixiTest = "0.2.7"
2 changes: 1 addition & 1 deletion test/test_svaerd_kalisch_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ end
cons_error=[1.0484871583691058e-9 0.5469460930247998 0.0],
change_waterheight=1.0484871583691058e-9,
change_entropy_modified=459.90372362340514,
atol=1e-11) # to make CI pass
atol=1e-10) # to make CI pass

@test_allocations(DispersiveShallowWater.rhs!, semi, sol, allocs=650_000)

Expand Down
27 changes: 12 additions & 15 deletions test/test_util.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Test: @test
using TrixiTest: @trixi_test_nowarn, @test_allocations, get_kwarg, append_to_kwargs
using TrixiTest: @trixi_test_nowarn, @test_allocations, get_kwarg, append_to_kwargs,
trixi_include_kwargs

# Use a macro to avoid world age issues when defining new initial conditions etc.
# inside an example.
Expand All @@ -20,25 +21,21 @@ macro test_trixi_include_base(example, args...)
local atol_ints = get_kwarg(args, :atol_ints, 1e-11)
local rtol_ints = get_kwarg(args, :rtol_ints, sqrt(eps()))

local kwargs = Pair{Symbol, Any}[]
for arg in args
if (arg.head == :(=) &&
!(arg.args[1] in (:additional_ignore_content,
:l2, :linf, :cons_error, :change_waterheight,
:change_velocity, :change_momentum, :change_entropy,
:change_entropy_modified, :change_hamiltonian,
:lake_at_rest,
:atol, :rtol, :atol_ints, :rtol_ints)))
push!(kwargs, Pair(arg.args...))
end
end
local kwargs = trixi_include_kwargs(args;
reserved = (:additional_ignore_content, :l2, :linf,
:cons_error, :change_waterheight,
:change_velocity, :change_momentum,
:change_entropy,
:change_entropy_modified,
:change_hamiltonian, :lake_at_rest,
:atol, :rtol, :atol_ints, :rtol_ints))

quote
println("═"^100)
println($example)
println($(esc(example)))

# evaluate examples in the scope of the module they're called from
@trixi_test_nowarn trixi_include(@__MODULE__, $example; $kwargs...) $additional_ignore_content
@trixi_test_nowarn trixi_include(@__MODULE__, $(esc(example)); $(kwargs...)) $additional_ignore_content

# if present, compare l2, linf and conservation errors against reference values
if !isnothing($l2) || !isnothing($linf) || !isnothing($cons_error)
Expand Down
Loading