Skip to content

Commit

Permalink
Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Jun 25, 2018
1 parent bfb7d27 commit 88bd46b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 43 deletions.
3 changes: 3 additions & 0 deletions test/utils.jl → test/preamble.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using Base.Test
using Compat
using Setfield: @lens

using Bifurcations
using Bifurcations: BifurcationProblem, special_points

macro test_nothrow(ex)
Expand Down
11 changes: 11 additions & 0 deletions test/preamble_plots.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include("preamble.jl")

import GR # Workaround Plots.jl world age problem
using Plots

using Bifurcations: plot # TODO: stop doing this


function nullshow(plt::Plots.Plot)
nullshow(MIME("image/png"), plt)
end
14 changes: 1 addition & 13 deletions test/test_codim2.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
module TestCodim2
using Base.Test
include("preamble_plots.jl")

import GR # Workaround Plots.jl world age problem
using Plots

using Bifurcations
using Bifurcations: plot # TODO: stop doing this
using Bifurcations: BifurcationProblem, special_points
using Bifurcations.Codim2: NormalizingAS, BackReferencingAS
using Bifurcations.Examples: Calcium
using Setfield: @lens
include("utils.jl")

function nullshow(plt::Plots.Plot)
nullshow(MIME("image/png"), plt)
end

@testset "smoke Calcium codim-2 ($(nameof(ASType)))" for
ASType in [NormalizingAS, BackReferencingAS]
Expand Down
5 changes: 1 addition & 4 deletions test/test_examples.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
module TestExamples
using Base.Test
include("preamble.jl")

using Bifurcations
using Bifurcations: BifurcationProblem, special_points
using Bifurcations.Continuations: find_errors, print_errors
using Bifurcations.Examples: PROBLEMS
using Bifurcations.Examples.Calcium: CalciumParam
using Setfield: @lens

make_codim2(::Real, point, solver1) = nothing
make_codim2(::Tuple, point, solver1) = nothing # PredatorPrey
Expand Down
3 changes: 1 addition & 2 deletions test/test_normal_form.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module TestNormalForm
include("preamble.jl")

using Base.Test
using Bifurcations
using Bifurcations.Continuations: as, ContinuationSolution, sweeps_as_vectors
using Bifurcations.Examples: Pitchfork, Transcritical

Expand Down
14 changes: 1 addition & 13 deletions test/test_predator_prey.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
module TestPredatorPrey
using Base.Test
include("preamble_plots.jl")

import GR # Workaround Plots.jl world age problem
using Plots

using Bifurcations
using Bifurcations: plot # TODO: stop doing this
using Bifurcations: BifurcationProblem, special_points
using Bifurcations.Examples: PredatorPrey
using Setfield: @lens
include("utils.jl")

function nullshow(plt::Plots.Plot)
nullshow(MIME("image/png"), plt)
end

@testset "smoke PredatorPrey codim-2" begin
codim1_solver = init(PredatorPrey.prob)
Expand Down
12 changes: 1 addition & 11 deletions test/test_smoke.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
module TestSmoke
using Base.Test
include("preamble_plots.jl")

import GR # Workaround Plots.jl world age problem
using Plots

using Bifurcations
using Bifurcations: plot # TODO: stop doing this
using Bifurcations.Codim1: resolved_points, SpecialPoint
using Bifurcations.Examples: PROBLEMS
include("utils.jl")

function nullshow(plt::Plots.Plot)
nullshow(MIME("image/png"), plt)
end

@testset "smoke PROBLEMS[$i]" for (i, prob) in enumerate(PROBLEMS)
solver = init(prob)
Expand Down

0 comments on commit 88bd46b

Please sign in to comment.