From 0a6d32a4c6f6ca9a528cff0e62198cd2b6f80a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Mon, 8 Jul 2024 10:36:01 +0200 Subject: [PATCH] Automate mock tests generation --- test/Tests/chebyshev.jl | 2 +- test/Tests/utilities.jl | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/Tests/chebyshev.jl b/test/Tests/chebyshev.jl index a27aa155a..14f8fa5cc 100644 --- a/test/Tests/chebyshev.jl +++ b/test/Tests/chebyshev.jl @@ -26,7 +26,7 @@ function chebyshev_test(optimizer, config::MOI.Test.Config) @objective(model, Max, γ) - JuMP.optimize!(model) + _optimize!(model, config) @test JuMP.termination_status(model) == MOI.OPTIMAL @test JuMP.primal_status(model) == MOI.FEASIBLE_POINT diff --git a/test/Tests/utilities.jl b/test/Tests/utilities.jl index a3786c975..bc3b64394 100644 --- a/test/Tests/utilities.jl +++ b/test/Tests/utilities.jl @@ -3,6 +3,11 @@ using Test, JuMP import StarAlgebras as SA using SumOfSquares +function _optimize!(model, config) + JuMP.optimize!(model) + return inner_variable_value(model, config.atol + config.rtol) +end + function _model(optimizer::MOI.AbstractOptimizer) MOI.empty!(optimizer) return direct_model(optimizer)