@testsnippet TreeMesh2DLinearizedEuler begin
    EXAMPLES_DIR = joinpath(examples_dir(), "tree_2d_dgsem")
end

@testitem "TreeMesh2D LinearizedEuler: elixir_linearizedeuler_convergence.jl" setup=[
    Setup,
    TreeMesh2DLinearizedEuler
] tags=[:tree_part2] begin
    @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_linearizedeuler_convergence.jl"),
                        l2=[
                            0.00020601485381444888,
                            0.00013380483421751216,
                            0.0001338048342174503,
                            0.00020601485381444888
                        ],
                        linf=[
                            0.0011006084408365924,
                            0.0005788678074691855,
                            0.0005788678074701847,
                            0.0011006084408365924
                        ])
    # Ensure that we do not have excessive memory allocations
    # (e.g., from type instabilities)
    @test_allocations(Trixi.rhs_hyperbolic!, semi, sol, 1000)
end

@testitem "TreeMesh2D LinearizedEuler: elixir_linearizedeuler_gauss_wall.jl" setup=[
    Setup,
    TreeMesh2DLinearizedEuler
] tags=[:tree_part2] begin
    @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_linearizedeuler_gauss_wall.jl"),
                        l2=[
                            0.048185623945503485,
                            0.01941899333212175,
                            0.019510224816991825,
                            0.048185623945503485
                        ],
                        linf=[
                            1.0392165942153189,
                            0.18188777290819994,
                            0.1877028372108587,
                            1.0392165942153189
                        ])

    # Ensure that we do not have excessive memory allocations
    # (e.g., from type instabilities)
    @test_allocations(Trixi.rhs_hyperbolic!, semi, sol, 1000)
end
