Skip to content

Commit b356b75

Browse files
Merge #96
96: Move callbacks test into safetestset r=charleskawczynski a=charleskawczynski This PR: - Deletes unused variables - Moves the `const_prob_inc` problem into `test/callbacks.jl` - Moves the callbacks test into a SafeTestsets test, to improve test modularity Co-authored-by: Charles Kawczynski <[email protected]>
2 parents f7d33e4 + 210674e commit b356b75

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

test/callbacks.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ cbs = CallbackSet(
4040
EveryXWallTimeSeconds(cb5, 0.49, comm_ctx)
4141
)
4242

43+
const_prob_inc = ODEProblem(
44+
IncrementingODEFunction{true}((du,u,p,t,α=true=false) -> (du .= α .* p .+ β .* du)),
45+
[0.0],(0.0,1.0),2.0)
46+
4347
solve(const_prob_inc, LSRKEulerMethod(), dt=1/32, callback=cbs)
4448

4549
@test cb1.initialized

test/problems.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ if !@isdefined(ArrayType)
44
ArrayType = Array
55
end
66

7-
const_prob = ODEProblem((du,u,p,t) -> (du .= p),[0.0],(0.0,1.0),2.0)
8-
const_prob_inc = ODEProblem(
9-
IncrementingODEFunction{true}((du,u,p,t,α=true=false) -> (du .= α .* p .+ β .* du)),
10-
[0.0],(0.0,1.0),2.0)
11-
const_prob_fe = ODEProblem(
12-
ForwardEulerODEFunction((un,u,p,t,dt) -> (un .= u .+ dt.* p)),
13-
[0.0],(0.0,1.0),2.0)
14-
const_sol(t) = [0.0 .+ 2.0 * t]
15-
16-
17-
187
"""
198
Single variable linear ODE
209

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ end
99
@safetestset "SparseContainers" begin include("sparse_containers.jl") end
1010
@safetestset "Newtons method" begin include("test_newtons_method.jl") end
1111
@safetestset "Single column ARS" begin include("single_column_ARS_test.jl") end
12+
@safetestset "Callbacks" begin include("callbacks.jl") end
1213
@safetestset "Aqua" begin include("aqua.jl") end
1314

1415
include("problems.jl")
1516
include("utils.jl")
1617

1718
include("integrator.jl")
1819
include("convergence.jl")
19-
include("callbacks.jl")
2020
include("test_convergence_checker.jl")
2121
include("compare_generated.jl") # TODO: Remove this.

0 commit comments

Comments
 (0)