Skip to content

Commit

Permalink
Breaking tests into groups
Browse files Browse the repository at this point in the history
  • Loading branch information
cadojo committed Dec 24, 2023
1 parent cc3edc1 commit 1e39c77
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using ModelingToolkit, Symbolics

using GalacticPotentials: AbstractField, AbstractScalarField, ScalarField

@testset "Scalar Fields" begin
@testset verbose = true "Scalar Fields" begin
@variables t
p = @parameters b
q = @variables x(t) y(t) z(t)
Expand All @@ -20,25 +20,25 @@ using GalacticPotentials: AbstractField, AbstractScalarField, ScalarField
name=:SomeField
)

@testset "Constructors" begin
@testset showtiming = true "Constructors" begin
@test field isa ModelingToolkit.AbstractSystem
end

@testset "Calculations" begin
@testset showtiming = true "Calculations" begin
@test all(calculate_jacobian(field) - calculate_gradient(field) .== 0)
@test calculate_hessian(field) isa AbstractMatrix
end

end

@testset "Galactic Potentials" begin
@testset verbose = true "Galactic Potentials" begin
for name in names(GalacticPotentials)
!occursin("Potential", "$name") && continue
occursin("Potentials", "$name") && continue

@eval field = $name()

@testset "$name" begin
@testset showtiming = true "$name" begin
N = length(states(field))
M = length(parameters(field))
@test field isa AbstractField
Expand Down

0 comments on commit 1e39c77

Please sign in to comment.