Skip to content

Commit 6faccad

Browse files
committed
Refactor test configuration for flexible problem selection
- Add override_list_of_problems flag for easy problem selection - Use OptimalControlProblems.problems() instead of local problems() function - Provide cleaner structure for including/excluding specific problems - Default to testing all available problems with optional exclusions
1 parent a6fd447 commit 6faccad

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

test/runtests.jl

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,22 @@ const MAX_ITER = 1000
2323
const MAX_WALL_TIME = 500.0
2424

2525
# Collect all the problems from OptimalControlProblems
26-
list_of_problems = OptimalControlProblems.problems()
26+
override_list_of_problems = false
2727

28-
# # Remove from the tests the following problems
29-
# problems_to_exclude = [
30-
# ]
31-
# list_of_problems = setdiff(list_of_problems, problems_to_exclude)
28+
list_of_problems = if override_list_of_problems
29+
[
30+
# put here the problems to test
31+
]
32+
else
33+
# Get all problems
34+
all_problems = OptimalControlProblems.problems()
3235

33-
# # Override the list of problems to test
34-
list_of_problems = [
35-
:ducted_fan,
36-
]
36+
# Remove from the tests the following problems
37+
problems_to_exclude = [
38+
# put here problems to exclude from the tests
39+
]
40+
setdiff(all_problems, problems_to_exclude)
41+
end
3742

3843
# The list of all the problems to test
3944
const LIST_OF_PROBLEMS = deepcopy(list_of_problems)
@@ -68,10 +73,10 @@ const VERBOSE = true # print or not details during tests
6873
println("\nProblems that passed the tests: ");
6974
display(LIST_OF_PROBLEMS_FINAL)
7075
println("\nList of available problems: ");
71-
display(problems());
76+
display(OptimalControlProblems.problems());
7277
println()
7378

7479
# @testset "available_problems" verbose=VERBOSE begin
75-
# @test LIST_OF_PROBLEMS_FINAL == problems()
80+
# @test LIST_OF_PROBLEMS_FINAL == OptimalControlProblems.problems()
7681
# end
7782
end

0 commit comments

Comments
 (0)