Skip to content

Commit

Permalink
Show message in tests to avoid stall in Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Jul 26, 2018
1 parent ff6bd2a commit d507640
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions test/preamble.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Base.Test
using Compat
using Compat: @info
using Setfield: @lens

using Bifurcations
Expand Down
12 changes: 9 additions & 3 deletions test/test_fold_lc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ solver_lc = init(
max_branches = 0,
nominal_angle_rad = 0.01,
)
solve!(solver_lc)
@info "Solving LimitCycleProblem..."
@time solve!(solver_lc)

@info "Testing LimitCycleProblem solution..."
@test_broken length(solver_lc.sweeps[1].super.simple_bifurcation) == 0

flc_points = resolved_points(solver_lc)
@time flc_points = resolved_points(solver_lc)
@test_broken length(flc_points) == 1
@test flc_points[1].point_type === Codim1LimitCycle.PointTypes.saddle_node

@info "Preparing FoldLimitCycleProblem..."
prob_flc = BifurcationProblem(
flc_points[1],
solver_lc,
Expand All @@ -47,6 +50,9 @@ solver_flc = init(
max_branches = 0,
nominal_angle_rad = 0.01,
)
solve!(solver_flc)
@info "Solving FoldLimitCycleProblem..."
@time solve!(solver_flc)

@info "Done!"

end # module
11 changes: 8 additions & 3 deletions test/test_hopf_to_lc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,26 @@ solver1 = init(
prob_lc;
start_from_nearest_root = true,
)
solve!(solver1)
@info "Solving LimitCycleProblem..."
@time solve!(solver1)

@info "Testing LimitCycleProblem solution..."
periods = [lc.period for lc in limitcycles(solver1)]
@test length(periods) > 0
@test all(!isnan, periods)
@test maximum(periods) >= period_max # it is stopped due to out-of-domain
@test minimum(periods) > 0

plt_multi_panel = plot(
@info "Plotting LimitCycleProblem solution..."
@time plt_multi_panel = plot(
plot(solver1, (:x=>:parameter, :y=>1, :color=>:period)),
plot(solver1, (:x=>:parameter, :y=>:period, :color=>:period)),
plot_state_space(solver1);
clims = (10, period_max), # TODO: make it work without this
)

@test_nothrow nullshow(plt_multi_panel)
@time @test_nothrow nullshow(plt_multi_panel)

@info "Done!"

end # module

0 comments on commit d507640

Please sign in to comment.