diff --git a/test/runtests.jl b/test/runtests.jl index 46cb9d6f..0cc9582b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,12 +7,10 @@ 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" @@ -20,7 +18,7 @@ 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 -> @@ -31,6 +29,7 @@ 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 @@ -38,19 +37,23 @@ pbs_with_issues = [ ] 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) @@ -67,6 +70,7 @@ const verbose = true @test list_of_problems_final == available_problems() broken=true end end + end # diff --git a/test/test_Init.jl b/test/test_comparison_init.jl similarity index 99% rename from test/test_Init.jl rename to test/test_comparison_init.jl index af7ea513..629ea613 100644 --- a/test/test_Init.jl +++ b/test/test_comparison_init.jl @@ -1,5 +1,4 @@ -# test_comparison_init -function test_Init() +function test_comparison_init() # Comparison Parameters ε = 1e-2 diff --git a/test/test_Objective.jl b/test/test_comparison_objective.jl similarity index 98% rename from test/test_Objective.jl rename to test/test_comparison_objective.jl index 3f7d6829..57994f71 100644 --- a/test/test_Objective.jl +++ b/test/test_comparison_objective.jl @@ -1,4 +1,4 @@ -function test_Objective() +function test_comparison_objective() # Comparison Parameters ε = 1e-2 diff --git a/test/test_Comparison.jl b/test/test_comparison_solution.jl similarity index 99% rename from test/test_Comparison.jl rename to test/test_comparison_solution.jl index 5f377e5b..1717d79f 100644 --- a/test/test_Comparison.jl +++ b/test/test_comparison_solution.jl @@ -1,5 +1,4 @@ -# test_Comparison_JuMP_OptimalControl -function test_Comparison() +function test_comparison_solution() # Comparison Parameters ε = 1e-2