@@ -11,7 +11,6 @@ using Test
1111mutable struct Config{T<: Real }
1212 atol:: T
1313 rtol:: T
14- supports_optimize:: Bool
1514 optimal_status:: MOI.TerminationStatusCode
1615 exclude:: Vector{Any}
1716end
2120 ::Type{T} = Float64;
2221 atol::Real = Base.rtoldefault(T),
2322 rtol::Real = Base.rtoldefault(T),
24- supports_optimize::Bool = true,
2523 optimal_status::MOI.TerminationStatusCode = MOI.OPTIMAL,
2624 exclude::Vector{Any} = Any[],
2725 ) where {T}
@@ -34,13 +32,12 @@ Return an object that is used to configure various tests.
3432 when comparing solutions.
3533 * `rtol::Real = Base.rtoldefault(T)`: Control the relative tolerance used
3634 when comparing solutions.
37- * `supports_optimize::Bool = true`: Set to `false` to skip tests requiring a
38- call to [`MOI.optimize!`](@ref)
3935 * `optimal_status = MOI.OPTIMAL`: Set to `MOI.LOCALLY_SOLVED` if the solver
4036 cannot prove global optimality.
4137 * `exclude = Vector{Any}`: Pass attributes or functions to `exclude` to skip
4238 parts of tests that require certain functionality. Common arguments include:
4339 - `MOI.delete` to skip deletion-related tests
40+ - `MOI.optimize!` to skip optimize-related tests
4441 - `MOI.ConstraintDual` to skip dual-related tests
4542 - `MOI.VariableName` to skip setting variable names
4643 - `MOI.ConstraintName` to skip setting constraint names
@@ -66,18 +63,16 @@ function Config(
6663 :: Type{T} = Float64;
6764 atol:: Real = Base. rtoldefault (T),
6865 rtol:: Real = Base. rtoldefault (T),
69- supports_optimize:: Bool = true ,
7066 optimal_status:: MOI.TerminationStatusCode = MOI. OPTIMAL,
7167 exclude:: Vector{Any} = Any[],
7268) where {T<: Real }
73- return Config {T} (atol, rtol, supports_optimize, optimal_status, exclude)
69+ return Config {T} (atol, rtol, optimal_status, exclude)
7470end
7571
7672function Base. copy (config:: Config{T} ) where {T}
7773 return Config {T} (
7874 config. atol,
7975 config. rtol,
80- config. supports_optimize,
8176 config. optimal_status,
8277 copy (config. exclude),
8378 )
@@ -344,7 +339,7 @@ function _test_model_solution(
344339 constraint_primal = nothing ,
345340 constraint_dual = nothing ,
346341) where {T}
347- if ! config. supports_optimize
342+ if ! _supports ( config, MOI . optimize!)
348343 return
349344 end
350345 MOI. optimize! (model)
0 commit comments