|
1 | | -using FiniteVolumeMethod |
2 | | -using Test |
3 | | -using Dates |
4 | | -using Aqua |
| 1 | +using SciMLTesting |
5 | 2 |
|
6 | | -ct() = Dates.format(now(), "HH:MM:SS") |
7 | | -function safe_include(filename; name = filename) # Workaround for not being able to interpolate into SafeTestset test names |
8 | | - mod = @eval module $(gensym()) end |
9 | | - @info "[$(ct())] Testing $name" |
10 | | - return @testset verbose = true "Example: $name" begin |
11 | | - Base.include(mod, filename) |
12 | | - end |
13 | | -end |
14 | | - |
15 | | -@testset verbose = true "FiniteVolumeMethod.jl" begin |
16 | | - @testset verbose = true "Geometry" begin |
17 | | - safe_include("geometry.jl") |
18 | | - end |
19 | | - @testset verbose = true "Conditions" begin |
20 | | - safe_include("conditions.jl") |
21 | | - end |
22 | | - @testset verbose = true "Problem" begin |
23 | | - safe_include("problem.jl") |
24 | | - end |
25 | | - @testset verbose = true "Equations" begin |
26 | | - safe_include("equations.jl") |
27 | | - end |
28 | | - @testset verbose = true "README" begin |
29 | | - safe_include("README.jl") |
30 | | - end |
31 | | - |
32 | | - @testset verbose = true "Tutorials" begin |
33 | | - dir = joinpath(dirname(@__DIR__), "docs", "src", "literate_tutorials") |
34 | | - files = readdir(dir) |
35 | | - file_names = [ |
36 | | - "diffusion_equation_in_a_wedge_with_mixed_boundary_conditions.jl", |
37 | | - "diffusion_equation_on_a_square_plate.jl", |
38 | | - "diffusion_equation_on_an_annulus.jl", |
39 | | - "equilibrium_temperature_distribution_with_mixed_boundary_conditions_and_using_ensembleproblems.jl", |
40 | | - "helmholtz_equation_with_inhomogeneous_boundary_conditions.jl", |
41 | | - "laplaces_equation_with_internal_dirichlet_conditions.jl", |
42 | | - "mean_exit_time.jl", |
43 | | - "piecewise_linear_and_natural_neighbour_interpolation_for_an_advection_diffusion_equation.jl", |
44 | | - "porous_fisher_equation_and_travelling_waves.jl", |
45 | | - "porous_medium_equation.jl", |
46 | | - "reaction_diffusion_brusselator_system_of_pdes.jl", |
47 | | - "reaction_diffusion_equation_with_a_time_dependent_dirichlet_boundary_condition_on_a_disk.jl", |
48 | | - "solving_mazes_with_laplaces_equation.jl", |
49 | | - "gray_scott_model_turing_patterns_from_a_coupled_reaction_diffusion_system.jl", |
50 | | - ] # do it manually just to make it easier for testing individual files rather than in a loop, e.g. one like |
51 | | - #= |
52 | | - for file in files |
53 | | - @testset "Example: $file" begin |
54 | | - safe_include(joinpath(dir, file)) |
55 | | - end |
56 | | - end |
57 | | - =# |
58 | | - @test length(files) == length(file_names) # make sure we didn't miss any |
59 | | - safe_include(joinpath(dir, file_names[1]); name = file_names[1]) # diffusion_equation_in_a_wedge_with_mixed_boundary_conditions |
60 | | - safe_include(joinpath(dir, file_names[2]); name = file_names[2]) # diffusion_equation_on_a_square_plate |
61 | | - safe_include(joinpath(dir, file_names[3]); name = file_names[3]) # diffusion_equation_on_an_annulus |
62 | | - safe_include(joinpath(dir, file_names[4]); name = file_names[4]) # equilibrium_temperature_distribution_with_mixed_boundary_conditions_and_using_ensembleproblems |
63 | | - safe_include(joinpath(dir, file_names[5]); name = file_names[5]) # helmholtz_equation_with_inhomogeneous_boundary_conditions |
64 | | - safe_include(joinpath(dir, file_names[6]); name = file_names[6]) # laplaces_equation_with_internal_dirichlet_conditions |
65 | | - safe_include(joinpath(dir, file_names[7]); name = file_names[7]) # mean_exit_time |
66 | | - safe_include(joinpath(dir, file_names[8]); name = file_names[8]) # piecewise_linear_and_natural_neighbour_interpolation_for_an_advection_diffusion_equation |
67 | | - safe_include(joinpath(dir, file_names[9]); name = file_names[9]) # porous_fisher_equation_and_travelling_waves |
68 | | - safe_include(joinpath(dir, file_names[10]); name = file_names[10]) # porous_medium_equation |
69 | | - safe_include(joinpath(dir, file_names[11]); name = file_names[11]) # reaction_diffusion_brusselator_system_of_pdes |
70 | | - safe_include(joinpath(dir, file_names[12]); name = file_names[12]) # reaction_diffusion_equation_with_a_time_dependent_dirichlet_boundary_condition_on_a_disk |
71 | | - safe_include(joinpath(dir, file_names[13]); name = file_names[13]) # solving_mazes_with_laplaces_equation |
72 | | - safe_include(joinpath(dir, file_names[14]); name = file_names[14]) # gray_scott_model_turing_patterns_from_a_coupled_reaction_diffusion_system |
73 | | - # safe_include(joinpath(dir, file_names[15]); name=file_names[15]) # keller_segel_chemotaxis |
74 | | - end |
75 | | - |
76 | | - @testset verbose = true "Custom Templates" begin |
77 | | - dir = joinpath(dirname(@__DIR__), "docs", "src", "literate_wyos") |
78 | | - files = readdir(dir) |
79 | | - file_names = [ |
80 | | - "diffusion_equations.jl", |
81 | | - "mean_exit_time.jl", |
82 | | - "linear_reaction_diffusion_equations.jl", |
83 | | - "poissons_equation.jl", |
84 | | - "laplaces_equation.jl", |
85 | | - ] |
86 | | - @test length(files) == length(file_names) # make sure we didn't miss any |
87 | | - safe_include(joinpath(dir, file_names[1]); name = file_names[1]) # diffusion_equations |
88 | | - safe_include(joinpath(dir, file_names[2]); name = file_names[2]) # mean_exit_time |
89 | | - safe_include(joinpath(dir, file_names[3]); name = file_names[3]) # linear_reaction_diffusion_equations |
90 | | - safe_include(joinpath(dir, file_names[4]); name = file_names[4]) # poissons_equation |
91 | | - safe_include(joinpath(dir, file_names[5]); name = file_names[5]) # laplaces_equation |
92 | | - end |
93 | | - |
94 | | - @testset verbose = true "Aqua" begin |
95 | | - Aqua.test_all(FiniteVolumeMethod; ambiguities = false, project_extras = false) # don't care about julia < 1.2 |
96 | | - Aqua.test_ambiguities(FiniteVolumeMethod) # don't pick up Base and Core... |
97 | | - end |
98 | | - |
99 | | - @testset verbose = true "Explicit Imports" begin |
100 | | - safe_include("explicit_imports.jl") |
101 | | - end |
102 | | -end |
| 3 | +run_tests(; |
| 4 | + core = joinpath(@__DIR__, "core_tests.jl"), |
| 5 | + qa = (; env = joinpath(@__DIR__, "qa"), body = joinpath(@__DIR__, "qa", "qa.jl")), |
| 6 | + all = ["Core"], |
| 7 | +) |
0 commit comments