Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ using OptimalControl
using OptimalControlProblems
using Test
using Plots

#
using Interpolations
include("utils.jl")

# Parameters
# Parameters for the solvers
const tol = 1e-6
const mu_strategy = "adaptive"
const sb = "yes"
const constr_viol_tol = 1e-6
const max_iter = 1000
const max_wall_time = 500.0

# Collecting all the OptimalControlProblems
# Collect all the problem from OptimalControlProblems
all_names = names(OptimalControlProblems; all=true)
functions_list = filter(
x ->
Expand All @@ -31,26 +29,31 @@ functions_list = filter(
all_names,
)

# Remove from the tests the problems that are not working
pbs_with_issues = [
:glider, :moonlander, # issues with OptimalControl
:cart_pendulum, :truck_trailer, # issues with JuMP
:space_shuttle, # not the same probleme between JuMP (tf not fixed) and OptimalControl (tf fixed)
]
functions_list = setdiff(functions_list, pbs_with_issues)

# The list of all the problems to test
const list_of_problems = deepcopy(functions_list)

# The final list of problems for which the tests pass
list_of_problems_final = deepcopy(functions_list)

#
const verbose = true
# Tests
const verbose = true # print or not details during tests
@testset "OptimalControlProblems tests" verbose=verbose showtiming=true begin

for name in (
:aqua,
:JuMP,
:OptimalControl,
:Comparison,
:Init,
:Objective,
:JuMP, # convergence tests for JuMP models
:OptimalControl, # convergence tests for OptimalControl models
:comparison_solution, # comparison between OptimalControl and JuMP in terms of solutions
:comparison_init, # comparison between OptimalControl and JuMP in terms of init guess
:comparison_objective, # comparison between OptimalControl and JuMP in terms of objective
)
@testset "$(name)" verbose=verbose begin
test_name = Symbol(:test_, name)
Expand All @@ -67,6 +70,7 @@ const verbose = true
@test list_of_problems_final == available_problems() broken=true
end
end

end

#
Expand Down
3 changes: 1 addition & 2 deletions test/test_Init.jl → test/test_comparison_init.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# test_comparison_init
function test_Init()
function test_comparison_init()

# Comparison Parameters
ε = 1e-2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function test_Objective()
function test_comparison_objective()

# Comparison Parameters
ε = 1e-2
Expand Down
3 changes: 1 addition & 2 deletions test/test_Comparison.jl → test/test_comparison_solution.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# test_Comparison_JuMP_OptimalControl
function test_Comparison()
function test_comparison_solution()

# Comparison Parameters
ε = 1e-2
Expand Down
Loading