Skip to content

Commit

Permalink
Run MOI test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Nov 20, 2023
1 parent fe20e8f commit 9d8f023
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
53 changes: 53 additions & 0 deletions test/MOI_wrapper.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
module TestMOI

using Test
import MathOptInterface as MOI
import SDPLR

function test_runtests()
optimizer = SDPLR.Optimizer()
MOI.set(optimizer, MOI.Silent(), true) # comment this to enable output
model = MOI.Bridges.full_bridge_optimizer(
MOI.Utilities.CachingOptimizer(
MOI.Utilities.UniversalFallback(MOI.Utilities.Model{Float64}()),
optimizer,
),
Float64,
)
config = MOI.Test.Config(
atol = 1e-2,
exclude = Any[
MOI.ConstraintBasisStatus,
MOI.VariableBasisStatus,
MOI.ConstraintName,
MOI.VariableName,
MOI.ObjectiveBound,
MOI.ConstraintPrimal, # TODO
MOI.ConstraintDual, # TODO
MOI.SolverVersion,
],
optimal_status = MOI.LOCALLY_SOLVED,
)
MOI.Test.runtests(
model,
config,
include = [r"test_conic_PositiveSemidefiniteConeTriangle_VectorOfVariables$",],
exclude = String[],
)
return
end

function runtests()
for name in names(@__MODULE__; all = true)
if startswith("$(name)", "test_")
@testset "$(name)" begin
getfield(@__MODULE__, name)()
end
end
end
return
end

end # module

TestMOI.runtests()
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include("test_vibra.jl")
include("test_simple.jl")
include("MOI_wrapper.jl")

0 comments on commit 9d8f023

Please sign in to comment.