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
12 changes: 1 addition & 11 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,5 @@ concurrency:

jobs:
tests:
name: "Tests"
strategy:
fail-fast: false
matrix:
version:
- "1.11"
- "pre"
- "lts"
uses: "SciML/.github/.github/workflows/tests.yml@v1"
with:
julia-version: "${{ matrix.version }}"
uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1"
secrets: "inherit"
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DelaunayTriangulation = "1.0"
PreallocationTools = "0.4, 1.2"
PrecompileTools = "1.2"
SciMLBase = "2.34, 3.1"
Test = "1"
julia = "1"

[extras]
Expand Down
10 changes: 4 additions & 6 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Bessels = "0e736298-9ec6-45e8-9647-e4fc86a2fe38"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
Cubature = "667455a9-e2ce-5579-9412-b964f529a492"
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand All @@ -15,7 +14,6 @@ DisplayAs = "0b91fe84-8a4c-11e9-3e1d-67c38462b6d6"
ElasticArrays = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
Expand All @@ -26,9 +24,10 @@ PolygonOps = "647866c9-e3ac-4575-94e7-e3d426903924"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReferenceTests = "324d217c-45ce-50fc-942e-d289b448e8cf"
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
SimpleGraphs = "55797a34-41de-5266-9ec1-32ac4eb504d3"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Expand All @@ -43,7 +42,6 @@ Aqua = "0.7, 0.8"
BenchmarkTools = "1.8.0"
Bessels = "0.2.8"
CairoMakie = "0.15.11"
Cthulhu = "3.0.2"
Cubature = "1.5.1"
DataInterpolations = "8.10.0"
DelaunayTriangulation = "1.6.6"
Expand All @@ -52,7 +50,6 @@ DisplayAs = "0.1.6"
ElasticArrays = "1.2.12"
ExplicitImports = "1.15.0"
FastGaussQuadrature = "1.3.0"
JET = "0.11.3"
Krylov = "0.10.6"
LinearSolve = "3.84.0"
NaturalNeighbours = "1.3.6"
Expand All @@ -61,8 +58,9 @@ OrdinaryDiffEq = "7.0.0"
PolygonOps = "0.1.2"
ReferenceTests = "0.10.6"
Roots = "3.0.0"
SafeTestsets = "0.1, 1"
SciMLTesting = "1"
SimpleGraphs = "0.8.10"
SparseDiffTools = "2.26.0"
SpecialFunctions = "2.8.0"
StableRNGs = "1.0.4"
StatsBase = "0.34.11"
Expand Down
91 changes: 91 additions & 0 deletions test/core_tests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
using FiniteVolumeMethod
using Dates

ct() = Dates.format(now(), "HH:MM:SS")
function safe_include(filename; name = filename) # Workaround for not being able to interpolate into SafeTestset test names
mod = @eval module $(gensym()) end
@info "[$(ct())] Testing $name"
return @testset verbose = true "Example: $name" begin
Base.include(mod, filename)
end
end

@testset verbose = true "FiniteVolumeMethod.jl" begin
@testset verbose = true "Geometry" begin
safe_include("geometry.jl")
end
@testset verbose = true "Conditions" begin
safe_include("conditions.jl")
end
@testset verbose = true "Problem" begin
safe_include("problem.jl")
end
@testset verbose = true "Equations" begin
safe_include("equations.jl")
end
@testset verbose = true "README" begin
safe_include("README.jl")
end

@testset verbose = true "Tutorials" begin
dir = joinpath(dirname(@__DIR__), "docs", "src", "literate_tutorials")
files = readdir(dir)
file_names = [
"diffusion_equation_in_a_wedge_with_mixed_boundary_conditions.jl",
"diffusion_equation_on_a_square_plate.jl",
"diffusion_equation_on_an_annulus.jl",
"equilibrium_temperature_distribution_with_mixed_boundary_conditions_and_using_ensembleproblems.jl",
"helmholtz_equation_with_inhomogeneous_boundary_conditions.jl",
"laplaces_equation_with_internal_dirichlet_conditions.jl",
"mean_exit_time.jl",
"piecewise_linear_and_natural_neighbour_interpolation_for_an_advection_diffusion_equation.jl",
"porous_fisher_equation_and_travelling_waves.jl",
"porous_medium_equation.jl",
"reaction_diffusion_brusselator_system_of_pdes.jl",
"reaction_diffusion_equation_with_a_time_dependent_dirichlet_boundary_condition_on_a_disk.jl",
"solving_mazes_with_laplaces_equation.jl",
"gray_scott_model_turing_patterns_from_a_coupled_reaction_diffusion_system.jl",
] # do it manually just to make it easier for testing individual files rather than in a loop, e.g. one like
#=
for file in files
@testset "Example: $file" begin
safe_include(joinpath(dir, file))
end
end
=#
@test length(files) == length(file_names) # make sure we didn't miss any
safe_include(joinpath(dir, file_names[1]); name = file_names[1]) # diffusion_equation_in_a_wedge_with_mixed_boundary_conditions
safe_include(joinpath(dir, file_names[2]); name = file_names[2]) # diffusion_equation_on_a_square_plate
safe_include(joinpath(dir, file_names[3]); name = file_names[3]) # diffusion_equation_on_an_annulus
safe_include(joinpath(dir, file_names[4]); name = file_names[4]) # equilibrium_temperature_distribution_with_mixed_boundary_conditions_and_using_ensembleproblems
safe_include(joinpath(dir, file_names[5]); name = file_names[5]) # helmholtz_equation_with_inhomogeneous_boundary_conditions
safe_include(joinpath(dir, file_names[6]); name = file_names[6]) # laplaces_equation_with_internal_dirichlet_conditions
safe_include(joinpath(dir, file_names[7]); name = file_names[7]) # mean_exit_time
safe_include(joinpath(dir, file_names[8]); name = file_names[8]) # piecewise_linear_and_natural_neighbour_interpolation_for_an_advection_diffusion_equation
safe_include(joinpath(dir, file_names[9]); name = file_names[9]) # porous_fisher_equation_and_travelling_waves
safe_include(joinpath(dir, file_names[10]); name = file_names[10]) # porous_medium_equation
safe_include(joinpath(dir, file_names[11]); name = file_names[11]) # reaction_diffusion_brusselator_system_of_pdes
safe_include(joinpath(dir, file_names[12]); name = file_names[12]) # reaction_diffusion_equation_with_a_time_dependent_dirichlet_boundary_condition_on_a_disk
safe_include(joinpath(dir, file_names[13]); name = file_names[13]) # solving_mazes_with_laplaces_equation
safe_include(joinpath(dir, file_names[14]); name = file_names[14]) # gray_scott_model_turing_patterns_from_a_coupled_reaction_diffusion_system
# safe_include(joinpath(dir, file_names[15]); name=file_names[15]) # keller_segel_chemotaxis
end

@testset verbose = true "Custom Templates" begin
dir = joinpath(dirname(@__DIR__), "docs", "src", "literate_wyos")
files = readdir(dir)
file_names = [
"diffusion_equations.jl",
"mean_exit_time.jl",
"linear_reaction_diffusion_equations.jl",
"poissons_equation.jl",
"laplaces_equation.jl",
]
@test length(files) == length(file_names) # make sure we didn't miss any
safe_include(joinpath(dir, file_names[1]); name = file_names[1]) # diffusion_equations
safe_include(joinpath(dir, file_names[2]); name = file_names[2]) # mean_exit_time
safe_include(joinpath(dir, file_names[3]); name = file_names[3]) # linear_reaction_diffusion_equations
safe_include(joinpath(dir, file_names[4]); name = file_names[4]) # poissons_equation
safe_include(joinpath(dir, file_names[5]); name = file_names[5]) # laplaces_equation
end
end
18 changes: 18 additions & 0 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
FiniteVolumeMethod = "d4f04ab7-4f65-4d72-8a28-7087bc7f46f4"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
FiniteVolumeMethod = {path = "../.."}

[compat]
Aqua = "0.7, 0.8"
ExplicitImports = "1.15.0"
SafeTestsets = "0.1, 1"
SciMLTesting = "1"
Test = "1"
julia = "1.10"
14 changes: 14 additions & 0 deletions test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using FiniteVolumeMethod
using Test
using Aqua
using ExplicitImports

@testset verbose = true "Aqua" begin
Aqua.test_all(FiniteVolumeMethod; ambiguities = false, project_extras = false) # don't care about julia < 1.2
Aqua.test_ambiguities(FiniteVolumeMethod) # don't pick up Base and Core...
end

@testset verbose = true "Explicit Imports" begin
@test check_no_implicit_imports(FiniteVolumeMethod) === nothing
@test check_no_stale_explicit_imports(FiniteVolumeMethod) === nothing
end
107 changes: 6 additions & 101 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,102 +1,7 @@
using FiniteVolumeMethod
using Test
using Dates
using Aqua
using SciMLTesting

ct() = Dates.format(now(), "HH:MM:SS")
function safe_include(filename; name = filename) # Workaround for not being able to interpolate into SafeTestset test names
mod = @eval module $(gensym()) end
@info "[$(ct())] Testing $name"
return @testset verbose = true "Example: $name" begin
Base.include(mod, filename)
end
end

@testset verbose = true "FiniteVolumeMethod.jl" begin
@testset verbose = true "Geometry" begin
safe_include("geometry.jl")
end
@testset verbose = true "Conditions" begin
safe_include("conditions.jl")
end
@testset verbose = true "Problem" begin
safe_include("problem.jl")
end
@testset verbose = true "Equations" begin
safe_include("equations.jl")
end
@testset verbose = true "README" begin
safe_include("README.jl")
end

@testset verbose = true "Tutorials" begin
dir = joinpath(dirname(@__DIR__), "docs", "src", "literate_tutorials")
files = readdir(dir)
file_names = [
"diffusion_equation_in_a_wedge_with_mixed_boundary_conditions.jl",
"diffusion_equation_on_a_square_plate.jl",
"diffusion_equation_on_an_annulus.jl",
"equilibrium_temperature_distribution_with_mixed_boundary_conditions_and_using_ensembleproblems.jl",
"helmholtz_equation_with_inhomogeneous_boundary_conditions.jl",
"laplaces_equation_with_internal_dirichlet_conditions.jl",
"mean_exit_time.jl",
"piecewise_linear_and_natural_neighbour_interpolation_for_an_advection_diffusion_equation.jl",
"porous_fisher_equation_and_travelling_waves.jl",
"porous_medium_equation.jl",
"reaction_diffusion_brusselator_system_of_pdes.jl",
"reaction_diffusion_equation_with_a_time_dependent_dirichlet_boundary_condition_on_a_disk.jl",
"solving_mazes_with_laplaces_equation.jl",
"gray_scott_model_turing_patterns_from_a_coupled_reaction_diffusion_system.jl",
] # do it manually just to make it easier for testing individual files rather than in a loop, e.g. one like
#=
for file in files
@testset "Example: $file" begin
safe_include(joinpath(dir, file))
end
end
=#
@test length(files) == length(file_names) # make sure we didn't miss any
safe_include(joinpath(dir, file_names[1]); name = file_names[1]) # diffusion_equation_in_a_wedge_with_mixed_boundary_conditions
safe_include(joinpath(dir, file_names[2]); name = file_names[2]) # diffusion_equation_on_a_square_plate
safe_include(joinpath(dir, file_names[3]); name = file_names[3]) # diffusion_equation_on_an_annulus
safe_include(joinpath(dir, file_names[4]); name = file_names[4]) # equilibrium_temperature_distribution_with_mixed_boundary_conditions_and_using_ensembleproblems
safe_include(joinpath(dir, file_names[5]); name = file_names[5]) # helmholtz_equation_with_inhomogeneous_boundary_conditions
safe_include(joinpath(dir, file_names[6]); name = file_names[6]) # laplaces_equation_with_internal_dirichlet_conditions
safe_include(joinpath(dir, file_names[7]); name = file_names[7]) # mean_exit_time
safe_include(joinpath(dir, file_names[8]); name = file_names[8]) # piecewise_linear_and_natural_neighbour_interpolation_for_an_advection_diffusion_equation
safe_include(joinpath(dir, file_names[9]); name = file_names[9]) # porous_fisher_equation_and_travelling_waves
safe_include(joinpath(dir, file_names[10]); name = file_names[10]) # porous_medium_equation
safe_include(joinpath(dir, file_names[11]); name = file_names[11]) # reaction_diffusion_brusselator_system_of_pdes
safe_include(joinpath(dir, file_names[12]); name = file_names[12]) # reaction_diffusion_equation_with_a_time_dependent_dirichlet_boundary_condition_on_a_disk
safe_include(joinpath(dir, file_names[13]); name = file_names[13]) # solving_mazes_with_laplaces_equation
safe_include(joinpath(dir, file_names[14]); name = file_names[14]) # gray_scott_model_turing_patterns_from_a_coupled_reaction_diffusion_system
# safe_include(joinpath(dir, file_names[15]); name=file_names[15]) # keller_segel_chemotaxis
end

@testset verbose = true "Custom Templates" begin
dir = joinpath(dirname(@__DIR__), "docs", "src", "literate_wyos")
files = readdir(dir)
file_names = [
"diffusion_equations.jl",
"mean_exit_time.jl",
"linear_reaction_diffusion_equations.jl",
"poissons_equation.jl",
"laplaces_equation.jl",
]
@test length(files) == length(file_names) # make sure we didn't miss any
safe_include(joinpath(dir, file_names[1]); name = file_names[1]) # diffusion_equations
safe_include(joinpath(dir, file_names[2]); name = file_names[2]) # mean_exit_time
safe_include(joinpath(dir, file_names[3]); name = file_names[3]) # linear_reaction_diffusion_equations
safe_include(joinpath(dir, file_names[4]); name = file_names[4]) # poissons_equation
safe_include(joinpath(dir, file_names[5]); name = file_names[5]) # laplaces_equation
end

@testset verbose = true "Aqua" begin
Aqua.test_all(FiniteVolumeMethod; ambiguities = false, project_extras = false) # don't care about julia < 1.2
Aqua.test_ambiguities(FiniteVolumeMethod) # don't pick up Base and Core...
end

@testset verbose = true "Explicit Imports" begin
safe_include("explicit_imports.jl")
end
end
run_tests(;
core = joinpath(@__DIR__, "core_tests.jl"),
qa = (; env = joinpath(@__DIR__, "qa"), body = joinpath(@__DIR__, "qa", "qa.jl")),
all = ["Core"],
)
5 changes: 5 additions & 0 deletions test/test_groups.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Core]
versions = ["lts", "1", "pre"]

[QA]
versions = ["lts", "1"]
Loading