Skip to content

Commit

Permalink
List example modules, instead of problems
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Jul 1, 2018
1 parent 82c67ef commit 4bbb213
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
19 changes: 13 additions & 6 deletions src/examples/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ include("calcium.jl")
include("predator_prey.jl")
include("bazykin_85.jl")

const PROBLEMS = [
Pitchfork.prob,
Transcritical.prob,
Calcium.prob,
PredatorPrey.prob,
Bazykin85.prob,
using Compat

example_modules() = [
Pitchfork,
Transcritical,
Calcium,
PredatorPrey,
Bazykin85,
]

examples() = [nameof(ex) => ex for ex in example_modules()]

end # module

using .Examples: examples
5 changes: 3 additions & 2 deletions test/test_examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include("preamble.jl")

using Bifurcations: Codim1, resolved_points
using Bifurcations.Continuations: find_errors, print_errors
using Bifurcations.Examples: PROBLEMS
using Bifurcations: examples
using Bifurcations.Examples.Calcium: CalciumParam
using Bifurcations.Examples.Bazykin85: Bazykin85Param

Expand Down Expand Up @@ -31,7 +31,8 @@ function make_codim2(::Bazykin85Param, point, solver1)
)
end

@testset "PROBLEMS[$i]" for (i, prob1) in enumerate(PROBLEMS)
@testset "example $name" for (name, ex) in examples()
prob1 = ex.prob
solver1 = init(prob1)
solve!(solver1)
errors = find_errors(solver1)
Expand Down
5 changes: 3 additions & 2 deletions test/test_smoke.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ module TestSmoke
include("preamble_plots.jl")

using Bifurcations.Codim1: resolved_points, SpecialPoint
using Bifurcations.Examples: PROBLEMS
using Bifurcations: examples

@testset "smoke PROBLEMS[$i]" for (i, prob) in enumerate(PROBLEMS)
@testset "smoke $name" for (name, ex) in examples()
prob = ex.prob
solver = init(prob)
solve!(solver)
points = resolved_points(solver)
Expand Down

0 comments on commit 4bbb213

Please sign in to comment.